From 17f6abb8efa7c291c34d72d370445778e4064953 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Fri, 3 Oct 2025 09:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/warehouse/ifsInventoryInit.vue | 73 +++++++++---------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/src/views/modules/warehouse/ifsInventoryInit.vue b/src/views/modules/warehouse/ifsInventoryInit.vue index c4f9ba6..2263005 100644 --- a/src/views/modules/warehouse/ifsInventoryInit.vue +++ b/src/views/modules/warehouse/ifsInventoryInit.vue @@ -150,7 +150,7 @@ :visible.sync="editPrintQtyVisible" width="400px" :close-on-click-modal="false"> - + @@ -334,12 +334,7 @@ export default { unPrintQty: 0, newPrintQty: 0 }, - editPrintQtyRules: { - newPrintQty: [ - { required: true, message: '新的已打印数量不能为空', trigger: 'blur' }, - { type: 'number', min: 0, message: '已打印数量不能小于0', trigger: 'blur' } - ] - }, + createHuVisible: false, createHuLoading: false, createHuForm: { @@ -435,42 +430,42 @@ export default { // 提交修改已打印数量 editPrintQtySubmit () { - this.$refs['editPrintQtyForm'].validate((valid) => { - if (valid) { - // 验证新的已打印数量不能超过现有库存 - if (this.editPrintQtyForm.newPrintQty > this.editPrintQtyForm.qtyOnHand) { - this.$message.error('已打印数量不能超过现有库存') - return - } + if (this.editPrintQtyForm.newPrintQty < 0) { + this.$message.error('已打印数量不能小于0') + return + } + // 验证新的已打印数量不能超过现有库存 + if (this.editPrintQtyForm.newPrintQty > this.editPrintQtyForm.qtyOnHand) { + this.$message.error('已打印数量不能超过现有库存') + return + } - this.editPrintQtyLoading = true - const updateData = { - site: this.editPrintQtyForm.site, - warehouseId: this.editPrintQtyForm.warehouseId, - partNo: this.editPrintQtyForm.partNo, - batchNo: this.editPrintQtyForm.batchNo, - locationId: this.editPrintQtyForm.locationId, - wdr: this.editPrintQtyForm.wdr, - newPrintQty: this.editPrintQtyForm.newPrintQty - } + this.editPrintQtyLoading = true + const updateData = { + site: this.editPrintQtyForm.site, + warehouseId: this.editPrintQtyForm.warehouseId, + partNo: this.editPrintQtyForm.partNo, + batchNo: this.editPrintQtyForm.batchNo, + locationId: this.editPrintQtyForm.locationId, + wdr: this.editPrintQtyForm.wdr, + newPrintQty: this.editPrintQtyForm.newPrintQty + } - updatePrintQty(updateData).then(({ data }) => { - if (data && data.code === 0) { - this.$message({ - message: '修改已打印数量成功', - type: 'success', - duration: 1500 - }) - this.editPrintQtyVisible = false - this.getDataList() - } else { - this.$message.error(data.msg || '修改已打印数量失败') - } - this.editPrintQtyLoading = false - }).catch(() => { - this.editPrintQtyLoading = false + updatePrintQty(updateData).then(({ data }) => { + if (data && data.code === 0) { + this.$message({ + message: '修改已打印数量成功', + type: 'success', + duration: 1500 }) + this.editPrintQtyVisible = false + this.getDataList() + } else { + this.$message.error(data.msg || '修改已打印数量失败') } + this.editPrintQtyLoading = false + }).catch(() => { + this.editPrintQtyLoading = false }) },