diff --git a/klp-ui/src/views/wms/post/aps/requirement.vue b/klp-ui/src/views/wms/post/aps/requirement.vue
index 1117d6325..cdfafaf9d 100644
--- a/klp-ui/src/views/wms/post/aps/requirement.vue
+++ b/klp-ui/src/views/wms/post/aps/requirement.vue
@@ -74,11 +74,11 @@
产需单信息
-
+ @click="handleDispatch">下发
@@ -205,8 +205,10 @@
- convertSelection = val">
@@ -580,8 +582,8 @@ export default {
pageNum: 1,
pageSize: 10
},
- statusMap: { 0: '草稿', 1: '待审核', 2: '已下达', 3: '已退回' },
- statusBadgeMap: { 0: 'gray', 1: 'blue', 2: 'green', 3: 'red' },
+ statusMap: { 0: '草稿', 1: '生产中', 2: '已完成' },
+ statusBadgeMap: { 0: 'gray', 1: 'blue', 2: 'green' },
// 绑定订单
bindDialogVisible: false,
@@ -598,7 +600,7 @@ export default {
// 当前预览订单已绑定的产需单列表
bindPreviewExistingRels: [],
// 产需单状态映射(用于展示绑定状态)
- bindPreviewRelStatusMap: { 0: '草稿', 1: '待审核', 2: '已下达', 3: '已退回' },
+ bindPreviewRelStatusMap: { 0: '草稿', 1: '生产中', 2: '已完成' },
// 排产明细
detailLoading: false,
@@ -622,6 +624,7 @@ export default {
convertReqNo: '',
convertProgress: 0,
convertProgressShow: false,
+ convertInitLoading: false,
convertSelection: [],
processList: [],
@@ -639,7 +642,7 @@ export default {
},
computed: {
canEdit() {
- return this.currentReq && (this.currentReq.scheduleStatus === 0 || this.currentReq.scheduleStatus === 3)
+ return this.currentReq && this.currentReq.scheduleStatus === 0
},
detailTotalWeight() {
return this.requirementDetailList.reduce((sum, item) => {
@@ -1062,7 +1065,7 @@ export default {
// ====== 下发 ======
handleDispatch() {
- this.$confirm('确认下发该产需单吗?下发后将进入审核流程。', '提示', {
+ this.$confirm('确认下发该产需单吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -1081,7 +1084,7 @@ export default {
},
handleRecall() {
- this.$confirm('确认撤回该产需单吗?撤回后将恢复为草稿状态。', '提示', {
+ this.$confirm('确认撤回该产需单吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -1101,22 +1104,24 @@ export default {
// ====== 产需转化 ======
openConvertDialogForReq(item) {
- // 确保加载了该产需单的详情
+ // 先打开弹窗并显示 loading
this.convertReqNo = item.scheduleNo || ''
this.convertProgressShow = false
this.convertProgress = 0
+ this.convertDetailList = []
+ this.convertDialogVisible = true
+ this.convertInitLoading = true
+
const loadDetail = item.scheduleId === (this.currentReq && this.currentReq.scheduleId)
? Promise.resolve(this.currentReq)
: getRequirement(item.scheduleId)
- // 同时加载工序列表和明细
Promise.all([
loadDetail,
listProcess({ pageNum: 1, pageSize: 1000 })
]).then(([res, processRes]) => {
const data = res.data || res
const detailList = (data.detailList || []).map(d => ({ ...d }))
- // 构建工序查找表
const processRows = processRes.rows || []
const processMap = new Map()
processRows.forEach(p => {
@@ -1129,7 +1134,6 @@ export default {
.map(s => s.stepName).join(' → ')
: ''
}))
- // 为已有 processId 的明细填充 _stepNames,默认 scheduleDate 为今天
const today = this.getTodayStr()
detailList.forEach(d => {
if (!d.scheduleDate) {
@@ -1140,10 +1144,10 @@ export default {
}
})
this.convertDetailList = detailList
- this.convertDialogVisible = true
}).catch(() => {
this.convertDetailList = []
- this.convertDialogVisible = true
+ }).finally(() => {
+ this.convertInitLoading = false
})
},
@@ -1706,11 +1710,6 @@ export default {
background: #f6ffed;
color: #52c41a;
}
-
- &.status-3 {
- background: $aps-red-1;
- color: $aps-red-2;
- }
}
.aps-table {
@@ -1818,7 +1817,27 @@ export default {
padding: 16px 20px 0 20px;
}
-.history-item:hover {
- background: #fdecea;
+.dispatch-progress {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 2px 10px;
+ border-radius: 12px;
+ font-size: 12px;
+ font-weight: 600;
+ background: #e6f7ff;
+ color: #1890ff;
+ border: 1px solid #91d5ff;
+}
+
+.dispatch-progress--done {
+ background: #f6ffed;
+ color: #52c41a;
+ border-color: #b7eb8f;
+}
+
+.dispatch-progress-pct {
+ font-size: 14px;
+ font-weight: 700;
}