From d35c30fe237b519e175996a772c4c597c7d9acf7 Mon Sep 17 00:00:00 2001 From: x_z Date: Thu, 9 Jun 2022 18:20:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=A4=8D=E5=88=B6=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/warehouse/DialogcChangeNewOrder.vue | 83 +++++++++++++++++-- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/src/views/warehouse/DialogcChangeNewOrder.vue b/src/views/warehouse/DialogcChangeNewOrder.vue index 4491b2f..4e9b2be 100644 --- a/src/views/warehouse/DialogcChangeNewOrder.vue +++ b/src/views/warehouse/DialogcChangeNewOrder.vue @@ -154,6 +154,35 @@ + + + + + + + + + + + + + + + + + + + @@ -163,7 +192,7 @@ import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"; import {parseTime} from "@/filtres"; import {getLocalJoinByUser} from "@/api/basic/busLocalType"; import {submitOrderWeb} from "@/api/warehouse/order"; -import {stockOrderChange} from "@/api/warehouse/stockOrder"; +import {stockOrderChange, stockOrderDetail} from "@/api/warehouse/stockOrder"; export default { name: "DialogcChangeNewOrder", @@ -189,6 +218,7 @@ export default { actDate: new Date(), action: null, locStorageCode: null, + mainAction: null }, fromStorageOptions: [], curAction: { @@ -198,7 +228,7 @@ export default { busTypes: [], fromOptions: [], loading:false, - + detailList: [] } }, methods: { @@ -216,16 +246,35 @@ export default { this.$message.error('当前往来单位不能为空'); return; } + if (this.detailList.length == 0) { + this.$message.error("产品列表不能为空"); + return; + } + let products = []; + this.detailList.forEach(item => { + let product = { + relId: item.relId, + batchNo: item.batchNo + }; + products.push(product); + }); + + this.busTypes.forEach(item => { + if (item.action === this.formData.action) { + this.formData.mainAction = item.mainAction; + } + }) let tQuery = { stockOrderId: this.curRow.id, locStorageCode: this.formData.locStorageCode, action: this.formData.action, + mainAction: this.formData.mainAction, fromCorp: this.formData.fromCorp, fromCorpId: this.formData.fromCorpId, - } + products: products + }; stockOrderChange(tQuery) .then((response) => { - console.log(response) if (response.code === 20000) { this.$message.success("提交成功"); this.closeDialog(); @@ -257,7 +306,6 @@ export default { }, findMethod(query) { - console.log(query); this.fromOptions = []; let cQuery = { key: query, @@ -300,7 +348,6 @@ export default { }, unitChange(row) { - console.log(row); this.formData.fromCorpId = row.erpId; this.formData.fromCorp = row.name; }, @@ -337,7 +384,28 @@ export default { .catch(() => { }); }, - + getStockOrderDetailList(orderId) { + let query = { + orderIdFk: orderId + } + stockOrderDetail(query) + .then((response) => { + this.detailLoading = false; + this.detailList = response.data.list || []; + }) + .catch(() => { + this.detailLoading = false; + this.detailList = []; + }); + }, + deleteOrderDetail(index) { + for (let i = 0; i < this.detailList.length; i++) { + if (index === i) { + this.detailList.splice(index, 1); + break + } + } + } }, created() { if (this.$isBlank(this.formData.corpOrderId)) { @@ -346,6 +414,7 @@ export default { } this.getBusType(); this.getStorage(); + this.getStockOrderDetailList(this.curRow.id); } }