diff --git a/src/views/modules/production-return/productionReturnPDA.vue b/src/views/modules/production-return/productionReturnPDA.vue index 4b5128a..f296432 100644 --- a/src/views/modules/production-return/productionReturnPDA.vue +++ b/src/views/modules/production-return/productionReturnPDA.vue @@ -17,7 +17,7 @@
-
申请单号:{{ material.notifyNo }} @@ -27,21 +27,24 @@
工单号:{{ material.soorderNo }}
+
+ 状态:{{ material.status }} +
-
+
@@ -70,7 +73,7 @@
-
需求数量
+
申请数量
{{ material.qtyToUnissue }}
@@ -152,6 +155,47 @@ export default { this.$router.back() }, + // 保存页面状态到sessionStorage(仅用于从领料记录页返回时恢复) + savePageStateForList() { + const state = { + requestReturnForm: { + ...this.requestReturnForm + }, + returnRequestMaterials: this.returnRequestMaterials, + selectedRequestMaterial: this.selectedRequestMaterial, + selectedWorkOrder: this.selectedWorkOrder, + materialList: this.materialList, + showOnlySelected: this.showOnlySelected, + } + sessionStorage.setItem('productionReturnPDA_state_fromList', JSON.stringify(state)) + }, + + // 从sessionStorage恢复页面状态(仅当从领料记录页返回时) + restorePageStateFromList() { + try { + const shouldRestore = sessionStorage.getItem('productionReturnPDA_shouldRestore') + const savedState = sessionStorage.getItem('productionReturnPDA_state_fromList') + if (shouldRestore === 'true' && savedState) { + const state = JSON.parse(savedState) + this.requestReturnForm = { + ...this.requestReturnForm, + ...state.requestReturnForm, + } + this.returnRequestMaterials = state.returnRequestMaterials || [] + this.selectedRequestMaterial = state.selectedRequestMaterial || null + this.selectedWorkOrder = state.selectedWorkOrder || '' + this.materialList = state.materialList || [] + this.showOnlySelected = state.showOnlySelected || false + // 清除标记 + sessionStorage.removeItem('productionReturnPDA_shouldRestore') + sessionStorage.removeItem('productionReturnPDA_state_fromList') + } + } catch (error) { + sessionStorage.removeItem('productionReturnPDA_shouldRestore') + sessionStorage.removeItem('productionReturnPDA_state_fromList') + } + }, + goBackToMaterials() { this.selectedRequestMaterial = null }, @@ -250,6 +294,8 @@ export default { // 打开材料列表页面(仿照 productionReturnPicking.vue 的 openIssueList) openReturnDetail(material) { + // 跳转前保存当前页面状态(用于从领料记录返回时恢复) + this.savePageStateForList() this.$router.push({ name: 'productionReturnPDAList', query: { @@ -283,6 +329,8 @@ export default { this.resetRequest() }, mounted() { + // 如果是从领料记录返回,则恢复页面状态 + this.restorePageStateFromList() // 聚焦申请单号输入框 this.$nextTick(() => { if (this.$refs.requestNoInput) { @@ -349,7 +397,7 @@ export default { /* 工单列表 */ .work-order-list { overflow-y: auto; - padding: 12px 16px; + padding: 12px 10px; } /* 工单卡片 */ diff --git a/src/views/modules/production-return/productionReturnPDAIssueList.vue b/src/views/modules/production-return/productionReturnPDAIssueList.vue index 36ce022..90cc458 100644 --- a/src/views/modules/production-return/productionReturnPDAIssueList.vue +++ b/src/views/modules/production-return/productionReturnPDAIssueList.vue @@ -402,12 +402,19 @@ export default { return } + let qty = 0 + if(data.labelInfo.availableQty>this.unissureQty){ + qty = this.unissureQty + }else{ + qty = data.labelInfo.availableQty + } + // 添加到列表 this.labelList.push({ id: Date.now(), labelCode: labelCode, partNo: data.labelInfo.partNo, - quantity: data.labelInfo.availableQty, + quantity: qty, batchNo: data.labelInfo.batchNo, returnReason: data.labelInfo.returnReason, locationId: data.labelInfo.locationId, diff --git a/src/views/modules/production-return/productionReturnPDAList.vue b/src/views/modules/production-return/productionReturnPDAList.vue index 6391379..a4a24f1 100644 --- a/src/views/modules/production-return/productionReturnPDAList.vue +++ b/src/views/modules/production-return/productionReturnPDAList.vue @@ -2,9 +2,9 @@
-
+
- 退仓 - 领料记录 + 退料 - 领料记录
首页
@@ -112,6 +112,10 @@ export default { this.$message.error('获取领料记录失败'); }); }, + handleBack() { + sessionStorage.setItem('productionReturnPDA_shouldRestore', 'true'); + this.$router.back(); + }, goDetail(item) { this.$router.push({ name: 'productionReturnPDAIssueList',