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({