From d14c0a07a214a7cd8b0ce416a335367e3c29e7ec 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: Fri, 14 Nov 2025 23:48:42 +0800 Subject: [PATCH] 1 --- .../noOrderIssue/noOrderNotification.vue | 333 ++++++++++++------ 1 file changed, 216 insertions(+), 117 deletions(-) diff --git a/src/views/modules/noOrderIssue/noOrderNotification.vue b/src/views/modules/noOrderIssue/noOrderNotification.vue index 115a850..f9e37ec 100644 --- a/src/views/modules/noOrderIssue/noOrderNotification.vue +++ b/src/views/modules/noOrderIssue/noOrderNotification.vue @@ -55,6 +55,8 @@ + + 推送WCS @@ -160,6 +162,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + {{ previewLoading ? '推送中...' : '推送至WCS' }} + + 关闭 + + +
@@ -458,7 +550,7 @@ 添加 - + @@ -561,40 +653,6 @@ - - -
- - - - - - - - - - - - -
- -
-
@@ -608,14 +666,17 @@ import { saveNoOrderMaterialDetail, getNoOrderMaterialList } from '@/api/orderIssure/noOrderIssueNotify.js' +// rqrq - 导入推送WCS相关API(使用领料申请的通用API) +import { + checkIssueNotifyInventory, + pushInventoryToWcs +} from '@/api/orderIssure/soIssueNotify.js' import { getSiteAndBuByUserName, createNotify, closeInboundNotification, checkUserHasUnissueShipment, cancelIssueShipment, - checkShipmentInventory, - pushShipmentInventoryToWcs, deleteNotifyUnissue, } from '@/api/shipment/shipmentIssue.js' import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -870,6 +931,26 @@ export default { fixed: '', columnWidth: 100, }, + + // rqrq - 添加推送WCS字段 + { + userId: this.$store.state.user.name, + functionId: 610, + serialNumber: '610Table1PushWcsFlag', + tableId: '610Table1', + tableName: '收货入库任务表', + columnProp: 'pushWcsFlag', + headerAlign: 'center', + align: 'center', + columnLabel: '推送WCS', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100, + }, /* { userId: this.$store.state.user.name, functionId: 610, @@ -1375,12 +1456,11 @@ export default { // 申请明细弹框相关 isMaterialDetailModal: false, // 标识是否从申请明细弹框打开选择物料弹框 clickrow: {}, - // rqrq - 库存预览相关变量 + // rqrq - 推送WCS预览相关数据 previewDialogVisible: false, previewLoading: false, - pushLoading: false, previewData: [], - currentNotifyRow: null, + currentNotifyRow: null, // 当前要推送WCS的通知单行数据 - rqrq } }, @@ -2275,7 +2355,7 @@ export default { const selectedPartNos = this.selectedMaterialList.map( (item) => item.partNo || item.componentPartNo ) - + // 如果是从申请明细弹框打开的,还需要过滤掉sobomList中已存在的物料 if (this.isMaterialDetailModal && this.sobomList && this.sobomList.length > 0) { const sobomPartNos = this.sobomList.map( @@ -2398,7 +2478,7 @@ export default { // 确认选择物料 confirmSelectMaterial() { if (this.isMaterialDetailModal) { - + // 从申请明细弹框打开的情况,将右侧"已有物料"列表的完整数据更新到sobomList const selectedItems = JSON.parse(JSON.stringify(this.selectedMaterialList)) // 将选中的物料转换为sobomList需要的格式 @@ -2417,7 +2497,7 @@ export default { }) // 将右侧"已有物料"列表的完整数据替换sobomList(包括原有和新增的) this.sobomList = selectedItems - + this.isMaterialDetailModal = false } @@ -2568,107 +2648,99 @@ export default { }, /** - * @Description 预览库存(发货通知单,只考虑立库) - rqrq + * @Description 预览库存匹配情况 - rqrq * @param row 当前申请单行数据 */ previewInventory(row) { - this.currentNotifyRow = row + this.currentNotifyRow = row // 保存当前通知单行数据 - rqrq this.previewDialogVisible = true this.previewLoading = true this.previewData = [] let inData = { site: row.site, - notifyNo: row.notifyNo, + notifyNo: row.notifyNo } - checkShipmentInventory(inData) - .then(({ data }) => { - this.previewLoading = false - if (data && data.code === 0) { - this.previewData = data.rows || [] - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定', - }) - } - }) - .catch(() => { - this.previewLoading = false - this.$message.error('获取库存预览失败') - }) + 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('获取库存预览失败') + }) }, /** - * @Description 推送至WCS(发货通知单) - rqrq + * @Description 根据订单满足状态设置行样式 - rqrq */ - pushToWcs() { - if (!this.previewData || this.previewData.length === 0) { - this.$message.warning('没有可推送的数据') - return + 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 '' + }, + + /** + * @Description 从预览对话框推送至WCS - rqrq + */ + pushToWCS() { + // 全部推送 后端判断 - rqrq + const validData = this.previewData - // 检查是否有满足条件的数据(orderSatisfactionStatus === 1,绿色) - rqrq - const validData = this.previewData.filter( - (item) => item.orderSatisfactionStatus === 1 - ) if (validData.length === 0) { - this.$message.warning('没有满足库存要求的订单,无法推送') + this.$message.warning('没有可推送的数据') return } - this.$confirm('确认推送至WCS?', '提示', { + this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', - type: 'warning', - }) - .then(() => { - this.pushLoading = true + type: 'warning' + }).then(() => { + // 显示加载状态 - rqrq + this.previewLoading = true - let pushData = { - site: this.currentNotifyRow.site, - notifyNo: this.currentNotifyRow.notifyNo, - shipmentInventoryList: this.previewData, - } + const inData = { + site: this.currentNotifyRow.site, + notifyNo: this.currentNotifyRow.notifyNo, + inventoryList: validData + } - pushShipmentInventoryToWcs(pushData) - .then(({ data }) => { - if (data && data.code === 0) { - this.$message({ - message: '推送WCS成功', - type: 'success', - duration: 1500, - }) - this.previewDialogVisible = false - this.getDataList() // 刷新列表 - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定', - }) - } - }) - .catch(() => { - this.$message.error('推送WCS失败') + pushInventoryToWcs(inData).then(({data}) => { + this.previewLoading = false + if (data && data.code === 0) { + this.$message({ + message: '推送WCS成功', + type: 'success', + duration: 1500 }) - .finally(() => { - this.pushLoading = false + this.previewDialogVisible = false + this.getDataList() // 刷新列表 + } else { + this.$alert(data.msg || '推送失败', '错误', { + confirmButtonText: '确定' }) + } + }).catch((error) => { + this.previewLoading = false + this.$message.error(error.message || '推送WCS失败,请重试') }) - .catch(() => { - // 用户取消 - rqrq - }) - }, - - /** - * @Description 表格行样式(发货通知单:绿色=满足,红色=不满足) - rqrq - */ - getRowStyle({ row }) { - if (row.orderSatisfactionStatus === 1) { - return { backgroundColor: '#67C23A20' } // 绿色背景 - } else if (row.orderSatisfactionStatus === 3) { - return { backgroundColor: '#F56C6C20' } // 红色背景 - } - return {} + }).catch(() => { + // 用户取消操作 - rqrq + console.log('用户取消推送') + }) }, }, } @@ -2683,10 +2755,37 @@ export default { line-height: 1.5; } -/* rqrq - 匹配条码列自动换行显示 */ /deep/ .wrap-text-column .cell { white-space: normal !important; word-break: break-all !important; line-height: 1.5 !important; } + +/* rqrq - 表格行样式:根据满足状态显示不同背景色 */ +/deep/ .el-table .success-row { + background-color: #f0f9ff !important; + border-left: 3px solid #67C23A; +} + +/deep/ .el-table .warning-row { + background-color: #fdf6ec !important; + border-left: 3px solid #E6A23C; +} + +/deep/ .el-table .danger-row { + background-color: #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; +}