From d9559ebde1c82c4664a1a0c7817b52f9b4618d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Tue, 30 Sep 2025 11:43:47 +0800 Subject: [PATCH] 1 --- src/api/orderIssure/soIssueNotify.js | 2 + src/assets/scss/aiDesign.scss | 9 + src/assets/scss/index.scss | 2 +- .../orderIssure/searchIssureNotify.vue | 201 +++++++++++++++++- 4 files changed, 210 insertions(+), 4 deletions(-) create mode 100644 src/assets/scss/aiDesign.scss diff --git a/src/api/orderIssure/soIssueNotify.js b/src/api/orderIssure/soIssueNotify.js index 9483c73..7102f5d 100644 --- a/src/api/orderIssure/soIssueNotify.js +++ b/src/api/orderIssure/soIssueNotify.js @@ -64,6 +64,8 @@ export const updateNotifyStatusNew = data => createAPI(`/orderIssure/newIssure/u export const searchNotifyLogNew = data => createAPI(`/orderIssure/newIssure/searchNotifyLogNew`,'post',data) export const searchNotifyLogCloseNew = data => createAPI(`/orderIssure/newIssure/searchNotifyLogCloseNew`,'post',data) export const pushNotifyToWcs = data => createAPI(`/orderIssure/newIssure/pushNotifyToWcs`,'post',data) +export const checkIssueNotifyInventory = data => createAPI(`/orderIssure/newIssure/checkIssueNotifyInventory`,'post',data) +export const pushInventoryToWcs = data => createAPI(`/orderIssure/newIssure/pushInventoryToWcs`,'post',data) diff --git a/src/assets/scss/aiDesign.scss b/src/assets/scss/aiDesign.scss new file mode 100644 index 0000000..bf3617d --- /dev/null +++ b/src/assets/scss/aiDesign.scss @@ -0,0 +1,9 @@ +/** + * AI设计样式文件 - WMS项目AI新增样式 + * 存放AI开发新功能时添加的可复用样式 + * 开发流程:先检查global.scss,没有的话再添加到这里 + * Author: AI Assistant + * Date: 2024-12-19 + */ + +/* AI新增样式将在这里添加 */ diff --git a/src/assets/scss/index.scss b/src/assets/scss/index.scss index 88801a0..0129704 100644 --- a/src/assets/scss/index.scss +++ b/src/assets/scss/index.scss @@ -2,7 +2,7 @@ @import "variables"; // 站点变量 @import "base"; @import "global"; - +@import "aiDesign"; // 确保 Element UI 消息组件显示在所有对话框之上 .el-message { z-index: 3000 !important; diff --git a/src/views/modules/orderIssure/searchIssureNotify.vue b/src/views/modules/orderIssure/searchIssureNotify.vue index 6d09e64..448fd14 100644 --- a/src/views/modules/orderIssure/searchIssureNotify.vue +++ b/src/views/modules/orderIssure/searchIssureNotify.vue @@ -100,11 +100,12 @@ @@ -254,8 +255,84 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + 推送至WCS + 关闭 + + @@ -272,6 +349,8 @@ , searchNotifyLogNew , searchNotifyLogCloseNew , pushNotifyToWcs + , checkIssueNotifyInventory + , pushInventoryToWcs } from "@/api/orderIssure/soIssueNotify.js" @@ -928,6 +1007,11 @@ spec: '', }, choosePartList: [], + // 预览相关数据 + previewDialogVisible: false, + previewLoading: false, + previewData: [], + currentRow: {} // 当前查看的申请单行数据 } }, mounted () { @@ -1098,6 +1182,89 @@ }) }) }, + // 预览库存匹配情况 + previewInventory(row) { + this.currentRow = row // 保存当前行数据 + this.previewDialogVisible = true + this.previewLoading = true + this.previewData = [] + + let inData = { + site: row.site, + notifyNo: row.notifyNo + } + + checkIssueNotifyInventory(inData).then(({data}) => { + this.previewLoading = false + if (data && data.code === 0) { + this.previewData = data.rows || [] + console.log('库存预览数据:', this.previewData) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.previewLoading = false + this.$message.error('获取库存预览失败') + }) + }, + + // 根据订单满足状态设置行样式 + getRowClassName({row}) { + if (row.orderSatisfactionStatus === 1) { + return 'success-row' // 绿色:完全立库满足 + } else if (row.orderSatisfactionStatus === 2) { + return 'warning-row' // 黄色:立库+分切区满足 + } else if (row.orderSatisfactionStatus === 3) { + return 'danger-row' // 红色:存在不满足 + } + return '' + }, + + // 从预览对话框推送至WCS + pushToWCS() { + // 筛选绿色和黄色的数据(orderSatisfactionStatus = 1 或 2) + const validData = this.previewData.filter(item => + item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2 + ) + + if (validData.length === 0) { + this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)') + return + } + + this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const inData = { + site: this.currentRow.site, + notifyNo: this.currentRow.notifyNo, + inventoryList: validData + } + + pushInventoryToWcs(inData).then(({data}) => { + if (data && data.code === 0) { + this.$message({ + message: '推送WCS成功', + type: 'success', + duration: 1500 + }) + this.previewDialogVisible = false + this.searchTable() + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.$message.error('推送WCS失败') + }) + }) + }, + pushToWcs(row){ this.$confirm('确认推送到WCS?', '提示', { confirmButtonText: '确定', @@ -1256,4 +1423,32 @@ flex-shrink: 0; min-width: 30px; } + +/* 库存预览表格行颜色 */ +/deep/ .el-table .success-row { + background: #f0f9ff !important; + border-left: 3px solid #67C23A; +} + +/deep/ .el-table .warning-row { + background: #fdf6ec !important; + border-left: 3px solid #E6A23C; +} + +/deep/ .el-table .danger-row { + background: #fef0f0 !important; + border-left: 3px solid #F56C6C; +} + +/deep/ .el-table .success-row:hover > td { + background-color: #ecf5ff !important; +} + +/deep/ .el-table .warning-row:hover > td { + background-color: #faecd8 !important; +} + +/deep/ .el-table .danger-row:hover > td { + background-color: #fde2e2 !important; +}