chore: update plan management views

This commit is contained in:
meswork764
2026-06-09 18:09:56 +08:00
parent 134f9d888a
commit 1a781b02c2
7 changed files with 1520 additions and 14 deletions

View File

@@ -104,7 +104,7 @@
</div>
</template>
</el-table-column>
<el-table-column align="center" label="工艺路线" width="450">
<el-table-column align="center" label="工艺路线" width="550">
<template slot-scope="scope">
<div class="process-route" v-html="formatProcessRoute(scope.row)" />
</template>
@@ -289,6 +289,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
@@ -392,6 +397,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.子数据
@@ -405,6 +418,7 @@ export default {
工序名称: name,
加工状态: 0,
收检合格数: 0,
计划开始时间: '',
指派对象: '',
订单行号: 0,
收料数量: 0,
@@ -418,12 +432,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">-&gt;</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) {
// 第一步:先按照订单行号对原始数据进行排序
@@ -760,11 +817,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;
@@ -781,8 +875,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 {
@@ -858,4 +960,7 @@ export default {
display: flex;
align-items: center;
}
.el-table tr{
background-color: initial;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -213,7 +213,7 @@
</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="备注" label="备注" width="150" />
<el-table-column align="center" prop="备注" label="备注" width="150" show-overflow-tooltip />
<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="120">

View File

@@ -180,7 +180,7 @@
@click="getitemdata(scope.row.订单号)">查看</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="备注" label="备注" width="150" />
<el-table-column align="center" prop="备注" label="备注" width="150" show-overflow-tooltip/>
<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">
@@ -1483,4 +1483,5 @@ export default {
.el-picker-panel__icon-btn{
padding: 0;
}
</style>

View File

@@ -734,6 +734,7 @@ export default {
var orderids = []
var ordernums = []
var orderitems = []
multipleSelection.forEach(item => {
if(item.标准工艺 == 1 & item.生产工艺 !=1 ){
orderids.push(item.订单编号)
@@ -749,7 +750,7 @@ export default {
param.push(['订单编号',orderids])
param.push(['零件图号',orderitems])
param.push(['计划数量',ordernums])
console.log(param)
var Data = this.CreateData('12', '工艺管理_零件工序_生产工艺_批量生成生产工艺', param)
this.ExecDatabase(Data).then(response => {
this.searchTable()
@@ -1141,6 +1142,7 @@ export default {
this.ExecDatabase(Data1).then(response => {
param1[0] = ['物料编号', this.selectedRow.物料编号]
param1[1] = ['订单编号', this.selectedRow.订单编号]
this.$message.success('操作成功')
// 参数数量与名称要与存储过程对应
// var Data3 = this.CreateData('11', '工艺管理_生产工艺_查询生产工艺', param1)
// this.ExecDatabase(Data3).then(response => {

View File

@@ -796,6 +796,7 @@ export default {
this.ExecDatabase(Data1).then(response => {
var param3 = []
param3[0] = ['物料编号', this.partNameValue3]
this.$message.success('保存成功')
// 参数数量与名称要与存储过程对应
// var Data3 = this.CreateData('11', '车间生产管理工艺_零件工序_查询工序信息_工艺库', param3)
// this.ExecDatabase(Data3).then(response => {

View File

@@ -148,7 +148,7 @@
</template>
</el-table-column>
<el-table-column align="center" prop="当前序" label="当前序" width="80" />
<el-table-column align="center" label="工艺路线" width="750">
<el-table-column align="center" label="工艺路线" width="550">
<template slot-scope="scope">
<div class="process-route" v-html="formatProcessRoute(scope.row)" />
</template>
@@ -959,4 +959,7 @@ export default {
display: flex;
align-items: center;
}
.el-table tr{
background-color: initial;
}
</style>