chore: update production plan views

This commit is contained in:
meswork764
2026-06-09 11:49:54 +08:00
parent 0bf5f3f704
commit 134f9d888a
4 changed files with 122 additions and 16 deletions

View File

@@ -221,6 +221,8 @@
<el-button type="text" size="mini" @click="editRemark(scope.row)">编辑</el-button> <el-button type="text" size="mini" @click="editRemark(scope.row)">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="行文本备注" label="工艺备注" width="120" />
<el-table-column align="center" prop="任务概述" label="工艺说明" width="120" />
<el-table-column align="center" label="二次派工" width="200"> <el-table-column align="center" label="二次派工" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select

View File

@@ -181,7 +181,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="备注" label="备注" width="150" /> <el-table-column align="center" prop="备注" label="备注" width="150" />
<el-table-column align="center" label="最晚开始" width="160"> <el-table-column align="center" prop="行文本备注" label="工艺备注" width="120" />
<el-table-column align="center" prop="任务概述" label="工艺说明" width="120" />
<!-- <el-table-column align="center" label="最晚开始" width="160">
<el-date-picker <el-date-picker
v-model="scope.row.最晚开始时间" v-model="scope.row.最晚开始时间"
type="date" type="date"
@@ -192,7 +194,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@change = "editlateTask"> @change = "editlateTask">
</el-date-picker> </el-date-picker>
</el-table-column> </el-table-column> -->
<!-- <el-table-column align="center" label="派工" width="100"> <!-- <el-table-column align="center" label="派工" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" <el-button type="primary" size="mini"

View File

