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