Commit 69d850fa authored by chicheng's avatar chicheng

进度报表BUG修复

parent dfc25896
......@@ -637,18 +637,19 @@ export default {
this.form = Object.assign({}, data, {quantity: null , workorderType:"complements", parentCode: data.workorderCode, workorderCode: ''})
this.gCode();
}
this.bomList = data.bomList;
const sizeList = data.sizeList || [];
this.bomList = data.bomList || [];
// 设置组件数据
this.$refs["ProogingBomRef"].tableData = data.bomList;
this.$refs["ProogingBomRef"].tableData = data.bomList || [];
console.log('生产工单', data.processList)
this.$refs["ProogingProcessRef"].tableData = data.processList;
this.$refs["WorkOrderSaleRef"].tableData = data.saleDirectiveList;
this.$refs["WorkOrderSizeRef"].tableData = data.sizeList;
this.$refs["ProogingProcessRef"].tableData = data.processList || [];
this.$refs["WorkOrderSaleRef"].tableData = data.saleDirectiveList || [];
this.$refs["WorkOrderSizeRef"].tableData = sizeList;
this.$refs["WorkOrderSizeRef"].tableColums = [];
this.$refs["WorkOrderSizeRef"].colums.forEach((value) => {
let flag = false;
data.sizeList.forEach((item) => {
sizeList.forEach((item) => {
if (item[value.prop] === 0 || item[value.prop]) {
flag = true;
}
......
......@@ -113,7 +113,7 @@
<el-table v-loading="loadingRight" :data="tbodysRight" border :height="tableHeightSecond" style="margin-left: 15px">
<el-table-column :label="$t('排产次数')" align="center" prop="taskBatch" >
<template slot-scope="scope">
{{scope.row.taskBatch.split('-').length > 1 ? scope.row.taskBatch.split('-')[scope.row.taskBatch.split('-').length - 1]: ''}}
<span v-if="scope.row.taskBatch">{{ scope.row.taskBatch.split('-').pop() }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('报工人员')" align="center" prop="nickName"></el-table-column>
......@@ -269,25 +269,56 @@ export default {
this.tableHeightSecond = 0
}
},
isSameProgressRow(row, highlight) {
if (!highlight || !row || row.workorderId == null) return false
return row.workorderId === highlight.workorderId
&& String(row.taskBatch || '') === String(highlight.taskBatch || '')
},
mainTableClick(row){
this.loadingLeft = true;
this.loadingRight = true;
this.highlightRow = row;
getProcessList({workorderCode: row.workorderCode, taskWorkunitId: row.taskWorkunitId}).then(response => {
response.rows.forEach(element => {
element['workorderCode'] = row.workorderCode
this.highlightRow1 = null;
this.tbodysRight = [];
getProcessList({ workorderCode: row.workorderCode, taskBatch: row.taskBatch }).then(response => {
const rows = (response && response.rows) ? response.rows : [];
rows.forEach(element => {
element.workorderCode = row.workorderCode;
});
this.tbodysLeft = response.rows
this.tbodysLeft = rows;
this.loadingLeft = false;
this.isShowSecond = true
this.$nextTick(() => this.calcTableHeight())
this.isShowSecond = true;
this.$nextTick(() => this.calcTableHeight());
if (rows.length > 0) {
this.secondTableClick(rows[0]);
} else {
this.loadingRight = false;
}
}).catch(() => {
this.tbodysLeft = [];
this.tbodysRight = [];
this.loadingLeft = false;
this.loadingRight = false;
});
this.secondTableClick(row)
},
secondTableClick(row) {
if (!row || row.taskId == null) {
this.tbodysRight = [];
this.loadingRight = false;
return;
}
this.loadingRight = true;
this.highlightRow1 = row;
getFeedbackList({workorderCode: row.workorderCode, taskId: row.taskId, taskWorkunitId: row.taskWorkunitId}).then(response => {
this.tbodysRight = response.rows;
const workorderCode = row.workorderCode || (this.highlightRow && this.highlightRow.workorderCode);
getFeedbackList({
workorderCode,
taskId: row.taskId,
taskWorkunitId: row.taskWorkunitId
}).then(response => {
this.tbodysRight = (response && response.rows) ? response.rows : [];
this.loadingRight = false;
}).catch(() => {
this.tbodysRight = [];
this.loadingRight = false;
});
},
......@@ -296,10 +327,9 @@ export default {
this.queryParams.productName = row.itemName;
}
},
tableRowClassName({ row, rowIndex }) {
if(!row.workorderId || !this.highlightRow) return ''
// 如果当前行是高亮行,则添加特定的类名
if (row.workorderId === this.highlightRow.workorderId) {
tableRowClassName({ row }) {
if (!this.highlightRow) return ''
if (this.isSameProgressRow(row, this.highlightRow)) {
return 'highlight-row';
}
return '';
......
......@@ -64,6 +64,7 @@
<el-table-column prop="orderCode" label="订单单号" width="140" align="center" />
<el-table-column prop="lineName" label="产线名称" width="100" align="center" />
<el-table-column prop="workorderCode" label="生产工单" width="140" align="center" />
<el-table-column prop="taskBatch" label="排产次数" width="90" align="center" />
<el-table-column prop="orderSerial" label="订单序号" width="100" align="center" />
<el-table-column prop="workorderType" label="工单类型" width="100" align="center" />
<el-table-column prop="productCode" label="产品编号" width="120" align="center" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment