| | |
| | | <span><i class="el-icon-tickets"></i> ç»çæ°æ®</span> |
| | | <span class="list-actions"> |
| | | <el-tag type="primary">å
± {{ materials.length }} æ¡è®°å½</el-tag> |
| | | <el-tag type="primary">å·²ç»ç {{ totalStockCount }}</el-tag> |
| | | <el-tag type="primary">åºåæ°é {{ totalStockSum }}<span>{{ uniqueUnit }}</span></el-tag> |
| | | <el-tag v-if="trayBarcode" type="success">æç: {{ trayBarcode }}</el-tag> |
| | | <!-- <el-button |
| | | v-if="materials.length > 0" |
| | |
| | | import VolTable from '@/components/basic/VolTable.vue'; |
| | | import { ElLoading, ElMessage,ElMessageBox } from 'element-plus'; |
| | | import { ref, onMounted, onUnmounted } from 'vue' |
| | | import InboundOrder from '../../../views/inbound/inboundOrder.vue'; |
| | | |
| | | export default { |
| | | name: 'BarcodeScanner', |
| | |
| | | scanTimer: null, |
| | | manualInputTimer: null, |
| | | scanTarget: 'tray', // å½åæ«ç ç®æ : tray æ material |
| | | |
| | | // åºåç»è®¡ç¸å
³åé |
| | | totalStockSum: 0, |
| | | totalStockCount: 0, |
| | | uniqueUnit: '', |
| | | sumLoading: false, |
| | | sumError: '' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | this.focusTrayInput(); |
| | | this.fetchStockStatistics(); // å è½½ç»è®¡æ°æ® |
| | | }, 300); |
| | | }); |
| | | } |
| | |
| | | this.palletForm = { palletCode: '', barcode: '' }; |
| | | this.backData = []; |
| | | this.$refs.palletForm?.reset(); |
| | | this.fetchStockStatistics(); // åæ®å·åäºï¼å·æ°ç»è®¡ |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.clearAllTimers(); |
| | | }, |
| | | methods: { |
| | | // æ°å¢ï¼æ¥è¯¢å端åºåç»è®¡æ°æ®ï¼è°ç¨ä¹åç SumQuantity æ¥å£ï¼ |
| | | async fetchStockStatistics() { |
| | | // åæ®å·ä¸ºç©ºæ¶ä¸æ¥è¯¢ |
| | | if (!this.docNo) { |
| | | this.sumError = 'åæ®å·ä¸ºç©ºï¼æ æ³ç»è®¡'; |
| | | return; |
| | | } |
| | | |
| | | this.sumLoading = true; |
| | | this.sumError = ''; |
| | | try { |
| | | // è°ç¨å端ç»è®¡æ¥å£ï¼æ¿æ¢ä¸ºä½ çå®é
æ¥å£è·¯å¾ï¼ |
| | | const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo='+this.docNo, { |
| | | |
| | | }); |
| | | |
| | | // ç»å®æ°æ®ï¼å¹é
PalletSumQuantityDTO ç»æï¼ |
| | | if (response.data) { |
| | | this.totalStockSum = response.data.stockSumQuantity || 0; // æ»åºåæ°é |
| | | this.totalStockCount = response.data.stockCount || 0; // æ»åºåè®°å½æ° |
| | | this.uniqueUnit = response.data.uniqueUnit || ''; // 计éåä½ |
| | | } |
| | | } catch (err) { |
| | | this.sumError = 'ç»è®¡å 载失败'; |
| | | this.totalStockSum = 0; |
| | | this.totalStockCount = 0; |
| | | console.error('åºåç»è®¡æ¥è¯¢å¼å¸¸ï¼', err); |
| | | } finally { |
| | | this.sumLoading = false; |
| | | } |
| | | }, |
| | | // éç½®æææ°æ® |
| | | resetData() { |
| | | console.log('éç½®å¼¹æ¡æ°æ®'); |
| | |
| | | this.currentFocus = 'tray'; |
| | | this.scanTarget = 'tray'; |
| | | this.clearAllTimers(); |
| | | this.totalStockSum = 0; |
| | | this.totalStockCount = 0; |
| | | this.sumLoading = false; |
| | | this.sumError = ''; |
| | | }, |
| | | |
| | | // æ¸
餿æè®¡æ¶å¨ |