报工组件修改10

master
zhaoxiaolin 8 months ago
parent ea287e1b45
commit b04d89ae3c

@ -1228,6 +1228,7 @@ export default {
_this.$modal.msgSuccess("报工成功"); _this.$modal.msgSuccess("报工成功");
} }
_this.loading = false; _this.loading = false;
_this.getList();
}); });
}).then(() => { }).then(() => {
@ -1247,6 +1248,7 @@ export default {
_this.$modal.msgSuccess("报工撤销成功"); _this.$modal.msgSuccess("报工撤销成功");
} }
_this.loading = false; _this.loading = false;
_this.getList();
}); });
}).then(() => { }).then(() => {
@ -1545,8 +1547,19 @@ export default {
//-- //--
deleteBomRow(index, rows) { deleteBomRow(index, rows) {
this.$modal.confirm('是否确认删除?确认后,不需要点击下方确定,立马删除!').then(function() { this.$modal.confirm('是否确认删除?确认后,不需要点击下方确定,立马删除!').then(function() {
return deleteBomRowNow(rows[index].recordId); if(rows[index].recordId != null ){
return deleteBomRowNow(rows[index].recordId);
}
}).then(() => { }).then(() => {
var newPConsumeRows = [];
this.pConsumeRows.forEach(item=>{
if (item.workorderCode!=rows[index].workorderCode
|| item.materialCode!=rows[index].materialCode) {
newPConsumeRows.push(item)
}
})
this.pConsumeRows = newPConsumeRows;
rows.splice(index, 1); rows.splice(index, 1);
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
@ -1554,7 +1567,6 @@ export default {
}, },
//-- //--
addConsumeTableRow(rows){ addConsumeTableRow(rows){
debugger
this.consumeList = rows; this.consumeList = rows;
if(rows.length==0){ if(rows.length==0){
this.$modal.msgError(`上位机尚未填写损耗,不允许提前新增`); this.$modal.msgError(`上位机尚未填写损耗,不允许提前新增`);
@ -1568,16 +1580,35 @@ export default {
onSelectNewPrepare(obj) { onSelectNewPrepare(obj) {
let sr = this.selectRow[0] let sr = this.selectRow[0]
for(let i=0;i<obj.length;i++){ for(let i=0;i<obj.length;i++){
const row = { if(this.pConsumeRows.length !=0 ){
workorderCode: obj[i].workorderCode, this.pConsumeRows.forEach(item=>{
materialCode: obj[i].component, if (item.materialCode==obj[i].component) {
materialName: obj[i].componentName, this.$modal.msgError("选择物料重复,自动过滤!");
quantity: obj[i].quantity, }else{
unit: obj[i].unit, const row = {
recoil:"X", workorderCode: obj[i].workorderCode,
parentOrder:sr.workorderCode materialCode: obj[i].component,
}; materialName: obj[i].componentName,
this.consumeList.push(row); quantity: obj[i].quantity,
unit: obj[i].unit,
recoil:"X",
parentOrder:sr.workorderCode
};
this.consumeList.push(row);
}
})
}else{
const row = {
workorderCode: obj[i].workorderCode,
materialCode: obj[i].component,
materialName: obj[i].componentName,
quantity: obj[i].quantity,
unit: obj[i].unit,
recoil:"X",
parentOrder:sr.workorderCode
};
this.consumeList.push(row);
}
} }
} }
} }

@ -110,7 +110,8 @@ export default {
productCode: '', productCode: '',
component : '', component : '',
componentName : '', componentName : '',
productGroupName:'' productGroupName:'',
workorderCode:''
}, },
selectionRows:[] selectionRows:[]
}; };
@ -128,6 +129,7 @@ export default {
}, },
init(workorderCode){ init(workorderCode){
this.workorderCode = workorderCode; this.workorderCode = workorderCode;
this.queryParams.workorderCode = this.workorderCode;
this.getList(); this.getList();
}, },
/** 查询表格列表*/ /** 查询表格列表*/

Loading…
Cancel
Save