|
|
|
@ -355,8 +355,13 @@
|
|
|
|
|
:show-overflow-tooltip="true" :formatter="orderCodeFormate" />
|
|
|
|
|
<el-table-column label="报工单号" width="115" align="left" prop="reportCode"
|
|
|
|
|
:show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column label="批次" width="250" align="left" prop="batch"
|
|
|
|
|
:show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column label="批次" width="250" align="left" prop="batch">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input size="small" v-model="scope.row.batch"
|
|
|
|
|
@change="handleEdit(scope.$index, scope.row)"
|
|
|
|
|
></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="单位" align="center" prop="unit" />
|
|
|
|
|
<el-table-column label="报工数量" width="120" align="left" prop="quantityFeedback"
|
|
|
|
|
:show-overflow-tooltip="true">
|
|
|
|
@ -385,19 +390,19 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="报工单编号" align="center" prop="reportCode" width="120" />
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="150" />
|
|
|
|
|
<!---->
|
|
|
|
|
<!---->
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="160">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click.native.prevent="deleteReportRow(scope.$index, item.libList)" size="small" type="danger" plain
|
|
|
|
|
<el-button @click.native.prevent="deleteReportRow(scope.$index, item.libList)" size="small" type="danger" plain
|
|
|
|
|
v-if="item.libId == 'order1'&&scope.row.uploadStatus!='1'&&scope.row.attr1!= '1'">
|
|
|
|
|
删除</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button @click.native.prevent="preReportRow(scope.$index, item.libList)" size="small" type="success" plain
|
|
|
|
|
<el-button @click.native.prevent="preReportRow(scope.$index, item.libList)" size="small" type="success" plain
|
|
|
|
|
v-if="item.libId == 'order1'&&scope.row.attr1!='1'&&scope.row.uploadStatus!='1'" >
|
|
|
|
|
预报工</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<div class="demo-input-suffix">
|
|
|
|
@ -443,7 +448,7 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="单位" width="50" align="center" prop="unit" />
|
|
|
|
|
<el-table-column label="反冲标识" align="center" prop="recoil" />
|
|
|
|
|
|
|
|
|
|
<el-table-column label="sap项目编码" align="center" prop="rspos" />
|
|
|
|
|
<el-table-column label="仓库" width="150" align="center" prop="warehouseCode">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select v-model="scope.row.warehouseCode" placeholder="请选择仓库" width="50%"
|
|
|
|
@ -1339,13 +1344,6 @@ export default {
|
|
|
|
|
this.queryParams.workorderCode = "";
|
|
|
|
|
this.queryParams.machineCode = "";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//this.queryParams.workorderCode = sr.workorderCode;
|
|
|
|
|
//查询母工单BOM记录列表
|
|
|
|
|
//this.queryParams.parentOrder = '0';
|
|
|
|
|
//getBomList(this.queryParams).then(response => {
|
|
|
|
|
// this.pBomTableList = this.handleTree(response, 'materialCode', 'pMaterialCode')
|
|
|
|
|
//});
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据(报工物料消耗专用特殊逻辑,不准改zxl)
|
|
|
|
|
pConsumeSelection(selection, row) {
|
|
|
|
@ -1354,7 +1352,8 @@ export default {
|
|
|
|
|
const hasDuplicate = acc.some(
|
|
|
|
|
(item) =>
|
|
|
|
|
item.materialCode === cur.materialCode &&
|
|
|
|
|
item.workorderCode === cur.workorderCode
|
|
|
|
|
item.workorderCode === cur.workorderCode &&
|
|
|
|
|
item.rspos === cur.rspos
|
|
|
|
|
);
|
|
|
|
|
if (!hasDuplicate) {
|
|
|
|
|
acc.push(cur);
|
|
|
|
@ -1370,7 +1369,8 @@ export default {
|
|
|
|
|
this.pConsumeRows.forEach((item) => {
|
|
|
|
|
if (
|
|
|
|
|
item.workorderCode != row.workorderCode ||
|
|
|
|
|
item.materialCode != row.materialCode
|
|
|
|
|
item.materialCode != row.materialCode ||
|
|
|
|
|
item.rspos != row.rspos
|
|
|
|
|
) {
|
|
|
|
|
newPConsumeRows.push(item);
|
|
|
|
|
}
|
|
|
|
@ -1389,7 +1389,8 @@ export default {
|
|
|
|
|
const hasDuplicate = acc.some(
|
|
|
|
|
(item) =>
|
|
|
|
|
item.materialCode === cur.materialCode &&
|
|
|
|
|
item.workorderCode === cur.workorderCode
|
|
|
|
|
item.workorderCode === cur.workorderCode &&
|
|
|
|
|
item.rspos === cur.rspos
|
|
|
|
|
);
|
|
|
|
|
if (!hasDuplicate) {
|
|
|
|
|
acc.push(cur);
|
|
|
|
@ -1397,16 +1398,16 @@ export default {
|
|
|
|
|
return acc;
|
|
|
|
|
}, []);
|
|
|
|
|
},
|
|
|
|
|
sConsumeSelection(selection) {
|
|
|
|
|
this.sConsumeRows = selection;
|
|
|
|
|
},
|
|
|
|
|
//sConsumeSelection(selection) {
|
|
|
|
|
//this.sConsumeRows = selection;
|
|
|
|
|
//},
|
|
|
|
|
submitConsume() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.pConsumeRows = this.pConsumeRows.concat(
|
|
|
|
|
this.mergedArray.filter(
|
|
|
|
|
(obj2) =>
|
|
|
|
|
!this.pConsumeRows.some(
|
|
|
|
|
(obj1) => obj1.materialCode === obj2.materialCode
|
|
|
|
|
(obj1) => obj1.materialCode === obj2.materialCode && obj1.rspos === obj2.rspos
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
@ -1539,7 +1540,7 @@ export default {
|
|
|
|
|
this.$modal.confirm('是否确认删除?确认后,不需要点击下方确定,立即生效!').then(function() {
|
|
|
|
|
return deleteReportNow(rows[index].reportCode);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var sr = rows[index];
|
|
|
|
|
this.queryParams.workorderCode = sr.workorderCode;
|
|
|
|
|
this.queryParams.machineCode = sr.machineCode;
|
|
|
|
@ -1577,23 +1578,24 @@ export default {
|
|
|
|
|
this.titleReport = "工单报工详情";
|
|
|
|
|
this.libTabs = response;
|
|
|
|
|
});
|
|
|
|
|
_this.loading = false;
|
|
|
|
|
_this.loading = false;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//物料损耗表格--删除
|
|
|
|
|
deleteBomRow(index, rows) {
|
|
|
|
|
let _this = this;
|
|
|
|
|
this.$modal
|
|
|
|
|
.confirm("是否确认删除?确认后,不需要点击下方确定,立马删除!")
|
|
|
|
|
.then(function () {
|
|
|
|
|
if (rows[index].recordId != null) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
return deleteBomRowNow(rows[index].recordId);
|
|
|
|
|
_this.loading = true;
|
|
|
|
|
deleteBomRowNow(rows[index].recordId);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
var newPConsumeRows = [];
|
|
|
|
|
this.pConsumeRows.forEach((item) => {
|
|
|
|
|
_this.pConsumeRows.forEach((item) => {
|
|
|
|
|
if (
|
|
|
|
|
item.workorderCode != rows[index].workorderCode ||
|
|
|
|
|
item.materialCode != rows[index].materialCode
|
|
|
|
@ -1601,10 +1603,10 @@ export default {
|
|
|
|
|
newPConsumeRows.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.pConsumeRows = newPConsumeRows;
|
|
|
|
|
_this.pConsumeRows = newPConsumeRows;
|
|
|
|
|
rows.splice(index, 1);
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
this.loading = false;
|
|
|
|
|
_this.$modal.msgSuccess("删除成功");
|
|
|
|
|
_this.loading = false;
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
},
|
|
|
|
@ -1632,7 +1634,7 @@ export default {
|
|
|
|
|
new Set([...this.pConsumeRowsall, ...obj].map(JSON.stringify))
|
|
|
|
|
).map(JSON.parse);
|
|
|
|
|
let arry2 = [];
|
|
|
|
|
this.pConsumeRowsall.forEach((item) => {
|
|
|
|
|
this.pConsumeRowsall.forEach((item,i) => {
|
|
|
|
|
const row = {
|
|
|
|
|
workorderCode: item.workorderCode,
|
|
|
|
|
materialCode: item.component,
|
|
|
|
@ -1640,26 +1642,28 @@ export default {
|
|
|
|
|
quantity: item.quantity,
|
|
|
|
|
unit: item.unit,
|
|
|
|
|
recoil: "X",
|
|
|
|
|
parentOrder: sr.workorderCode,
|
|
|
|
|
parentOrder: sr.workorderCode
|
|
|
|
|
};
|
|
|
|
|
arry2.push(row);
|
|
|
|
|
});
|
|
|
|
|
this.mergedArray = this.pConsumeRows.concat(
|
|
|
|
|
arry2.filter(
|
|
|
|
|
(obj2) =>
|
|
|
|
|
!this.pConsumeRows.some(
|
|
|
|
|
(obj1) => obj1.materialCode === obj2.materialCode
|
|
|
|
|
(obj2) =>!this.pConsumeRows.some(
|
|
|
|
|
(obj1) => obj1.materialCode === obj2.materialCode && obj1.rspos === obj2.rspos
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
const materialCodeSet = new Set(
|
|
|
|
|
this.pConsumeRows.map((item) => item.materialCode)
|
|
|
|
|
//const materialCodeSet = new Set(
|
|
|
|
|
// this.pConsumeRows.map((item) => item.materialCode)
|
|
|
|
|
//);
|
|
|
|
|
const rsposSet = new Set(
|
|
|
|
|
this.pConsumeRows.map((item) => item.rspos)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 遍历obj数组
|
|
|
|
|
for (let i = 0; i < obj.length; i++) {
|
|
|
|
|
// 判断obj中的component是否已存在于pConsumeRows中
|
|
|
|
|
if (!materialCodeSet.has(obj[i].component)) {
|
|
|
|
|
if (!rsposSet.has(obj[i].rspos)|| obj[i].rspos==null) {
|
|
|
|
|
const row = {
|
|
|
|
|
workorderCode: obj[i].workorderCode,
|
|
|
|
|
materialCode: obj[i].component,
|
|
|
|
@ -1668,6 +1672,7 @@ export default {
|
|
|
|
|
unit: obj[i].unit,
|
|
|
|
|
recoil: "X",
|
|
|
|
|
parentOrder: sr.workorderCode,
|
|
|
|
|
rspos: obj[i].rspos
|
|
|
|
|
};
|
|
|
|
|
// 将满足条件的行数据添加到consumeList中
|
|
|
|
|
this.consumeList.push(row);
|
|
|
|
|