|
|
|
|
@ -148,7 +148,7 @@ |
|
|
|
|
}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="type" label="出库类型"> |
|
|
|
|
<!-- <el-table-column prop="type" label="出库类型"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ |
|
|
|
|
scope.row.type === "NY" |
|
|
|
|
@ -158,7 +158,7 @@ |
|
|
|
|
: "" |
|
|
|
|
}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column prop="unit" label="单位"> </el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="部门" |
|
|
|
|
@ -279,7 +279,7 @@ |
|
|
|
|
}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
<!-- <el-table-column |
|
|
|
|
prop="departmentName" |
|
|
|
|
label="部门" |
|
|
|
|
v-if="sizeForm.options == 2" |
|
|
|
|
@ -290,27 +290,18 @@ |
|
|
|
|
{{ getDepartmentName(scope.row.department) }} |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="num" label="数量"> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column prop="num" label="数量"> </el-table-column> |
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
prop="date" |
|
|
|
|
label="出库信息" |
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
<el-table-column prop="date" label="出库信息"> |
|
|
|
|
<el-table-column prop="theOutboundQuantity" label="数量"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.theOutboundQuantity || 0 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
prop="date" |
|
|
|
|
label="出库后库存" |
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
<el-table-column prop="date" label="出库后库存"> |
|
|
|
|
<el-table-column prop="totalQuantity" label="数量"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.totalQuantity || 0 }} |
|
|
|
|
@ -563,8 +554,8 @@ export default { |
|
|
|
|
if ( |
|
|
|
|
columnIndex === 0 || |
|
|
|
|
columnIndex === 1 || |
|
|
|
|
columnIndex === 6 || |
|
|
|
|
columnIndex === 7 |
|
|
|
|
columnIndex === 5 || |
|
|
|
|
columnIndex === 6 |
|
|
|
|
) { |
|
|
|
|
const key = `${row.materialCode}-${row.materialName}`; |
|
|
|
|
const rows = this.sizeForm.inTableData.filter( |
|
|
|
|
@ -594,25 +585,41 @@ export default { |
|
|
|
|
}, |
|
|
|
|
getStatistics() { |
|
|
|
|
getStatistics(this.sizeForm.inTableData).then((res) => { |
|
|
|
|
this.statisticsList = res.data.result |
|
|
|
|
this.statisticsList = res.data.result; |
|
|
|
|
this.statisticsList = this.statisticsList.map((stat) => { |
|
|
|
|
const detail = this.sizeForm.inTableData.find( |
|
|
|
|
(item) => item.materialCode === stat.materialCode |
|
|
|
|
) |
|
|
|
|
console.log("detail", detail, stat) |
|
|
|
|
); |
|
|
|
|
console.log("detail", detail, stat); |
|
|
|
|
// |
|
|
|
|
if ( |
|
|
|
|
this.sizeForm.options == 1 && |
|
|
|
|
this.inBatchForm.optionType == "NY" |
|
|
|
|
) { |
|
|
|
|
const detailList = this.sizeForm.inTableData.filter( |
|
|
|
|
(item) => |
|
|
|
|
item.materialCode === stat.materialCode && |
|
|
|
|
item.materialName === stat.materialName |
|
|
|
|
); |
|
|
|
|
console.log("detailList", detailList); |
|
|
|
|
detail.theOutboundQuantity = detailList.reduce((acc, cur) => acc + cur.num, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
...stat, |
|
|
|
|
theOutboundQuantity: detail.theOutboundQuantity, //本次出库数量 |
|
|
|
|
unitPrice: detail.unitPrice, |
|
|
|
|
totalQuantity: stat.num - detail.theOutboundQuantity, |
|
|
|
|
department: detail.department, // 部门ID |
|
|
|
|
departmentName: detail.departmentName || this.getDepartmentName(detail.department), |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
departmentName: |
|
|
|
|
detail.departmentName || |
|
|
|
|
this.getDepartmentName(detail.department), |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
changeDepartment(){ |
|
|
|
|
this.getStatistics() |
|
|
|
|
changeDepartment() { |
|
|
|
|
this.getStatistics(); |
|
|
|
|
}, |
|
|
|
|
batchclose() { |
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
@ -684,18 +691,18 @@ export default { |
|
|
|
|
if (row.theOutboundQuantity > maxAllowQuantity) { |
|
|
|
|
this.$message.error(`本次出库数量不能大于${maxAllowQuantity}`); |
|
|
|
|
row.theOutboundQuantity = maxAllowQuantity; |
|
|
|
|
return false |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.sizeForm.optionType === "NY") { |
|
|
|
|
row.theOutboundQuantity = 1; |
|
|
|
|
} |
|
|
|
|
this.getStatistics() |
|
|
|
|
this.getStatistics(); |
|
|
|
|
}, |
|
|
|
|
//关闭新增弹窗 |
|
|
|
|
handleCloseDetail() { |
|
|
|
|
this.outDialogVisible = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$emit("handleCloseDetail"); |
|
|
|
|
}, |
|
|
|
|
closeDialog() { |
|
|
|
|
@ -769,7 +776,6 @@ export default { |
|
|
|
|
let res; |
|
|
|
|
if (this.inBatchForm.optionType === "YH") { |
|
|
|
|
res = await getDetailedList(requestParams); |
|
|
|
|
|
|
|
|
|
} else if (this.inBatchForm.optionType === "NY") { |
|
|
|
|
res = await batchList(requestParams); |
|
|
|
|
} |
|
|
|
|
@ -804,8 +810,8 @@ export default { |
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
console.log(1); |
|
|
|
|
this.batchTableData = res.data.result; |
|
|
|
|
}else { |
|
|
|
|
this.getStatistics() |
|
|
|
|
} else { |
|
|
|
|
this.getStatistics(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 强制更新视图 |
|
|
|
|
@ -839,8 +845,8 @@ export default { |
|
|
|
|
getDepartmentName(departmentId) { |
|
|
|
|
const department = this.list.find( |
|
|
|
|
(item) => item.departmentId === departmentId |
|
|
|
|
) |
|
|
|
|
return department ? department.department : "" |
|
|
|
|
); |
|
|
|
|
return department ? department.department : ""; |
|
|
|
|
}, |
|
|
|
|
//获取单条选择的物资名称列表 |
|
|
|
|
async getMaterialList() { |
|
|
|
|
@ -872,7 +878,7 @@ export default { |
|
|
|
|
this.sizeForm.inTableData[index].materialName = row.materialName; |
|
|
|
|
this.sizeForm.inTableData[index].type = row.type; |
|
|
|
|
this.sizeForm.inTableData[index].unit = row.unit; |
|
|
|
|
this.getStatistics() |
|
|
|
|
this.getStatistics(); |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
async submit(index) { |
|
|
|
|
@ -928,7 +934,10 @@ export default { |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
console.log(this.sizeForm, "111"); |
|
|
|
|
this.sizeForm.inTableData = []; |
|
|
|
|
// this.sizeForm.inTableData = []; |
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
this.sizeForm.optionType = this.inBatchForm.optionType; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
const res = await submitData(this.sizeForm); |
|
|
|
|
console.log(this.sizeForm, "222"); |
|
|
|
|
@ -1000,13 +1009,13 @@ export default { |
|
|
|
|
// 选项选择 |
|
|
|
|
radioChange() { |
|
|
|
|
this.sizeForm.inTableData = []; |
|
|
|
|
this.statisticsList = [] |
|
|
|
|
this.statisticsList = []; |
|
|
|
|
this.sizeForm.optionType = ""; |
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
this.consumableVisible = false; |
|
|
|
|
this.inBatchDialogVisible = false; |
|
|
|
|
this.batchSelectionVisible = false; |
|
|
|
|
this.sizeForm.optionType = ''; |
|
|
|
|
this.sizeForm.optionType = ""; |
|
|
|
|
this.batchTableData = []; |
|
|
|
|
if (this.sizeForm.options === 1) { |
|
|
|
|
this.getQuarterList(); |
|
|
|
|
|