| | |
| | | <template> |
| | | <vol-box |
| | | v-model="groupPalletVisible" |
| | | :title="'ç»çæä½ - åæ®å·ï¼' + currentDocNo" |
| | | :height="1000" |
| | | :width="1100" |
| | | :padding="20" |
| | | :modal="true" |
| | | |
| | | @open="handleDialogOpen" |
| | | @close="handleDialogClose" |
| | | > |
| | | <div class="barcode-scanner-container"> |
| | | |
| | | <!-- æçä¿¡æ¯æ¾ç¤º --> |
| | | <div class="tray-info" v-if="trayBarcode"> |
| | | <i class="el-icon-s-management"></i> å½åæç: {{ trayBarcode }} |
| | | <!-- <el-button |
| | | class="small-button" |
| | | type="text" |
| | | @click="clearTray" |
| | | style="float: right;" |
| | | > |
| | | æ¸
餿ç |
| | | </el-button> --> |
| | | <vol-box v-model="groupPalletVisible" :title="'ç»çæä½ - åæ®å·ï¼' + currentDocNo" :height="1000" :width="1100" :padding="20" |
| | | :modal="true" @open="handleDialogOpen" @close="handleDialogClose"> |
| | | <div class="barcode-scanner-container"> |
| | | |
| | | <!-- ä»åºéæ© - ç´§åå¸å± --> |
| | | <div class="location-section compact"> |
| | | <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form"> |
| | | <el-form-item label="ä»åº" prop="warehouseType" class="location-select compact-item"> |
| | | <el-select v-model="form.warehouseType" placeholder="è¯·éæ©ä»åº" clearable filterable |
| | | @change="handleWarehouseChange" style="width: 100%" :loading="warehouseLoading" size="medium"> |
| | | <el-option v-for="item in warehouseTypes" :key="item.warehouseType" :label="item.warehouseTypeDesc" |
| | | :value="item.warehouseType" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- æ«ç ææå¨è¾å
¥åºå --> |
| | | <div class="input-section"> |
| | | <el-card shadow="hover"> |
| | | <div slot="header"> |
| | | <span><i class="el-icon-scanner"></i> </span> |
| | | |
| | | <!-- ä»åºåºåéæ© - ç´§åå¸å± --> |
| | | <div class="location-section compact"> |
| | | <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form"> |
| | | <el-form-item label="ä»åºåºå" prop="locationType" class="location-select compact-item"> |
| | | <el-select v-model="form.locationType" placeholder="请å
éæ©ä»åº" clearable filterable |
| | | @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium"> |
| | | <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc" |
| | | :value="item.locationType" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- æçä¿¡æ¯æ¾ç¤º - ç´§åå¸å± --> |
| | | <div class="tray-info compact" v-if="trayBarcode"> |
| | | <i class="el-icon-s-management"></i> å½åæç®±: {{ trayBarcode }} |
| | | <span class="location-info" v-if="form.warehouseType"> |
| | | | ä»åº: {{ currentWarehouseName }} |
| | | </span> |
| | | <span class="location-info" v-if="form.locationType"> |
| | | | ä»åºåºå: {{ currentLocationDesc }} |
| | | </span> |
| | | </div> |
| | | |
| | | <!-- æ«ç åºå - ç´§åå¸å± --> |
| | | <div class="input-section compact"> |
| | | <el-card shadow="hover" class="compact-card"> |
| | | <div slot="header" class="compact-header"> |
| | | <span><i class="el-icon-scanner"></i> æ«ç åºå</span> |
| | | <span class="scan-status"> |
| | | <span class="scan-indicator"></span>æ«ç 就绪 |
| | | <span class="scan-indicator"></span> |
| | | {{ form.locationType && form.warehouseType ? 'æ«ç 就绪' : '请å
éæ©ä»åºåä»åºåºå' }} |
| | | </span> |
| | | </div> |
| | | |
| | | |
| | | <!-- æçæ¡ç è¾å
¥ --> |
| | | <div class="input-wrapper custom-input-group"> |
| | | <div class="input-label">æçæ¡ç </div> |
| | | <el-input |
| | | ref="trayInput" |
| | | v-model="trayBarcode" |
| | | placeholder="è¯·æ«ææè¾å
¥æçæ¡ç åæå车é®" |
| | | clearable |
| | | @keyup.enter.native="handleTraySubmit" |
| | | @clear="handleTrayClear" |
| | | @input="handleTrayInput" |
| | | class="custom-input" |
| | | > |
| | | <template slot="prepend"> |
| | | <span>æçæ¡ç </span> |
| | | </template> |
| | | <div class="input-wrapper custom-input-group compact-input"> |
| | | <div class="input-label">æç®±ç </div> |
| | | <el-input ref="trayInput" v-model="trayBarcode" placeholder="è¯·æ«ææè¾å
¥æç®±ç åæå车é®" clearable |
| | | :disabled="!form.locationType || !form.warehouseType" @keyup.enter.native="handleTraySubmit" |
| | | @clear="handleTrayClear" @input="handleTrayInput" class="custom-input" size="medium"> |
| | | <template slot="append"> |
| | | <el-button |
| | | @click="handleTraySubmit" |
| | | type="primary" |
| | | icon="el-icon-position" |
| | | > |
| | | <el-button @click="handleTraySubmit" type="primary" icon="el-icon-position" |
| | | :disabled="!form.locationType || !trayBarcode || !form.warehouseType" size="medium"> |
| | | 确认 |
| | | </el-button> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | |
| | | |
| | | <!-- ç©ææ¡ç è¾å
¥ --> |
| | | <div class="input-wrapper custom-input-group"> |
| | | <div class="input-wrapper custom-input-group compact-input"> |
| | | <div class="input-label">ç©ææ¡ç </div> |
| | | <el-input |
| | | ref="barcodeInput" |
| | | v-model="barcode" |
| | | placeholder="è¯·æ«ææè¾å
¥ç©ææ¡ç åæå车é®" |
| | | clearable |
| | | :disabled="!trayBarcode" |
| | | @keyup.enter.native="handleBarcodeSubmit" |
| | | @clear="handleClear" |
| | | @input="handleBarcodeInput" |
| | | class="custom-input" |
| | | > |
| | | <template slot="prepend"> |
| | | <span>ç©ææ¡ç </span> |
| | | </template> |
| | | <el-input ref="barcodeInput" v-model="barcode" placeholder="è¯·æ«ææè¾å
¥ç©ææ¡ç åæå车é®" clearable |
| | | :disabled="!form.locationType || !trayBarcode || !form.warehouseType" |
| | | @keyup.enter.native="handleBarcodeSubmit" @clear="handleClear" @input="handleBarcodeInput" |
| | | class="custom-input" size="medium"> |
| | | <template slot="append"> |
| | | <el-button |
| | | :loading="loading" |
| | | @click="handleBarcodeSubmit" |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | :disabled="!trayBarcode" |
| | | > |
| | | <el-button :loading="loading" @click="handleBarcodeSubmit" type="primary" icon="el-icon-search" |
| | | :disabled="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" size="medium"> |
| | | {{ loading ? 'æ¥è¯¢ä¸...' : 'æ¥è¯¢' }} |
| | | </el-button> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | |
| | | <div class="input-tips"> |
| | | <p>æç¤ºï¼å
è¾å
¥æçæ¡ç ï¼ç¶åè¾å
¥ç©ææ¡ç </p> |
| | | |
| | | |
| | | <div class="input-tips compact-tips"> |
| | | <p>æç¤ºï¼è¯·å
éæ©ä»åº â éæ©ä»åºåºå â è¾å
¥æç®±ç â è¾å
¥ç©ææ¡ç </p> |
| | | <p v-if="!form.warehouseType" class="warning-text">â ï¸ è¯·å
éæ©ä»åº</p> |
| | | <p v-if="!form.locationType && !form.warehouseType" class="warning-text">â ï¸ è¯·å
éæ©ä»åºåºå</p> |
| | | <p v-if="form.warehouseType && form.locationType && !trayBarcode" class="warning-text">â ï¸ è¯·å
è¾å
¥æç®±ç </p> |
| | | </div> |
| | | |
| | | |
| | | </el-card> |
| | | </div> |
| | | |
| | | <!-- å è½½ç¶æ --> |
| | | <div v-if="loading" class="loading"> |
| | | <div v-if="loading" class="loading compact"> |
| | | <el-progress :percentage="100" status="success" :show-text="false" /> |
| | | <p>æ£å¨æ¥è¯¢ç©æä¿¡æ¯...</p> |
| | | </div> |
| | | |
| | | <!-- é误æç¤º --> |
| | | <div v-if="error" class="error-message"> |
| | | <el-alert |
| | | :title="error" |
| | | type="error" |
| | | show-icon |
| | | closable |
| | | @close="error = ''" |
| | | /> |
| | | <div v-if="error" class="error-message compact"> |
| | | <el-alert :title="error" type="error" show-icon closable @close="error = ''" /> |
| | | </div> |
| | | |
| | | <!-- ç©æå表 --> |
| | | <div class="material-list"> |
| | | <el-card shadow="hover"> |
| | | <div slot="header"> |
| | | <span><i class="el-icon-tickets"></i> ç»çæ°æ®</span> |
| | | <!-- æªç»çå表 --> |
| | | <div class="unpallet-section compact"> |
| | | <el-card shadow="hover" class="compact-card unpallet-card"> |
| | | <div slot="header" class="compact-header"> |
| | | <span><i class="el-icon-tickets"></i> æªç»çæ¡ç </span> |
| | | <span class="list-actions"> |
| | | <el-tag type="primary">å
± {{ materials.length }} æ¡è®°å½</el-tag> |
| | | <el-tag v-if="trayBarcode" type="success">æç: {{ trayBarcode }}</el-tag> |
| | | <!-- <el-button |
| | | v-if="materials.length > 0" |
| | | class="small-button clear-all-btn" |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | @click="clearAllMaterials" |
| | | > |
| | | æ¸
空å表 |
| | | </el-button> --> |
| | | <!-- <el-button |
| | | class="small-button clear-all-btn" |
| | | @click="debugMode = !debugMode" |
| | | > |
| | | {{ debugMode ? 'éèè°è¯' : 'æ¾ç¤ºè°è¯' }} |
| | | </el-button> --> |
| | | <el-tag type="primary" size="small">æªç»ç {{ totalStockCount }}</el-tag> |
| | | </span> |
| | | </div> |
| | | |
| | | |
| | | <div v-if="materials.length === 0" class="empty-state"> |
| | | <div class="table-container"> |
| | | <el-table :data="unpalletMaterials" stripe style="width: 100%" height="100%" size="small" v-loading="unpalletBarcodesLoading"> |
| | | <el-table-column type="index" label="åºå·" width="60" align="center"></el-table-column> |
| | | <el-table-column prop="barcode" label="æ¡ç " min-width="140" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="materielCode" label="ç©æç¼ç " min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="batchNo" label="æ¹æ¬¡" min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="orderQuantity" label="æ°é" min-width="130" align="right"></el-table-column> |
| | | <el-table-column prop="unit" label="åä½" width="80" align="center"></el-table-column> |
| | | <el-table-column prop="supplyCode" label="ä¾åºå" min-width="130" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | |
| | | </div> |
| | | |
| | | <!-- ç©æå表 - åºå®é«åº¦å¸¦æ»å¨æ¡ --> |
| | | <div class="material-list compact"> |
| | | <el-card shadow="hover" class="compact-card"> |
| | | <div slot="header" class="compact-header"> |
| | | <span><i class="el-icon-tickets"></i> ç»çæ°æ®</span> |
| | | <span class="list-actions"> |
| | | <el-tag type="primary" size="small">å
± {{ materials.length }} æ¡</el-tag> |
| | | <el-tag type="primary" size="small">æªå
¥åºæ°é {{ totalStockSum }}{{ uniqueUnit }}</el-tag> |
| | | <el-tag v-if="trayBarcode" type="success" size="small">æç: {{ trayBarcode }}</el-tag> |
| | | <el-tag v-if="form.warehouseType" type="info" size="small">ä»åº: {{ currentWarehouseName }}</el-tag> |
| | | <el-tag v-if="form.locationType" type="info" size="small">åºå: {{ currentLocationDesc }}</el-tag> |
| | | </span> |
| | | </div> |
| | | |
| | | <div v-if="materials.length === 0" class="empty-state compact"> |
| | | <i class="el-icon-document"></i> |
| | | <p v-if="!trayBarcode">请å
è¾å
¥æçæ¡ç </p> |
| | | <p v-if="!form.warehouseType">请å
éæ©ä»åº</p> |
| | | <p v-if="!form.locationType">请å
éæ©ä»åºåºå</p> |
| | | <p v-else-if="!trayBarcode">请å
è¾å
¥æç®±æ¡ç </p> |
| | | <p v-else>ææ ç©ææ°æ®ï¼è¯·æ«ææè¾å
¥ç©ææ¡ç </p> |
| | | </div> |
| | | |
| | | <el-table |
| | | v-else |
| | | :data="materials" |
| | | stripe |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column type="index" label="åºå·" width="60" align="center"></el-table-column> |
| | | <el-table-column prop="barcode" label="æ¡ç " min-width="140"></el-table-column> |
| | | <el-table-column prop="materielCode" label="ç©æç¼ç " min-width="150"></el-table-column> |
| | | <el-table-column prop="batchNo" label="æ¹æ¬¡" min-width="150"></el-table-column> |
| | | <el-table-column prop="stockQuantity" label="æ°é" min-width="130"></el-table-column> |
| | | <el-table-column prop="unit" label="åä½" width="80" align="center"></el-table-column> |
| | | <el-table-column prop="supplyCode" label="ä¾åºå" min-width="130"></el-table-column> |
| | | <el-table-column prop="warehouseCode" label="ä»åº" min-width="120"></el-table-column> |
| | | |
| | | <!-- <el-table-column label="æä½" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope" |
| | | class="small-button" |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | circle |
| | | @click="removeMaterial(scope.$index)" |
| | | ></el-button> |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | |
| | | <div class="table-container" v-else> |
| | | <el-table :data="materials" stripe style="width: 100%" height="100%" size="small"> |
| | | <el-table-column type="index" label="åºå·" width="60" align="center"></el-table-column> |
| | | <el-table-column prop="barcode" label="æ¡ç " min-width="140" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="materielCode" label="ç©æç¼ç " min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="batchNo" label="æ¹æ¬¡" min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="stockQuantity" label="æ°é" min-width="130" align="right"></el-table-column> |
| | | <el-table-column prop="unit" label="åä½" width="80" align="center"></el-table-column> |
| | | <el-table-column prop="supplyCode" label="ä¾åºå" min-width="130" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="warehouseType" label="ä»åº" min-width="120" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div slot="footer" class="dialog-footer"> |
| | | |
| | | <!-- <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleCancel">åæ¶</el-button> |
| | | <el-button type="primary" @click="handleConfirm">确认</el-button> |
| | | </div> --> |
| | | </vol-box> |
| | | </vol-box> |
| | | </template> |
| | | |
| | | <script> |
| | | import http from '@/api/http.js'; |
| | | import VolBox from '@/components/basic/VolBox.vue'; |
| | | import VolForm from '@/components/basic/VolForm.vue'; |
| | | import VolTable from '@/components/basic/VolTable.vue'; |
| | | import { ElLoading, ElMessage,ElMessageBox } from 'element-plus'; |
| | | import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { ref, onMounted, onUnmounted } from 'vue' |
| | | import InboundOrder from '../../../views/inbound/inboundOrder.vue'; |
| | | import { th } from 'element-plus/es/locales.mjs'; |
| | | |
| | | export default { |
| | | name: 'BarcodeScanner', |
| | |
| | | |
| | | data() { |
| | | return { |
| | | palletVisible: this.visible, |
| | | trayBarcode: '', |
| | | barcode: '', |
| | | materials: [], |
| | | loading: false, |
| | | error: '', |
| | | debugMode: false, |
| | | currentFocus: 'tray', |
| | | |
| | | // æ«ç æªç¸å
³åé |
| | | scanCode: '', |
| | | lastKeyTime: null, |
| | | isManualInput: false, |
| | | isScanning: false, |
| | | scanTimer: null, |
| | | manualInputTimer: null, |
| | | scanTarget: 'tray', // å½åæ«ç ç®æ : tray æ material |
| | | palletVisible: this.visible, |
| | | trayBarcodeReg:/^[A-Z]\d{9}$/, |
| | | trayBarcode: '', |
| | | barcode: '', |
| | | materials: [], |
| | | loading: false, |
| | | error: '', |
| | | debugMode: false, |
| | | currentFocus: 'warehouse', |
| | | |
| | | unpalletBarcodes:[], |
| | | unpalletBarcodesLoading: false, |
| | | unpalletMaterials: [], // æªç»çè¯¦ç»æ°æ®å表 |
| | | |
| | | // æ«ç æªç¸å
³åé |
| | | scanCode: '', |
| | | lastKeyTime: null, |
| | | isManualInput: false, |
| | | isScanning: false, |
| | | scanTimer: null, |
| | | manualInputTimer: null, |
| | | scanTarget: 'tray', // å½åæ«ç ç®æ : tray æ material |
| | | |
| | | // åºåç»è®¡ç¸å
³åé |
| | | totalStockSum: 0, |
| | | totalStockCount: 0, |
| | | uniqueUnit: '', |
| | | sumLoading: false, |
| | | sumError: '', |
| | | // ä»åºç¸å
³åé |
| | | warehouseTypes: [], |
| | | warehouseLoading: false, |
| | | // ä»åºåºåç¸å
³åé |
| | | locationTypes: [], |
| | | locationLoading: false, |
| | | form: { |
| | | warehouseType: null, |
| | | locationType: null |
| | | }, |
| | | rules: { |
| | | locationType: [ |
| | | { |
| | | validator: this.validateLocationType, |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | trayBarcode:[ |
| | | { |
| | | pattern: this.trayBarcodeReg, |
| | | message: 'æçå·æ ¼å¼é误ï¼é为1个大å忝+9个æ°åï¼å¦A000008024ï¼', |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | warehouseType: [ |
| | | { |
| | | message: 'è¯·éæ©ä»åº', |
| | | trigger: 'change' |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | get() { return this.visible; }, |
| | | set(newVal) { this.$emit('update:visible', newVal); } |
| | | }, |
| | | currentDocNo() { return this.docNo; } |
| | | currentDocNo() { return this.docNo; }, |
| | | // å½åéæ©çä»åºåç§° |
| | | currentWarehouseName() { |
| | | const warehouse = this.warehouseTypes.find(item => item.warehouseType === this.form.warehouseType); |
| | | return warehouse ? warehouse.warehouseTypeDesc : ''; |
| | | }, |
| | | // å½åéæ©çä»åºåºåæè¿° |
| | | currentLocationDesc() { |
| | | const location = this.locationTypes.find(item => item.locationType === this.form.locationType) |
| | | return location ? location.locationTypeDesc : '' |
| | | } |
| | | }, |
| | | watch: { |
| | | visible(newVal, oldVal) { |
| | | this.palletVisible = newVal; |
| | | |
| | | // å½ä» false å为 true æ¶ï¼è¡¨ç¤ºå¼¹æ¡æå¼ |
| | | if (newVal === true && oldVal === false) { |
| | | console.log('å¼¹æ¡æå¼ï¼éç½®æ°æ®'); |
| | | this.resetData(); |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | this.focusTrayInput(); |
| | | }, 300); |
| | | }); |
| | | } |
| | | |
| | | // å½ä» true å为 false æ¶ï¼è¡¨ç¤ºå¼¹æ¡å
³é |
| | | if (newVal === false && oldVal === true) { |
| | | console.log('å¼¹æ¡å
³éï¼éç½®æ°æ®'); |
| | | this.resetData(); |
| | | } |
| | | }, |
| | | palletVisible(newVal) { |
| | | this.$emit('update:visible', newVal); |
| | | }, |
| | | this.palletVisible = newVal; |
| | | |
| | | // å½ä» false å为 true æ¶ï¼è¡¨ç¤ºå¼¹æ¡æå¼ |
| | | if (newVal === true && oldVal === false) { |
| | | console.log('å¼¹æ¡æå¼ï¼éç½®æ°æ®'); |
| | | this.resetData(); |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | // this.focusTrayInput(); |
| | | this.initwarehouseTypes(); // åå§åä»åº |
| | | this.initLocationTypes(); // åå§åä»åºåºå |
| | | this.fetchStockStatistics(); // å è½½ç»è®¡æ°æ® |
| | | this.fetchUnpalletMaterialDetails(); |
| | | }, 300); |
| | | }); |
| | | } |
| | | |
| | | // å½ä» true å为 false æ¶ï¼è¡¨ç¤ºå¼¹æ¡å
³é |
| | | if (newVal === false && oldVal === true) { |
| | | console.log('å¼¹æ¡å
³éï¼éç½®æ°æ®'); |
| | | this.resetData(); |
| | | } |
| | | }, |
| | | palletVisible(newVal) { |
| | | this.$emit('update:visible', newVal); |
| | | }, |
| | | docNo(newVal) { |
| | | if (newVal) { |
| | | this.palletForm = { palletCode: '', barcode: '' }; |
| | | this.backData = []; |
| | | this.$refs.palletForm?.reset(); |
| | | this.fetchStockStatistics(); // åæ®å·åäºï¼å·æ°ç»è®¡ |
| | | this.fetchUnpalletMaterialDetails(); |
| | | } |
| | | } |
| | | }, |
| | | 'form.warehouseType'(newVal) { |
| | | if (newVal) { |
| | | this.form.locationType = null; |
| | | } else { |
| | | this.locationTypes = []; |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | | |
| | | // æ·»å å
¨å±é®ççå¬ |
| | | document.addEventListener('keypress', this.handleKeyPress); |
| | | |
| | | // 使ç¨setTimeoutç¡®ä¿DOMå®å
¨æ¸²æååèç¦ |
| | | setTimeout(() => { |
| | | this.focusTrayInput(); |
| | | }, 300); |
| | | }, |
| | | beforeDestroy() { |
| | | // æ¸
çäºä»¶çå¬ |
| | | document.removeEventListener('keypress', this.handleKeyPress); |
| | | this.clearAllTimers(); |
| | | }, |
| | | methods: { |
| | | // éç½®æææ°æ® |
| | | mounted() { |
| | | |
| | | // æ·»å å
¨å±é®ççå¬ |
| | | document.addEventListener('keypress', this.handleKeyPress); |
| | | |
| | | // 使ç¨setTimeoutç¡®ä¿DOMå®å
¨æ¸²æååèç¦ |
| | | setTimeout(() => { |
| | | // this.focusTrayInput(); |
| | | this.focusLocationSelect(); |
| | | }, 300); |
| | | }, |
| | | beforeDestroy() { |
| | | // æ¸
çäºä»¶çå¬ |
| | | document.removeEventListener('keypress', this.handleKeyPress); |
| | | this.clearAllTimers(); |
| | | }, |
| | | methods: { |
| | | /** |
| | | * èªå®ä¹ä»åºåºåéªè¯ |
| | | * å
许å¼ä¸º0ï¼å 为0æ¯åæ³çlocationType |
| | | */ |
| | | validateLocationType(rule, value, callback) { |
| | | // æ£æ¥å¼æ¯å¦ä¸ºnullãundefinedæç©ºå符串ï¼ä½å
许æ°å0 |
| | | if (!this.form.warehouseType) { |
| | | callback(new Error('请å
éæ©ä»åº')); |
| | | } else if (value === null || value === undefined || value === '') { |
| | | callback(new Error('è¯·éæ©ä»åºåºå')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | |
| | | // æ ¹æ®æ¡ç å表è·åè¯¦ç»æ°æ® |
| | | async fetchUnpalletMaterialDetails() { |
| | | try { |
| | | // å°è¯è°ç¨æ¥å£è·åè¯¦ç»æ°æ® |
| | | // 注æï¼å¦æè¿ä¸ªæ¥å£ä¸åå¨ï¼å¯ä»¥æ³¨éæææ ¹æ®å®é
APIè°æ´ |
| | | const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo='+this.docNo, { |
| | | |
| | | }); |
| | | |
| | | console.log('æªç»çæ°æ®:', response.data); |
| | | |
| | | |
| | | if (response.status && Array.isArray(response.data)) { |
| | | this.unpalletMaterials = response.data; |
| | | this.unpalletBarcodes = response.data.map(item => item.barcode || ''); |
| | | this.totalStockCount = response.data.length; |
| | | } else { |
| | | // 妿æ¥å£è¿åæ ¼å¼ä¸åï¼å°è¯å
¶ä»æ¹å¼ |
| | | // 妿æ¥å£ä¸åå¨ï¼è¿éä¼è¿å
¥catchï¼è®¾ç½®ä¸ºç©ºæ°ç» |
| | | this.unpalletMaterials = []; |
| | | } |
| | | } catch (err) { |
| | | console.warn('è·åæªç»çè¯¦ç»æ°æ®æ¥å£å¯è½ä¸åå¨ï¼ä½¿ç¨æ¡ç å表æ¾ç¤ºï¼', err); |
| | | // 妿æ¥å£ä¸åå¨ï¼å°æ¡ç å表转æ¢ä¸ºç®åçæ¾ç¤ºæ ¼å¼ |
| | | // æè
ä¿æä¸ºç©ºï¼è®©ç¨æ·ç¥ééè¦éæ©ä»åºååºåæ¥æ¥çè¯¦ç»æ°æ® |
| | | this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({ |
| | | barcode: barcode, |
| | | materielCode: '-', |
| | | batchNo: '-', |
| | | stockQuantity: '-', |
| | | unit: '-', |
| | | supplyCode: '-', |
| | | warehouseType: '-' |
| | | })); |
| | | } |
| | | }, |
| | | /** |
| | | * åå§åä»åºåºåæ°æ® |
| | | */ |
| | | async initLocationTypes() { |
| | | this.locationLoading = true; |
| | | this.error = ''; |
| | | |
| | | try { |
| | | const response = await http.post('/api/LocationInfo/GetLocationTypes'); |
| | | |
| | | if (response.status && Array.isArray(response.data)) { |
| | | this.locationTypes = response.data; |
| | | if (this.locationTypes.length === 0) { |
| | | this.error = 'æªè·åå°ä»åºåºåæ°æ®'; |
| | | } else { |
| | | // 妿æé»è®¤åºåï¼å¯ä»¥å¨è¿é设置 |
| | | // this.form.locationType = this.locationTypes[0].locationType; |
| | | } |
| | | } else { |
| | | this.error = 'è·åä»åºåºåæ°æ®å¤±è´¥'; |
| | | } |
| | | } catch (error) { |
| | | console.error('è·åä»åºåºå失败:', error); |
| | | this.error = `è·åä»åºåºå失败: ${error.message || 'ç½ç»é误'}`; |
| | | } finally { |
| | | this.locationLoading = false; |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * åå§åä»åºæ°æ® |
| | | */ |
| | | async initwarehouseTypes() { |
| | | this.warehouseLoading = true; |
| | | this.error = ''; |
| | | |
| | | try { |
| | | const response = await http.post('/api/Warehouse/GetwarehouseTypes'); |
| | | |
| | | if (response.status && Array.isArray(response.data)) { |
| | | this.warehouseTypes = response.data; |
| | | if (this.warehouseTypes.length === 0) { |
| | | this.error = 'æªè·åå°ä»åºæ°æ®'; |
| | | } else { |
| | | // 妿æé»è®¤åºåï¼å¯ä»¥å¨è¿é设置 |
| | | // this.form.locationType = this.locationTypes[0].locationType; |
| | | } |
| | | } else { |
| | | this.error = 'è·åä»åºæ°æ®å¤±è´¥'; |
| | | } |
| | | } catch (error) { |
| | | console.error('è·åä»åºå¤±è´¥:', error); |
| | | this.error = `è·åä»åºå¤±è´¥: ${error.message || 'ç½ç»é误'}`; |
| | | } finally { |
| | | this.warehouseLoading = false; |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * ä»åºåºååæ´å¤ç |
| | | */ |
| | | handleLocationChange(value) { |
| | | console.log('éæ©ä»åºåºå:', value, 'ç±»å:', typeof value, this.currentLocationDesc); |
| | | |
| | | // ç«å³æ¸
é¤éè¯¯ä¿¡æ¯ |
| | | this.error = ''; |
| | | |
| | | // æå¨è§¦å表åéªè¯æ´æ° |
| | | this.$nextTick(() => { |
| | | if (this.$refs.locationForm) { |
| | | // æ¸
é¤è¯¥å段çéªè¯ç¶æï¼ç¶åéæ°éªè¯ |
| | | this.$refs.locationForm.clearValidate('locationType'); |
| | | |
| | | // çæå»¶è¿åéæ°éªè¯ï¼ç¡®ä¿DOMå·²æ´æ° |
| | | setTimeout(() => { |
| | | this.$refs.locationForm.validateField('locationType', (errorMsg) => { |
| | | if (!errorMsg && (value === 0 || value)) { |
| | | console.log('ä»åºåºåéªè¯éè¿:', value); |
| | | // åºåéæ©åï¼èªå¨èç¦å°æçè¾å
¥æ¡ |
| | | this.focusLocationSelect(); |
| | | // å·æ°æªç»çæ°æ®ï¼æ ¹æ®éæ©çä»åºååºåè¿æ»¤ï¼ |
| | | } |
| | | }); |
| | | }, 100); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * ä»åºåæ´å¤ç |
| | | */ |
| | | handleWarehouseChange(value) { |
| | | console.log('éæ©ä»åº:', value, 'ç±»å:', typeof value, this.currentWarehouseName); |
| | | |
| | | // ç«å³æ¸
é¤éè¯¯ä¿¡æ¯ |
| | | this.error = ''; |
| | | |
| | | // æå¨è§¦å表åéªè¯æ´æ° |
| | | this.$nextTick(() => { |
| | | if (this.$refs.locationForm) { |
| | | // æ¸
é¤è¯¥å段çéªè¯ç¶æï¼ç¶åéæ°éªè¯ |
| | | this.$refs.locationForm.clearValidate('warehouseType'); |
| | | |
| | | // çæå»¶è¿åéæ°éªè¯ï¼ç¡®ä¿DOMå·²æ´æ° |
| | | setTimeout(() => { |
| | | this.$refs.locationForm.validateField('warehouseType', (errorMsg) => { |
| | | if (!errorMsg && (value === 0 || value)) { |
| | | console.log('ä»åºéªè¯éè¿:', value); |
| | | this.focusLocationSelect(); |
| | | } |
| | | }); |
| | | }, 100); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | 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; |
| | | } |
| | | }, |
| | | /** |
| | | * 表åéªè¯ |
| | | */ |
| | | async validateForm() { |
| | | return new Promise((resolve) => { |
| | | if (!this.$refs.locationForm) { |
| | | this.error = 'è¡¨åæªåå§å'; |
| | | this.$message.warning('请å
éæ©ä»åºåºå'); |
| | | resolve(false); |
| | | return; |
| | | } |
| | | |
| | | this.$refs.locationForm.validate((valid) => { |
| | | if (valid) { |
| | | this.error = ''; |
| | | resolve(true); |
| | | } else { |
| | | // æå¨æ£æ¥locationTypeï¼æ£ç¡®å¤çå¼ä¸º0çæ
åµ |
| | | if (!this.from.warehouseType) { |
| | | this.error = '请å
éæ©ä»åº'; |
| | | } |
| | | else if (this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') { |
| | | this.error = '请å
éæ©ä»åºåºå'; |
| | | //this.$message.warning('请å
éæ©ä»åºåºå'); |
| | | } else { |
| | | // 妿å¼åå¨ï¼å
æ¬0ï¼ï¼ä½éªè¯ä¸éè¿ï¼å¯è½æ¯å
¶ä»éªè¯é误 |
| | | this.error = 'è¯·æ£æ¥è¡¨å填忝妿£ç¡®'; |
| | | } |
| | | resolve(false); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | focusWarehouseSelect() { |
| | | if (this.$refs.locationForm) { |
| | | const selectEl = this.$el.querySelector('.location-select:first-child .el-input__inner'); |
| | | if (selectEl) { |
| | | selectEl.focus(); |
| | | this.currentFocus = 'warehouse'; |
| | | } |
| | | } |
| | | }, |
| | | // èç¦å°ä»åºåºåéæ© |
| | | focusLocationSelect() { |
| | | if (this.$refs.locationForm) { |
| | | const selectEl = this.$el.querySelector('.location-select:nth-child(2) .el-input__inner'); |
| | | if (selectEl) { |
| | | selectEl.focus(); |
| | | this.currentFocus = 'location'; |
| | | } |
| | | } |
| | | }, |
| | | // èç¦å°æçè¾å
¥æ¡ |
| | | focusTrayInput() { |
| | | if (this.$refs.trayInput && this.$refs.trayInput.$el) { |
| | | const inputEl = this.$refs.trayInput.$el.querySelector('input'); |
| | | if (inputEl) { |
| | | inputEl.focus(); |
| | | this.currentFocus = 'tray'; |
| | | this.scanTarget = 'tray'; |
| | | inputEl.select(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // èç¦å°ç©æè¾å
¥æ¡ |
| | | focusBarcodeInput() { |
| | | if (this.$refs.barcodeInput && this.$refs.barcodeInput.$el) { |
| | | const inputEl = this.$refs.barcodeInput.$el.querySelector('input'); |
| | | if (inputEl) { |
| | | inputEl.focus(); |
| | | this.currentFocus = 'material'; |
| | | this.scanTarget = 'material'; |
| | | |
| | | |
| | | inputEl.select(); |
| | | console.log('ç©æè¾å
¥æ¡å
容已éä¸'); |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | // éç½®æææ°æ® |
| | | resetData() { |
| | | console.log('éç½®å¼¹æ¡æ°æ®'); |
| | | this.trayBarcode = ''; |
| | | this.barcode = ''; |
| | | this.materials = []; |
| | | this.unpalletBarcodes = []; |
| | | this.unpalletMaterials = []; |
| | | this.loading = false; |
| | | this.error = ''; |
| | | this.scanCode = ''; |
| | | this.lastKeyTime = null; |
| | | this.isManualInput = false; |
| | | this.isScanning = false; |
| | | this.currentFocus = 'tray'; |
| | | this.currentFocus = 'warehouse'; |
| | | this.scanTarget = 'tray'; |
| | | this.clearAllTimers(); |
| | | this.totalStockSum = 0; |
| | | this.totalStockCount = 0; |
| | | this.sumLoading = false; |
| | | this.sumError = ''; |
| | | this.form = { |
| | | warehouseType: null, |
| | | locationType: null |
| | | } |
| | | this.warehouseTypes = []; |
| | | this.locationTypes = []; |
| | | // æ¸
é¤è¡¨åéªè¯ç¶æ |
| | | this.$nextTick(() => { |
| | | if (this.$refs.locationForm) { |
| | | this.$refs.locationForm.clearValidate(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | // æ¸
餿æè®¡æ¶å¨ |
| | | clearAllTimers() { |
| | | if (this.manualInputTimer) { |
| | |
| | | this.scanTimer = null; |
| | | } |
| | | }, |
| | | |
| | | |
| | | // å¼¹æ¡æå¼æ¶éç½®æ°æ® |
| | | handleDialogOpen() { |
| | | console.log('å¼¹æ¡æå¼ï¼éç½®æ°æ®'); |
| | |
| | | // 使ç¨setTimeoutç¡®ä¿DOMå®å
¨æ¸²æååèç¦ |
| | | this.$nextTick(() => { |
| | | setTimeout(() => { |
| | | this.focusTrayInput(); |
| | | this.initwarehouseTypes(); |
| | | this.initLocationTypes(); // åå§åä»åºåºå |
| | | // ç¡®ä¿è¡¨åå¼ç¨åå¨ååèç¦ |
| | | if (this.$refs.locationForm) { |
| | | this.focusWarehouseSelect(); |
| | | } else { |
| | | // å¦æè¡¨åå¼ç¨è¿ä¸åå¨ï¼ç¨åéè¯ |
| | | setTimeout(() => { |
| | | this.focusWarehouseSelect(); |
| | | }, 500); |
| | | } |
| | | }, 300); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | // å¼¹æ¡å
³éæ¶éç½®æ°æ® |
| | | handleDialogClose() { |
| | | console.log('å¼¹æ¡å
³éï¼éç½®æ°æ®'); |
| | | this.resetData(); |
| | | }, |
| | | |
| | | |
| | | // åæ¶æé® |
| | | handleCancel() { |
| | | this.palletVisible = false; |
| | | }, |
| | | |
| | | |
| | | // 确认æé® |
| | | handleConfirm() { |
| | | async handleConfirm() { |
| | | if (!await this.validateForm()) return; |
| | | |
| | | if (this.materials.length === 0) { |
| | | this.$message.warning('请è³å°æ·»å ä¸ä¸ªç©æ'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (!this.trayBarcode) { |
| | | this.$message.warning('请è¾å
¥æçæ¡ç '); |
| | | return; |
| | | } |
| | | |
| | | |
| | | const result = { |
| | | warehouseType: this.form.warehouseType, |
| | | warehouseName: this.currentWarehouseName, |
| | | locationType: this.form.locationType, |
| | | locationDesc: this.currentLocationDesc, |
| | | trayBarcode: this.trayBarcode, |
| | | materials: this.materials, |
| | | docNo: this.docNo |
| | | }; |
| | | |
| | | |
| | | // 触åç¶ç»ä»¶ç back-success äºä»¶ |
| | | this.$emit('back-success', result); |
| | | this.palletVisible = false; |
| | | }, |
| | | // èç¦å°æçè¾å
¥æ¡ |
| | | focusTrayInput() { |
| | | if (this.$refs.trayInput && this.$refs.trayInput.$el) { |
| | | const inputEl = this.$refs.trayInput.$el.querySelector('input'); |
| | | if (inputEl) { |
| | | inputEl.focus(); |
| | | this.currentFocus = 'tray'; |
| | | this.scanTarget = 'tray'; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // èç¦å°ç©æè¾å
¥æ¡ |
| | | focusBarcodeInput() { |
| | | if (this.$refs.barcodeInput && this.$refs.barcodeInput.$el) { |
| | | const inputEl = this.$refs.barcodeInput.$el.querySelector('input'); |
| | | if (inputEl) { |
| | | inputEl.focus(); |
| | | this.currentFocus = 'material'; |
| | | this.scanTarget = 'material'; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // å¤çæçè¾å
¥ |
| | | handleTrayInput() { |
| | | // æ 记为æå¨è¾å
¥æ¨¡å¼ |
| | | this.isManualInput = true; |
| | | this.isScanning = false; |
| | | // å¤çæçè¾å
¥ |
| | | handleTrayInput() { |
| | | // æ 记为æå¨è¾å
¥æ¨¡å¼ |
| | | this.isManualInput = true; |
| | | this.isScanning = false; |
| | | |
| | | // æ¸
é¤ä¹åç计æ¶å¨ |
| | | if (this.manualInputTimer) { |
| | | clearTimeout(this.manualInputTimer); |
| | | } |
| | | |
| | | // 设置计æ¶å¨ï¼å¦æä¸æ®µæ¶é´å
没æè¾å
¥ï¼åé置为æ«ç æ¨¡å¼ |
| | | this.manualInputTimer = setTimeout(() => { |
| | | this.isManualInput = false; |
| | | }, 1000); |
| | | }, |
| | | |
| | | // å¤çç©æè¾å
¥ |
| | | handleBarcodeInput() { |
| | | // æ 记为æå¨è¾å
¥æ¨¡å¼ |
| | | this.isManualInput = true; |
| | | this.isScanning = false; |
| | | |
| | | // æ¸
é¤ä¹åç计æ¶å¨ |
| | | if (this.manualInputTimer) { |
| | | clearTimeout(this.manualInputTimer); |
| | | } |
| | | |
| | | // 设置计æ¶å¨ï¼å¦æä¸æ®µæ¶é´å
没æè¾å
¥ï¼åé置为æ«ç æ¨¡å¼ |
| | | this.manualInputTimer = setTimeout(() => { |
| | | this.isManualInput = false; |
| | | }, 1000); |
| | | }, |
| | | |
| | | // å¤çæçæ¡ç æäº¤ |
| | | async handleTraySubmit() { |
| | | // å
ç´æ¥æ£æ¥locationTypeï¼é¿å
表åéªè¯ç弿¥é®é¢ |
| | | if (!this.form.warehouseType) { |
| | | this.error = '请å
éæ©ä»åº'; |
| | | return; |
| | | } |
| | | if (!this.form.locationType) { |
| | | this.error = '请å
éæ©ä»åºåºå'; |
| | | //this.$message.warning('请å
éæ©ä»åºåºå'); |
| | | return; |
| | | } |
| | | |
| | | // ç¶ååè¿è¡å®æ´ç表åéªè¯ |
| | | if (!await this.validateForm()) return; |
| | | |
| | | const currentTrayBarcode = this.trayBarcode.trim(); |
| | | |
| | | if (!currentTrayBarcode) { |
| | | this.error = '请è¾å
¥ææ«ææçæ¡ç '; |
| | | return; |
| | | } |
| | | |
| | | this.error = ''; |
| | | |
| | | if(!this.trayBarcodeReg.test(currentTrayBarcode)){ |
| | | ElMessage.warning({ |
| | | message: 'æçå·æ ¼å¼é误', |
| | | type: 'warning', |
| | | duration: 3000 |
| | | }) |
| | | this.focusTrayInput(); |
| | | return; |
| | | } |
| | | |
| | | // 设置æçæ¡ç åï¼èªå¨èç¦å°ç©æè¾å
¥æ¡ |
| | | this.focusBarcodeInput(); |
| | | |
| | | this.$message({ |
| | | message: `æçæ¡ç 已设置: ${currentTrayBarcode}`, |
| | | type: 'success', |
| | | duration: 2000 |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
餿ç |
| | | clearTray() { |
| | | this.trayBarcode = ''; |
| | | this.materials = []; |
| | | this.focusTrayInput(); |
| | | this.$message({ |
| | | message: 'æçæ¡ç å·²æ¸
é¤', |
| | | type: 'info', |
| | | duration: 2000 |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
空æçè¾å
¥ |
| | | handleTrayClear() { |
| | | this.error = ''; |
| | | }, |
| | | |
| | | // æ¸
空è¾å
¥ |
| | | handleClear() { |
| | | this.error = ''; |
| | | this.scanCode = ''; |
| | | this.isManualInput = false; |
| | | this.isScanning = false; |
| | | }, |
| | | |
| | | |
| | | // å¤çç©ææ¡ç æäº¤ |
| | | async handleBarcodeSubmit() { |
| | | if (!await this.validateForm()) return; |
| | | const currentBarcode = this.barcode.trim(); |
| | | |
| | | if (!this.trayBarcode) { |
| | | this.error = '请å
è¾å
¥æçæ¡ç '; |
| | | this.focusTrayInput(); |
| | | return; |
| | | } |
| | | |
| | | if (!currentBarcode) { |
| | | this.error = '请è¾å
¥ææ«æç©ææ¡ç '; |
| | | return; |
| | | } |
| | | |
| | | this.focusBarcodeInput(); |
| | | this.error = ''; |
| | | this.loading = true; |
| | | |
| | | try { |
| | | // è°ç¨APIæ¥è¯¢ç©æä¿¡æ¯ |
| | | const materialData = await this.fetchMaterialData(currentBarcode); |
| | | if (!materialData || materialData.length === 0) { |
| | | |
| | | |
| | | return; |
| | | } |
| | | // æ£æ¥æ¯å¦å·²åå¨ç¸åç©æç¼ç çè®°å½ |
| | | const exists = this.materials.some(item => |
| | | item.barcode === this.trayBarcode |
| | | ); |
| | | console.log('API:', materialData) |
| | | if (exists) { |
| | | this.$message({ |
| | | message: '该æ¡ç å·²åå¨å½åæççå表ä¸', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }); |
| | | |
| | | // æ¸
é¤ä¹åç计æ¶å¨ |
| | | if (this.manualInputTimer) { |
| | | clearTimeout(this.manualInputTimer); |
| | | } |
| | | } else { |
| | | |
| | | materialData.forEach(item => { |
| | | |
| | | // 妿ä¸åå¨ï¼æ·»å æ°ç©æ |
| | | this.materials.push({ |
| | | ...item, |
| | | trayCode: this.trayBarcode, |
| | | locationType: this.form.locationType, |
| | | locationDesc: this.currentLocationDesc, |
| | | scanTime: this.formatTime(new Date()) |
| | | }); |
| | | }); |
| | | |
| | | // 设置计æ¶å¨ï¼å¦æä¸æ®µæ¶é´å
没æè¾å
¥ï¼åé置为æ«ç æ¨¡å¼ |
| | | this.manualInputTimer = setTimeout(() => { |
| | | this.isManualInput = false; |
| | | }, 1000); |
| | | }, |
| | | |
| | | // å¤çç©æè¾å
¥ |
| | | handleBarcodeInput() { |
| | | // æ 记为æå¨è¾å
¥æ¨¡å¼ |
| | | this.isManualInput = true; |
| | | this.isScanning = false; |
| | | |
| | | // æ¸
é¤ä¹åç计æ¶å¨ |
| | | if (this.manualInputTimer) { |
| | | clearTimeout(this.manualInputTimer); |
| | | } |
| | | |
| | | // 设置计æ¶å¨ï¼å¦æä¸æ®µæ¶é´å
没æè¾å
¥ï¼åé置为æ«ç æ¨¡å¼ |
| | | this.manualInputTimer = setTimeout(() => { |
| | | this.isManualInput = false; |
| | | }, 1000); |
| | | }, |
| | | |
| | | // å¤çæçæ¡ç æäº¤ |
| | | handleTraySubmit() { |
| | | const currentTrayBarcode = this.trayBarcode.trim(); |
| | | |
| | | if (!currentTrayBarcode) { |
| | | this.error = '请è¾å
¥ææ«ææçæ¡ç '; |
| | | return; |
| | | const removeIndex = this.unpalletMaterials.findIndex(item => item.barcode === currentBarcode); |
| | | if (removeIndex > -1) { |
| | | this.unpalletMaterials.splice(removeIndex, 1); // å 餿ªç»çå¯¹åºæ°æ® |
| | | this.unpalletBarcodes = this.unpalletMaterials.map(item => item.barcode || ''); // æ´æ°æ¡ç æ°ç» |
| | | this.totalStockCount = Math.max(0, this.totalStockCount - 1); |
| | | } |
| | | |
| | | this.error = ''; |
| | | |
| | | // 设置æçæ¡ç åï¼èªå¨èç¦å°ç©æè¾å
¥æ¡ |
| | | this.focusBarcodeInput(); |
| | | |
| | | this.$message({ |
| | | message: `æçæ¡ç 已设置: ${currentTrayBarcode}`, |
| | | message: `æåæ·»å æ¡ç : ${currentBarcode}`, |
| | | type: 'success', |
| | | duration: 2000 |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
餿ç |
| | | clearTray() { |
| | | this.trayBarcode = ''; |
| | | this.materials = []; |
| | | this.focusTrayInput(); |
| | | this.$message({ |
| | | message: 'æçæ¡ç å·²æ¸
é¤', |
| | | type: 'info', |
| | | duration: 2000 |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
空æçè¾å
¥ |
| | | handleTrayClear() { |
| | | this.error = ''; |
| | | }, |
| | | |
| | | // æ¸
空è¾å
¥ |
| | | handleClear() { |
| | | this.error = ''; |
| | | this.scanCode = ''; |
| | | this.isManualInput = false; |
| | | |
| | | this.fetchStockStatistics(); |
| | | // æ¸
ç©ºç©æè¾å
¥æ¡å¹¶ä¿æèç¦ |
| | | this.barcode = ''; |
| | | this.scanCode = ''; // æ¸
空æ«ç ç¼å |
| | | this.isScanning = false; |
| | | }, |
| | | |
| | | // å¤çç©ææ¡ç æäº¤ |
| | | async handleBarcodeSubmit() { |
| | | const currentBarcode = this.barcode.trim(); |
| | | |
| | | if (!this.trayBarcode) { |
| | | this.error = '请å
è¾å
¥æçæ¡ç '; |
| | | this.focusTrayInput(); |
| | | return; |
| | | } |
| | | |
| | | if (!currentBarcode) { |
| | | this.error = '请è¾å
¥ææ«æç©ææ¡ç '; |
| | | return; |
| | | } |
| | | |
| | | this.error = ''; |
| | | this.loading = true; |
| | | setTimeout(() => { |
| | | this.focusBarcodeInput(); |
| | | }, 100); |
| | | } |
| | | } catch (err) { |
| | | this.error = err.message || 'æ¥è¯¢æ¡ç ä¿¡æ¯å¤±è´¥ï¼è¯·éè¯'; |
| | | this.focusBarcodeInput(); |
| | | setTimeout(() => { |
| | | // éä¸è¾å
¥æ¡å
çé误å
容ï¼ç¡®ä¿focus宿忧è¡ï¼ |
| | | const inputEl = this.$refs.barcodeInput?.$el?.querySelector('input'); |
| | | if (inputEl) inputEl.select(); |
| | | }, 100); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | try { |
| | | // è°ç¨APIæ¥è¯¢ç©æä¿¡æ¯ |
| | | const materialData = await this.fetchMaterialData(currentBarcode); |
| | | if (!materialData || materialData.length === 0) { |
| | | |
| | | |
| | | return; |
| | | } |
| | | // æ£æ¥æ¯å¦å·²åå¨ç¸åç©æç¼ç çè®°å½ |
| | | const exists = this.materials.some(item => |
| | | item.barcode === this.trayBarcode |
| | | ); |
| | | console.log('API:',materialData) |
| | | if (exists) { |
| | | this.$message({ |
| | | message: '该æ¡ç å·²åå¨å½åæççå表ä¸', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }); |
| | | } else { |
| | | |
| | | materialData.forEach(item => { |
| | | |
| | | // 妿ä¸åå¨ï¼æ·»å æ°ç©æ |
| | | this.materials.push({ |
| | | ...item, |
| | | trayCode: this.trayBarcode, |
| | | scanTime: this.formatTime(new Date()) |
| | | }); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | this.$message({ |
| | | message: `æåæ·»å æ¡ç : ${currentBarcode}`, |
| | | type: 'success', |
| | | duration: 2000 |
| | | }); |
| | | |
| | | |
| | | // æ¸
ç©ºç©æè¾å
¥æ¡å¹¶ä¿æèç¦ |
| | | this.barcode = ''; |
| | | this.scanCode = ''; // æ¸
空æ«ç ç¼å |
| | | this.isScanning = false; |
| | | |
| | | setTimeout(() => { |
| | | this.focusBarcodeInput(); |
| | | }, 100); |
| | | } |
| | | } catch (err) { |
| | | this.error = err.message || 'æ¥è¯¢æ¡ç ä¿¡æ¯å¤±è´¥ï¼è¯·éè¯'; |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | |
| | | // APIè¯·æ± - æ¿æ¢ä¸ºå®é
çAPIè°ç¨ |
| | | async fetchMaterialData(barcode) { |
| | | try { |
| | | const response = await http.post('/api/InboundOrder/BarcodeMaterielGroup', |
| | | { |
| | | // APIè¯·æ± - æ¿æ¢ä¸ºå®é
çAPIè°ç¨ |
| | | async fetchMaterialData(barcode) { |
| | | try { |
| | | const response = await http.post('/api/InboundOrder/BarcodeMaterielGroup', |
| | | { |
| | | palletCode: this.trayBarcode, |
| | | orderNo: this.docNo, |
| | | barcodes: barcode |
| | | } |
| | | barcodes: barcode, |
| | | locationTypeDesc: this.currentLocationDesc, |
| | | locationType: this.form.locationType, // æ·»å ä»åºåºåä¿¡æ¯ |
| | | warehouseType: this.form.warehouseType |
| | | } |
| | | ); |
| | | |
| | | |
| | | |
| | | |
| | | let materialData; |
| | | |
| | | |
| | | if (typeof response.data === 'string') { |
| | | |
| | | |
| | | try { |
| | | materialData = JSON.parse(response.data); |
| | | } catch (e) { |
| | | |
| | | |
| | | } |
| | | } else { |
| | | // 妿è¿åçæ¯JSON对象ï¼ç´æ¥ä½¿ç¨ |
| | | materialData = response.data; |
| | | } |
| | | if(!response.status){ |
| | | this.error = response.message || 'æ¥è¯¢æ¡ç ä¿¡æ¯å¤±è´¥ï¼è¯·éè¯'; |
| | | } |
| | | // ç¡®ä¿è¿åçæ°æ®å
嫿æå¿
éçåæ®µ |
| | | return materialData; |
| | | |
| | | if (!response.status) { |
| | | this.error = response.message || 'æ¥è¯¢æ¡ç ä¿¡æ¯å¤±è´¥ï¼è¯·éè¯'; |
| | | } |
| | | |
| | | return materialData; |
| | | |
| | | } catch (error) { |
| | | console.error('APIè°ç¨å¤±è´¥:', error); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | }, |
| | | |
| | | // å¤çæ«ç æªè¾å
¥ |
| | | handleKeyPress(event) { |
| | | // å¦ææ¯æå¨è¾å
¥æ¨¡å¼ï¼ä¸å¤çæ«ç æªé»è¾ |
| | | if (this.isManualInput) { |
| | | return; |
| | | }, |
| | | |
| | | // å¤çæ«ç æªè¾å
¥ |
| | | handleKeyPress(event) { |
| | | // å¦ææ¯æå¨è¾å
¥æ¨¡å¼ï¼ä¸å¤çæ«ç æªé»è¾ |
| | | if (this.isManualInput) { |
| | | return; |
| | | } |
| | | |
| | | const key = event.key; |
| | | const currentTime = new Date().getTime(); |
| | | |
| | | // 忽ç¥ç´æ¥æä¸çå车é®ï¼ç±handleBarcodeSubmitå¤çï¼ |
| | | if (key === 'Enter') { |
| | | if (this.scanCode.length > 0) { |
| | | // 黿¢é»è®¤å车è¡ä¸ºï¼é¿å
表åæäº¤ |
| | | event.preventDefault(); |
| | | |
| | | // æ«ç 宿ï¼èªå¨è§¦åæ¥è¯¢ |
| | | this.isScanning = false; |
| | | |
| | | // æ ¹æ®å½åæ«ç ç®æ 设置ç¸åºçè¾å
¥æ¡å¼ |
| | | if (this.scanTarget === 'tray') { |
| | | this.trayBarcode = this.scanCode; |
| | | this.handleTraySubmit(); |
| | | } else if (this.scanTarget === 'material') { |
| | | this.barcode = this.scanCode; |
| | | this.handleBarcodeSubmit(); |
| | | } |
| | | |
| | | const key = event.key; |
| | | const currentTime = new Date().getTime(); |
| | | |
| | | // 忽ç¥ç´æ¥æä¸çå车é®ï¼ç±handleBarcodeSubmitå¤çï¼ |
| | | if (key === 'Enter') { |
| | | if (this.scanCode.length > 0) { |
| | | // 黿¢é»è®¤å车è¡ä¸ºï¼é¿å
表åæäº¤ |
| | | event.preventDefault(); |
| | | |
| | | // æ«ç 宿ï¼èªå¨è§¦åæ¥è¯¢ |
| | | this.isScanning = false; |
| | | |
| | | // æ ¹æ®å½åæ«ç ç®æ 设置ç¸åºçè¾å
¥æ¡å¼ |
| | | if (this.scanTarget === 'tray') { |
| | | this.trayBarcode = this.scanCode; |
| | | this.handleTraySubmit(); |
| | | } else if (this.scanTarget === 'material') { |
| | | this.barcode = this.scanCode; |
| | | this.handleBarcodeSubmit(); |
| | | } |
| | | } |
| | | this.scanCode = ''; |
| | | this.lastKeyTime = null; |
| | | return; |
| | | } |
| | | |
| | | // æå»ºæ«ç å
容ï¼å¿«éè¿ç»è¾å
¥è§ä¸ºæ«ç ï¼ |
| | | if (this.lastKeyTime && currentTime - this.lastKeyTime < 50) { |
| | | this.scanCode += key; |
| | | this.isScanning = true; |
| | | } else { |
| | | this.scanCode = key; |
| | | this.isScanning = true; |
| | | } |
| | | |
| | | // 设置计æ¶å¨ï¼å¦æä¸æ®µæ¶é´å
没æè¾å
¥ï¼åéç½®æ«æç¶æ |
| | | if (this.scanTimer) { |
| | | clearTimeout(this.scanTimer); |
| | | } |
| | | this.scanTimer = setTimeout(() => { |
| | | this.isScanning = false; |
| | | }, 100); |
| | | |
| | | this.lastKeyTime = currentTime; |
| | | }, |
| | | |
| | | // å é¤ç©æ |
| | | removeMaterial(index) { |
| | | this.$confirm('ç¡®å®è¦å é¤è¿æ¡ç©æè®°å½å?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.materials.splice(index, 1); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å 餿å!' |
| | | }); |
| | | }).catch(() => { |
| | | // åæ¶å é¤ |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
空ææç©æ |
| | | clearAllMaterials() { |
| | | if (this.materials.length === 0) return; |
| | | |
| | | this.$confirm('ç¡®å®è¦æ¸
空ææç©æè®°å½å?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.materials = []; |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å·²æ¸
空ææè®°å½!' |
| | | }); |
| | | }).catch(() => { |
| | | // åæ¶æ¸
空 |
| | | }); |
| | | }, |
| | | |
| | | // æ ¼å¼åæ¶é´ |
| | | formatTime(date) { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | const hours = String(date.getHours()).padStart(2, '0'); |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); |
| | | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | this.scanCode = ''; |
| | | this.lastKeyTime = null; |
| | | return; |
| | | } |
| | | |
| | | // æå»ºæ«ç å
容ï¼å¿«éè¿ç»è¾å
¥è§ä¸ºæ«ç ï¼ |
| | | if (this.lastKeyTime && currentTime - this.lastKeyTime < 50) { |
| | | this.scanCode += key; |
| | | this.isScanning = true; |
| | | } else { |
| | | this.scanCode = key; |
| | | this.isScanning = true; |
| | | } |
| | | |
| | | // 设置计æ¶å¨ï¼å¦æä¸æ®µæ¶é´å
没æè¾å
¥ï¼åéç½®æ«æç¶æ |
| | | if (this.scanTimer) { |
| | | clearTimeout(this.scanTimer); |
| | | } |
| | | this.scanTimer = setTimeout(() => { |
| | | this.isScanning = false; |
| | | }, 100); |
| | | |
| | | this.lastKeyTime = currentTime; |
| | | }, |
| | | |
| | | // å é¤ç©æ |
| | | removeMaterial(index) { |
| | | this.$confirm('ç¡®å®è¦å é¤è¿æ¡ç©æè®°å½å?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.materials.splice(index, 1); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å 餿å!' |
| | | }); |
| | | this.fetchStockStatistics(); |
| | | |
| | | }).catch(() => { |
| | | // åæ¶å é¤ |
| | | }); |
| | | }, |
| | | |
| | | // æ¸
空ææç©æ |
| | | clearAllMaterials() { |
| | | if (this.materials.length === 0) return; |
| | | |
| | | this.$confirm('ç¡®å®è¦æ¸
空ææç©æè®°å½å?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.materials = []; |
| | | this.$message({ |
| | | type: 'success', |
| | | message: 'å·²æ¸
空ææè®°å½!' |
| | | }); |
| | | }).catch(() => { |
| | | // åæ¶æ¸
空 |
| | | }); |
| | | }, |
| | | |
| | | // æ ¼å¼åæ¶é´ |
| | | formatTime(date) { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | const hours = String(date.getHours()).padStart(2, '0'); |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); |
| | | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .barcode-scanner-container { |
| | | max-width: 1200px; |
| | | margin: 0 auto; |
| | | padding: 20px; |
| | | } |
| | | .page-title { |
| | | text-align: center; |
| | | margin-bottom: 30px; |
| | | } |
| | | .input-section { |
| | | margin-bottom: 30px; |
| | | } |
| | | .scan-status { |
| | | float: right; |
| | | font-size: 12px; |
| | | color: #67C23A; |
| | | } |
| | | .scan-indicator { |
| | | display: inline-block; |
| | | width: 10px; |
| | | height: 10px; |
| | | border-radius: 50%; |
| | | background-color: #67C23A; |
| | | margin-right: 5px; |
| | | animation: pulse 1.5s infinite; |
| | | } |
| | | @keyframes pulse { |
| | | 0% { opacity: 1; } |
| | | 50% { opacity: 0.4; } |
| | | 100% { opacity: 1; } |
| | | } |
| | | .input-wrapper { |
| | | position: relative; |
| | | margin-bottom: 15px; |
| | | } |
| | | .input-tips { |
| | | margin-top: 10px; |
| | | font-size: 12px; |
| | | color: #909399; |
| | | } |
| | | .loading { |
| | | text-align: center; |
| | | margin: 20px 0; |
| | | } |
| | | .loading p { |
| | | margin-top: 10px; |
| | | color: #409EFF; |
| | | } |
| | | .error-message { |
| | | margin-bottom: 20px; |
| | | } |
| | | .material-list { |
| | | margin-top: 30px; |
| | | } |
| | | .list-actions { |
| | | float: right; |
| | | } |
| | | .clear-all-btn { |
| | | margin-left: 10px; |
| | | } |
| | | .empty-state { |
| | | text-align: center; |
| | | padding: 40px 0; |
| | | color: #909399; |
| | | } |
| | | .empty-state i { |
| | | font-size: 48px; |
| | | margin-bottom: 10px; |
| | | } |
| | | .material-code { |
| | | font-family: 'Courier New', monospace; |
| | | font-weight: bold; |
| | | color: #409EFF; |
| | | } |
| | | .tray-info { |
| | | background: #f0f9ff; |
| | | padding: 10px 15px; |
| | | border-radius: 4px; |
| | | margin-bottom: 15px; |
| | | border-left: 4px solid #409EFF; |
| | | } |
| | | .debug-info { |
| | | background: #f5f7fa; |
| | | padding: 10px; |
| | | border-radius: 4px; |
| | | margin-top: 10px; |
| | | font-size: 12px; |
| | | color: #909399; |
| | | } |
| | | .small-button { |
| | | padding: 7px 9px; |
| | | font-size: 12px; |
| | | } |
| | | .barcode-scanner-container { |
| | | max-width: 1200px; |
| | | margin: 0 auto; |
| | | padding: 10px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | gap: 8px; |
| | | } |
| | | |
| | | /* ç´§åå¸å±æ ·å¼ */ |
| | | .compact { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .compact-form { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .compact-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .compact-card { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .compact-card>>>.el-card__body { |
| | | padding: 12px; |
| | | } |
| | | |
| | | .compact-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | .compact-header>>>.el-card__header { |
| | | padding: 8px 12px; |
| | | } |
| | | |
| | | .compact-input { |
| | | margin: 8px 0; |
| | | } |
| | | |
| | | .compact-tips { |
| | | margin-top: 8px; |
| | | font-size: 11px; |
| | | } |
| | | |
| | | /* ä»åºåºåéæ© - ç´§å */ |
| | | .location-section.compact { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .location-section.compact>>>.el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | /* æçä¿¡æ¯ - ç´§å */ |
| | | .tray-info.compact { |
| | | padding: 6px 10px; |
| | | margin-bottom: 8px; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | /* æ«ç åºå - ç´§å */ |
| | | .input-section.compact { |
| | | margin-bottom: 8px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | /* ç©æå表 - åºå®é«åº¦å¸¦æ»å¨ */ |
| | | .material-list.compact { |
| | | flex: 1; |
| | | min-height: 0; |
| | | /* éè¦ï¼å
许flexå项æ¶ç¼© */ |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .material-list.compact>>>.el-card { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100%; |
| | | } |
| | | |
| | | .material-list.compact>>>.el-card__body { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | padding: 0; |
| | | min-height: 0; |
| | | } |
| | | |
| | | .table-container { |
| | | flex: 1; |
| | | min-height: 0; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .material-list.compact>>>.el-table { |
| | | flex: 1; |
| | | } |
| | | |
| | | .material-list.compact>>>.el-table__body-wrapper { |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | /* ç´§åçç©ºç¶æ */ |
| | | .empty-state.compact { |
| | | padding: 20px 0; |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .empty-state.compact i { |
| | | font-size: 36px; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .empty-state.compact p { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | /* å
¶ä»åææ ·å¼è°æ´ */ |
| | | .page-title { |
| | | text-align: center; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .scan-status { |
| | | font-size: 12px; |
| | | color: #67C23A; |
| | | } |
| | | |
| | | .scan-indicator { |
| | | display: inline-block; |
| | | width: 8px; |
| | | height: 8px; |
| | | border-radius: 50%; |
| | | background-color: #67C23A; |
| | | margin-right: 5px; |
| | | animation: pulse 1.5s infinite; |
| | | } |
| | | |
| | | @keyframes pulse { |
| | | 0% { |
| | | opacity: 1; |
| | | } |
| | | |
| | | 50% { |
| | | opacity: 0.4; |
| | | } |
| | | |
| | | 100% { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | |
| | | .input-wrapper { |
| | | position: relative; |
| | | } |
| | | |
| | | .input-tips { |
| | | margin-top: 6px; |
| | | color: #909399; |
| | | } |
| | | |
| | | .warning-text { |
| | | color: #E6A23C; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .loading.compact { |
| | | text-align: center; |
| | | margin: 10px 0; |
| | | padding: 5px; |
| | | } |
| | | |
| | | .loading.compact p { |
| | | margin-top: 5px; |
| | | color: #409EFF; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .error-message.compact { |
| | | margin: 5px 0; |
| | | } |
| | | |
| | | .error-message.compact>>>.el-alert { |
| | | padding: 6px 12px; |
| | | } |
| | | |
| | | .list-actions { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 4px; |
| | | } |
| | | |
| | | .list-actions>>>.el-tag { |
| | | height: 24px; |
| | | line-height: 22px; |
| | | padding: 0 6px; |
| | | } |
| | | |
| | | .clear-all-btn { |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | .material-code { |
| | | font-family: 'Courier New', monospace; |
| | | font-weight: bold; |
| | | color: #409EFF; |
| | | } |
| | | |
| | | .location-info { |
| | | color: #606266; |
| | | font-weight: normal; |
| | | } |
| | | |
| | | .debug-info { |
| | | background: #f5f7fa; |
| | | padding: 8px; |
| | | border-radius: 4px; |
| | | margin-top: 8px; |
| | | font-size: 11px; |
| | | color: #909399; |
| | | } |
| | | |
| | | .small-button { |
| | | padding: 6px 8px; |
| | | font-size: 11px; |
| | | } |
| | | |
| | | /* è¾å
¥æ¡ç»æ ·å¼è°æ´ */ |
| | | .custom-input-group { |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | margin: 20px 0; |
| | | margin: 8px 0; |
| | | border: 1px solid #DCDFE6; |
| | | border-radius: 4px; |
| | | overflow: hidden; |
| | |
| | | } |
| | | |
| | | .input-label { |
| | | padding: 0 15px; |
| | | padding: 0 12px; |
| | | background: #F5F7FA; |
| | | border-right: 1px solid #DCDFE6; |
| | | color: #606266; |
| | | font-size: 14px; |
| | | font-size: 13px; |
| | | white-space: nowrap; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | height: 36px; |
| | | line-height: 36px; |
| | | flex-shrink: 0; |
| | | min-width: 70px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .input-container { |
| | |
| | | flex: 1; |
| | | } |
| | | |
| | | .custom-input ::v-deep .el-input__inner { |
| | | .custom-input>>>.el-input__inner { |
| | | border: none; |
| | | border-radius: 0; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | height: 36px; |
| | | line-height: 36px; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | |
| | | /* ååºå¼è°æ´ */ |
| | | @media (max-width: 768px) { |
| | | .barcode-scanner-container { |
| | | padding: 5px; |
| | | } |
| | | |
| | | .custom-input-group { |
| | | flex-direction: column; |
| | | border: none; |
| | | } |
| | | |
| | | .input-label { |
| | | width: 100%; |
| | | border-right: none; |
| | | border-bottom: 1px solid #DCDFE6; |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | .input-container { |
| | | width: 100%; |
| | | border: 1px solid #DCDFE6; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .unpallet-section.compact { |
| | | margin-bottom: 8px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .unpallet-card { |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .unpallet-barcode-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 6px; |
| | | padding: 8px 0; |
| | | max-height: 180px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .unpallet-barcode-list>>>.el-tag { |
| | | cursor: pointer; |
| | | max-width: calc(33.333% - 4px); |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .unpallet-barcode-list>>>.el-tag { |
| | | max-width: calc(50% - 4px); |
| | | } |
| | | } |
| | | } |
| | | </style> |