chore: update production plan views
This commit is contained in:
@@ -221,6 +221,8 @@
|
||||
<el-button type="text" size="mini" @click="editRemark(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
|
||||
@@ -181,7 +181,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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
|
||||
v-model="scope.row.最晚开始时间"
|
||||
type="date"
|
||||
@@ -192,7 +194,7 @@
|
||||
value-format="yyyy-MM-dd"
|
||||
@change = "editlateTask">
|
||||
</el-date-picker>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column align="center" label="派工" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini"
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<span>{{ stationGroup.station }}</span>
|
||||
</td>
|
||||
<!-- <td>{{ stationGroup.totalQuantity }}</td> -->
|
||||
<td>{{ stationGroup.totalQuantity*stationGroup.totalHours }}</td>
|
||||
<td>{{ stationGroup.totalHours }}</td>
|
||||
<td colspan="21"></td>
|
||||
</tr>
|
||||
<template v-for="dateGroup in stationGroup.dates">
|
||||
@@ -109,7 +109,7 @@
|
||||
<span>{{ dateGroup.date }}</span>
|
||||
</td>
|
||||
<!-- <td>{{ dateGroup.totalQuantity }}</td> -->
|
||||
<td>{{ dateGroup.totalQuantity*dateGroup.totalHours }}</td>
|
||||
<td>{{ dateGroup.totalHours }}</td>
|
||||
<td colspan="21"></td>
|
||||
</tr>
|
||||
<tr
|
||||
@@ -465,7 +465,7 @@ export default {
|
||||
const quantity = Number(task.指派数量 || task.计划数量) || 0
|
||||
stationGroup.totalCount += 1
|
||||
stationGroup.totalQuantity += quantity
|
||||
stationGroup.totalHours += hours
|
||||
stationGroup.totalHours += hours*quantity
|
||||
|
||||
if (!stationGroup.dateMap.has(planDate)) {
|
||||
stationGroup.dateMap.set(planDate, {
|
||||
@@ -478,7 +478,7 @@ export default {
|
||||
|
||||
const dateGroup = stationGroup.dateMap.get(planDate)
|
||||
dateGroup.totalQuantity += quantity
|
||||
dateGroup.totalHours += hours
|
||||
dateGroup.totalHours += hours*quantity
|
||||
dateGroup.tasks.push(task)
|
||||
})
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<div class="process-route" v-html="formatProcessRoute(scope.row)" />
|
||||
</template>
|
||||
@@ -288,6 +288,11 @@ export default {
|
||||
if (!date) return ''
|
||||
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) {
|
||||
const num = Number(value)
|
||||
return Number.isFinite(num) ? num : 0
|
||||
@@ -391,6 +396,14 @@ export default {
|
||||
}
|
||||
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) {
|
||||
if (Array.isArray(row.子数据) && row.子数据.length > 0) {
|
||||
return row.子数据
|
||||
@@ -404,6 +417,7 @@ export default {
|
||||
工序名称: name,
|
||||
加工状态: 0,
|
||||
收检合格数: 0,
|
||||
计划开始时间: '',
|
||||
指派对象: '',
|
||||
订单行号: 0,
|
||||
收料数量: 0,
|
||||
@@ -417,12 +431,55 @@ export default {
|
||||
}
|
||||
|
||||
const outsourceGroupClasses = this.getOutsourceGroupClassState(processes)
|
||||
return processes.map((process, index) => {
|
||||
const name = process.工序名称 || ''
|
||||
const className = this.getProcessClass(process, index, outsourceGroupClasses)
|
||||
const arrow = index < processes.length - 1 ? '<span class="process-route-arrow">-></span>' : ''
|
||||
return `<span class="${className}">${this.escapeProcessHtml(name)}</span>${arrow}`
|
||||
}).join('')
|
||||
const maxPerRow = 8
|
||||
const rows = Math.ceil(processes.length / maxPerRow)
|
||||
let tableHtml = '<div class="process-route-wrap"><table class="process-route-table"><tbody>'
|
||||
|
||||
for (let rowIndex = 0; rowIndex < rows; rowIndex++) {
|
||||
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) {
|
||||
// 第一步:先按照订单行号对原始数据进行排序
|
||||
@@ -759,11 +816,48 @@ export default {
|
||||
}
|
||||
|
||||
.process-route {
|
||||
line-height: 20px;
|
||||
line-height: 1.4;
|
||||
white-space: normal;
|
||||
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 {
|
||||
color: #28d961;
|
||||
font-weight: 700;
|
||||
@@ -780,8 +874,16 @@ export default {
|
||||
}
|
||||
|
||||
::v-deep .process-route-arrow {
|
||||
margin: 0 4px;
|
||||
color: #909399;
|
||||
color: rgba(0, 164, 255, 0.6) !important;
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user