报工组件修改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() {
if(rows[index].recordId != null ){
return deleteBomRowNow(rows[index].recordId); 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,6 +1580,24 @@ 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++){
if(this.pConsumeRows.length !=0 ){
this.pConsumeRows.forEach(item=>{
if (item.materialCode==obj[i].component) {
this.$modal.msgError("选择物料重复,自动过滤!");
}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);
}
})
}else{
const row = { const row = {
workorderCode: obj[i].workorderCode, workorderCode: obj[i].workorderCode,
materialCode: obj[i].component, materialCode: obj[i].component,
@ -1581,6 +1611,7 @@ export default {
} }
} }
} }
}
}; };
</script> </script>
<style scoped> <style scoped>

@ -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