diff --git a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue index 35472dc..0acbe31 100644 --- a/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue +++ b/src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue @@ -97,7 +97,7 @@ - + 分切订单 @@ -106,30 +106,12 @@ - - - - - - - - - - - - - - - - - - - - 订单添加 + + + 从订单添加 - + @@ -178,6 +160,57 @@ 关闭 + + + + + + + + + + + + + + + + + + + + + + + 添加 + + + + + + + + + + + + + + + + + + + + + + 汇总到主列表 + 关闭 + + + @@ -1119,9 +1152,21 @@ export default { clickrow:{}, partNo:'', addLineLoading:false, - addOrderLoading:false, // 订单添加按钮loading状态 - rqrq + addOrderLoading:false, // 订单添加按钮loading状态 - rqrq(已废弃) remark:'', // 已添加订单号列表(分号分隔) - rqrq addedOrderNoList: [], // 已添加订单号数组 - rqrq + + // ==================== 订单管理弹窗相关 - rqrq ==================== + orderManageDialogVisible: false, // 订单管理弹窗显示状态 - rqrq + orderManageData: { // 订单管理输入数据 - rqrq + orderNo: '', + releaseNo: '*', + sequenceNo: '*' + }, + tempOrderList: [], // 临时订单明细列表(不汇总) - rqrq + tempOrderListLoading: false, // 临时订单列表加载状态 - rqrq + addOrderTempLoading: false, // 添加订单到临时列表按钮loading - rqrq + summaryLoading: false, // 汇总按钮loading状态 - rqrq } }, @@ -1138,6 +1183,18 @@ export default { this.getUserNotifyNo() }, + computed: { + // 获取订单类型的中文名称 - rqrq + orderTypeText() { + const typeMap = { + 'slittingorder': '分切订单', + 'shipment': '销售发货', + 'shoporder': '成品订单' + } + return typeMap[this.orderType] || '未知类型' + } + }, + methods: { tabClick(tab, event) { // 刷新当前标签页的表格数据 @@ -1586,6 +1643,8 @@ export default { // 清空已添加订单记录 - rqrq this.addedOrderNoList = [] this.remark = '' + // 清空临时订单列表 - rqrq + this.tempOrderList = [] this.seqNoModalFlag = true }, searchSOSRouting() { @@ -1644,7 +1703,216 @@ export default { this.seqNoData.releaseNo = '' this.seqNoData.sequenceNo = '' }, - // 根据订单号添加物料到列表 - rqrq + + // ==================== 订单管理弹窗相关方法 - rqrq ==================== + + // 打开订单管理弹窗 - rqrq + openOrderManageDialog() { + this.orderManageDialogVisible = true + // 不清空临时列表,保留上次输入的数据 - rqrq + // this.tempOrderList = [] + }, + + // 关闭订单管理弹窗 - rqrq + closeOrderManageDialog() { + this.orderManageDialogVisible = false + // 清空输入框 - rqrq + this.orderManageData = { + orderNo: '', + releaseNo: '*', + sequenceNo: '*' + } + }, + + // 添加订单到临时列表(不汇总) - rqrq + addOrderToTempList() { + // 1. 参数校验 - rqrq + if (!this.orderManageData.orderNo || this.orderManageData.orderNo.trim() === '') { + this.$message.warning('请输入Order No!') + return + } + + // 2. 根据订单类型选择API - rqrq + let apiMethod = null + if (this.orderType === 'shipment') { + apiMethod = getShipmentAndLineForIssure + } else { + apiMethod = getShopOrderAndMaterialByShoporder + } + + // 3. 准备请求参数 - rqrq + const requestParams = { + site: this.$store.state.user.site, + orderNo: this.orderManageData.orderNo.trim(), + releaseNo: this.orderManageData.releaseNo || '*', + sequenceNo: this.orderManageData.sequenceNo || '*', + } + + // 4. 调用API获取订单物料 - rqrq + this.addOrderTempLoading = true + apiMethod(requestParams) + .then(({ data }) => { + if (data && data.code === 0) { + let materialList = data.rows || [] + + if (!materialList || materialList.length === 0) { + this.$message.warning('该订单没有物料明细!') + return + } + + // 5. 字段映射处理 - rqrq + materialList.forEach(item => { + if (this.orderType === 'shipment') { + if (item.inventoryPartNo) { + item.componentPartNo = item.inventoryPartNo + } + if (item.shipmentId) { + item.orderNo = item.shipmentId + } + if (item.inventoryQty !== undefined && !item.applyQty) { + item.applyQty = item.inventoryQty + } + if (item.inventoryUom && !item.uom) { + item.uom = item.inventoryUom + } + } else { + if (item.qtyRequired !== undefined && !item.applyQty) { + item.applyQty = item.qtyRequired + } + } + + // 6. 添加订单信息到每一行 - rqrq + item.orderNo = this.orderManageData.orderNo + item.releaseNo = this.orderManageData.releaseNo || '' + item.sequenceNo = this.orderManageData.sequenceNo || '' + item.partNo = item.componentPartNo + item.lineItemNo = '' + item.materialLineStatus = '' + item.startDate = '' + item.finishDate = '' + item.needDate = '' + }) + + // 7. 直接追加到临时列表(不汇总) - rqrq + this.tempOrderList.push(...materialList) + + // 8. 更新已添加订单号 - rqrq + if (!this.addedOrderNoList.includes(this.orderManageData.orderNo)) { + this.addedOrderNoList.push(this.orderManageData.orderNo) + this.remark = this.addedOrderNoList.join(';') + } + + this.$message.success(`订单 ${this.orderManageData.orderNo} 添加成功,共 ${materialList.length} 条物料!`) + + // 9. 清空输入框 - rqrq + this.orderManageData.orderNo = '' + + + } else { + this.$message.error(data.msg || '获取订单物料失败!') + } + }) + .catch((error) => { + this.$message.error(error.msg || '获取订单物料失败,请稍后重试') + }) + .finally(() => { + this.addOrderTempLoading = false + }) + }, + + // 删除临时订单列表中的某一行 - rqrq + deleteTempOrderRow(index) { + this.tempOrderList.splice(index, 1) + this.$message.success('删除成功!') + }, + + // 汇总到主列表 - rqrq + summaryOrderToMainList() { + if (!this.tempOrderList || this.tempOrderList.length === 0) { + this.$message.warning('临时列表为空,无法汇总!') + return + } + + this.summaryLoading = true + + try { + // 1. 创建物料映射表,用于汇总 - rqrq + const materialMap = new Map() + + // 2. 先将临时列表的数据按物料号汇总 - rqrq + this.tempOrderList.forEach(item => { + const partNo = item.componentPartNo + if (!partNo) return + + if (materialMap.has(partNo)) { + // 已存在,累加数量 - rqrq + const existing = materialMap.get(partNo) + existing.applyQty = (parseFloat(existing.applyQty) || 0) + (parseFloat(item.applyQty) || 0) + // 合并订单号到remark - rqrq + if (item.orderNo && !existing.remark.includes(item.orderNo)) { + existing.remark = existing.remark ? existing.remark + ';' + item.orderNo : item.orderNo + } + } else { + // 新增 - rqrq + materialMap.set(partNo, { + partNo: partNo, + componentPartNo: partNo, + height: item.height || '', + isInWh: item.isInWh || '', + applyQty: parseFloat(item.applyQty) || 0, + componentPartDesc: item.componentPartDesc || item.partDesc || '', + uom: item.uom || '', + orderNo: item.orderNo || '', + releaseNo: item.releaseNo || '', + sequenceNo: item.sequenceNo || '', + lineItemNo: '', + materialLineStatus: '', + startDate: '', + finishDate: '', + needDate: '', + remark: item.orderNo || '', // 初始remark为订单号 - rqrq + }) + } + }) + + // 3. 与主列表seqNoList中现有物料汇总 - rqrq + this.seqNoList.forEach(existingItem => { + const partNo = existingItem.componentPartNo + if (!partNo) return + + if (materialMap.has(partNo)) { + // 累加数量 - rqrq + const mapItem = materialMap.get(partNo) + mapItem.applyQty = (parseFloat(mapItem.applyQty) || 0) + (parseFloat(existingItem.applyQty) || 0) + // 合并remark - rqrq + if (existingItem.remark) { + mapItem.remark = existingItem.remark + ';' + mapItem.remark + } + } else { + // 主列表中的物料在临时列表没有,直接保留 - rqrq + materialMap.set(partNo, existingItem) + } + }) + + // 4. 更新主列表seqNoList为汇总后的结果 - rqrq + this.seqNoList = Array.from(materialMap.values()) + + this.$message.success(`汇总成功!共 ${this.seqNoList.length} 行物料!`) + + // 5. 清空临时列表 - rqrq + this.tempOrderList = [] + + // 6. 关闭弹窗 - rqrq + this.orderManageDialogVisible = false + + } catch (error) { + this.$message.error('汇总失败:' + error.message) + } finally { + this.summaryLoading = false + } + }, + + // 根据订单号添加物料到列表 - rqrq(已废弃,保留用于兼容) addOrderToList() { // 1. 参数校验 - rqrq if (!this.seqNoData.orderNo || this.seqNoData.orderNo.trim() === '') { @@ -1695,8 +1963,11 @@ export default { if (this.orderType === 'shipment') { // 销售发货API字段映射 - rqrq // inventoryPartNo -> partNo - rqrq - if (item.inventoryPartNo && !item.partNo) { - item.partNo = item.inventoryPartNo + if (item.inventoryPartNo ) { + item.componentPartNo = item.inventoryPartNo + } + if(item.shipmentId){ + item.orderNo = item.shipmentId } // inventoryQty -> applyQty - rqrq if (item.inventoryQty !== undefined && !item.applyQty) { @@ -1720,7 +1991,7 @@ export default { // 6. 按物料号汇总后端返回的物料 - rqrq const backendMaterialMap = new Map() materialList.forEach(item => { - const partNo = item.partNo || item.componentPartNo + const partNo = item.componentPartNo if (!partNo) return if (backendMaterialMap.has(partNo)) { @@ -1752,7 +2023,7 @@ export default { // 7. 与seqNoList中现有物料汇总 - rqrq this.seqNoList.forEach(existingItem => { - const partNo = existingItem.partNo || existingItem.componentPartNo + const partNo = existingItem.componentPartNo if (!partNo) return if (backendMaterialMap.has(partNo)) { diff --git a/src/views/modules/noOrderIssue/newNoOrderIssueNotify_old.vue b/src/views/modules/noOrderIssue/newNoOrderIssueNotify_old.vue new file mode 100644 index 0000000..cdf52da --- /dev/null +++ b/src/views/modules/noOrderIssue/newNoOrderIssueNotify_old.vue @@ -0,0 +1,2540 @@ + + + + + diff --git a/src/views/modules/warehouse/changeHUSpecialItem.vue b/src/views/modules/warehouse/changeHUSpecialItem.vue index 6c5de0c..30d827e 100644 --- a/src/views/modules/warehouse/changeHUSpecialItem.vue +++ b/src/views/modules/warehouse/changeHUSpecialItem.vue @@ -2,8 +2,8 @@
- - + + @@ -28,10 +28,16 @@ 查询 重置 - 批量修改 + + + Change W/D/R + Change Expiration Date + Change Availability Control ID + + - + style="width: 100%; margin-bottom: 15px;margin-top:3px"> + + width="50" + :selectable="checkSelectable"> @@ -86,7 +93,7 @@ @@ -96,25 +103,25 @@ @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" - :page-sizes="[20, 50, 100]" + :page-sizes="[30, 100, 500]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> - + - + - + @@ -139,17 +146,17 @@ - + - + - + @@ -158,12 +165,12 @@ - + - + @@ -172,28 +179,12 @@ - - + - - + @@ -202,12 +193,12 @@ - + - + @@ -216,22 +207,22 @@ - + - + - + - - + + @@ -239,12 +230,12 @@ - + - + @@ -253,17 +244,17 @@ - + - + - + @@ -272,17 +263,103 @@ - + + + + + + +
+ 界面2:点击Change W/D/R,弹出如下对话框 +
+ + + + + + + + +
+ + + + +
+ 界面3:点击Change Expiration Date,弹出如下对话框 +
+ + + + + + + + + +
+ + + + +
+ 界面4:点击Change Availability Control ID,弹出如下对话框 +
+ + + + + List + + + + + + + +
@@ -290,7 +367,7 @@