diff --git a/src/api/production/production-return.js b/src/api/production/production-return.js index c814c8d..5d9fcba 100644 --- a/src/api/production/production-return.js +++ b/src/api/production/production-return.js @@ -1,6 +1,7 @@ import { createAPI } from "@/utils/httpRequest.js"; //直接退料接口 +export const productionReturnConfirm = data => createAPI(`/pda/production/return/productionReturnConfirm`,'post',data) // 获取工单信息 export const getReturnWorkOrderInfo = data => createAPI(`/pda/production/return/getReturnWorkOrderInfo`,'post',data) @@ -24,4 +25,7 @@ export const getUnissueMatericalForShopOrder = data => createAPI(`/pda/productio export const scanMaterialLabel = data => createAPI(`/pda/production/return/scanMaterialLabel`,'post',data) export const productionReturnUnissueConfirm = data => createAPI(`/pda/production/return/productionReturnUnissueConfirm`,'post',data) -export const printLabelInfo = data => createAPI('/label/setting/printLabel','post',data) \ No newline at end of file +export const printLabelInfo = data => createAPI('/label/setting/printLabel','post',data) + +// 打印标签 +export const printLabelCommon = data => createAPI('/label/setting/printLabelCommon','post',data) \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 98b8cbb..d1fc84d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -56,7 +56,7 @@ const globalRoutes = [ {path: "/productionreturn",name: "productionreturn", component: resolve => require(["@/views/modules/production-return/production.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}}, {path: "/productionReturnPicking", name: "productionReturnPicking", component: resolve => require(["@/views/modules/production-return/productionReturnPicking.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, {path: "/productionReturnIssueList", name: "productionReturnIssueList", component: resolve => require(["@/views/modules/production-return/productionReturnIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, - {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: "/productionReturnPickingDetail", 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: false } }, {path: "/productionReturnPDAList", name: "productionReturnPDAList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, {path: "/productionReturnPDAIssueList", name: "productionReturnPDAIssueList", component: resolve => require(["@/views/modules/production-return/productionReturnPDAIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, diff --git a/src/views/modules/production-return/production.vue b/src/views/modules/production-return/production.vue index 735a891..2345e31 100644 --- a/src/views/modules/production-return/production.vue +++ b/src/views/modules/production-return/production.vue @@ -31,7 +31,7 @@ export default { data() { return { buttons: [ - { icon: 'scan', label: '直接退料', iconClass: 'direct', to: 'productionReturnPicking', disabled: true }, + { icon: 'scan', label: '直接退料', iconClass: 'direct', to: 'productionReturnPicking', disabled: false }, { icon: 'records', label: '申请单退料', iconClass: 'request', to: 'productionReturnPDA', disabled: false }, { icon: 'logistics', label: '移库退料', iconClass: 'move', to: 'productionReturnPicking', disabled: true }, { icon: 'revoke', label: '退料撤销', iconClass: 'cancel', to: 'productionReturnPicking', disabled: true }, diff --git a/src/views/modules/production-return/productionReturnIssueList.vue b/src/views/modules/production-return/productionReturnIssueList.vue index 8d429da..dcb2866 100644 --- a/src/views/modules/production-return/productionReturnIssueList.vue +++ b/src/views/modules/production-return/productionReturnIssueList.vue @@ -2,12 +2,26 @@
-
+
- 退仓 - 领料记录 + 退料 - 领料记录
首页
+
+
+ +
+
+ +
+
+ +
+ +
@@ -19,7 +33,7 @@ >
- 物料编码:{{ partNo }}    领料号:{{ item.TRANSACTION_ID }} + 物料编码:{{ item.PART_NO }}    领料号:{{ item.TRANSACTION_ID }}
@@ -63,20 +77,23 @@ export default { return { workOrderNo: '', partNo: '', + componentPartNo: '', loading: false, issueList: [], + componentPartDesc: '', + lineItemNo: '', }; }, methods: { loadIssueList() { - if (!this.workOrderNo || !this.partNo) { + if (!this.workOrderNo) { return; } this.loading = true; const params = { workOrderNo: this.workOrderNo, site: localStorage.getItem('site'), - partNo: this.partNo, + componentPartNo: this.componentPartNo, }; getIssueForShopOrder(params) .then(({ data }) => { @@ -93,23 +110,36 @@ export default { this.$message.error('获取领料记录失败'); }); }, + handleBack() { + // 设置标记,返回上一页时让productionReturnPicking恢复状态 + sessionStorage.setItem('productionReturnPicking_shouldRestore', 'true'); + this.$router.back(); + }, goDetail(item) { this.$router.push({ name: 'productionReturnPickingDetail', - params: { + query: { orderNo: this.workOrderNo, orderType: 'workOrder', - partNo: this.partNo, + componentPartNo: this.componentPartNo, transactionId: item.TRANSACTION_ID, + accountingId: item.ACCOUNTING_ID, quantity: item.QUANTITY, + qtyReversed: item.QTY_REVERSED, batchNo: item.LOT_BATCH_NO, + lineItemNo: this.lineItemNo, + componentPartDesc: this.componentPartDesc, }, }); }, }, mounted() { - this.workOrderNo = this.$route.params.workOrderNo; - this.partNo = this.$route.params.partNo; + console.log("lineItemNo",this.$route.query); + + this.workOrderNo = this.$route.query.workOrderNo; + this.componentPartNo = this.$route.query.componentPartNo; + this.componentPartDesc = this.$route.query.componentPartDesc; + this.lineItemNo = this.$route.query.lineItemNo; this.loadIssueList(); }, }; @@ -121,8 +151,8 @@ export default { .header-left { display: flex; align-items: center; cursor: pointer; font-size: 16px; font-weight: 500; } .header-left i { margin-right: 8px; font-size: 18px; } .header-right { cursor: pointer; font-size: 16px; font-weight: 500; } -.content-area { flex: 1; overflow-y: auto; padding: 12px 16px; } -.work-order-list { overflow-y: auto; padding: 12px 16px; } +.content-area { flex: 1; overflow-y: auto; } +.work-order-list { overflow-y: auto;} .material-card { background: white; border-radius: 8px; margin-bottom: 12px; padding: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; } .material-card:hover { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); transform: translateY(-1px); } .material-card:active { transform: translateY(0); } diff --git a/src/views/modules/production-return/productionReturnPDA.vue b/src/views/modules/production-return/productionReturnPDA.vue index 7a1070e..4b5128a 100644 --- a/src/views/modules/production-return/productionReturnPDA.vue +++ b/src/views/modules/production-return/productionReturnPDA.vue @@ -11,7 +11,7 @@
-
@@ -178,7 +178,7 @@ export default { getUnissueNotifyHeaderInfo({ site: localStorage.getItem('site'), - notifyNo: this.requestReturnForm.requestNo, + orderNo: this.requestReturnForm.requestNo, }).then(({ data }) => { if (data.code === 0) { console.log(data) diff --git a/src/views/modules/production-return/productionReturnPDAIssueList.vue b/src/views/modules/production-return/productionReturnPDAIssueList.vue index a64b8f3..36ce022 100644 --- a/src/views/modules/production-return/productionReturnPDAIssueList.vue +++ b/src/views/modules/production-return/productionReturnPDAIssueList.vue @@ -4,7 +4,7 @@
- 生产退料成功 + 生产申请单退料
首页
@@ -553,10 +553,11 @@ export default { .then(({ data }) => { if (data.code === 0 && data) { this.$message.success('生产退料成功') - this.printViaServer() - this.$router.push({ - name: 'productionReturnPDA', - }) + const unitIds = data.unitIds || []; + if (unitIds.length > 0) { + this.printViaServer(unitIds); + } + this.$router.back() this.loading = false } else { this.$message.error(data.message || '操作失败') @@ -570,6 +571,35 @@ export default { }) }, + async printViaServer(unitIds) { + if (!unitIds || unitIds.length === 0) { + console.warn('没有可打印的标签'); + return; + } + + this.$emit('print-start') + try { + const printRequest = { + userId: localStorage.getItem('userName'), + username: localStorage.getItem('userName'), + site: localStorage.getItem('site'), + unitIds: unitIds, + labelType: "BIL标签" + } + console.log('打印请求:', printRequest); + + const { data } = await printLabelCommon(printRequest) + if (data.code === 200 || data.code === 0) { + this.$message.success(`打印任务已发送!共${unitIds.length}个标签`) + } else { + this.$message.error(data.msg || '打印失败') + } + } catch (error) { + console.error('服务器打印失败:', error) + this.$message.error(`打印失败: ${error.message || error}`) + } + }, + async printViaServer(unitId) { try { const printRequest = { diff --git a/src/views/modules/production-return/productionReturnPicking.vue b/src/views/modules/production-return/productionReturnPicking.vue index 45e0066..01355c2 100644 --- a/src/views/modules/production-return/productionReturnPicking.vue +++ b/src/views/modules/production-return/productionReturnPicking.vue @@ -4,7 +4,7 @@
- 生产退料 + 直接退料
首页 @@ -24,7 +24,7 @@
-
+
{{ workOrder.partDesc }}
@@ -59,7 +57,7 @@
-
+
-->
+
+ 工单号:{{ material.orderNo }} + +
物料编码:{{ material.componentPartNo }}    行号:{{ - material.lineNo || index + 1 + material.lineItemNo }}
@@ -121,7 +123,7 @@