|
|
|
@ -66,7 +66,7 @@ |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;" |
|
|
|
<el-select v-model="scope.row.materialitem" placeholder="请选择物资名称" style="width: 100%;" |
|
|
|
@change="handleMaterialChange(scope.row.materialitem, scope.$index)" |
|
|
|
@change="handleMaterialChange(scope.row.materialitem, scope.$index)" |
|
|
|
v-if='inDialogType != "details" && sizeForm.options == 2 && sizeForm.optionType == "YH"' |
|
|
|
v-if='outDialogType != "details" && sizeForm.options == 2 && sizeForm.optionType == "YH"' |
|
|
|
value-key="id"> |
|
|
|
value-key="id"> |
|
|
|
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item"> |
|
|
|
<el-option v-for="item in materials" :key="item.materialId" :label="item.materialName" :value="item"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
@ -97,7 +97,7 @@ |
|
|
|
:value="item.departmentId"> |
|
|
|
:value="item.departmentId"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<span v-else> {{ scope.row.departmentName || '无'}}</span> |
|
|
|
<span v-else> {{ scope.row.departmentName || '无' }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options"> |
|
|
|
<!-- <el-table-column prop="departmentName" label="部门" :key="'account-dept-' + sizeForm.options"> |
|
|
|
@ -116,8 +116,8 @@ |
|
|
|
{{ scope.row.applicationQuantity || 0 }} |
|
|
|
{{ scope.row.applicationQuantity || 0 }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1 "> |
|
|
|
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.outboundQuantity || 0 }} |
|
|
|
{{ scope.row.outboundQuantity || 0 }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -276,10 +276,8 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
dialogVisible: false, |
|
|
|
dialogVisible: false, |
|
|
|
materialList: [], |
|
|
|
|
|
|
|
demandDialogTitle: '耐用品出库', |
|
|
|
demandDialogTitle: '耐用品出库', |
|
|
|
batchSelectionTitle: '耐用品出库', |
|
|
|
batchSelectionTitle: '耐用品出库', |
|
|
|
goodsVisible: false, |
|
|
|
|
|
|
|
batchSelectionVisible: false, |
|
|
|
batchSelectionVisible: false, |
|
|
|
batchSelection: true, // 保持组件渲染 |
|
|
|
batchSelection: true, // 保持组件渲染 |
|
|
|
batchTableData: [], |
|
|
|
batchTableData: [], |
|
|
|
@ -308,8 +306,6 @@ export default { |
|
|
|
mainErDepartmentName: "主管部门名称", |
|
|
|
mainErDepartmentName: "主管部门名称", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
goodsList: [], |
|
|
|
|
|
|
|
goodsSelectList: [], |
|
|
|
|
|
|
|
// inTableData: [], |
|
|
|
// inTableData: [], |
|
|
|
inBatchDialogVisible: false,//选择采购单的数据 |
|
|
|
inBatchDialogVisible: false,//选择采购单的数据 |
|
|
|
batchType: '',//需求单选择类型 |
|
|
|
batchType: '',//需求单选择类型 |
|
|
|
@ -358,14 +354,7 @@ export default { |
|
|
|
this.consumableVisible = false |
|
|
|
this.consumableVisible = false |
|
|
|
this.sizeForm.inTableData = allSelectedList |
|
|
|
this.sizeForm.inTableData = allSelectedList |
|
|
|
console.log(this.sizeForm.inTableData, '111220') |
|
|
|
console.log(this.sizeForm.inTableData, '111220') |
|
|
|
}, |
|
|
|
}, // 处理搜索 |
|
|
|
// // 获取物资列表 |
|
|
|
|
|
|
|
// async getMaterialList() { |
|
|
|
|
|
|
|
// const { data: res } = await this.$http.get('material/getMaterialList') |
|
|
|
|
|
|
|
// if (res.code !== 200) return this.$message.error(res.msg) |
|
|
|
|
|
|
|
// this.materialList = res.data |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// 处理搜索 |
|
|
|
|
|
|
|
async handleSearch() { |
|
|
|
async handleSearch() { |
|
|
|
// 重置当前页 |
|
|
|
// 重置当前页 |
|
|
|
this.currentPage = 1; |
|
|
|
this.currentPage = 1; |
|
|
|
@ -384,50 +373,6 @@ export default { |
|
|
|
this.currentPage = val; |
|
|
|
this.currentPage = val; |
|
|
|
this.loadGoodsList(); |
|
|
|
this.loadGoodsList(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 加载商品列表数据(包含分页和搜索) |
|
|
|
|
|
|
|
// async loadGoodsList() { |
|
|
|
|
|
|
|
// try { |
|
|
|
|
|
|
|
// const res = await getMaterialList({ |
|
|
|
|
|
|
|
// optionType: 'NY', // 耐用品 |
|
|
|
|
|
|
|
// // pageNum: this.currentPage, |
|
|
|
|
|
|
|
// // pageSize: this.pageSize, |
|
|
|
|
|
|
|
// // keyword: this.searchKeyword // 搜索关键词 |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (res.data && res.data.result) { |
|
|
|
|
|
|
|
// // this.goodsList = res.data.result.list; // 列表数据 |
|
|
|
|
|
|
|
// this.goodsList = res.data.result; // 列表数据 |
|
|
|
|
|
|
|
// this.total = res.data.result.total; // 总条数 |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } catch (error) { |
|
|
|
|
|
|
|
// this.$message.error("获取商品列表失败,请重试"); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// 选择变化时保存到数组 |
|
|
|
|
|
|
|
goodsListSelectionChange(val) { |
|
|
|
|
|
|
|
this.goodsSelectList = JSON.parse(JSON.stringify(val)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 批量选择耐用品弹窗确认选择 |
|
|
|
|
|
|
|
// goodsSubmit() { |
|
|
|
|
|
|
|
// if (this.goodsSelectList.length > 0) { |
|
|
|
|
|
|
|
// const newItems = this.goodsSelectList.map(item => ({ |
|
|
|
|
|
|
|
// ...item, |
|
|
|
|
|
|
|
// materialId: item.materialId, |
|
|
|
|
|
|
|
// materialCode: item.materialCode, |
|
|
|
|
|
|
|
// materialName: item.materialName, |
|
|
|
|
|
|
|
// model: item.model, |
|
|
|
|
|
|
|
// type: item.type, |
|
|
|
|
|
|
|
// unit: item.unit, |
|
|
|
|
|
|
|
// department: item.departmentId, |
|
|
|
|
|
|
|
// departmentName: item.departmentName, |
|
|
|
|
|
|
|
// theOutboundQuantity: 0 |
|
|
|
|
|
|
|
// })); |
|
|
|
|
|
|
|
// this.sizeForm.inTableData.push(...newItems); |
|
|
|
|
|
|
|
// this.batchSelectionVisible = true; |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// this.$message.warning('请先勾选需要添加的数据') |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
depchange(value) { |
|
|
|
depchange(value) { |
|
|
|
this.departmentList = this.departmentList |
|
|
|
this.departmentList = this.departmentList |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -518,57 +463,7 @@ export default { |
|
|
|
this.departmentList = [] |
|
|
|
this.departmentList = [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
//批量选择弹窗确定 |
|
|
|
|
|
|
|
// async batchSubmit() { |
|
|
|
|
|
|
|
// if (!this.inBatchForm.batchType) { |
|
|
|
|
|
|
|
// this.$message.error('请选择需求单'); |
|
|
|
|
|
|
|
// return; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if (!this.inBatchForm.department) { |
|
|
|
|
|
|
|
// this.$message.error('请选择部门'); |
|
|
|
|
|
|
|
// return; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if (!this.inBatchForm.optionType) { |
|
|
|
|
|
|
|
// this.$message.error('请选择类别'); |
|
|
|
|
|
|
|
// return; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// const res = await getDetailedList({ |
|
|
|
|
|
|
|
// ids: this.inBatchForm.batchType, |
|
|
|
|
|
|
|
// departmentId: this.inBatchForm.department, |
|
|
|
|
|
|
|
// optionType: this.inBatchForm.optionType, |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (res.data && res.data.result) { |
|
|
|
|
|
|
|
// this.sizeForm.inTableData = res.data.result |
|
|
|
|
|
|
|
// const selectedDept = this.departmentList.find( |
|
|
|
|
|
|
|
// dept => dept.departmentId === this.inBatchForm.department |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// const deptName = selectedDept ? selectedDept.department : ''; |
|
|
|
|
|
|
|
// this.sizeForm.inTableData = res.data.result.map(item => ({ |
|
|
|
|
|
|
|
// ...item, |
|
|
|
|
|
|
|
// IdDemandEndld: this.inBatchForm.batchType, |
|
|
|
|
|
|
|
// // department: this.inBatchForm.department, |
|
|
|
|
|
|
|
// department: deptName |
|
|
|
|
|
|
|
// })) |
|
|
|
|
|
|
|
// this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
// const selectedQuarter = this.quarterList.find( |
|
|
|
|
|
|
|
// item => item.ids === this.inBatchForm.batchType |
|
|
|
|
|
|
|
// ) |
|
|
|
|
|
|
|
// if (selectedQuarter) { |
|
|
|
|
|
|
|
// this.sizeForm.demandEndInfo = selectedQuarter.quarterName; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if (this.inBatchForm.optionType === 'NY') { |
|
|
|
|
|
|
|
// this.batchSelectionVisible = true; |
|
|
|
|
|
|
|
// this.batchTableData = res.data.result; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
|
|
|
// this.$forceUpdate(); |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// this.$message.warning('未获取到详细数据'); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
async batchSubmit() { |
|
|
|
async batchSubmit() { |
|
|
|
if (!this.inBatchForm.batchType) { |
|
|
|
if (!this.inBatchForm.batchType) { |
|
|
|
this.$message.error('请选择需求单'); |
|
|
|
this.$message.error('请选择需求单'); |
|
|
|
@ -642,20 +537,6 @@ export default { |
|
|
|
console.error('批量提交接口调用失败:', error); |
|
|
|
console.error('批量提交接口调用失败:', error); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
//批量选择耐用品选择回调函数 |
|
|
|
|
|
|
|
goodsListSelectionChange(val) { |
|
|
|
|
|
|
|
this.goodsSelectList = val |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//批量选择耐用品弹窗点击确认按钮 |
|
|
|
|
|
|
|
// goodsSubmit() { |
|
|
|
|
|
|
|
// if (this.goodsSelectList.length > 0) { |
|
|
|
|
|
|
|
// this.sizeForm.inTableData.push(...this.goodsSelectList); |
|
|
|
|
|
|
|
// this.$forceUpdate(); |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// this.$message.warning('请先勾选需要添加的数据'); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// this.batchSelectionVisible = true; |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
//获取单条选择的部门名称列表 |
|
|
|
//获取单条选择的部门名称列表 |
|
|
|
async getDetailedItems() { |
|
|
|
async getDetailedItems() { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
@ -675,10 +556,9 @@ export default { |
|
|
|
//获取单条选择的物资名称列表 |
|
|
|
//获取单条选择的物资名称列表 |
|
|
|
async getMaterialList() { |
|
|
|
async getMaterialList() { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
this.goodsVisible = false; |
|
|
|
|
|
|
|
this.consumableVisible = false; |
|
|
|
this.consumableVisible = false; |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (this.sizeForm.optionType === "NY") { |
|
|
|
if (this.sizeForm.optionType === "NY" && this.outDialogType !== 'details') { |
|
|
|
this.consumableVisible = true |
|
|
|
this.consumableVisible = true |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const res = await getMaterialList({ optionType: this.sizeForm.optionType }) |
|
|
|
const res = await getMaterialList({ optionType: this.sizeForm.optionType }) |
|
|
|
@ -778,60 +658,46 @@ export default { |
|
|
|
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo |
|
|
|
this.sizeForm.demandEndInfo = ldOneOutStorage.demandEndInfo |
|
|
|
this.sizeForm.outDate = ldOneOutStorage.outDate |
|
|
|
this.sizeForm.outDate = ldOneOutStorage.outDate |
|
|
|
this.sizeForm.options = Number(ldOneOutStorage.options) |
|
|
|
this.sizeForm.options = Number(ldOneOutStorage.options) |
|
|
|
// this.sizeForm.optionType = ldOneOutStorage.optionType |
|
|
|
this.sizeForm.optionType = ldOneOutStorage.optionType |
|
|
|
// reason: '',//事由 |
|
|
|
|
|
|
|
// inAccountsTableData: [],//总计 |
|
|
|
|
|
|
|
// inTableData: [], |
|
|
|
|
|
|
|
// ldOneOutStorageDetailVOList: [], |
|
|
|
|
|
|
|
// demandEndInfo: '',//需求单名称 |
|
|
|
|
|
|
|
// outDate: '',//出库时间 |
|
|
|
|
|
|
|
// options: 2,//出库类型 |
|
|
|
|
|
|
|
// optionType: '', // 1易耗品 2耐用品 |
|
|
|
|
|
|
|
// materialType: '1',//物资类型 |
|
|
|
|
|
|
|
// status: '',//1暂存 2提交 |
|
|
|
|
|
|
|
// materialld: '',//物资Id |
|
|
|
|
|
|
|
this.$set(this.sizeForm, 'inTableData', res.data.result.ldOneOutStorageDetails) |
|
|
|
this.$set(this.sizeForm, 'inTableData', res.data.result.ldOneOutStorageDetails) |
|
|
|
console.log(this.sizeForm, '111') |
|
|
|
console.log(this.sizeForm, '111') |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// this.sizeForm = { |
|
|
|
// async inInit() { |
|
|
|
// // ...this.sizeForm, |
|
|
|
// if (this.outDialogType == 'details' || this.outDialogType == 'edit') { |
|
|
|
// // ...ldOneOutStorage, |
|
|
|
// try { |
|
|
|
// // outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '', |
|
|
|
// const res = await editList(this.id); |
|
|
|
// // options: Number(ldOneOutStorage.options) || 1, |
|
|
|
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {}; |
|
|
|
// // inTableData: ldOneOutStorageDetails |
|
|
|
// if (!ldOneOutStorage) { |
|
|
|
// } |
|
|
|
// this.$message.error("回显数据异常"); |
|
|
|
// }) |
|
|
|
// return; |
|
|
|
// try { |
|
|
|
// } |
|
|
|
// const res = await editList(this.id) |
|
|
|
// const handledDetailList = ldOneOutStorageDetails.map(item => ({ |
|
|
|
// console.log(res, '详情数据') |
|
|
|
// ...item, |
|
|
|
// const { ldOneOutStorage, ldOneOutStorageDetails = [] } = res.data.result || {}; |
|
|
|
// outboundQuantity: item.outboundQuantity || 0 |
|
|
|
// if (!ldOneOutStorage) { |
|
|
|
// })) |
|
|
|
// this.$message.error("回显数据异常"); |
|
|
|
// this.sizeForm = { |
|
|
|
// return; |
|
|
|
// ...this.sizeForm, |
|
|
|
// } |
|
|
|
// ...ldOneOutStorage, |
|
|
|
// // const handledDetailList = ldOneOutStorageDetails.map(item => ({ |
|
|
|
// outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '', |
|
|
|
// // ...item, |
|
|
|
// options: Number(ldOneOutStorage.options) || 1, |
|
|
|
// // outboundQuantity: item.outboundQuantity || 0 |
|
|
|
// } |
|
|
|
// // })) |
|
|
|
// this.sizeForm.inTableData = handledDetailList; |
|
|
|
// console.log(handledDetailList, 'handledDetailList') |
|
|
|
|
|
|
|
// this.sizeForm = { |
|
|
|
|
|
|
|
// ...this.sizeForm, |
|
|
|
|
|
|
|
// ...ldOneOutStorage, |
|
|
|
|
|
|
|
// outDate: ldOneOutStorage.outDate ? new Date(ldOneOutStorage.outDate) : '', |
|
|
|
|
|
|
|
// options: Number(ldOneOutStorage.options) || 1, |
|
|
|
|
|
|
|
// inTableData: ldOneOutStorageDetails |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// // console.log(this.sizeForm.inTableData, 'this.sizeForm') |
|
|
|
|
|
|
|
// } catch (error) { |
|
|
|
|
|
|
|
// this.$message.error("获取详情数据失败"); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// } catch (error) { |
|
|
|
|
|
|
|
// this.$message.error("获取详情数据失败"); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
// 选项选择 |
|
|
|
// 选项选择 |
|
|
|
radioChange() { |
|
|
|
radioChange() { |
|
|
|
this.sizeForm.inTableData = [] |
|
|
|
this.sizeForm.inTableData = [] |
|
|
|
this.sizeForm.optionType = ''; |
|
|
|
this.sizeForm.optionType = ''; |
|
|
|
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
|
|
|
this.consumableVisible = false; |
|
|
|
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
|
|
|
this.batchTableData = []; |
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
this.getQuarterList() |
|
|
|
this.getQuarterList() |
|
|
|
this.inBatchDialogVisible = true |
|
|
|
this.inBatchDialogVisible = true |
|
|
|
@ -866,13 +732,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
'sizeForm.optionType': function (newVal) { |
|
|
|
'sizeForm.optionType': function (newVal) { |
|
|
|
if (newVal && this.outDialogType === 'add') { |
|
|
|
if (newVal && this.outDialogType === 'add') { |
|
|
|
this.sizeForm.inTableData = [] |
|
|
|
this.sizeForm.inTableData = [] |
|
|
|
this.getMaterialList() |
|
|
|
this.getMaterialList() |
|
|
|
} else if (newVal && this.outDialogType !== 'add') { |
|
|
|
} else if (newVal && this.outDialogType !== 'add') { |
|
|
|
this.getMaterialList() |
|
|
|
this.getMaterialList() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|