| | |
| | | <template> |
| | | <vol-box |
| | | v-model="groupPalletVisible" |
| | | :title="'ç»çæä½ - åæ®å·ï¼' + currentDocNo" |
| | | :height="1000" |
| | | :width="1100" |
| | | :padding="20" |
| | | :modal="true" |
| | | |
| | | @open="handleDialogOpen" |
| | | @close="handleDialogClose" |
| | | > |
| | | <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 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 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 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 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" |
| | | > |
| | | <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" |
| | | :disabled="!form.locationType || !trayBarcode || !form.warehouseType" |
| | | size="medium" |
| | | > |
| | | <el-button @click="handleTraySubmit" type="primary" icon="el-icon-position" |
| | | :disabled="!form.locationType || !trayBarcode || !form.warehouseType" size="medium"> |
| | | 确认 |
| | | </el-button> |
| | | </template> |
| | |
| | | <!-- ç©ææ¡ç è¾å
¥ --> |
| | | <div class="input-wrapper custom-input-group compact-input"> |
| | | <div class="input-label">ç©ææ¡ç </div> |
| | | <el-input |
| | | ref="barcodeInput" |
| | | v-model="barcode" |
| | | placeholder="è¯·æ«ææè¾å
¥ç©ææ¡ç åæå车é®" |
| | | clearable |
| | | <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" |
| | | > |
| | | @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="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" |
| | | size="medium" |
| | | > |
| | | <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> |
| | |
| | | |
| | | <!-- é误æç¤º --> |
| | | <div v-if="error" class="error-message compact"> |
| | | <el-alert |
| | | :title="error" |
| | | type="error" |
| | | show-icon |
| | | closable |
| | | @close="error = ''" |
| | | /> |
| | | <el-alert :title="error" type="error" show-icon closable @close="error = ''" /> |
| | | </div> |
| | | |
| | | <!-- ç©æå表 - åºå®é«åº¦å¸¦æ»å¨æ¡ --> |
| | |
| | | </div> |
| | | |
| | | <div class="table-container" v-else> |
| | | <el-table |
| | | :data="materials" |
| | | stripe |
| | | style="width: 100%" |
| | | height="100%" |
| | | size="small" |
| | | > |
| | | <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> |
| | |
| | | inputEl.focus(); |
| | | this.currentFocus = 'material'; |
| | | this.scanTarget = 'material'; |
| | | |
| | | |
| | | inputEl.select(); |
| | | console.log('ç©æè¾å
¥æ¡å
容已éä¸'); |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | // éç½®æææ°æ® |
| | | resetData() { |
| | | console.log('éç½®å¼¹æ¡æ°æ®'); |
| | |
| | | this.isScanning = false; |
| | | }, |
| | | |
| | | |
| | | // å¤çç©ææ¡ç æäº¤ |
| | | async handleBarcodeSubmit() { |
| | | if (!await this.validateForm()) return; |
| | |
| | | return; |
| | | } |
| | | |
| | | this.focusBarcodeInput(); |
| | | this.error = ''; |
| | | this.loading = true; |
| | | |
| | |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }); |
| | | |
| | | } else { |
| | | |
| | | materialData.forEach(item => { |
| | |
| | | scanTime: this.formatTime(new Date()) |
| | | }); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | this.$message({ |
| | | message: `æåæ·»å æ¡ç : ${currentBarcode}`, |
| | |
| | | } |
| | | } 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; |
| | | } |
| | |
| | | /* ç©æå表 - åºå®é«åº¦å¸¦æ»å¨ */ |
| | | .material-list.compact { |
| | | flex: 1; |
| | | min-height: 0; /* éè¦ï¼å
许flexå项æ¶ç¼© */ |
| | | min-height: 0; |
| | | /* éè¦ï¼å
许flexå项æ¶ç¼© */ |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | |
| | | } |
| | | |
| | | @keyframes pulse { |
| | | 0% { opacity: 1; } |
| | | 50% { opacity: 0.4; } |
| | | 100% { opacity: 1; } |
| | | 0% { |
| | | opacity: 1; |
| | | } |
| | | |
| | | 50% { |
| | | opacity: 0.4; |
| | | } |
| | | |
| | | 100% { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | |
| | | .input-wrapper { |