diff --git a/src/components/storegoods/ProcessOutBinBar.vue b/src/components/storegoods/ProcessOutBinBar.vue deleted file mode 100644 index 4c96a8c..0000000 --- a/src/components/storegoods/ProcessOutBinBar.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/pages/storegoods/storeGoodsProcessOutAdd.vue b/src/pages/storegoods/storeGoodsProcessOutAdd.vue index ebfde2d..a69ee0d 100644 --- a/src/pages/storegoods/storeGoodsProcessOutAdd.vue +++ b/src/pages/storegoods/storeGoodsProcessOutAdd.vue @@ -29,17 +29,6 @@ - {{ form.remark || '-' }} - { - this.warehouseBinCode = String(scanResult || '').trim().replace(/[\r\n]/g, ''); - this.$nextTick(() => this.resolveWarehouseBin()); - }, - fail: () => {}, - }); - }, handlePhoneScan() { if (!this.canScan || !this.orderId) { this.showError('请先提交保存后再扫码'); return; } - // 删除模式可直接扫布匹码;录入模式无仓位时先扫仓位 - if (!this.BarCodeDelStatus && !this.warehouseBinId) { - this.handleBinPhoneScan(); - return; - } - this.phoneScanTarget = 'qr'; this.phoneContinuousScan = true; this.openContinuousPhoneScan(); }, @@ -179,60 +140,10 @@ export default { this.registerScanBroadcast((scanResult) => { const code = String(scanResult || '').trim().replace(/[\r\n]/g, ''); if (!code) return; - // 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位 - if (!this.BarCodeDelStatus && !this.warehouseBinId) { - this.warehouseBinCode = code; - this.$nextTick(() => this.resolveWarehouseBin()); - return; - } this.QRBarCode = code; this.$nextTick(() => this.handleScan()); }); }, - resolveWarehouseBin() { - const code = (this.warehouseBinCode || '').trim(); - if (!this.canScan || !this.orderId) { - this.showError('请先提交保存后再扫码'); - return; - } - if (!code) return; - if (!this.form.warehouse_id) { - this.showError('单据缺少仓库信息'); - return; - } - uni.showLoading({ title: '识别仓位...' }); - return this.$u.api.warehouseBin.getByQrCode({ - qr_code: code, - warehouse_id: Number(this.form.warehouse_id), - }) - .then((data) => { - uni.hideLoading(); - if (!data || !data.id) { - throw new Error('未识别到仓位'); - } - // 返回 physical_warehouse_id,与单据仓库校验 - if ( - data.physical_warehouse_id - && String(data.physical_warehouse_id) !== String(this.form.warehouse_id) - ) { - this.warehouseBinId = 0; - this.warehouseBinName = ''; - throw new Error('该仓位不属于当前仓库'); - } - this.warehouseBinId = data.id; - this.warehouseBinCode = data.code || data.qr_code || code; - this.warehouseBinName = data.name || ''; - this.BillDataMessage = ''; - speak('仓位成功'); - uni.showToast({ title: '仓位识别成功', icon: 'success' }); - }) - .catch((e) => { - uni.hideLoading(); - this.warehouseBinId = 0; - this.warehouseBinName = ''; - this.showError(e.message || '仓位识别失败'); - }); - }, syncCanScanFromStatus(status) { const nextCanScan = this.isEditable && canScanAtStatus(status); if (this.canScan && !nextCanScan) { @@ -316,7 +227,6 @@ export default { this.auditStatus = order.audit_status; this.headerSaved = true; this.form = orderToFormFields(order); - this.clearWarehouseBin(); this.syncCanScanFromStatus(order.audit_status); if (this.canScan) this.registerOrderScanBroadcast(); return order; @@ -402,9 +312,8 @@ export default { const order = normalizeOrder(detail); this.applyOrder(order); this.headerSaved = true; - this.clearWarehouseBin(); this.syncCanScanFromStatus(order.audit_status); - this.showSuccess('保存成功,请先扫描仓位'); + this.showSuccess('保存成功,请开始扫码'); this.registerOrderScanBroadcast(); }) .catch((e) => { @@ -426,19 +335,12 @@ export default { this.phoneContinuousScan = false; return; } - const isDelete = this.BarCodeDelStatus; - if (!isDelete && !this.warehouseBinId) { - this.showError('请先扫描仓位'); - this.QRBarCode = ''; - this.phoneContinuousScan = false; - return; - } if (!code) { this.QRBarCode = ''; if (fromPhone) this.scheduleNextPhoneScan(); return; } - const arrangeType = isDelete ? ARRANGE_TYPE.DEL : ARRANGE_TYPE.IN; + const arrangeType = this.BarCodeDelStatus ? ARRANGE_TYPE.DEL : ARRANGE_TYPE.IN; this.doScanUpdate(code, arrangeType, { fromPhone }); }, BarCodeDelChange(e) { @@ -480,8 +382,6 @@ export default { id: this.orderId, scanCode, arrangeType, - // 删除不强制仓位;录入带当前仓位 - warehouseBinId: isDelete ? 0 : this.warehouseBinId, })) .then((scanRes) => { this.scanDetail = buildScanDetailFromScanResponse(scanRes);