diff --git a/src/views/productionManagement/shortageApplication/components/declareAdd.vue b/src/views/productionManagement/shortageApplication/components/declareAdd.vue index 3ab3691..115dc70 100644 --- a/src/views/productionManagement/shortageApplication/components/declareAdd.vue +++ b/src/views/productionManagement/shortageApplication/components/declareAdd.vue @@ -23,7 +23,7 @@ {{ formError }} - + @@ -229,16 +229,35 @@ export default { }, selectChange(list, row) { + console.log(999999, list); + this.selectTableData = list; + this.form.tableData.forEach(item => { + item._select = list.includes(item); + }); if (list.length > 0) { list.forEach(item => { - item.quantity = null; - item.woCode = null; - item.reworkCode = null; - item.remark = null; + // 修正原有的赋值错误逻辑 + // 原代码: item.reworkCode = item.woCode?item.woCode:null; (错误) + // 原代码: item.remark = item.woCode?item.woCode:null; (错误) + + // 建议:只有在刚选中且字段为空时才清空,或者根据业务需求强制清空 + // 这里保留你原有的“清空”意图,但修复变量名 + if (!item.quantity) item.quantity = null; + if (!item.woCode) item.woCode = null; + if (!item.reworkCode) item.reworkCode = null; + if (!item.remark) item.remark = null; }); } - this.selectTableData = list; - row._select = !row._select; + // if (list.length > 0) { + // list.forEach(item => { + // item.quantity = item.quantity?item.quantity:null; + // item.woCode = item.woCode?item.woCode:null; + // item.reworkCode = item.reworkCode?item.reworkCode:null; + // item.remark = item.remark?item.remark:null; + // }); + // } + // this.selectTableData = list; + // row._select = !row._select; }, // 删除选中行 @@ -274,24 +293,24 @@ export default { this.$refs.tableForm.validate(valid => { if (valid) { this.saveLoading = true; - let query = [] + let query = []; selectedRows.forEach(row => { query.push({ - useCode: row.useCode,//领用单号 - woCode: row.woCode,//车间订单号 - reworkCode: row.reworkCode,//返工单号 - partCode: row.prtno,//零件号 - batchNo: row.splcode,//批次号 - quaLevel: row.prtlotno,//生产标识 - quantity: row.quantity,//数量 - remark: row.remark,//备注 - keeper: row.warctlr,//保管员 - planMan: row.schemer,//计划员 - locationNo:row.warlocno,//库位 - }) - }) + useCode: row.useCode, //领用单号 + woCode: row.woCode, //车间订单号 + reworkCode: row.reworkCode, //返工单号 + partCode: row.prtno, //零件号 + batchNo: row.splcode, //批次号 + quaLevel: row.prtlotno, //生产标识 + quantity: row.quantity, //数量 + remark: row.remark, //备注 + keeper: row.warctlr, //保管员 + planMan: row.schemer, //计划员 + locationNo: row.warlocno, //库位 + }); + }); - saveDeclare({orderDeclares:query}) + saveDeclare({ orderDeclares: query }) .then(res => { this.$message.success('操作成功'); this.saveLoading = false; diff --git a/src/views/productionManagement/workReportingManagement/components/wordReporting.vue b/src/views/productionManagement/workReportingManagement/components/wordReporting.vue index 3c13c89..2de54db 100644 --- a/src/views/productionManagement/workReportingManagement/components/wordReporting.vue +++ b/src/views/productionManagement/workReportingManagement/components/wordReporting.vue @@ -58,10 +58,10 @@ - - - - + + + + @@ -239,6 +239,7 @@ export default { teamRules: { makeTeam: [{ required: true, message: '请选择新班组', trigger: 'blur' }], }, + tableData:[] }; }, mounted() { @@ -256,7 +257,7 @@ export default { handleDetail(row) { this.detailDialog = true; getDataByWpId({ wpId: row.wpId }).then(res => { - this.detailData = res.data.data; + this.tableData = res.data.data; }); }, // 转班