From 7af762596716960a21668d6031e45097be4b54f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 10 Jul 2026 13:17:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(wms/aps/requirement):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BA=A7=E9=9C=80=E5=8D=95=E7=8A=B6=E6=80=81=E4=B8=8E=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=8C=89=E9=92=AE=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=B8=8B=E5=8F=91=E8=BF=9B=E5=BA=A6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修正编辑和下发按钮的状态判断逻辑,移除状态3的相关校验 2. 更新产需单状态映射,将原状态2、3替换为已完成、生产中调整为正确的业务状态 3. 优化下发进度展示样式,拆分百分比显示并添加完成状态样式 4. 调整产需转化弹窗的加载逻辑,新增初始化加载状态 5. 简化下发、撤回的确认弹窗文案 --- klp-ui/src/views/wms/post/aps/requirement.vue | 73 ++++++++++++------- 1 file changed, 46 insertions(+), 27 deletions(-) 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 @@
排产明细({{ requirementDetailList.length }} 条,合计 {{ detailTotalWeight }} T) - - 已下发 {{ detailDispatchProgress.issued }} / {{ detailDispatchProgress.total }}({{ detailDispatchProgress.percent }}%) + + 已下发 {{ detailDispatchProgress.issued }} / {{ detailDispatchProgress.total }} + {{ detailDispatchProgress.percent }}% @@ -431,9 +433,9 @@ v-for="rel in bindPreviewExistingRels" :key="rel.scheduleId" size="small" - :type="rel.scheduleStatus === 3 ? 'danger' : 'info'" + :type="rel.scheduleStatus === 2 ? 'success' : 'info'" effect="plain" - :style="rel.scheduleStatus === 2 ? 'color:#555;border-color:#ccc;background:#f5f5f5;' : ''" + :style="rel.scheduleStatus === 0 ? 'color:#555;border-color:#ccc;background:#f5f5f5;' : ''" > {{ rel.scheduleNo }} {{ bindPreviewRelStatusMap[rel.scheduleStatus] || '' }} @@ -486,7 +488,7 @@ 产需单号:{{ convertReqNo }} 共 {{ convertDetailList.length }} 条明细
- @@ -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; }