入库数据修改

master
zhangdi 5 days ago
parent 8e2e0b5e9a
commit 221d087166
  1. 56
      src/views/firstOrder/components/inDialog.vue

@ -155,7 +155,6 @@
label="已入库数量" label="已入库数量"
v-if="sizeForm.option == 1" v-if="sizeForm.option == 1"
> >
</el-table-column> </el-table-column>
<el-table-column prop="theInboundQuantity" label="本次入库数量"> <el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope"> <template slot-scope="scope">
@ -392,8 +391,12 @@
</div> </div>
<span slot="footer" class="dialog-footer" v-if="!allDisabled"> <span slot="footer" class="dialog-footer" v-if="!allDisabled">
<el-button @click="handleCloseDetail()"> </el-button> <el-button @click="handleCloseDetail()"> </el-button>
<el-button type="primary" @click="submit(1)" :loading="isSubmitting">暂存</el-button> <el-button type="primary" @click="submit(1)" :loading="isSubmitting"
<el-button type="primary" @click="submit(2)" :loading="isSubmitting">提交</el-button> >暂存</el-button
>
<el-button type="primary" @click="submit(2)" :loading="isSubmitting"
>提交</el-button
>
</span> </span>
</el-dialog> </el-dialog>
@ -465,7 +468,7 @@ export default {
}, },
data() { data() {
return { return {
isSubmitting:false, isSubmitting: false,
inDialogVisible: false, inDialogVisible: false,
sizeForm: { sizeForm: {
orderNo: "", // orderNo: "", //
@ -526,11 +529,24 @@ export default {
(item) => (item) =>
item.materialCode === stat.materialCode && item.type === stat.type item.materialCode === stat.materialCode && item.type === stat.type
); );
if (stat.type == "YH") {
stat.theInboundQuantity = detail.theInboundQuantity; //
stat.totalQuantity = stat.num + detail.theInboundQuantity;
stat.unitPrice = detail.unitPrice;
}
if (stat.type == "NY" && stat.num == 0) {
stat.theInboundQuantity = detail.theInboundQuantity; //
stat.totalQuantity = stat.num + detail.theInboundQuantity;
stat.unitPrice = detail.unitPrice;
} else {
stat.theInboundQuantity = 0; //
stat.unitPrice = stat.unitPrice;
stat.totalQuantity = stat.num + detail.theInboundQuantity;
}
return { return {
...stat, ...stat,
theInboundQuantity: detail.theInboundQuantity, //
unitPrice: detail.unitPrice,
totalQuantity: stat.num + detail.theInboundQuantity,
}; };
}); });
}); });
@ -544,11 +560,23 @@ export default {
(item) => (item) =>
item.materialId === stat.materialId && item.type === stat.type item.materialId === stat.materialId && item.type === stat.type
); );
if (stat.type == "YH") {
stat.theInboundQuantity = detail.theInboundQuantity; //
stat.totalQuantity = stat.num + detail.theInboundQuantity;
stat.unitPrice = detail.unitPrice;
}
if (stat.type == "NY" && stat.num == 0) {
stat.theInboundQuantity = detail.theInboundQuantity; //
stat.totalQuantity = stat.num + detail.theInboundQuantity;
stat.unitPrice = detail.unitPrice;
} else {
stat.theInboundQuantity = 0; //
stat.unitPrice = stat.unitPrice;
stat.totalQuantity = stat.num + detail.theInboundQuantity;
}
return { return {
...stat, ...stat,
theInboundQuantity: detail.theInboundQuantity, //
unitPrice: detail.unitPrice,
totalQuantity: stat.num + detail.theInboundQuantity,
}; };
}); });
}); });
@ -844,7 +872,7 @@ export default {
} }
// status == 1 2 // status == 1 2
this.isSubmitting = true this.isSubmitting = true;
this.sizeForm.status = index; this.sizeForm.status = index;
if (this.sizeForm.option == 1) { if (this.sizeForm.option == 1) {
// this.sizeForm.singleData = []; // this.sizeForm.singleData = [];
@ -868,13 +896,13 @@ export default {
// //
this.$emit("submitSuccess"); this.$emit("submitSuccess");
this.handleCloseDetail(); this.handleCloseDetail();
this.isSubmitting = false this.isSubmitting = false;
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
this.isSubmitting = false this.isSubmitting = false;
} }
} catch (error) { } catch (error) {
this.isSubmitting = false this.isSubmitting = false;
this.$message.error(error.message); this.$message.error(error.message);
} }
}, },

Loading…
Cancel
Save