From ac0adfed913be84935204cd3ccebbb664dd35365 Mon Sep 17 00:00:00 2001 From: shenzhouyu Date: Mon, 22 Sep 2025 16:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E9=80=80=E6=96=99=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/production/production-return.js | 4 +- src/router/index.js | 2 +- .../modules/production-issue/directIssue.vue | 41 +++++++++- .../production-return/productionReturnPDA.vue | 37 ++++++++- .../productionReturnPDAIssueList.vue | 81 +++++++++---------- .../productionReturnPicking.vue | 40 +++++---- 6 files changed, 130 insertions(+), 75 deletions(-) diff --git a/src/api/production/production-return.js b/src/api/production/production-return.js index a1ea423..fc4ab04 100644 --- a/src/api/production/production-return.js +++ b/src/api/production/production-return.js @@ -20,4 +20,6 @@ export const printReturnLabel = data => createAPI(`/pda/production/issue/print //申请单退料接口 export const getUnissueNotifyHeaderInfo = data => createAPI(`/pda/production/return/getUnissueNotifyHeaderInfo`,'post',data) export const getUnissueNotifyHeaderOrderMaterialList = data => createAPI(`/pda/production/return/getUnissueNotifyHeaderOrderMaterialList`,'post',data) -export const getUnissueMatericalForShopOrder = data => createAPI(`/pda/production/return/getUnissueMatericalForShopOrder`,'post',data) \ No newline at end of file +export const getUnissueMatericalForShopOrder = data => createAPI(`/pda/production/return/getUnissueMatericalForShopOrder`,'post',data) +export const scanMaterialLabel = data => createAPI(`/pda/production/return/scanMaterialLabel`,'post',data) +export const productionReturnUnissueConfirm = data => createAPI(`/pda/production/return/productionReturnUnissueConfirm`,'post',data) diff --git a/src/router/index.js b/src/router/index.js index 74fad2f..a55197d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -55,7 +55,7 @@ const globalRoutes = [ {path: "/productionReturnPickingDetail/:orderNo/:orderType/:partNo/:transactionId/:quantity/:batchNo", name: "productionReturnPickingDetail", component: resolve => require(["@/views/modules/production-return/productionReturnPickingDetail.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, {path: "/productionReturnPDA", name: "productionReturnPDA", component: resolve => require(["@/views/modules/production-return/productionReturnPDA.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, {path: "/productionReturnPDAList/:workOrderNo/:partNo/:unissureQty", name: "productionReturnPDAList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, - {path: "/productionReturnPDAIssueList/:notifyNo/:itemNo/:workOrderNo", name: "productionReturnPDAIssueList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, + {path: "/productionReturnPDAIssueList/:notifyNo/:itemNo/:workOrderNo/:unissureQty", name: "productionReturnPDAIssueList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, {path: '/production-return/pick/:orderNo', name: 'ProductionIssuePick',component: resolve => require(["@/views/modules/production-return/pick.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}}, diff --git a/src/views/modules/production-issue/directIssue.vue b/src/views/modules/production-issue/directIssue.vue index c50939d..97a8553 100644 --- a/src/views/modules/production-issue/directIssue.vue +++ b/src/views/modules/production-issue/directIssue.vue @@ -24,9 +24,9 @@
@@ -131,8 +131,17 @@ export default { materialList: [], selectedMaterial: null, loading: false, + showOnlySelected: false, }; }, + computed: { + displayWorkOrderList() { + if (this.showOnlySelected && this.selectedWorkOrder) { + return [this.selectedWorkOrder]; + } + return this.workOrderList; + }, + }, methods: { formatDate(date) { return date ? moment(date).format("YYYY-MM-DD") : ""; @@ -164,11 +173,13 @@ export default { this.workOrderList = data.workOrders; this.selectedWorkOrder = null; this.materialList = []; + this.showOnlySelected = false; } else { this.$message.error("未找到该工单信息"); this.workOrderList = []; this.selectedWorkOrder = null; this.materialList = []; + this.showOnlySelected = false; } }) .catch((error) => { @@ -178,9 +189,33 @@ export default { }); }, - // 选择工单 + // 判断是否为同一工单 + isSameWorkOrder(a, b) { + if (!a || !b) return false; + return ( + a.orderNo === b.orderNo && + a.releaseNo === b.releaseNo && + a.sequenceNo === b.sequenceNo + ); + }, + + // 选择工单(支持再次点击切换显示所有) selectWorkOrder(workOrder) { + if ( + this.showOnlySelected && + this.selectedWorkOrder && + this.isSameWorkOrder(this.selectedWorkOrder, workOrder) + ) { + // 再次点击同一条,恢复显示所有主数据 + this.selectedWorkOrder = null; + this.materialList = []; + this.showOnlySelected = false; + return; + } + + // 选择并仅显示当前工单 this.selectedWorkOrder = workOrder; + this.showOnlySelected = true; this.loadMaterialList(); }, diff --git a/src/views/modules/production-return/productionReturnPDA.vue b/src/views/modules/production-return/productionReturnPDA.vue index c762cbb..8d3d4eb 100644 --- a/src/views/modules/production-return/productionReturnPDA.vue +++ b/src/views/modules/production-return/productionReturnPDA.vue @@ -17,8 +17,8 @@
-
+
申请单号:{{ material.notifyNo }}    行号:{{ material.itemNo @@ -135,12 +135,19 @@ export default { selectedRequestMaterial: null, selectedWorkOrder:'', materialList: [], // 新增:材料清单 + showOnlySelected: false, } }, computed: { functionTitle() { return '申请单退料' }, + displayReturnRequestMaterials() { + if (this.showOnlySelected && this.selectedRequestMaterial) { + return [this.selectedRequestMaterial] + } + return this.returnRequestMaterials + } }, methods: { goBack() { @@ -168,6 +175,8 @@ export default { this.loadingText = '加载申请单物料...' this.returnRequestMaterials = [] this.materialList = [] + this.selectedRequestMaterial = null + this.showOnlySelected = false getUnissueNotifyHeaderInfo({ site: this.$store.state.user.site, @@ -189,10 +198,32 @@ export default { }) }, + isSameRequestMaterial(a, b) { + if (!a || !b) return false + return ( + a.notifyNo === b.notifyNo && + a.itemNo === b.itemNo && + a.soorderNo === b.soorderNo + ) + }, selectRequestMaterial(material) { + if ( + this.showOnlySelected && + this.selectedRequestMaterial && + this.isSameRequestMaterial(this.selectedRequestMaterial, material) + ) { + // 再次点击同一条,恢复显示所有主数据 + this.selectedRequestMaterial = null + this.selectedWorkOrder = '' + this.materialList = [] + this.showOnlySelected = false + return + } + + // 选择并仅显示当前申请单物料 this.selectedRequestMaterial = material this.selectedWorkOrder = material.notifyNo - // 直接跳转到材料列表页面 + this.showOnlySelected = true this.getUnissueNotifyHeaderOrderMaterialList(material) }, getUnissueNotifyHeaderOrderMaterialList(material){ diff --git a/src/views/modules/production-return/productionReturnPDAIssueList.vue b/src/views/modules/production-return/productionReturnPDAIssueList.vue index 4ffe24f..f875c26 100644 --- a/src/views/modules/production-return/productionReturnPDAIssueList.vue +++ b/src/views/modules/production-return/productionReturnPDAIssueList.vue @@ -15,7 +15,7 @@ clearable class="compact-input" v-model="scanCode" - placeholder="请扫描物料标签或批次号" + placeholder="请扫描物料标签" prefix-icon="el-icon-search" @keyup.enter.native="handleScan" ref="scanInput" @@ -40,8 +40,7 @@ {{ orderInfo.type === "workOrder" ? "工单号" : "退料申请单号" - }}:{{ orderInfo.orderNo }} + }}:{{ orderInfo.orderNo }}     批次号:{{ batchNo }}
@@ -61,8 +60,8 @@
-
退料物料
-
{{ orderInfo.qtyToUnissue }}
+
所需退量
+
{{ unissureQty }}
领料数量
@@ -94,7 +93,7 @@
NO.
物料标签
-
批次号
+
库位
退料数量
@@ -104,9 +103,9 @@ :key="label.id" class="list-item" > -
{{ labelList.length - index }}
+
{{ index+1 }}
{{ label.labelCode }}
-
{{ label.batchNo }}
+
{{ label.locationId }}
{{ label.quantity }} @@ -121,7 +120,7 @@
-
+
@@ -365,7 +364,9 @@ import { // getWorkOrderMaterials, // parseMaterialLabel, // directReturn, - getInventoryPart + getInventoryPart, + scanMaterialLabel, + productionReturnUnissueConfirm, } from "@/api/production/production-return"; import moment from "moment"; @@ -398,6 +399,7 @@ export default { quantity: 0 }, editIndex: -1, // 当前编辑的标签索引 + unissureQty:0, // 需求数量 }; }, computed: { @@ -429,16 +431,15 @@ export default { // 验证标签并添加到列表(保留生产退仓功能) validateAndAddLabel(labelCode) { const params = { - labelCode: labelCode, + scannedLabel: labelCode, orderNo: this.orderNo, orderType: this.orderType, site: this.$store.state.user.site, }; // 模拟生产退料标签验证 - this.simulateReturnLabelScan(params) - .then((result) => { - if (result.success) { + scanMaterialLabel(params).then(({data}) => { + if (data.code === 0 && data) { // 检查是否已经扫描过 const exists = this.labelList.find( (item) => item.labelCode === labelCode @@ -452,10 +453,10 @@ export default { this.labelList.push({ id: Date.now(), labelCode: labelCode, - partNo: result.data.partNo, - quantity: result.data.quantity, - batchNo: result.data.batchNo, - returnReason: result.data.returnReason, + partNo: data.labelInfo.partNo, + quantity: data.labelInfo.quantity, + batchNo: data.labelInfo.batchNo, + returnReason: data.labelInfo.returnReason, }); this.$message.success("操作成功"); @@ -561,10 +562,9 @@ export default { } const returnParams = { - site: this.orderInfo.site, + site: this.$store.state.user.site, orderNo: this.orderNo, orderType: this.orderType, - returnReason: this.returnReason, labels: this.labelList.map((label) => ({ labelCode: label.labelCode, quantity: label.quantity, @@ -574,32 +574,18 @@ export default { }; // 模拟生产退料确认API - this.simulateReturnConfirm(returnParams) - .then((result) => { - if (result.success) { + productionReturnUnissueConfirm(returnParams).then(({data}) => { + if (data.code === 0 && data) { this.$message.success("生产退料成功"); this.$router.back(); } else { - this.$message.error(result.message || "操作失败"); + this.$message.error(data.message || "操作失败"); } - }) - .catch(() => { + }).catch(() => { this.$message.error("操作失败"); }); }, - // 模拟生产退料确认API - simulateReturnConfirm() { - return new Promise((resolve) => { - setTimeout(() => { - resolve({ - success: true, - message: "生产退料成功", - }); - }, 1000); - }); - }, - // 打印标签 printLabels() { @@ -812,6 +798,7 @@ export default { this.transactionId = this.$route.params.transactionId this.quantity = this.$route.params.quantity this.batchNo = this.$route.params.batchNo + this.unissureQty = this.$route.params.unissureQty console.log("订单号:", this.orderNo, "订单类型:", this.orderType,"物料编码:",this.partNo); if (!this.orderNo) { @@ -1046,7 +1033,7 @@ export default { justify-content: space-between; padding: 6px 8px; background: white; - margin: 0 16px; + margin: 0 10px; margin-top: 4px; border-radius: 8px 8px 0 0; border-bottom: 2px solid #17b3a3; @@ -1056,7 +1043,7 @@ export default { /* 工单列表容器背景与间距 */ .work-order-list { overflow-y: auto; - padding: 12px 16px; + padding: 10px 10px; } /* 工单卡片具有白色背景、圆角、阴影与边框一致性 */ @@ -1064,7 +1051,7 @@ export default { background: white; border-radius: 8px; margin-bottom: 12px; - padding: 16px; + padding: 10px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); transition: all 0.2s ease; border: 2px solid transparent; @@ -1130,9 +1117,11 @@ export default { /* 标签列表 */ .label-list { background: white; - margin: 0 16px 12px; + margin: 0 10px 12px; border-radius: 0 0 8px 8px; overflow: hidden; + max-height: 300px; + overflow-y: auto; } .list-header { @@ -1143,6 +1132,9 @@ export default { font-size: 12px; color: #666; font-weight: 500; + position: sticky; + top: 0; + z-index: 1; } .list-item { @@ -1163,7 +1155,7 @@ export default { } .col-label { - flex: 2; + flex: 4; text-align: center; } @@ -1242,7 +1234,6 @@ export default { padding: 16px; gap: 20px; background: white; - margin-top: auto; } .action-btn { diff --git a/src/views/modules/production-return/productionReturnPicking.vue b/src/views/modules/production-return/productionReturnPicking.vue index c3f1a8e..dd30e9c 100644 --- a/src/views/modules/production-return/productionReturnPicking.vue +++ b/src/views/modules/production-return/productionReturnPicking.vue @@ -6,7 +6,9 @@ 生产退仓
-
首页
+
+ 首页 +
@@ -31,6 +33,7 @@ >
工单号:{{ workOrder.orderNo }} +
{{ workOrder.partNo }} @@ -117,12 +120,9 @@