feat(aps): 优化排产页面与对比页面的工序类型展示和筛选功能

1. 为待审核、已排产卡片添加自定义加载提示文本
2. 替换工序类型输入框为下拉选择器,使用全局工序枚举数据
3. 为排产表格添加工序类型名称转换显示
4. 重构对比页面的工序筛选逻辑,改为顶部单选按钮组筛选
5. 优化钢卷数据查询逻辑,关联选中的工序类型进行查询
6. 修复编辑和合并表单的字段类型转换问题
This commit is contained in:
2026-06-30 16:43:03 +08:00
parent 524f8f3333
commit f4c870aa23
2 changed files with 119 additions and 56 deletions

View File

@@ -23,14 +23,14 @@
</div>
<!-- 待审核 Tab -->
<div v-show="activeTab === 'pending'" class="detail-card aps-sch-card">
<div v-loading="loading" v-show="activeTab === 'pending'" class="detail-card aps-sch-card">
<div class="detail-card-header">
<span>待审核产需单明细</span>
<span v-if="pendingScheduleList.length > 0" style="font-weight:normal;font-size:12px;opacity:0.8;">
{{ pendingScheduleList.length }} 个产需单
</span>
</div>
<div v-loading="loading" class="detail-card-body" style="padding:0;">
<div element-loading-text="正在加载待审核产需单..." class="detail-card-body" style="padding:0;">
<div v-if="pendingScheduleList.length > 0" class="aps-sch-list">
<div v-for="sch in pendingScheduleList" :key="sch.scheduleId" class="aps-sch-item">
<!-- 产需单头部排产单号 + 状态标签 + 操作 -->
@@ -162,7 +162,7 @@
</div>
<!-- 已排产 Tab -->
<div v-show="activeTab === 'scheduled'" class="detail-card aps-sch-card">
<div v-loading="schLoading" v-show="activeTab === 'scheduled'" class="detail-card aps-sch-card">
<div class="detail-card-header">
<span>已排产明细</span>
<div style="display:flex; align-items:center; gap:8px;">
@@ -191,7 +191,7 @@
</span>
</div>
</div>
<div v-loading="schLoading" class="detail-card-body" style="padding:0;">
<div element-loading-text="正在加载已排产数据..." class="detail-card-body" style="padding:0;">
<el-table
v-if="scheduledItemList.length > 0"
ref="scheduledTable"
@@ -205,7 +205,11 @@
<el-table-column type="selection" width="45" align="center" />
<el-table-column label="排产单号" prop="scheduleNo" min-width="140" show-overflow-tooltip />
<el-table-column label="生产日期" prop="prodDate" width="110" align="center" show-overflow-tooltip />
<el-table-column label="工序类型" prop="actionType" width="100" align="center" show-overflow-tooltip />
<el-table-column label="工序类型" prop="actionType" width="100" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ getActionTypeName(scope.row.actionType) }}
</template>
</el-table-column>
<el-table-column label="排产状态" prop="scheduleStatus" width="90" align="center">
<template slot-scope="scope">
<span class="aps-status-tag" :class="'status-' + (scope.row.scheduleStatus || 1)">{{ statusMap[scope.row.scheduleStatus] || '未知' }}</span>
@@ -303,17 +307,28 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工序类型">
<el-input v-model="editForm.actionType" />
<el-form-item label="排产状态">
<el-select v-model="editForm.scheduleStatus" placeholder="请选择排产状态" style="width:100%">
<el-option v-for="(label, val) in statusMap" :key="val" :label="label" :value="Number(val)" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="工序类型">
<el-select v-model="editForm.actionType" placeholder="请选择工序类型" clearable filterable style="width:100%">
<el-option v-for="p in processOptions" :key="p.actionType" :label="p.name" :value="p.actionType" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订货单位">
<el-input v-model="editForm.customerName" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="规格" prop="spec">
<el-input v-model="editForm.spec" />
@@ -512,7 +527,11 @@
<el-form-item label="排产单号"><el-input v-model="mergeForm.scheduleNo" /></el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工序类型"><el-input v-model="mergeForm.actionType" /></el-form-item>
<el-form-item label="工序类型">
<el-select v-model="mergeForm.actionType" placeholder="请选择工序类型" clearable filterable style="width:100%">
<el-option v-for="p in processOptions" :key="p.actionType" :label="p.name" :value="p.actionType" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
@@ -635,6 +654,7 @@ import {
receiveScheduleItem,
mergeScheduleItem
} from '@/api/aps/schedule'
import { PROCESSES } from '@/utils/meta'
export default {
name: 'ApsSchedule',
@@ -654,6 +674,7 @@ export default {
pendingScheduleList: [],
summaryText: '',
statusMap: { 1: '待审核', 2: '已接收', 3: '已驳回' },
processOptions: PROCESSES,
// 已排产
scheduledItemList: [],
@@ -870,6 +891,14 @@ export default {
handleEditScheduled(row) {
this.editForm = { ...this.getEmptyEditForm(), ...row }
// 确保 actionType 为数字类型以匹配下拉选项
if (this.editForm.actionType != null && typeof this.editForm.actionType !== 'number') {
this.editForm.actionType = Number(this.editForm.actionType)
}
// 确保 scheduleStatus 为数字类型以匹配下拉选项
if (this.editForm.scheduleStatus != null && typeof this.editForm.scheduleStatus !== 'number') {
this.editForm.scheduleStatus = Number(this.editForm.scheduleStatus)
}
this.editDialogTitle = '编辑排产明细'
this.editDialogVisible = true
this.$nextTick(() => {
@@ -948,7 +977,7 @@ export default {
this.mergeForm = {
itemCount: this.mergeSourceRows.length,
scheduleNo: row.scheduleNo || '',
actionType: row.actionType || '',
actionType: row.actionType != null ? Number(row.actionType) : '',
customerName: row.customerName || '',
spec: row.spec || '',
material: row.material || '',
@@ -1004,6 +1033,11 @@ export default {
return total.toFixed(3)
},
getActionTypeName(actionType) {
const p = this.processOptions.find(item => String(item.actionType) === String(actionType))
return p ? p.name : (actionType || '')
},
handleDetailClick(sch, detail) {
// 点击明细行查看来源订单
if (!sch || !sch.orderList || sch.orderList.length === 0) {