From 1816cb6fd5585f81608fc4c1195068ca40ee1d54 Mon Sep 17 00:00:00 2001 From: x_z Date: Thu, 30 Mar 2023 15:42:46 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E7=9B=98=E7=82=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BDbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inventory/invCountOrder.js | 8 +++++ src/views/inventory/DeptDeviceDetail.vue | 1 + src/views/inventory/InvCountOrderModify.vue | 39 ++++++++++++++++----- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/api/inventory/invCountOrder.js b/src/api/inventory/invCountOrder.js index 98dd2499..86db43dc 100644 --- a/src/api/inventory/invCountOrder.js +++ b/src/api/inventory/invCountOrder.js @@ -81,3 +81,11 @@ export function printOrder(data) { responseType: 'arraybuffer', //一定要设置响应类型,否则页面会是空白pdf }); } + +export function batchAddDetail(data) { + return axios({ + url: "/inv/count/order/detail/batchAddDetail", + method: "post", + data: data + }); +} diff --git a/src/views/inventory/DeptDeviceDetail.vue b/src/views/inventory/DeptDeviceDetail.vue index aeab5bc4..9a183678 100644 --- a/src/views/inventory/DeptDeviceDetail.vue +++ b/src/views/inventory/DeptDeviceDetail.vue @@ -125,6 +125,7 @@ + diff --git a/src/views/inventory/InvCountOrderModify.vue b/src/views/inventory/InvCountOrderModify.vue index 44b8ccfe..af169a28 100644 --- a/src/views/inventory/InvCountOrderModify.vue +++ b/src/views/inventory/InvCountOrderModify.vue @@ -11,6 +11,7 @@ >开始盘点 { if (item.code === this.formData.invCode) { this.formData.deptCode = item.parentId; } }) - this.invChange(); } } }); @@ -335,6 +338,9 @@ export default { } }); this.formData.invSpaceCode = null; + this.getSpaceList(); + }, + getSpaceList() { this.spaceList = []; let params = {invWarehouseCode: this.formData.invCode, status: 1}; getInvSpaceList(params).then((res) => { @@ -363,6 +369,7 @@ export default { this.$message.success("保存成功"); if (type != null) { //保存当前单据详情 + let orderDetails = []; this.countProductList.forEach(product => { let detailData = { orderIdFk: this.formData.orderId, @@ -374,12 +381,17 @@ export default { invCode: this.formData.invCode, invSpaceCode: this.formData.invSpaceCode }; - addCountOrderDetail(detailData).then((result) => { - if (result.code === 20000) { - this.getList(); - this.getCountOrderList(); - } - }); + orderDetails.push(detailData); + }); + let params = { + orderId: this.formData.orderId, + countOrderDetailList: orderDetails + } + batchAddDetail(params).then((res) => { + if (res.code === 20000) { + this.getList(); + this.getCountOrderList(); + } }) } else { this.closeDialog(); @@ -515,7 +527,7 @@ export default { }, startCount(val) { this.countProductList = []; - if (this.countType === 0) { + if (this.countType === 0 && val === 1) { if (isBlank(this.formData.invCode)) { this.$message.warning("请先选择盘点仓库"); return; @@ -534,6 +546,14 @@ export default { this.saveOrder(1); } }); + } else if (this.countType === 0) { + if (isBlank(this.formData.invCode)) { + this.$message.warning("请先选择盘点仓库"); + return; + } + this.productList = []; + this.selectInvProductVisible = true; + this.queryInvProducts(); } else if (this.countType === 1) { if (isBlank(this.formData.invCode) || isBlank(this.formData.invSpaceCode)) { this.$message.warning("请先选择盘点仓库和货位"); @@ -556,6 +576,7 @@ export default { } else { this.productList = []; this.selectInvProductVisible = true; + this.queryInvProducts(); } } else if (this.countType === 2) { if (isBlank(this.formData.invCode)) {