diff --git a/src/views/modules/boxManage/com_saleBoxManage_boxing.vue b/src/views/modules/boxManage/com_saleBoxManage_boxing.vue index 33b8691..a190b75 100644 --- a/src/views/modules/boxManage/com_saleBoxManage_boxing.vue +++ b/src/views/modules/boxManage/com_saleBoxManage_boxing.vue @@ -586,7 +586,7 @@ export default { // ===== 左侧文字信息 ===== // NO.文字: ADD_PRINT_TEXT(上边距, 左边距, 宽度, 高度, 内容) // 文字区域:从3mm到54mm,宽度50mm,字号5,Arial字体紧凑显示 - const text1 = LODOP.ADD_PRINT_TEXT('4.5mm', '3mm', '52mm', '5mm', 'NO:' + ('FHJH-2026010393-20260123037' || '')) + const text1 = LODOP.ADD_PRINT_TEXT('4.5mm', '3mm', '52mm', '5mm', 'NO:' + (this.searchData.orderNo || '')) LODOP.SET_PRINT_STYLEA(text1, "FontName", "Arial") // 使用Arial,紧凑字体 LODOP.SET_PRINT_STYLEA(text1, "FontSize", 5) // 5号字体 LODOP.SET_PRINT_STYLEA(text1, "Bold", 1) // 粗体 diff --git a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue index 8f410d5..4a71162 100644 --- a/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue @@ -2692,11 +2692,25 @@ this.$message.warning('该类型单据不能编辑!') return } - if (this.editBatchVisible) { - this.editBatchVisible = false - } else { - this.editBatchVisible = true - } + // 先查询材料汇总数据,校验是否有合计已发数量大于零 + searchSumNotifyMaterialList(this.currentRow).then(({data}) => { + if (data && data.code === 0 && data.rows && data.rows.length > 0) { + const hasIssuedQty = data.rows.some(item => { + const qty = parseFloat(item.qtyToIssueOriginal) || 0; + return qty > 0; + }); + if (hasIssuedQty) { + this.$message.warning('该单据已有合计已发数量,不能批量编辑材料明细!'); + return; + } + } + // 校验通过,继续执行 + if (this.editBatchVisible) { + this.editBatchVisible = false + } else { + this.editBatchVisible = true + } + }); }, // 批量保存 @@ -3017,27 +3031,41 @@ }) }, deleteNotifyMaterial(row){ - this.$confirm('确认删除?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - deleteNotifyMaterial(row).then(({data}) => { - if (data && data.code === 0) { - this.refreshCurrentTabTable() - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + // 先查询材料汇总数据,校验是否有合计已发数量大于零 + searchSumNotifyMaterialList(this.currentRow).then(({data}) => { + if (data && data.code === 0 && data.rows && data.rows.length > 0) { + const hasIssuedQty = data.rows.some(item => { + const qty = parseFloat(item.qtyToIssueOriginal) || 0; + return qty > 0; + }); + if (hasIssuedQty) { + this.$message.warning('该单据已有合计已发数量,不能删除材料明细!'); + return; } + } + // 校验通过,继续执行删除 + this.$confirm('确认删除?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + deleteNotifyMaterial(row).then(({data}) => { + if (data && data.code === 0) { + this.refreshCurrentTabTable() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) }) - }) + }); }, deleteNotifySOSPlus(row){ // 检查当前状态是否允许编辑 @@ -3891,28 +3919,44 @@ }, editNotifyMaterialFun(row){ - // 设置当前行为要编辑的行 - this.currentRow = JSON.parse(JSON.stringify(row)); - - editNotifyMaterial(row).then(({data})=>{ - if (data.code === 0) { - //刷新主表数据 - this.searchTable().then(() => { // 等刷新完成 - const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo); - if (foundRow) { - this.currentRow = JSON.parse(JSON.stringify(foundRow)); - this.$nextTick(() => { - this.$refs.mainTable.setCurrentRow(foundRow); - }); - } + // 先查询该行的材料汇总数据,校验是否有合计已发数量大于零 + searchSumNotifyMaterialList(row).then(({data}) => { + if (data && data.code === 0 && data.rows && data.rows.length > 0) { + // 检查是否有合计已发数量大于零的记录 + const hasIssuedQty = data.rows.some(item => { + const qty = parseFloat(item.qtyToIssueOriginal) || 0; + return qty > 0; }); - this.$message.success( '操作成功') - }else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + if (hasIssuedQty) { + this.$message.warning('该单据已有合计已发数量,不能编辑主信息!'); + return; + } } - }) + + // 校验通过,继续执行编辑操作 + // 设置当前行为要编辑的行 + this.currentRow = JSON.parse(JSON.stringify(row)); + + editNotifyMaterial(row).then(({data})=>{ + if (data.code === 0) { + //刷新主表数据 + this.searchTable().then(() => { // 等刷新完成 + const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo); + if (foundRow) { + this.currentRow = JSON.parse(JSON.stringify(foundRow)); + this.$nextTick(() => { + this.$refs.mainTable.setCurrentRow(foundRow); + }); + } + }); + this.$message.success( '操作成功') + }else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }); }, // 判断当前状态是否可编辑 @@ -3956,24 +4000,38 @@ return false; } - // 重置表单数据 - this.newMaterialData = { - componentPartNo: '', - partDesc: '', - issueType: '替代料', - orderNo: '', - itemNo: '', // 申请单序号,将在选择生产订单时自动填充 - remark: '', - componentScrap: 0, - firstInspectionQty: 0, - standardDosage: 0, - bomSeqNo: '', - warehouseId: '', - qtyToIssueOriginal: 0 - }; - // 加载生产订单选项 - this.loadOrderOptions(); - this.addMaterialModalFlag = true; + // 先查询材料汇总数据,校验是否有合计已发数量大于零 + searchSumNotifyMaterialList(this.currentRow).then(({data}) => { + if (data && data.code === 0 && data.rows && data.rows.length > 0) { + const hasIssuedQty = data.rows.some(item => { + const qty = parseFloat(item.qtyToIssueOriginal) || 0; + return qty > 0; + }); + if (hasIssuedQty) { + this.$message.warning('该单据已有合计已发数量,不能新增材料明细!'); + return; + } + } + // 校验通过,继续执行 + // 重置表单数据 + this.newMaterialData = { + componentPartNo: '', + partDesc: '', + issueType: '替代料', + orderNo: '', + itemNo: '', // 申请单序号,将在选择生产订单时自动填充 + remark: '', + componentScrap: 0, + firstInspectionQty: 0, + standardDosage: 0, + bomSeqNo: '', + warehouseId: '', + qtyToIssueOriginal: 0 + }; + // 加载生产订单选项 + this.loadOrderOptions(); + this.addMaterialModalFlag = true; + }); }, // 加载生产订单选项 diff --git a/src/views/modules/qc/inboundNotification.vue b/src/views/modules/qc/inboundNotification.vue index 2c39072..d10d5b0 100644 --- a/src/views/modules/qc/inboundNotification.vue +++ b/src/views/modules/qc/inboundNotification.vue @@ -202,9 +202,9 @@
- 新增 - 删除 - 批量编辑 + 新增 + 删除 + 批量编辑 更换仓库 批量保存 取消编辑 @@ -320,7 +320,7 @@ label="操作"> @@ -1274,6 +1274,16 @@ const qty = parseFloat(item.requiredQty) || 0; return sum + qty; }, 0); + }, + // 判断是否有实际入库数量大于零的明细(有则禁止编辑) + hasActualInboundQty() { + if (!this.detailList || this.detailList.length === 0) { + return false; + } + return this.detailList.some(item => { + const qty = parseFloat(item.actualStockInQty) || 0; + return qty > 0; + }); } }, @@ -1403,6 +1413,11 @@ this.$message.warning('该类型单据不能编辑!') return } + // 校验当前行的明细是否有实际入库数量大于零 + if (this.hasActualInboundQty) { + this.$message.warning('该单据已有实际入库数量,不能编辑主信息!') + return + } this.modalData = { flag: '2', site: row.site, diff --git a/src/views/modules/qc/outboundNotification.vue b/src/views/modules/qc/outboundNotification.vue index 5c65b15..4a6d537 100644 --- a/src/views/modules/qc/outboundNotification.vue +++ b/src/views/modules/qc/outboundNotification.vue @@ -203,9 +203,9 @@ - 新增 - 删除 - 批量编辑 + 新增 + 删除 + 批量编辑 更换仓库 批量保存 取消编辑 @@ -1227,6 +1227,19 @@ } }, + computed: { + // 判断是否有实际出库数量大于零的明细(有则禁止编辑) + hasActualOutboundQty() { + if (!this.detailList || this.detailList.length === 0) { + return false; + } + return this.detailList.some(item => { + const qty = parseFloat(item.actualStockOutQty) || 0; + return qty > 0; + }); + } + }, + mounted () { this.$nextTick(() => { this.height = window.innerHeight / 2 - 100 @@ -1351,6 +1364,11 @@ this.$message.warning('销售出库单据不能编辑!') return } + // 校验当前行的明细是否有实际出库数量大于零 + if (this.hasActualOutboundQty) { + this.$message.warning('该单据已有实际出库数量,不能编辑主信息!') + return + } this.modalData = { flag: '2', site: row.site,