From ee497b1700526c2072c057bdcb1dfa6ad2af6c71 Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Tue, 29 Sep 2026 18:03:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor(inventoryCount):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9B=98=E7=82=B9=E5=88=97=E8=A1=A8=E4=B8=8E=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 盘点列表从详情页返回时自动刷新,保证状态与详情操作一致 - 默认列表仅展示 approved/checking/completed/cancelled 四种状态,过滤 created/submitted/rejected - 详情页移除提交审核入口(删除按钮、canSubmit 计算属性及 handleSubmitAudit 方法) - 盘点数量字段兼容 checked_quantity,回退 check_quantity(涉及列表行解析与回填两处) --- pages/warehouse/inventoryCount.vue | 11 +++++++++- pages/warehouse/inventoryCountDetail.vue | 27 +++++------------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/pages/warehouse/inventoryCount.vue b/pages/warehouse/inventoryCount.vue index 66ef49e..b0619e5 100644 --- a/pages/warehouse/inventoryCount.vue +++ b/pages/warehouse/inventoryCount.vue @@ -124,7 +124,8 @@ export default { currentPage: 1, paginationTotal: 0, recordList: [], - loading: false + loading: false, + _listLoaded: false } }, onLoad(options = {}) { @@ -143,6 +144,11 @@ export default { this.safeDispatchBroadcast('setCallbacks', { onResult: this.handleBroadcastResult }); this.safeDispatchBroadcast('resume'); this.scheduleBroadcastSelfHeal(); + // 从详情页返回时刷新列表,保证状态与详情页操作一致 + if (this._listLoaded) { + this.loadRecordList(this.currentPage); + } + this._listLoaded = true; }, onHide() { this.safeDispatchBroadcast('pause'); @@ -248,6 +254,9 @@ export default { } if (this.statusFilter) { where.status = this.statusFilter; + } else { + // 列表仅展示以下四种状态,过滤掉 created/submitted/rejected + where.status = ['approved', 'checking', 'completed', 'cancelled']; } if (Object.keys(where).length) { params.where = where; diff --git a/pages/warehouse/inventoryCountDetail.vue b/pages/warehouse/inventoryCountDetail.vue index f4eef6f..fe0a346 100644 --- a/pages/warehouse/inventoryCountDetail.vue +++ b/pages/warehouse/inventoryCountDetail.vue @@ -116,9 +116,6 @@ - - 提交审核 - 取消任务 @@ -154,9 +151,6 @@ export default { canFinish() { return this.status === 'approved' || this.status === 'checking'; }, - canSubmit() { - return this.status === 'created' || this.status === 'rejected'; - }, canCancel() { return this.status === 'created' || this.status === 'submitted' || this.status === 'rejected'; } @@ -413,7 +407,7 @@ export default { const batchNo = this.firstValue(source, ['batch_no', 'batchNo', 'batch_number']); const locationCode = this.firstValue(source, ['location_code', 'locationCode', 'space_code', 'spaceCode']); const systemRaw = this.firstValue(source, ['system_quantity', 'systemQuantity', 'book_quantity', 'stock_quantity', 'quantity']); - const checkRaw = this.firstValue(source, ['check_quantity', 'checkQuantity']); + const checkRaw = this.firstValue(source, ['checked_quantity', 'checkedQuantity', 'check_quantity', 'checkQuantity']); const diffRaw = this.firstValue(source, ['diff_quantity', 'diffQuantity']); const detailId = this.firstValue(source, ['id', 'detail_id', 'detailId']) || `${index + 1}`; const systemNumber = systemRaw === '' ? null : Number(systemRaw); @@ -511,8 +505,10 @@ export default { return; } const detail = (response && typeof response === 'object') ? (response.detail || {}) : {}; - const checkQty = detail.check_quantity !== undefined && detail.check_quantity !== null - ? Number(detail.check_quantity) : quantity; + const checkQtyRaw = detail.checked_quantity !== undefined && detail.checked_quantity !== null + ? detail.checked_quantity : detail.check_quantity; + const checkQty = checkQtyRaw !== undefined && checkQtyRaw !== null + ? Number(checkQtyRaw) : quantity; item.checkQuantity = checkQty; item.inputValue = String(checkQty); item.diffQuantity = detail.diff_quantity !== undefined && detail.diff_quantity !== null @@ -587,19 +583,6 @@ export default { } }); }, - handleSubmitAudit() { - if (this.submitting || !this.taskId) return; - uni.showModal({ - title: '提交审核', - content: '确认提交该盘点任务进入审核?', - confirmText: '提交', - cancelText: '取消', - success: async (res) => { - if (!res.confirm) return; - await this.doStatusAction('check.submit', '已提交审核'); - } - }); - }, handleCancel() { if (this.submitting || !this.taskId) return; uni.showModal({