| | |
| | | <template> |
| | | <div class="picking-container" v-loading="globalLoading" element-loading-text="å¤çä¸..." |
| | | element-loading-background="rgba(255, 255, 255, 0.8)"> |
| | | element-loading-background="rgba(255, 255, 255, 0.8)" element-loading-spinner="el-icon-loading" |
| | | element-loading-custom-class="custom-loading"> |
| | | <!-- é¡¶é¨è®¢åä¿¡æ¯ --> |
| | | <el-card class="order-info-card" shadow="never"> |
| | | <div class="order-header"> |
| | |
| | | <span class="order-label">订åå·ï¼</span> |
| | | <span class="order-value">{{ orderNo }}</span> |
| | | </div> |
| | | <div class="order-status" v-if="orderInfo"> |
| | | <el-tag :type="getStatusType(orderInfo.status)" size="medium"> |
| | | <div class="order-status"> |
| | | <!-- æµè¯æé® --> |
| | | |
| | | <el-tag v-if="orderInfo" :type="getStatusType(orderInfo.orderStatus)" size="medium" |
| | | style="margin-left: 10px;"> |
| | | {{ orderInfo.statusName || 'è¿è¡ä¸' }} |
| | | </el-tag> |
| | | </div> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="æçç " prop="palletCode"> |
| | | <el-input ref="palletInput" v-model="scanForm.palletCode" placeholder="è¯·æ«ææçç " size="large" |
| | | clearable @keyup.enter="handlePalletScan"> |
| | | <el-input ref="palletInput" v-model="scanForm.palletCode" placeholder="è¯·æ«ææçç " |
| | | size="large" clearable @keyup.enter="handlePalletScan"> |
| | | <template #prefix> |
| | | <i class="el-icon-box"></i> |
| | | </template> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- æ´åºç¡®è®¤å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="wholeOutDialogVisible" title="æ´åºæä½ç¡®è®¤" width="500px" :before-close="handleWholeOutDialogClose" |
| | | custom-class="whole-out-dialog" style="margin-right: 0px;"> |
| | | <el-dialog v-model="wholeOutDialogVisible" title="æ´åºæä½ç¡®è®¤" width="500px" |
| | | :before-close="handleWholeOutDialogClose" custom-class="whole-out-dialog" style="margin-right: 0px;"> |
| | | <div class="whole-out-content" v-if="wholeOutInfo"> |
| | | <!-- è¦åæç¤º --> |
| | | <el-alert title="该æçå
å«éè¦æ´åºçç©æ" type="warning" :closable="false" show-icon class="whole-out-alert"> |
| | |
| | | <div class="info-item"> |
| | | <label>æ´åºæ°éï¼</label> |
| | | <span class="info-value highlight">{{ wholeOutInfo.assignQuantity }} {{ wholeOutInfo.unit |
| | | }}</span> |
| | | }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <label>å½ååºåï¼</label> |
| | |
| | | |
| | | import printView from "@/extension/outbound/extend/printView.vue" |
| | | import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager"; |
| | | import { ElLoading } from 'element-plus' |
| | | |
| | | export default { |
| | | components: { printView }, |
| | | name: 'OutPicking', |
| | |
| | | matMixed: true, |
| | | wholeOutDialogVisible: false, |
| | | wholeOutInfo: null, |
| | | globalLoading: false |
| | | globalLoading: false, |
| | | loadingInstance: null |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | this.$router.back() |
| | | return |
| | | } |
| | | |
| | | // å 载订åä¿¡æ¯ |
| | | this.loadOrderInfo() |
| | | |
| | | // èªå¨èç¦å°æçç è¾å
¥æ¡ |
| | | this.$nextTick(() => { |
| | | if (this.$refs.palletInput) { |
| | | this.$refs.palletInput.focus() |
| | | } |
| | | }) |
| | | }, |
| | | async loadOrderInfo() { |
| | | try { |
| | | this.showFullScreenLoading() |
| | | const response = await this.http.get(`/api/Outbound/GetOrderInfo?orderNo=${this.orderNo}`) |
| | | if (response.status) { |
| | | this.orderInfo = response.data |
| | | } else { |
| | | } |
| | | } |
| | | catch (error) { |
| | | |
| | | } finally { |
| | | this.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | |
| | | async loadPalletData() { |
| | |
| | | } |
| | | |
| | | try { |
| | | this.globalLoading = true |
| | | this.showFullScreenLoading() |
| | | await Promise.all([ |
| | | this.loadUnpickedData(), |
| | | this.loadPickedData() |
| | | ]); |
| | | |
| | | } catch (error) { |
| | | console.error('å è½½æçæ°æ®å¤±è´¥:', error) |
| | | this.unpickedData = [] |
| | | } finally { |
| | | this.globalLoading = false |
| | | this.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | loadUnpickedData() { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.warning('该æçæ æªæ£éä»»å¡') |
| | | if (flag) { |
| | | this.$message.warning('该æçæ æªæ£éä»»å¡') |
| | | } |
| | | this.unpickedData = [] |
| | | } |
| | | resolve() |
| | |
| | | reject(response.message || 'è·åæçæ°æ®å¤±è´¥') |
| | | } |
| | | }).catch(error => { |
| | | console.error('å è½½æªæ£éæ°æ®å¤±è´¥:', error) |
| | | reject(error) |
| | | }) |
| | | }) |
| | |
| | | reject(response.message || 'è·åæçæ°æ®å¤±è´¥') |
| | | } |
| | | }).catch(error => { |
| | | console.error('å 载已æ£éæ°æ®å¤±è´¥:', error) |
| | | reject(error) |
| | | }) |
| | | }) |
| | |
| | | this.pickedTotal = this.pickedCount |
| | | }, |
| | | |
| | | handlePalletScan() { |
| | | handlePalletScan(flag = true) { |
| | | if (this.scanForm.palletCode) { |
| | | // this.$message.success(`æçç : ${this.scanForm.palletCode}`) |
| | | this.loadPalletData() |
| | | this.loadPalletData(flag) |
| | | } else { |
| | | } |
| | | }, |
| | | |
| | |
| | | this.handleConfirmPick() |
| | | }, |
| | | |
| | | handleConfirmPick() { |
| | | async handleConfirmPick() { |
| | | if (!this.scanForm.palletCode || !this.scanForm.materialBarcode) { |
| | | this.$message.warning('请å
æ«ææçç åç©ææ¡ç ') |
| | | return |
| | | } |
| | | |
| | | this.confirmLoading = true |
| | | this.globalLoading = true |
| | | this.showFullScreenLoading() |
| | | |
| | | try { |
| | | this.http.post('/api/Outbound/CompleteOutboundWithBarcode', { |
| | | const response = await this.http.post('/api/Outbound/CompleteOutboundWithBarcode', { |
| | | orderNo: this.orderNo, |
| | | palletCode: this.scanForm.palletCode, |
| | | barcode: this.scanForm.materialBarcode, |
| | | operator: this.getUserName() |
| | | }).then(response => { |
| | | if (response.status) { |
| | | if (response.data.scannedDetail.isUnpacked && response.data.scannedDetail.materialCodes.length > 0) { |
| | | this.$refs.printView.open(response.data.scannedDetail.materialCodes); |
| | | } |
| | | this.$message.success('æ£é确认æå') |
| | | this.resetMaterialBarcode() |
| | | // this.loadUnpickedData() |
| | | // this.loadPickedData() |
| | | this.loadPalletData() |
| | | } else { |
| | | this.$message.error(response.message || 'æ£é确认失败') |
| | | } |
| | | }) |
| | | if (response.status) { |
| | | if (response.data.scannedDetail.isUnpacked && response.data.scannedDetail.materialCodes.length > 0) { |
| | | this.$refs.printView.open(response.data.scannedDetail.materialCodes); |
| | | } |
| | | this.$message.success('æ£é确认æå') |
| | | this.resetMaterialBarcode() |
| | | // this.loadUnpickedData() |
| | | // this.loadPickedData() |
| | | await this.loadPalletData(false) |
| | | } else { |
| | | this.$message.error(response.message || 'æ£é确认失败') |
| | | } |
| | | } catch (error) { |
| | | console.error('æ£é确认失败:', error) |
| | | this.$message.error('æ£é确认失败') |
| | | } finally { |
| | | this.confirmLoading = false |
| | | this.globalLoading = false |
| | | this.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | |
| | |
| | | this.confirmDialogVisible = true |
| | | }, |
| | | |
| | | executeConfirm() { |
| | | async executeConfirm() { |
| | | this.executeLoading = true |
| | | this.globalLoading = true |
| | | this.showFullScreenLoading() |
| | | |
| | | try { |
| | | let apiUrl = '' |
| | |
| | | palletCode: this.scanForm.palletCode, |
| | | station: stationManager.getStation() |
| | | } |
| | | console.log(params); |
| | | if (this.currentAction === 'emptyBox') { |
| | | apiUrl = '/api/Outbound/EmptyBox' |
| | | } else if (this.currentAction === 'returnToWarehouse') { |
| | | apiUrl = '/api/Outbound/ReturnToWarehouse' |
| | | } |
| | | |
| | | this.http.post(apiUrl, params).then(response => { |
| | | const response = await this.http.post(apiUrl, params) |
| | | |
| | | if (response.status) { |
| | | this.$message.success('æä½æå') |
| | | this.confirmDialogVisible = false |
| | | this.resetForm() |
| | | // this.loadUnpickedData() |
| | | // this.loadPickedData() |
| | | } else { |
| | | this.$message.error(response.message || 'æä½å¤±è´¥') |
| | | } |
| | | }) |
| | | if (response.status) { |
| | | this.$message.success('æä½æå') |
| | | this.confirmDialogVisible = false |
| | | this.resetForm() |
| | | // this.loadUnpickedData() |
| | | // this.loadPickedData() |
| | | } else { |
| | | this.$message.error(response.message || 'æä½å¤±è´¥') |
| | | } |
| | | } catch (error) { |
| | | console.error('æä½å¤±è´¥:', error) |
| | | this.$message.error('æä½å¤±è´¥') |
| | | } finally { |
| | | this.executeLoading = false |
| | | this.globalLoading = false |
| | | this.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | |
| | |
| | | showWholeOutConfirm() { |
| | | // è·åéè¦æ´åºçç©æä¿¡æ¯ |
| | | const wholeOutItem = this.unpickedData.find(item => item.assignQuantity === item.originalQuantity); |
| | | console.log('wholeOutItem:', wholeOutItem); |
| | | if (wholeOutItem) { |
| | | this.wholeOutInfo = { |
| | | palletCode: this.scanForm.palletCode, |
| | |
| | | } |
| | | }, |
| | | |
| | | executeWholeOut() { |
| | | async executeWholeOut() { |
| | | if (!this.wholeOutInfo) { |
| | | this.$message.error('æ´åºä¿¡æ¯æ æ'); |
| | | return; |
| | | } |
| | | |
| | | this.executeLoading = true; |
| | | this.globalLoading = true; |
| | | this.showFullScreenLoading(); |
| | | |
| | | try { |
| | | // è°ç¨æ´åºæ¥å£ï¼è¿é使ç¨ç©æç¼ç ä½ä¸ºæ¡ç |
| | | this.http.post('/api/Outbound/CompleteOutboundWithPallet', { |
| | | const response = await this.http.post('/api/Outbound/CompleteOutboundWithPallet', { |
| | | orderNo: this.orderNo, |
| | | palletCode: this.scanForm.palletCode, |
| | | operator: this.getUserName() |
| | | }).then(response => { |
| | | if (response.status) { |
| | | this.$message.success('æ´åºæä½æå'); |
| | | this.wholeOutDialogVisible = false; |
| | | this.wholeOutInfo = null; |
| | | this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(response.message || 'æ´åºæä½å¤±è´¥'); |
| | | } |
| | | }); |
| | | if (response.status) { |
| | | this.$message.success('æ´åºæä½æå'); |
| | | this.wholeOutDialogVisible = false; |
| | | this.wholeOutInfo = null; |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(response.message || 'æ´åºæä½å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | console.error('æ´åºæä½å¤±è´¥:', error); |
| | | this.$message.error('æ´åºæä½å¤±è´¥'); |
| | | } finally { |
| | | this.executeLoading = false; |
| | | this.globalLoading = false; |
| | | this.hideFullScreenLoading(); |
| | | } |
| | | }, |
| | | |
| | |
| | | }) |
| | | } catch (error) { |
| | | if (error !== 'cancel') { |
| | | console.error('æ¤é失败:', error) |
| | | this.$message.error('æ¤é失败') |
| | | } |
| | | } |
| | |
| | | return user.userName || user.username || 'æªç»å½ç¨æ·' |
| | | } |
| | | } catch (error) { |
| | | console.error('è·åç¨æ·ä¿¡æ¯å¤±è´¥:', error) |
| | | } |
| | | |
| | | return 'æªç»å½ç¨æ·' |
| | |
| | | |
| | | // æ£æ¥æ¯å¦å
嫿´åº |
| | | hasWholeOut() { |
| | | console.log('æ£æ¥æ´åºç¶æ:', this.unpickedData.some(item => item.assignQuantity === item.originalQuantity)); |
| | | return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed; |
| | | }, |
| | | |
| | |
| | | getStatusType(status) { |
| | | const statusMap = { |
| | | 0: 'info', // å¾
å¤ç |
| | | 10: 'warning', // è¿è¡ä¸ |
| | | 1: 'warning', // è¿è¡ä¸ |
| | | 20: 'primary', // æ£éä¸ |
| | | 30: 'success', // 已宿 |
| | | 40: 'danger' // å¼å¸¸ |
| | | } |
| | | return statusMap[status] || 'info' |
| | | }, |
| | | |
| | | // æ¾ç¤ºå
¨å±é®ç½©å± |
| | | showFullScreenLoading() { |
| | | if (this.loadingInstance) { |
| | | this.loadingInstance.close() |
| | | } |
| | | this.loadingInstance = ElLoading.service({ |
| | | lock: true, |
| | | text: 'å¤çä¸...', |
| | | background: 'rgba(0, 0, 0, 0.7)', |
| | | customClass: 'custom-full-loading' |
| | | }) |
| | | }, |
| | | |
| | | // éèå
¨å±é®ç½©å± |
| | | hideFullScreenLoading() { |
| | | if (this.loadingInstance) { |
| | | this.loadingInstance.close() |
| | | this.loadingInstance = null |
| | | } else { |
| | | } |
| | | }, |
| | | |
| | | // æµè¯é®ç½©å±æ¾ç¤º |
| | | testLoading() { |
| | | // æµè¯ä¸¤ç§æ¹å¼ |
| | | this.globalLoading = true |
| | | // 忶乿µè¯å
¨å±loading |
| | | this.showFullScreenLoading() |
| | | setTimeout(() => { |
| | | this.globalLoading = false |
| | | this.hideFullScreenLoading() |
| | | }, 3000) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /* Element Plus Loading é®ç½©å±æ ·å¼ä¿®å¤ */ |
| | | ::v-deep .el-loading-mask { |
| | | background-color: rgba(255, 255, 255, 0.8) !important; |
| | | ::v-deep .custom-loading { |
| | | background-color: rgba(0, 0, 0, 0.7) !important; |
| | | z-index: 9999 !important; |
| | | position: fixed !important; |
| | | top: 0 !important; |
| | | left: 0 !important; |
| | | right: 0 !important; |
| | | bottom: 0 !important; |
| | | display: flex !important; |
| | | justify-content: center !important; |
| | | align-items: center !important; |
| | | } |
| | | |
| | | ::v-deep .custom-loading .el-loading-mask { |
| | | background-color: rgba(0, 0, 0, 0.7) !important; |
| | | } |
| | | |
| | | ::v-deep .custom-loading .el-loading-spinner { |
| | | z-index: 10000 !important; |
| | | } |
| | | |
| | | ::v-deep .custom-loading .el-loading-text { |
| | | color: #ffffff !important; |
| | | font-weight: bold !important; |
| | | font-size: 16px !important; |
| | | } |
| | | |
| | | /* å
¨å± Loading æ ·å¼ */ |
| | | ::v-deep .el-loading-mask { |
| | | background-color: rgba(0, 0, 0, 0.7) !important; |
| | | z-index: 9999 !important; |
| | | } |
| | | |
| | | ::v-deep .el-loading-spinner { |
| | | z-index: 10000 !important; |
| | | margin-top: -21px !important; |
| | | } |
| | | |
| | | ::v-deep .el-loading-text { |
| | | color: #409EFF !important; |
| | | color: #ffffff !important; |
| | | font-weight: bold !important; |
| | | font-size: 16px !important; |
| | | margin-top: 15px !important; |
| | | } |
| | | |
| | | /* å
¨å±Loadingèªå®ä¹æ ·å¼ */ |
| | | ::v-deep .custom-full-loading { |
| | | z-index: 999999 !important; |
| | | } |
| | | |
| | | ::v-deep .custom-full-loading .el-loading-mask { |
| | | z-index: 999999 !important; |
| | | } |
| | | |
| | | ::v-deep .custom-full-loading .el-loading-spinner { |
| | | z-index: 1000000 !important; |
| | | } |
| | | |
| | | ::v-deep .custom-full-loading .el-loading-text { |
| | | color: #ffffff !important; |
| | | font-weight: bold !important; |
| | | font-size: 18px !important; |
| | | } |
| | | |
| | | /* ç¡®ä¿å¯¹è¯æ¡ä¸ä¼é®çloading */ |
| | | ::v-deep .el-dialog { |
| | | z-index: 2000 !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__wrapper { |
| | | z-index: 2000 !important; |
| | | } |
| | | |
| | | /* ç¡®ä¿å®¹å¨ç¸å¯¹å®ä½ */ |