From 2c4fb58a8e58ff8e5c56fa5a04e0face4b754869 Mon Sep 17 00:00:00 2001 From: x_z Date: Fri, 25 Nov 2022 17:46:18 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E5=BA=93=E5=AD=98=E5=85=BB?= =?UTF-8?q?=E6=8A=A4=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=AF=B9=E6=8E=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inventory/addInvMAOrder.vue | 269 +++++++-- src/views/inventory/invMAOrderAudit.vue | 578 ++++++-------------- src/views/inventory/invMAOrderCompleted.vue | 545 ++++++------------ src/views/inventory/invMAOrderNew.vue | 10 +- 4 files changed, 585 insertions(+), 817 deletions(-) diff --git a/src/views/inventory/addInvMAOrder.vue b/src/views/inventory/addInvMAOrder.vue index 8e4ff64..155fa22 100644 --- a/src/views/inventory/addInvMAOrder.vue +++ b/src/views/inventory/addInvMAOrder.vue @@ -10,7 +10,7 @@ 保存 @@ -48,7 +48,7 @@ - + - - - - - - + + + + + - + + - + + + + + @@ -191,7 +294,6 @@ import { import {isBlank} from "@/utils/strUtil"; export default { - name: "", props: { maOrder: { type: Object, @@ -205,6 +307,15 @@ export default { data() { return { + filterQuery: { + nameCode: null, + cpmctymc: null, + batchNo: null, + page: 1, + limit: 10 + }, + productList: [], + productTotal: null, warehouseList: [], spaceList: [], formData: { @@ -217,7 +328,8 @@ export default { detailList: [], loading: false, scanText: "扫码录入:", - + currentIndex: -1, + selectInvProductVisible: false } }, methods: { @@ -225,6 +337,10 @@ export default { filterSubAll().then((res) => { if (res.code === 20000) { this.warehouseList = res.data || []; + if (!isBlank(this.maOrder.invSpaceCode)) { + this.warehouseChange(); + this.formData.invSpaceCode = this.maOrder.invSpaceCode; + } } }); }, @@ -242,21 +358,48 @@ export default { } }, - saveOrder() { + saveMAOrder() { + this.saveOrder(); + this.closeDialog(); + }, + saveOrder(code) { if (isBlank(this.formData.invWarehouseCode)) { this.$message.warning("请选择养护仓库!"); return; } - if (this.detailList.length === 0) { - this.$message.warning("请录入养护产品信息!"); - return; + if (!isBlank(this.formData.orderId)) { + //更新单据 + updateOrder(this.formData).then((res) => { + if (res.code === 20000) { + this.$message.success("更新成功!"); + } + }) + } else { + addOrder(this.formData).then((res) => { + if (res.code === 20000) { + this.formData.orderId = res.data.orderId; + this.formData.createTime = res.data.createTime; + this.$message.success("保存成功!"); + if (!isBlank(!code)) { + //扫码添加库存养护记录详情 + let params = { + orderIdFk: this.formData.orderId, + code: this.formData.code + } + addOrderDetail(params).then((res) => { + if (res.code === 20000) { + this.$message.success("添加成功!"); + this.getList(); + } else { + this.$message.error(res.message); + } + }); + } + } else { + this.$message.error(res.message); + } + }); } - addOrder(this.formData).then((res) => { - if (res.code === 200000) { - this.formData.orderId = res.data; - this.$message.success("保存成功!"); - } - }); }, getInputFocus(event) { event.currentTarget.select(); @@ -272,11 +415,48 @@ export default { return; } if (isBlank(this.formData.orderId)) { - this.saveOrder(); + this.saveOrder(this.formData.code); + return; + } + //扫码添加库存养护记录详情 + let params = { + orderIdFk: this.formData.orderId, + code: this.formData.code } + addOrderDetail(params).then((res) => { + if (res.code === 20000) { + this.$message.success("添加成功!"); + this.getList(); + } else { + this.$message.error(res.message); + } + }); }, deleteOrderDetail(index, row) { - + if (row.count === 1) { + this.$confirm('此产品养护数量为1,减一后将删除此产品养护记录,是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let params = {id: row.id}; + deleteDetail(params).then((res) => { + if (res.code === 20000) { + this.$message.success("删除成功"); + this.getList(); + } + }) + }).catch(() => { + }); + } else { + let params = {id: row.id}; + deleteDetail(params).then((res) => { + if (res.code === 20000) { + this.$message.success("删除成功"); + this.getList(); + } + }) + } }, getList() { let params = {orderIdFk: this.formData.orderId}; @@ -286,12 +466,37 @@ export default { } }) }, + updateOrderDetail(row) { + updateDetail(row).then((res) => { + if (res.code === 20000) { + this.$message.success("保存成功!") + this.getList(); + } + }) + }, + editOrderDetail(index, row) { + this.currentIndex = index; + }, + onReset() { + this.filterQuery = {}; + }, + handleCurrentChange(val) { + this.filterQuery.page = 1; + this.queryInvProducts(); + }, + queryInvProducts() { + + }, + combine() { + + }, }, created() { this.getAllWarehouse(); - if (!isBlank(this.maOrder.orderId)) { + if (null !== this.maOrder) { this.formData.orderId = this.maOrder.orderId; this.formData.createTime = this.maOrder.createTime; + this.formData.invWarehouseCode = this.maOrder.invWarehouseCode; this.getList(); } }, diff --git a/src/views/inventory/invMAOrderAudit.vue b/src/views/inventory/invMAOrderAudit.vue index 24714c4..31ebfc9 100644 --- a/src/views/inventory/invMAOrderAudit.vue +++ b/src/views/inventory/invMAOrderAudit.vue @@ -4,19 +4,11 @@ - - - {{ item.name }} - - + - 查询 - 摆放 + 新增养护记录 @@ -59,199 +51,115 @@ - + - - + + - - - - - - - - - - - - - - - - - 提交 - - - - -
- 当前仓库: -
-
- - - - - - {{ item.name }} - - - - - - - -
- 当前分库: -
-
- - - - - - {{ item.name }} - - - - -
- - - - -
- 当前货位: -
-
- -
+ + + + + + + + - - + + - - -
条码数量:{{ codeArray.length }} -
-
-
- - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +