diff --git a/src/api/order/poOrder.js b/src/api/order/poOrder.js index 8c1e3c1..010881d 100644 --- a/src/api/order/poOrder.js +++ b/src/api/order/poOrder.js @@ -31,6 +31,9 @@ export const issuePoDetail = (data) => createAPI(`/pODetail/issuePoDetail`, 'pos /** 回滚 PO 订单行(已下达 → 草稿) */ export const rollbackPoDetail = (data) => createAPI(`/pODetail/rollbackPoDetail`, 'post', data) +/** 回滚订单状态(SRM0007):无验货申请明细时回滚为已下达(Confirm)并清空验货过程数量 */ +export const rollbackStatusPoDetail = (data) => createAPI(`/pODetail/rollbackStatusPoDetail`, 'post', data) + /** 发货弹窗预览(返回订单数量、可发货数量、默认本次发货数量) */ export const shipPoDetailPreview = (data) => createAPI(`/pODetail/shipPoDetailPreview`, 'post', data) diff --git a/src/views/modules/inspection/com_inspectionRequestDetail.vue b/src/views/modules/inspection/com_inspectionRequestDetail.vue index 6a1e358..d06ec33 100644 --- a/src/views/modules/inspection/com_inspectionRequestDetail.vue +++ b/src/views/modules/inspection/com_inspectionRequestDetail.vue @@ -206,6 +206,20 @@ + + + + + + + + + + + + + + @@ -282,6 +296,11 @@ export default { detailData: { type: Object, default: () => ({}) + }, + // 是否在查看模式展示 Planner 与备注(默认不展示,保持其他引用页不变) - rqrq + showPlannerRemark: { + type: Boolean, + default: false } }, data() { diff --git a/src/views/modules/inspection/inspectionRequestList.vue b/src/views/modules/inspection/inspectionRequestList.vue index 289cbfd..7a43e64 100644 --- a/src/views/modules/inspection/inspectionRequestList.vue +++ b/src/views/modules/inspection/inspectionRequestList.vue @@ -169,7 +169,7 @@
- +
diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue index fa7ea9b..bbc362d 100644 --- a/src/views/modules/order/poOrder.vue +++ b/src/views/modules/order/poOrder.vue @@ -68,6 +68,10 @@ v-if="canIssuePoOrder(scope.row.status)" type="primary" @click.stop="handleIssuePoOrder(scope.row)">下达 + 回滚状态 {}) }, + // SRM0007 回滚状态按钮显隐:草稿/已下达(Confirm)状态下不显示 - rqrq + canRollbackStatusPoOrder (status) { + return status !== '草稿' && status !== '已下达' + }, + + // 查询 SRM0007 特殊权限:是否允许显示“回滚状态”按钮 - rqrq + checkRollbackStatusPermission () { + const username = this.$store.state.user.name || '' + if (!username) { + this.hasRollbackStatusPermission = false + return + } + getPermissionValue(username, 'SRM0007').then(({ data }) => { + if (data && data.code === 0) { + this.hasRollbackStatusPermission = String(data.value).trim() === 'Y' + } else { + this.hasRollbackStatusPermission = false + } + }).catch(error => { + console.error('查询回滚状态权限失败:', error) + this.hasRollbackStatusPermission = false + }) + }, + + // 回滚状态(SRM0007):无验货申请明细时回滚为 Confirm(已下达)并清空验货过程数量,后端二次校验兑底 - rqrq + handleRollbackStatus (row) { + const params = buildPoDetailActionParams(row, this.$store.state.user.site) + if (!params.id && !(params.orderNo && params.site && params.itemNo != null)) { + this.$message.error('无法识别订单行,请刷新后重试') + return + } + const poLabel = row.poNo ? `PO ${row.poNo}` : '该订单' + const itemLabel = row.itemNo != null ? ` 行 ${row.itemNo}` : '' + this.$confirm(`确定将${poLabel}${itemLabel}回滚为Confirm状态,并清空已申请验货/已验货/验货成功数量?`, '提示', { type: 'warning' }).then(() => { + rollbackStatusPoDetail(params).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('回滚状态成功') + this.getDataList() + } else { + this.$message.error((data && data.msg) || '回滚状态失败') + } + }).catch(err => { + this.$message.error((err && err.message) || '回滚状态失败') + }) + }).catch(() => {}) + }, + /** * 生成发货弹窗默认模型。 * 说明:所有数量字段默认按 0 初始化,避免出现 null 导致的显示/比较异常。