| | |
| | | import { h,createVNode, render,reactive,ref } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect ,ElOption } from 'element-plus'; // å¼å
¥ElMessageï¼è§£å³æç¤ºæ ååº |
| | | import gridBody from './extend/allocateOrderDetail.vue' |
| | | import gridHeader from './extend/Pallet.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridHeader:gridHeader, |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ |
| | | { |
| | | name: 'ç»ç', |
| | | type: 'primary', |
| | | value: 'ç»ç', |
| | | onClick: function () { // ä¿®å¤1ï¼ç§»é¤æ ç¨rowåæ°ï¼å æ¥å¿è°è¯ |
| | | console.log('ç»çæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | // { |
| | | // name: 'ç»ç', |
| | | // type: 'primary', |
| | | // value: 'ç»ç', |
| | | // onClick: function () { // ä¿®å¤1ï¼ç§»é¤æ ç¨rowåæ°ï¼å æ¥å¿è°è¯ |
| | | // console.log('ç»çæé®è¢«ç¹å»ï¼å¼å§æ ¡éª'); |
| | | // const selectedRows = this.$refs.table.getSelected(); |
| | | |
| | | // æ ¡éª1ï¼æ¯å¦éä¸è¡ |
| | | if (selectedRows.length === 0) { |
| | | console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | ElMessage.warning('è¯·éæ©ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | // æ ¡éª2ï¼æ¯å¦éä¸åè¡ |
| | | if (selectedRows.length > 1) { |
| | | console.log('æ ¡éªä¸éè¿ï¼éä¸å¤è¡åæ®'); |
| | | ElMessage.warning('åªè½éæ©ä¸æ¡åæ®'); |
| | | return; |
| | | } |
| | | // // æ ¡éª1ï¼æ¯å¦éä¸è¡ |
| | | // if (selectedRows.length === 0) { |
| | | // console.log('æ ¡éªä¸éè¿ï¼æªéä¸ä»»ä½åæ®'); |
| | | // ElMessage.warning('è¯·éæ©ä¸æ¡åæ®'); |
| | | // return; |
| | | // } |
| | | // // æ ¡éª2ï¼æ¯å¦éä¸åè¡ |
| | | // if (selectedRows.length > 1) { |
| | | // console.log('æ ¡éªä¸éè¿ï¼éä¸å¤è¡åæ®'); |
| | | // ElMessage.warning('åªè½éæ©ä¸æ¡åæ®'); |
| | | // return; |
| | | // } |
| | | |
| | | const targetRow = selectedRows[0]; |
| | | // const targetRow = selectedRows[0]; |
| | | |
| | | this.$emit('openPalletDialog', targetRow.orderNo); |
| | | } |
| | | }, |
| | | // this.$emit('openPalletDialog', targetRow.orderNo); |
| | | // } |
| | | // }, |
| | | { |
| | | name: 'æ¤éç»ç', |
| | | type: 'primary', |
| | |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | |
| | | var GroupPalletBtn = this.buttons.find(x => x.value == "GroupPallet"); |
| | | if (GroupPalletBtn != null) { |
| | | GroupPalletBtn.onClick = () => { |
| | | // console.log(this.$refs) |
| | | this.$refs.gridHeader.open(); |
| | | } |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | onInited() { |
| | | |
| | | //æ¡æ¶åå§åé
ç½®å |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vol-box v-model="show" :title="'ç»çæä½ - åæ®å·ï¼' + orderNo" :height="1000" :width="1100" :padding="20" :modal="true"> |
| | | <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="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> |
| | | {{ form.locationType && form.warehouseType ? 'æ«ç 就绪' : '请å
éæ©ä»åºåä»åºåºå' }} |
| | | </span> |
| | | </div> |
| | | |
| | | <!-- æçæ¡ç è¾å
¥ --> |
| | | <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" |
| | | :disabled="!form.locationType || !trayBarcode || !form.warehouseType" size="medium"> |
| | | 确认 |
| | | </el-button> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | |
| | | <!-- ç©ææ¡ç è¾å
¥ --> |
| | | <div class="input-wrapper custom-input-group compact-input"> |
| | | <div class="input-label">ç©ææ¡ç </div> |
| | | <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="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" size="medium"> |
| | | {{ loading ? 'æ¥è¯¢ä¸...' : 'æ¥è¯¢' }} |
| | | </el-button> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | |
| | | <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 compact"> |
| | | <el-progress :percentage="100" status="success" :show-text="false" /> |
| | | <p>æ£å¨æ¥è¯¢ç©æä¿¡æ¯...</p> |
| | | </div> |
| | | |
| | | <!-- é误æç¤º --> |
| | | <div v-if="error" class="error-message compact"> |
| | | <el-alert :title="error" type="error" show-icon closable @close="error = ''" /> |
| | | </div> |
| | | |
| | | <!-- æªç»çå表 --> |
| | | <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" size="small">æªç»ç {{ totalStockCount }}</el-tag> |
| | | </span> |
| | | </div> |
| | | |
| | | |
| | | <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="!form.warehouseType">请å
éæ©ä»åº</p> |
| | | <p v-if="!form.locationType">请å
éæ©ä»åºåºå</p> |
| | | <p v-else-if="!trayBarcode">请å
è¾å
¥æç®±æ¡ç </p> |
| | | <p v-else>ææ ç©ææ°æ®ï¼è¯·æ«ææè¾å
¥ç©ææ¡ç </p> |
| | | </div> |
| | | |
| | | <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> |
| | | <template #footer> |
| | | <el-button type="danger" size="small" @click="handleDialogClose()">å
³é</el-button> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | <script> |
| | | import http from '@/api/http.js'; |
| | | import VolBox from '@/components/basic/VolBox.vue'; |
| | | |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | show: false, |
| | | orderNo: "", |
| | | 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: { |
| | | // å½åéæ©çä»åºåç§° |
| | | 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.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.fetchUnpalletMaterialDetails(); |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | document.addEventListener('keypress', this.handleKeyPress); |
| | | }, |
| | | beforeDestroy() { |
| | | document.removeEventListener('keypress', this.handleKeyPress); |
| | | this.clearAllTimers(); |
| | | }, |
| | | methods: { |
| | | open() { |
| | | this.show = true; |
| | | this.orderNo = ""; |
| | | this.resetData(); |
| | | this.initLocationTypes(); |
| | | this.initwarehouseTypes(); |
| | | this.fetchUnpalletMaterialDetails(); |
| | | }, |
| | | validateLocationType(rule, value, callback) { |
| | | if (!this.form.warehouseType) { |
| | | callback(new Error('请å
éæ©ä»åº')); |
| | | } else if (value === null || value === undefined || value === '') { |
| | | callback(new Error('è¯·éæ©ä»åºåºå')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | |
| | | // æ ¹æ®æ¡ç å表è·åè¯¦ç»æ°æ® |
| | | async fetchUnpalletMaterialDetails() { |
| | | try { |
| | | const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo=' + this.orderNo, {}); |
| | | 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 { |
| | | this.unpalletMaterials = []; |
| | | } |
| | | } catch (err) { |
| | | this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({ |
| | | barcode: barcode, |
| | | materielCode: '-', |
| | | batchNo: '-', |
| | | stockQuantity: '-', |
| | | unit: '-', |
| | | supplyCode: '-', |
| | | warehouseType: '-' |
| | | })); |
| | | } |
| | | }, |
| | | async initLocationTypes() { |
| | | try { |
| | | const { data } = await this.http.post("api/LocationInfo/GetLocationTypes") |
| | | this.locationTypes = data |
| | | } catch (e) { |
| | | this.$message.error('è·ååºåç±»å失败') |
| | | } |
| | | }, |
| | | async initwarehouseTypes() { |
| | | try { |
| | | const { data } = await this.http.post("api/Warehouse/GetwarehouseTypes") |
| | | this.warehouseTypes = data |
| | | } catch (e) { |
| | | this.$message.error('è·ååºåç±»å失败') |
| | | } |
| | | }, |
| | | |
| | | async fetchStockStatistics(orderNo) { |
| | | // åæ®å·ä¸ºç©ºæ¶ä¸æ¥è¯¢ |
| | | if (!orderNo) { |
| | | this.sumError = 'åæ®å·ä¸ºç©ºï¼æ æ³ç»è®¡'; |
| | | return; |
| | | } |
| | | |
| | | this.sumLoading = true; |
| | | this.sumError = ''; |
| | | try { |
| | | const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo=' + orderNo, {}); |
| | | 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; |
| | | } 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 { |
| | | if (!this.from.warehouseType) { |
| | | this.error = '请å
éæ©ä»åº'; |
| | | } |
| | | else if (this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') { |
| | | this.error = '请å
éæ©ä»åºåºå'; |
| | | } else { |
| | | this.error = 'è¯·æ£æ¥è¡¨å填忝妿£ç¡®'; |
| | | } |
| | | resolve(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'; |
| | | 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(); |
| | | } |
| | | } |
| | | }, |
| | | // éç½®æææ°æ® |
| | | resetData() { |
| | | 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 = '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) { |
| | | clearTimeout(this.manualInputTimer); |
| | | this.manualInputTimer = null; |
| | | } |
| | | if (this.scanTimer) { |
| | | clearTimeout(this.scanTimer); |
| | | this.scanTimer = null; |
| | | } |
| | | }, |
| | | handleDialogClose() { |
| | | this.show = false; |
| | | this.resetData(); |
| | | }, |
| | | |
| | | // 确认æé® |
| | | 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; |
| | | }, |
| | | // å¤çæçè¾å
¥ |
| | | 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.$message("æçå·æ ¼å¼é误"); |
| | | this.focusTrayInput(); |
| | | return; |
| | | } |
| | | |
| | | // 设置æçæ¡ç åï¼èªå¨èç¦å°ç©æè¾å
¥æ¡ |
| | | this.focusBarcodeInput(); |
| | | |
| | | // this.$message({ |
| | | // message: `æçæ¡ç 已设置: ${currentTrayBarcode}`, |
| | | // type: 'success', |
| | | // duration: 2000 |
| | | // }); |
| | | this.$message.success(`æçæ¡ç 已设置: ${currentTrayBarcode}`); |
| | | }, |
| | | |
| | | // æ¸
餿ç |
| | | 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; |
| | | } |
| | | |
| | | this.materials = []; |
| | | materialData.forEach(item => { |
| | | this.materials.push({ |
| | | ...item, |
| | | trayCode: this.trayBarcode, |
| | | locationType: this.form.locationType, |
| | | locationDesc: this.currentLocationDesc, |
| | | scanTime: this.formatTime(new Date()) |
| | | }); |
| | | }); |
| | | this.orderNo = materialData[0].orderNo; |
| | | await this.fetchStockStatistics(materialData[0].orderNo); |
| | | await this.fetchUnpalletMaterialDetails(); |
| | | // æ¸
ç©ºç©æè¾å
¥æ¡å¹¶ä¿æèç¦ |
| | | this.barcode = ''; |
| | | this.scanCode = ''; // æ¸
空æ«ç ç¼å |
| | | this.isScanning = false; |
| | | |
| | | 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; |
| | | } |
| | | }, |
| | | |
| | | // APIè¯·æ± - æ¿æ¢ä¸ºå®é
çAPIè°ç¨ |
| | | async fetchMaterialData(barcode) { |
| | | try { |
| | | const response = await http.post('/api/Inbound/GroupPallet', |
| | | { |
| | | palletCode: this.trayBarcode, |
| | | barcode: 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 { |
| | | materialData = response.data; |
| | | } |
| | | if (!response.status) { |
| | | this.error = response.message || 'æ¥è¯¢æ¡ç ä¿¡æ¯å¤±è´¥ï¼è¯·éè¯'; |
| | | } |
| | | |
| | | return materialData; |
| | | |
| | | } catch (error) { |
| | | console.error('APIè°ç¨å¤±è´¥:', error); |
| | | } |
| | | }, |
| | | |
| | | // å¤çæ«ç æªè¾å
¥ |
| | | 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(); |
| | | } |
| | | } |
| | | 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; |
| | | }, |
| | | |
| | | // æ ¼å¼åæ¶é´ |
| | | 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: 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: 8px 0; |
| | | border: 1px solid #DCDFE6; |
| | | border-radius: 4px; |
| | | overflow: hidden; |
| | | background: #fff; |
| | | } |
| | | |
| | | .input-label { |
| | | padding: 0 12px; |
| | | background: #F5F7FA; |
| | | border-right: 1px solid #DCDFE6; |
| | | color: #606266; |
| | | font-size: 13px; |
| | | white-space: nowrap; |
| | | height: 36px; |
| | | line-height: 36px; |
| | | flex-shrink: 0; |
| | | min-width: 70px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .input-container { |
| | | display: flex; |
| | | flex: 1; |
| | | align-items: center; |
| | | } |
| | | |
| | | .custom-input { |
| | | flex: 1; |
| | | } |
| | | |
| | | .custom-input>>>.el-input__inner { |
| | | border: none; |
| | | border-radius: 0; |
| | | 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> |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="75%" |
| | | height="80%" |
| | | title="åæ®æç»ä¿¡æ¯" |
| | | > |
| | | <div> |
| | | <vol-box v-model="showDetialBox" :lazy="true" width="75%" :padding="15" title="åæ®æç»ä¿¡æ¯"> |
| | | <div class="box-head"> |
| | | <el-alert :closable="false" style="width: 100%"> |
| | | <el-row> |
| | |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link> --> |
| | | |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="handleOpenPicking" |
| | | >æ£é</el-link> |
| | | |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound" |
| | | >ç´æ¥åºåº</el-link |
| | | > --> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | ></el-col |
| | | > |
| | | <el-link type="primary" size="small" v-if="isBatch === 0" style="float: right; height: 20px" |
| | | @click="handleOpenPicking">æ£é</el-link> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px" |
| | | v-if="isBatch === 1" @click="handleOpenBatchPicking">åæ¹æ£é</el-link> |
| | | <el-link type="primary" size="small" v-if="isBatch === 0" |
| | | style="float: right; height: 20px; margin-right: 10px" @click="outbound">ç´æ¥åºåº</el-link> |
| | | <el-link type="primary" size="small" v-if="isBatch === 1" |
| | | style="float: right; height: 20px; margin-right: 10px" @click="outboundbatch">åæ¹åºåº</el-link> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData">å·æ°</el-link> |
| | | </el-col> |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | | <div class="box-table" style="margin-top: 1%"> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="tableData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | @current-change="handleCurrentChange" |
| | | height="500px" |
| | | @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table ref="singleTable" :data="tableData" style="width: 100%; height: 100%" highlight-current-row |
| | | @current-change="handleCurrentChange" height="500px" @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed="left" |
| | | width="55" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <el-table-column label="åºå·" type="index" fixed="left" width="55" align="center"></el-table-column> |
| | | <el-table-column v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" :key="index" :prop="item.prop" |
| | | :label="item.title" :width="item.width" align="center"> |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-link |
| | | type="primary" |
| | | :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-link |
| | | ></el-tooltip> |
| | | <el-tooltip class="item" effect="dark" :content="item.title" placement="bottom"> |
| | | <el-link type="primary" :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)"> |
| | | <i :class="item.icon" style="font-size: 22px"></i> |
| | | </el-link> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | <div v-else> |
| | | {{ scoped.row[item.prop] }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </div> |
| | | </vol-box> |
| | | <stock-select ref="child" @parentCall="parentCall"></stock-select> |
| | | <selected-stock |
| | | ref="selectedStock" |
| | | @parentCall="parentCall" |
| | | ></selected-stock> |
| | | <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VolForm from "@/components/basic/VolForm.vue"; |
| | | import StockSelect from "./AllocateStockSelect.vue"; |
| | | import StockSelect from "./StockSelect.vue"; |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import { h,createVNode, render,reactive } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElMessage } from 'element-plus'; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | import { h, createVNode, render, reactive } from "vue"; |
| | | import { |
| | | ElDialog, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElSelect, |
| | | ElOption, |
| | | ElButton, |
| | | ElInput, |
| | | ElMessage, |
| | | } from "element-plus"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | isBatch: 0, |
| | | showDetialBox: false, |
| | | flag: false, |
| | | currentRow: null, |
| | | selection: [], |
| | | tableData: [], |
| | | mainBusinessType: null, // æ°å¢ï¼åå¨ä¸»åæ®çbusinessType |
| | | tableColumns: [ |
| | | { |
| | | prop: "id", |
| | |
| | | prop: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 120, |
| | | }, |
| | | { |
| | | prop: "materielName", |
| | |
| | | prop: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "orderQuantity", |
| | |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "moveQty", |
| | | title: "æªææ°é", |
| | | type: "string", |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | width: 80, |
| | | }, |
| | | { |
| | | prop: "orderDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "tag", |
| | | width: 180, |
| | | width: 90, |
| | | bindKey: "orderDetailStatusEnum", |
| | | }, |
| | | { |
| | | prop: "assignStock", |
| | | title: "æå®åºå", |
| | | type: "icon", |
| | | width: 90, |
| | | icon: "el-icon-s-grid", |
| | | }, |
| | | |
| | | { |
| | | prop: "viewDetail", |
| | | title: "åºåºè¯¦ç»", |
| | |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [30, 60, 100, 120], |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | size: 30, |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | toggleAssignStockColumn() { |
| | | const assignStockColumn = this.tableColumns.find( |
| | | (item) => item.prop === "assignStock" |
| | | ); |
| | | if (assignStockColumn) { |
| | | // businessType为22æ¶æ¾ç¤ºï¼å¦åéè |
| | | assignStockColumn.hidden = this.mainBusinessType !== '22'; |
| | | } |
| | | }, |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | console.log("ä¸»åæ®æ°æ®ï¼", this.row); |
| | | this.isBatch = row.isBatch; |
| | | this.mainBusinessType = row.businessType; |
| | | this.getDictionaryData(); |
| | | this.getData(); |
| | | this.toggleAssignStockColumn(); |
| | | }, |
| | | getData() { |
| | | var wheres = [{ name: "orderId", value: this.row.id }]; |
| | | var wheres = [{ name: "orderId", value: this.row.id }]; |
| | | var param = { |
| | | page: this.paginations.page, |
| | | rows: this.paginations.rows, |
| | |
| | | tableButtonClick(row, column) { |
| | | if (column.prop == "assignStock") { |
| | | this.$refs.child.open(row); |
| | | } else if (column.prop == "NoStockOut") { |
| | | this.$refs.NoStockOut.open(row); |
| | | } else { |
| | | //ç¹å»æå¼ |
| | | this.$refs.selectedStock.open(row); |
| | | } |
| | | }, |
| | |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | var keys = this.selection.map((item) => item.id); // è·åéä¸è¡çid |
| | | var keys = this.selection.map((item) => item.id); |
| | | this.http |
| | | .post("api/AllocateOrderDetail/LockOutboundStocks", keys, "æ°æ®å¤çä¸") |
| | | .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // æå¼æ£éé¡µé¢ |
| | | handleOpenPicking() { |
| | | handleOpenPicking() { |
| | | this.$router.push({ |
| | | path: '/outbound/picking', |
| | | query: { orderId: this.row.id ,orderNo:this.row.orderNo} |
| | | }) |
| | | path: "/outbound/outPicking", |
| | | query: { orderId: this.row.id, orderNo: this.row.orderNo }, |
| | | }); |
| | | }, |
| | | handleOpenBatchPicking() { |
| | | this.$router.push({ |
| | | path: "/outbound/outPicking", |
| | | query: { orderId: this.row.id, orderNo: this.row.orderNo }, |
| | | }); |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | const platformOptions = [{label:'ç«å°2',value:'2-1'},{label:'ç«å°3',value:'3-1'}]; |
| | | const mountNode = document.createElement('div'); |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // 2. è¡¨åæ°æ®ï¼é»è®¤éä¸ç«å°3ï¼ |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | const savedStation = stationManager.getStation(); |
| | | console.log(savedStation); |
| | | if (savedStation) { |
| | | formData.selectedPlatform = savedStation; |
| | | } |
| | | |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'åºåºæä½ - éæ©åºåºç«å°', |
| | | width: '500px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData00, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ] |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | ref: 'outboundForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px' |
| | | } |
| | | }, [ |
| | | // åºåºç«å°éæ©é¡¹ï¼æ ¸å¿è¡¨åé¡¹ï¼ |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°ï¼3-12ï¼', |
| | | modelValue: formData.selectedPlatform, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.selectedPlatform = val; |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | } |
| | | }, platformOptions.map(platform => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { |
| | | style: { |
| | | textAlign: 'right', |
| | | marginTop: '8px', |
| | | paddingRight: '4px' |
| | | } |
| | | }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶åºåºæä½'); |
| | | }, |
| | | style: { |
| | | marginRight: '8px', |
| | | color: '#606266' |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | // è¡¨åæ ¡éª |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | // 4. æé 请æ±åæ°ï¼éä¸åæ®ID + éæ©çåºåºç«å°ï¼ |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | taskIds: keys, |
| | | outboundPlatform: formData.selectedPlatform // åºåºç«å° |
| | | }; |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: 1, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | // 5. è°ç¨åºåºæ¥å£ |
| | | this.http |
| | | .post("api/Task/GenerateOutboundTasks", requestParams, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; // å
³é详æ
æ¡ |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); // éç¥ç¶ç»ä»¶å·æ° |
| | | }); |
| | | // å
³éå¼¹çª |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®åºåº') |
| | | ]) |
| | | ]) |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | // .catch(() => { |
| | | // ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | if (this.selection.length > 1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | outboundDecimal: "", |
| | | }); |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿Elç»ä»¶æ£å¸¸å·¥ä½ |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | outboundDecimal: [ |
| | | { required: true, message: "请è¾å
¥å°æ°æ°å¼", trigger: "blur" }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/; |
| | | if (value && !decimalReg.test(value)) { |
| | | callback(new Error("请è¾å
¥ææçå°æ°ï¼æ£æ°ï¼æå¤2ä½å°æ°ï¼")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h(ElFormItem, { |
| | | label: "åºåºæ°", |
| | | prop: "outboundDecimal", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElInput, { |
| | | type: "number", |
| | | placeholder: "请è¾å
¥å°æ°æ°å¼ï¼æå¤2ä½å°æ°ï¼", |
| | | modelValue: formData.outboundDecimal, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.outboundDecimal = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | step: "0.01", |
| | | precision: 2, |
| | | min: 0.01, |
| | | }), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åæ¹åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: formData.outboundDecimal, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åæ¹åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | |
| | | var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey); |
| | | if (item) { |
| | | var dicItem = item.data.find((x) => x.key == row[column.prop]); |
| | | console.log(dicItem); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | |
| | | return row[column.prop]; |
| | | } |
| | | } |
| | | return row[column.prop]; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .text-button { |
| | | border: 0px; |
| | |
| | | background: oldlace; |
| | | } |
| | | |
| | | .box-table .el-table tbody tr:hover > td { |
| | | .box-table .el-table tbody tr:hover>td { |
| | | background-color: #d8e0d4 !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .box-table .el-table tbody tr.current-row > td { |
| | | .box-table .el-table tbody tr.current-row>td { |
| | | background-color: #f0f9eb !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .el-table .success-row { |
| | |
| | | .box-table .el-table { |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridHeader from './extend/EmptyTrayInbound.vue' |
| | | import gridBody from './extend/Pallet.vue' |
| | | import gridBody from './extend/AllcatedPallet.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="75%" |
| | | :padding="15" |
| | | title="åæ®æç»ä¿¡æ¯" |
| | | > |
| | | <vol-box v-model="showDetialBox" :lazy="true" width="75%" :padding="15" title="åæ®æç»ä¿¡æ¯"> |
| | | <div class="box-head"> |
| | | <el-alert :closable="false" style="width: 100%"> |
| | | <el-row> |
| | |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link> --> |
| | | |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px" |
| | | @click="handleOpenPicking" |
| | | >æ£é</el-link> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | v-if="isBatch === 1" |
| | | @click="handleOpenBatchPicking" |
| | | >åæ¹æ£é</el-link> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 0" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outbound" |
| | | >ç´æ¥åºåº</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | v-if="isBatch === 1" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="outboundbatch" |
| | | >åæ¹åºåº</el-link |
| | | > |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData" |
| | | >å·æ°</el-link |
| | | ></el-col |
| | | > |
| | | <el-link type="primary" size="small" v-if="isBatch === 0" style="float: right; height: 20px" |
| | | @click="handleOpenPicking">æ£é</el-link> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px" |
| | | v-if="isBatch === 1" @click="handleOpenBatchPicking">åæ¹æ£é</el-link> |
| | | <el-link type="primary" size="small" v-if="isBatch === 0" |
| | | style="float: right; height: 20px; margin-right: 10px" @click="outbound">ç´æ¥åºåº</el-link> |
| | | <el-link type="primary" size="small" v-if="isBatch === 1" |
| | | style="float: right; height: 20px; margin-right: 10px" @click="outboundbatch">åæ¹åºåº</el-link> |
| | | <el-link type="primary" size="small" style="float: right; height: 20px; margin-right: 10px" |
| | | @click="getData">å·æ°</el-link> |
| | | </el-col> |
| | | </el-row> |
| | | </el-alert> |
| | | </div> |
| | | <div class="box-table" style="margin-top: 1%"> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="tableData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | @current-change="handleCurrentChange" |
| | | height="500px" |
| | | @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table ref="singleTable" :data="tableData" style="width: 100%; height: 100%" highlight-current-row |
| | | @current-change="handleCurrentChange" height="500px" @row-click="handleRowClick" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed="left" |
| | | width="55" |
| | | align="center" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <el-table-column label="åºå·" type="index" fixed="left" width="55" align="center"></el-table-column> |
| | | <el-table-column v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" :key="index" :prop="item.prop" |
| | | :label="item.title" :width="item.width" align="center"> |
| | | <template #default="scoped"> |
| | | <div v-if="item.type == 'icon'"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | | :content="item.title" |
| | | placement="bottom" |
| | | ><el-link |
| | | type="primary" |
| | | :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)" |
| | | ><i :class="item.icon" style="font-size: 22px"></i></el-link |
| | | ></el-tooltip> |
| | | <el-tooltip class="item" effect="dark" :content="item.title" placement="bottom"> |
| | | <el-link type="primary" :disabled="getButtonEnable(item.prop, scoped.row)" |
| | | @click="tableButtonClick(scoped.row, item)"> |
| | | <i :class="item.icon" style="font-size: 22px"></i> |
| | | </el-link> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | <div v-else-if="item.type == 'tag'"> |
| | | <el-tag size="small"> |
| | | {{ getDictionary(scoped.row, item) }} |
| | | </el-tag> |
| | | </div> |
| | | <div v-else> |
| | | {{ scoped.row[item.prop] }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </div> |
| | | </vol-box> |
| | | <stock-select ref="child" @parentCall="parentCall"></stock-select> |
| | | <selected-stock |
| | | ref="selectedStock" |
| | | @parentCall="parentCall" |
| | | ></selected-stock> |
| | | <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock> |
| | | <NoStockOut ref="NoStockOut" @parentCall="parentCall"></NoStockOut> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VolForm from "@/components/basic/VolForm.vue"; |
| | | import StockSelect from "./StockSelect.vue"; |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import NoStockOut from "./NoStockOut.vue"; |
| | | import { h,createVNode, render,reactive } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElInput, ElMessage } from 'element-plus'; |
| | | import { th } from 'element-plus/es/locale'; |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | import { h, createVNode, render, reactive } from "vue"; |
| | | import { |
| | | ElDialog, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElSelect, |
| | | ElOption, |
| | | ElButton, |
| | | ElInput, |
| | | ElMessage, |
| | | } from "element-plus"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock,NoStockOut}, |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | | isBatch :0, |
| | | isBatch: 0, |
| | | showDetialBox: false, |
| | | flag: false, |
| | | currentRow: null, |
| | | selection: [], |
| | | tableData: [], |
| | | mainBusinessType: null, // æ°å¢ï¼åå¨ä¸»åæ®çbusinessType |
| | | tableColumns: [ |
| | | { |
| | | prop: "id", |
| | |
| | | prop: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 120, |
| | | }, |
| | | { |
| | | prop: "materielName", |
| | |
| | | prop: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 90, |
| | | }, |
| | | { |
| | | prop: "orderQuantity", |
| | |
| | | prop: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | width: 80, |
| | | }, |
| | | { |
| | | prop: "orderDetailStatus", |
| | |
| | | title: "æå®åºå", |
| | | type: "icon", |
| | | width: 90, |
| | | hidden:true, |
| | | hidden: true, // é»è®¤éè |
| | | icon: "el-icon-s-grid", |
| | | }, |
| | | { |
| | |
| | | order: "desc", |
| | | Foots: "", |
| | | total: 0, |
| | | // 2020.08.29å¢å èªå®ä¹å页æ¡å¤§å° |
| | | sizes: [30, 60, 100, 120], |
| | | size: 30, // é»è®¤åé¡µå¤§å° |
| | | size: 30, |
| | | Wheres: [], |
| | | page: 1, |
| | | rows: 30, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | toggleAssignStockColumn() { |
| | | const assignStockColumn = this.tableColumns.find( |
| | | (item) => item.prop === "assignStock" |
| | | ); |
| | | if (assignStockColumn) { |
| | | // businessType为22æ¶æ¾ç¤ºï¼å¦åéè |
| | | assignStockColumn.hidden = this.mainBusinessType !== '22'; |
| | | } |
| | | }, |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | console.log(this.row); |
| | | console.log("ä¸»åæ®æ°æ®ï¼", this.row); |
| | | this.isBatch = row.isBatch; |
| | | this.mainBusinessType = row.businessType; |
| | | this.getDictionaryData(); |
| | | this.getData(); |
| | | this.toggleAssignStockColumn(); |
| | | }, |
| | | getData() { |
| | | var wheres = [{ name: "orderId", value: this.row.id }]; |
| | |
| | | this.$refs.child.open(row); |
| | | } else if (column.prop == "NoStockOut") { |
| | | this.$refs.NoStockOut.open(row); |
| | | }else{ |
| | | //ç¹å»æå¼åºåºè¯¦æ
|
| | | } else { |
| | | this.$refs.selectedStock.open(row); |
| | | } |
| | | }, |
| | |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | var keys = this.selection.map((item) => item.id); // è·åéä¸è¡çid |
| | | var keys = this.selection.map((item) => item.id); |
| | | this.http |
| | | .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | // æå¼æ£éé¡µé¢ |
| | | handleOpenPicking() { |
| | | handleOpenPicking() { |
| | | this.$router.push({ |
| | | path: '/outbound/picking', |
| | | query: { orderId: this.row.id ,orderNo:this.row.orderNo} |
| | | }) |
| | | path: "/outbound/outPicking", |
| | | query: { orderId: this.row.id, orderNo: this.row.orderNo }, |
| | | }); |
| | | }, |
| | | handleOpenBatchPicking() { |
| | | this.$router.push({ |
| | | path: '/outbound/batchpicking', |
| | | query: { orderId: this.row.id ,orderNo:this.row.orderNo}}) |
| | | this.$router.push({ |
| | | path: "/outbound/outPicking", |
| | | query: { orderId: this.row.id, orderNo: this.row.orderNo }, |
| | | }); |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | const platformOptions = [{label:'ç«å°2',value:'2-1'},{label:'ç«å°3',value:'3-1'}]; |
| | | const mountNode = document.createElement('div'); |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // 2. è¡¨åæ°æ®ï¼é»è®¤éä¸ç«å°3ï¼ |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | const savedStation = stationManager.getStation(); |
| | | if (savedStation) { |
| | | formData.selectedPlatform = savedStation; |
| | | } |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'åºåºæä½ - éæ©åºåºç«å°', |
| | | width: '500px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ] |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | ref: 'outboundForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px' |
| | | } |
| | | }, [ |
| | | // åºåºç«å°éæ©é¡¹ï¼æ ¸å¿è¡¨åé¡¹ï¼ |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°ï¼3-12ï¼', |
| | | modelValue: formData.selectedPlatform, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.selectedPlatform = val; |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | } |
| | | }, platformOptions.map(platform => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { |
| | | style: { |
| | | textAlign: 'right', |
| | | marginTop: '8px', |
| | | paddingRight: '4px' |
| | | } |
| | | }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶åºåºæä½'); |
| | | }, |
| | | style: { |
| | | marginRight: '8px', |
| | | color: '#606266' |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | // è¡¨åæ ¡éª |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | // 4. æé 请æ±åæ°ï¼éä¸åæ®ID + éæ©çåºåºç«å°ï¼ |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | taskIds: keys, |
| | | outboundPlatform: formData.selectedPlatform // åºåºç«å° |
| | | }; |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: 1, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | // 5. è°ç¨åºåºæ¥å£ |
| | | this.http |
| | | .post("api/Task/GenerateOutboundTasks", requestParams, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; // å
³é详æ
æ¡ |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); // éç¥ç¶ç»ä»¶å·æ° |
| | | }); |
| | | // å
³éå¼¹çª |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®åºåº') |
| | | ]) |
| | | ]) |
| | | }); |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | // .catch(() => { |
| | | // ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿Elç»ä»¶æ£å¸¸å·¥ä½ |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | if (this.selection.length>1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | const platformOptions = [{label:'ç«å°2',value:'2-1'},{label:'ç«å°3',value:'3-1'}]; |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // 2. è¡¨åæ°æ®ï¼é»è®¤éä¸ç«å°3ï¼æ°å¢å°æ°åæ®µï¼ |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, // é»è®¤ç»å®ãç«å°3ãçvalue |
| | | outboundDecimal: '' // æ°å¢ï¼å°æ°è¾å
¥æ¡å段 |
| | | }); |
| | | |
| | | // 3. 卿å建弹çªç»ä»¶ |
| | | const vnode = createVNode(ElDialog, { |
| | | title: 'åºåºæä½ - éæ©åºåºç«å°', |
| | | width: '500px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ], |
| | | // æ°å¢ï¼å°æ°å段éªè¯è§åï¼å¿
å¡« + ææå°æ°æ ¼å¼ï¼ |
| | | outboundDecimal: [ |
| | | { required: true, message: '请è¾å
¥å°æ°æ°å¼', trigger: 'blur' }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | // éªè¯è§åï¼æ£æ°ãæ¯æå°æ°ç¹åæå¤2ä½ï¼å¯æ ¹æ®éæ±è°æ´å°æ°ä½æ°ï¼ |
| | | const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/; |
| | | if (value && !decimalReg.test(value)) { |
| | | callback(new Error('请è¾å
¥ææçå°æ°ï¼æ£æ°ï¼æå¤2ä½å°æ°ï¼')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | ref: 'outboundForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px' |
| | | if (this.selection.length > 1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | }, [ |
| | | // åºåºç«å°éæ©é¡¹ï¼æ ¸å¿è¡¨åé¡¹ï¼ |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°ï¼3-12ï¼', |
| | | modelValue: formData.selectedPlatform, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | } |
| | | }, platformOptions.map(platform => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )) |
| | | ]), |
| | | // æ°å¢ï¼å°æ°è¾å
¥æ¡è¡¨å项 |
| | | h(ElFormItem, { |
| | | label: 'åºåºæ°', // 坿 ¹æ®ä¸å¡éæ±ä¿®æ¹æ ç¾åï¼å¦âåºåºæ°éââééâçï¼ |
| | | prop: 'outboundDecimal', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElInput, { |
| | | type: 'number', // æ°åç±»åï¼åçæ¯æå°æ°è¾å
¥ |
| | | placeholder: '请è¾å
¥å°æ°æ°å¼ï¼æå¤2ä½å°æ°ï¼', |
| | | modelValue: formData.outboundDecimal, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.outboundDecimal = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | }, |
| | | step: '0.01', // æ¥é¿0.01ï¼ç¹å»ä¸ä¸ç®å¤´æ¶æ0.01å¢å |
| | | precision: 2, // éå¶æå¤è¾å
¥2ä½å°æ°ï¼Element Plus屿§ï¼ |
| | | min: 0.01, // å¯éï¼éå¶æå°å¼ä¸º0.01ï¼é¿å
è¾å
¥0æè´æ° |
| | | }) |
| | | ]), |
| | | // åºé¨æé®åº |
| | | h('div', { |
| | | style: { |
| | | textAlign: 'right', |
| | | marginTop: '8px', |
| | | paddingRight: '4px' |
| | | } |
| | | }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶åæ¹åºåºæä½'); |
| | | }, |
| | | style: { |
| | | marginRight: '8px', |
| | | color: '#606266' |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | // è¡¨åæ ¡éªï¼ä¼åæ¶æ ¡éªåºåºç«å°åå°æ°åæ®µï¼ |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | outboundDecimal: "", |
| | | }); |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | console.log(this.selection); |
| | | // 4. æé 请æ±åæ°ï¼æ°å¢å°æ°åæ®µï¼ |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | orderDetailId: keys[0], // åæ¹åºåºä»
æ¯æåæ¡æç» |
| | | outboundPlatform: formData.selectedPlatform, // åºåºç«å° |
| | | batchQuantity: formData.outboundDecimal // æ°å¢ï¼å°æ°åæ®µä¼ ç»å端 |
| | | }; |
| | | |
| | | // 5. è°ç¨åºåºæ¥å£ |
| | | this.http |
| | | .post("api/Task/GenerateOutboundBatchTasks", requestParams, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; // å
³é详æ
æ¡ |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); // éç¥ç¶ç»ä»¶å·æ° |
| | | }); |
| | | // å
³éå¼¹çª |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®åæ¹åºåº') |
| | | ]) |
| | | ]) |
| | | }); |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | outboundDecimal: [ |
| | | { required: true, message: "请è¾å
¥å°æ°æ°å¼", trigger: "blur" }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/; |
| | | if (value && !decimalReg.test(value)) { |
| | | callback(new Error("请è¾å
¥ææçå°æ°ï¼æ£æ°ï¼æå¤2ä½å°æ°ï¼")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h(ElFormItem, { |
| | | label: "åºåºæ°", |
| | | prop: "outboundDecimal", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElInput, { |
| | | type: "number", |
| | | placeholder: "请è¾å
¥å°æ°æ°å¼ï¼æå¤2ä½å°æ°ï¼", |
| | | modelValue: formData.outboundDecimal, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.outboundDecimal = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | step: "0.01", |
| | | precision: 2, |
| | | min: 0.01, |
| | | }), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åæ¹åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿Elç»ä»¶æ£å¸¸å·¥ä½ |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: formData.outboundDecimal, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åæ¹åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | setCurrent(row) { |
| | | this.$refs.singleTable.setCurrentRow(row); |
| | | }, |
| | |
| | | var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey); |
| | | if (item) { |
| | | var dicItem = item.data.find((x) => x.key == row[column.prop]); |
| | | console.log(dicItem); |
| | | if (dicItem) { |
| | | return dicItem.value; |
| | | } else { |
| | |
| | | return row[column.prop]; |
| | | } |
| | | } |
| | | return row[column.prop]; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .text-button { |
| | | border: 0px; |
| | |
| | | background: oldlace; |
| | | } |
| | | |
| | | .box-table .el-table tbody tr:hover > td { |
| | | .box-table .el-table tbody tr:hover>td { |
| | | background-color: #d8e0d4 !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .box-table .el-table tbody tr.current-row > td { |
| | | .box-table .el-table tbody tr.current-row>td { |
| | | background-color: #f0f9eb !important; |
| | | /* color: #ffffff; */ |
| | | } |
| | | |
| | | .el-table .success-row { |
| | |
| | | .box-table .el-table { |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | Unit = stockDetail.Unit, |
| | | InboundOrderRowNo = stockDetail.InboundOrderRowNo, |
| | | SupplyCode = stockDetail.SupplyCode, |
| | | Creater = stockDetail.Creater, |
| | | CreateDate = stockDetail.CreateDate, |
| | | FactoryArea = stockDetail.FactoryArea, |
| | | WarehouseCode = stockDetail.WarehouseCode, |
| | | Remark = $"æå
ååå§è®°å½ï¼åºåºåå·ï¼{orderNo}ï¼åºåºå主é®ï¼{orderId}ï¼åæ¡ç ï¼{request.Barcode}ï¼åæ°éï¼{stockDetail.StockQuantity}ï¼åºåºæ°éï¼{actualOutboundQuantity}ï¼æä½è
ï¼{request.Operator}" |
| | |
| | | InboundOrderRowNo = stockDetail.InboundOrderRowNo, |
| | | SupplyCode = stockDetail.SupplyCode, |
| | | FactoryArea = stockDetail.FactoryArea, |
| | | Creater = stockDetail.Creater, |
| | | CreateDate = stockDetail.CreateDate, |
| | | WarehouseCode = stockDetail.WarehouseCode, |
| | | Remark = $"åºåºå®æå é¤ï¼æ¡ç ï¼{request.Barcode}ï¼åæ°éï¼{stockDetail.StockQuantity}ï¼åºåºæ°éï¼{actualOutboundQuantity}ï¼æä½è
ï¼{request.Operator}" |
| | | }; |