@@ -95,7 +95,7 @@
<span>{{ stationGroup.station }}</span> <span>{{ stationGroup.station }}</span>
</td> </td>
<!-- <td>{{ stationGroup.totalQuantity }}</td> --> <!-- <td>{{ stationGroup.totalQuantity }}</td> -->
<td>{{ stationGroup.totalQuantity*stationGroup.totalHours }}</td> <td>{{ stationGroup.totalHours }}</td>
<td colspan="21"></td> <td colspan="21"></td>
</tr> </tr>
<template v-for="dateGroup in stationGroup.dates"> <template v-for="dateGroup in stationGroup.dates">
@@ -109,7 +109,7 @@
<span>{{ dateGroup.date }}</span> <span>{{ dateGroup.date }}</span>
</td> </td>
<!-- <td>{{ dateGroup.totalQuantity }}</td> --> <!-- <td>{{ dateGroup.totalQuantity }}</td> -->
<td>{{ dateGroup.totalQuantity*dateGroup.totalHours }}</td> <td>{{ dateGroup.totalHours }}</td>
<td colspan="21"></td> <td colspan="21"></td>
</tr> </tr>
<tr <tr
@@ -465,7 +465,7 @@ export default {
const quantity = Number(task.指派数量 || task.计划数量) || 0 const quantity = Number(task.指派数量 || task.计划数量) || 0
stationGroup.totalCount += 1 stationGroup.totalCount += 1
stationGroup.totalQuantity += quantity stationGroup.totalQuantity += quantity
stationGroup.totalHours += hours stationGroup.totalHours += hours*quantity
if (!stationGroup.dateMap.has(planDate)) { if (!stationGroup.dateMap.has(planDate)) {
stationGroup.dateMap.set(planDate, { stationGroup.dateMap.set(planDate, {
@@ -478,7 +478,7 @@ export default {
const dateGroup = stationGroup.dateMap.get(planDate) const dateGroup = stationGroup.dateMap.get(planDate)
dateGroup.totalQuantity += quantity dateGroup.totalQuantity += quantity
dateGroup.totalHours += hours dateGroup.totalHours += hours*quantity
dateGroup.tasks.push(task) dateGroup.tasks.push(task)
}) })

View File

@@ -148,7 +148,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="当前序" label="当前序" width="80" /> <el-table-column align="center" prop="当前序" label="当前序" width="80" />
<el-table-column align="center" label="工艺路线" width="260"> <el-table-column align="center" label="工艺路线" width="750">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="process-route" v-html="formatProcessRoute(scope.row)" /> <div class="process-route" v-html="formatProcessRoute(scope.row)" />
</template> </template>
@@ -288,6 +288,11 @@ export default {
if (!date) return '' if (!date) return ''
return date.split(' ').length > 1 ? date.split(' ')[0] : date return date.split(' ').length > 1 ? date.split(' ')[0] : date
}, },
formatProcessRouteDate(date) {
const formattedDate = this.formatDate(date)
const match = formattedDate.match(/^(\d{4})-(\d{2})-(\d{2})$/)
return match ? `${match[2]}-${match[3]}` : formattedDate
},
toProcessNumber(value) { toProcessNumber(value) {
const num = Number(value) const num = Number(value)
return Number.isFinite(num) ? num : 0 return Number.isFinite(num) ? num : 0
@@ -391,6 +396,14 @@ export default {
} }
return this.getProcessBaseClass(process) return this.getProcessBaseClass(process)
}, },
getProcessRouteName(process) {
const name = String(process.工序名称 || '')
const assignee = String(process.指派对象 || '')
if (!assignee || name.includes(`(${assignee})`) || name.includes(`${assignee}`)) {
return name
}
return `${name}(${assignee})`
},
getRouteProcesses(row) { getRouteProcesses(row) {
if (Array.isArray(row.子数据) && row.子数据.length > 0) { if (Array.isArray(row.子数据) && row.子数据.length > 0) {
return row.子数据 return row.子数据
@@ -404,6 +417,7 @@ export default {
工序名称: name, 工序名称: name,
加工状态: 0, 加工状态: 0,
收检合格数: 0, 收检合格数: 0,
计划开始时间: '',
指派对象: '', 指派对象: '',
订单行号: 0, 订单行号: 0,
收料数量: 0, 收料数量: 0,
@@ -417,12 +431,55 @@ export default {
} }
const outsourceGroupClasses = this.getOutsourceGroupClassState(processes) const outsourceGroupClasses = this.getOutsourceGroupClassState(processes)
return processes.map((process, index) => { const maxPerRow = 8
const name = process.工序名称 || '' const rows = Math.ceil(processes.length / maxPerRow)
const className = this.getProcessClass(process, index, outsourceGroupClasses) let tableHtml = '<div class="process-route-wrap"><table class="process-route-table"><tbody>'
const arrow = index < processes.length - 1 ? '<span class="process-route-arrow">-&gt;</span>' : ''
return `<span class="${className}">${this.escapeProcessHtml(name)}</span>${arrow}` for (let rowIndex = 0; rowIndex < rows; rowIndex++) {
}).join('') const startIndex = rowIndex * maxPerRow
const endIndex = Math.min(startIndex + maxPerRow, processes.length)
const rowProcesses = processes.slice(startIndex, endIndex)
if (rowIndex > 0) {
tableHtml += '<tr class="process-route-spacer"><td colspan="' + (maxPerRow * 2 - 1) + '"></td></tr>'
}
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const planDate = this.formatProcessRouteDate(process.计划开始时间 || process.计划完成时间 || '')
tableHtml += `<td class="process-route-date ${className}">${this.escapeProcessHtml(planDate)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow-hidden"></td>'
}
})
tableHtml += '</tr>'
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const name = this.getProcessRouteName(process)
tableHtml += `<td class="${className}">${this.escapeProcessHtml(name)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow">→</td>'
}
})
tableHtml += '</tr>'
tableHtml += '<tr>'
rowProcesses.forEach((process, index) => {
const className = this.getProcessClass(process, startIndex + index, outsourceGroupClasses)
const count = this.toProcessNumber(process.收检合格数)
tableHtml += `<td class="process-route-count ${className}">合格${this.escapeProcessHtml(count)}</td>`
if (index < rowProcesses.length - 1) {
tableHtml += '<td class="process-route-arrow-hidden"></td>'
}
})
tableHtml += '</tr>'
}
tableHtml += '</tbody></table></div>'
return tableHtml
}, },
mergeOrderData(dataList) { mergeOrderData(dataList) {
// 第一步:先按照订单行号对原始数据进行排序 // 第一步:先按照订单行号对原始数据进行排序
@@ -759,11 +816,48 @@ export default {
} }
.process-route { .process-route {
line-height: 20px; line-height: 1.4;
white-space: normal; white-space: normal;
word-break: break-all; word-break: break-all;
} }
::v-deep .process-route-wrap {
width: 100%;
text-align: left;
}
::v-deep .process-route-table {
width: auto;
border-collapse: collapse;
text-align: left;
table-layout: auto;
}
::v-deep .process-route-table td {
text-align: left;
padding: 2px 2px;
font-size: 11px;
white-space: nowrap;
line-height: 1.4;
}
::v-deep .process-route-date {
font-size: 10px !important;
color: #8899aa !important;
padding: 2px 2px !important;
}
::v-deep .process-route-count {
font-weight: 700;
font-size: 12px !important;
}
::v-deep .process-route-spacer td {
height: 4px;
padding: 0 !important;
line-height: 1 !important;
}
::v-deep .process-route-green { ::v-deep .process-route-green {
color: #28d961; color: #28d961;
font-weight: 700; font-weight: 700;
@@ -780,8 +874,16 @@ export default {
} }
::v-deep .process-route-arrow { ::v-deep .process-route-arrow {
margin: 0 4px; color: rgba(0, 164, 255, 0.6) !important;
color: #909399; font-size: 10px !important;
padding: 2px 0 !important;
width: 8px;
text-align: center !important;
}
::v-deep .process-route-arrow-hidden {
padding: 2px 0 !important;
width: 8px;
} }
.search-container { .search-container {