一级出库和二级出库问题修改

master
zhangdi 3 months ago
parent 6449275882
commit 6b71c5ec1f
  1. 10
      src/views/firstOrder/components/batchSelectionDialog.vue
  2. 5
      src/views/firstOrder/components/inDialog.vue
  3. 87
      src/views/firstOrder/components/outDialog.vue
  4. 18
      src/views/firstOrder/outbound.vue

@ -10,23 +10,19 @@
@selection-change="(val) => handleSelectionChange(val, props.row)" border>
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="#" width="55" />
<!-- <el-table-column label="表单ID" prop="id" width="80" /> -->
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="物料编码" prop="materialCode" />
<el-table-column label="规格型号" prop="model" />
<!-- <el-table-column label="申请数量" prop="applicationQuantity" /> -->
<el-table-column label="单价" prop="unitPrice" width="80" />
</el-table>
</template>
</el-table-column>
<!-- 常规列展示 -->
<!-- <el-table-column label="物料ID" prop="materialId" /> -->
<el-table-column label="物料编码" prop="materialCode" />
<el-table-column label="物料名称" prop="materialName" />
<el-table-column label="规格型号" prop="model" />
<el-table-column label="申请数量" prop="applicationQuantity" />
<!-- <el-table-column label="本此出库数量" prop="applicationQuantity" /> -->
<el-table-column label="已出库数量" prop="outboundQuantity" />
<el-table-column label="部门" prop="departmentName" />
<el-table-column label="单位" prop="unit" />
@ -96,6 +92,11 @@ export default {
//
handleSelectionChange(selection, parentRow) {
console.log('666666', selection, parentRow)
if(selection.length>(parentRow.applicationQuantity-parentRow.outboundQuantity)){
this.$message.error('勾选数量不能大于申请数量')
return
}
//
const selectionWithParent = selection.map(item => ({
...item,
@ -112,7 +113,6 @@ export default {
);
//
this.selectedRows.push(...selectionWithParent);
console.log('777777', selection, parentRow, this.selectedRows)
//
},

@ -652,9 +652,8 @@ export default {
this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.inTableData.find(
(item) => item.materialCode === stat.materialCode
(item) => item.materialCode === stat.materialCode && item.type === stat.type
);
console.log("detail", detail,stat);
return {
...stat,
theInboundQuantity: detail.theInboundQuantity, //
@ -670,7 +669,7 @@ export default {
this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.singleData.find(
(item) => item.materialId === stat.materialId
(item) => item.materialId === stat.materialId&& item.type === stat.type
);
return {
...stat,

@ -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();

@ -18,6 +18,10 @@
>
<span v-else></span>
</template>
<template slot-scope="scope" slot="outTypeInfo">
<span v-if="scope.row.optionType=='YH'">发放单</span>
<span v-if="scope.row.optionType=='NY'">出库单</span>
</template>
<template #menu="scope">
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
<el-button type="text" v-if="scope.row.status == 1" @click.stop="handleEdit(scope.row)">编辑</el-button>
@ -104,13 +108,13 @@ export default {
headerAlign: "center",
align: "center",
},
// {
// label: "",
// prop: "outType",
// width: 140,
// headerAlign: "center",
// align: "center",
// },
{
label: "出库类型",
prop: "outTypeInfo",
width: 140,
headerAlign: "center",
align: "center",
},
{
label: "出库日期",
prop: "outDate",

Loading…
Cancel
Save