| | |
| | | <template> |
| | | <div class="picking-container"> |
| | | <div class="picking-container" v-loading="globalLoading" element-loading-text="å¤çä¸..." |
| | | 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> |
| | |
| | | <div class="scan-section"> |
| | | <el-alert title="è¯·ä½¿ç¨æ«ç æªæ«æï¼æ¯æå车èªå¨ç¡®è®¤" type="info" :closable="false" show-icon class="scan-alert"> |
| | | <template #default> |
| | | <span>1. 请å
æ«ææçç â 2. åæ«æç©ææ¡ç </span> |
| | | <div> |
| | | <div>1. 请å
æ«ææçç â 2. åæ«æç©ææ ç¾ç </div> |
| | | <div style="margin-top: 8px; font-size: 13px; color: #666;"> |
| | | <i class="el-icon-info" style="color: #409EFF;"></i> |
| | | æ¯ææ«æçç æ´ç®±åºåºï¼æ«ææçç åå¯ç´æ¥è¿è¡æ´ç®±ç©ææ£éï¼æ éåæ«æç©ææ ç¾ç ã |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-alert> |
| | | |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | |
| | | <!-- 忣ç»è®¡ä¿¡æ¯ --> |
| | | <div class="picking-stats" v-if="scanForm.palletCode && unpickedData.length > 0"> |
| | | <el-divider content-position="left"> |
| | | <span style="color: #409EFF; font-size: 14px;"> |
| | | <i class="el-icon-data-analysis"></i> æç忣ç»è®¡ |
| | | </span> |
| | | </el-divider> |
| | | <div class="stats-container"> |
| | | <div class="stat-item"> |
| | | <el-tag type="primary" size="medium" effect="dark"> |
| | | <i class="el-icon-s-order"></i> |
| | | åæ£æ»æ°ï¼<b>{{ calculateTotalAssignQuantity() }}</b> |
| | | </el-tag> |
| | | </div> |
| | | <div class="stat-item"> |
| | | <el-tag type="success" size="medium" effect="dark"> |
| | | <i class="el-icon-circle-check"></i> |
| | | 已忣ï¼<b>{{ calculateTotalSortedQuantity() }}</b> |
| | | </el-tag> |
| | | </div> |
| | | <div class="stat-item"> |
| | | <el-tag type="warning" size="medium" effect="dark"> |
| | | <i class="el-icon-time"></i> |
| | | æªåæ£ï¼<b>{{ calculateTotalUnsortedQuantity() }}</b> |
| | | </el-tag> |
| | | </div> |
| | | <div class="stat-item"> |
| | | <el-tag :type="hasWholeOut() ? 'success' : 'warning'" size="medium" effect="dark"> |
| | | <i class="el-icon-box"></i> |
| | | æ¯å¦æ´åºï¼{{ hasWholeOut() ? 'æ¯' : 'å¦' }} |
| | | </el-tag> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | |
| | |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- æçç©æåºåä¿¡æ¯ --> |
| | | <!-- <div class="pallet-inventory" v-if="scanForm.palletCode && unpickedData.length > 0"> |
| | | <el-divider content-position="left"> |
| | | <span style="color: #67C23A; font-size: 14px;"> |
| | | <i class="el-icon-goods"></i> æçç©æåºåä¿¡æ¯ |
| | | </span> |
| | | </el-divider> |
| | | <div class="inventory-container"> |
| | | <el-table :data="unpickedData" size="small" :show-header="true" :border="true" stripe |
| | | highlight-current-row max-height="200" class="inventory-table"> |
| | | <el-table-column type="index" label="åºå·" width="50" align="center" /> |
| | | <el-table-column prop="materielCode" label="ç©æç¼ç " width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="materielName" label="ç©æåç§°" width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="batchNo" label="æ¹æ¬¡å·" width="90" /> |
| | | <el-table-column label="å½ååºå" width="80" align="right"> |
| | | <template #default="scope"> |
| | | <el-text type="primary" tag="b">{{ scope.row.currentStock || 0 }}</el-text> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="忣æ°é" width="80" align="right"> |
| | | <template #default="scope"> |
| | | <el-text type="warning">{{ scope.row.assignQuantity }}</el-text> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="已忣" width="70" align="right"> |
| | | <template #default="scope"> |
| | | <el-text type="success">{{ scope.row.sortedQuantity || 0 }}</el-text> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å©ä½åºå" width="80" align="right"> |
| | | <template #default="scope"> |
| | | <el-text type="info">{{ calculateRemainingStock(scope.row) }}</el-text> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unit" label="åä½" width="100" align="center" /> |
| | | <el-table-column prop="locationCode" label="åºä½" width="150" /> |
| | | <el-table-column label="ç¶æ" width="80" align="center"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStockStatusType(scope.row)" size="mini"> |
| | | {{ getStockStatusText(scope.row) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | |
| | | <print-view ref="printView" @parentcall="parentcall"></print-view> |
| | | |
| | | <!-- ç¡®è®¤å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="confirmDialogVisible" title="æä½ç¡®è®¤" width="400px" :before-close="handleDialogClose"> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- æ´åºç¡®è®¤å¯¹è¯æ¡ --> |
| | | <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"> |
| | | <template #default> |
| | | <div>æ´åºæä½å°ä¸æ¬¡æ§æ£éè¯¥ç©æçææåºåï¼è¯·ç¡®è®¤ä¿¡æ¯æ è¯¯åæ§è¡</div> |
| | | </template> |
| | | </el-alert> |
| | | |
| | | <!-- æçä¿¡æ¯ --> |
| | | <div class="info-section"> |
| | | <h4 class="section-title"> |
| | | <i class="el-icon-box"></i> |
| | | æçä¿¡æ¯ |
| | | </h4> |
| | | <div class="info-grid"> |
| | | <div class="info-item"> |
| | | <label>æçç ï¼</label> |
| | | <span class="info-value">{{ wholeOutInfo.palletCode }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <label>åºä½ï¼</label> |
| | | <span class="info-value">{{ wholeOutInfo.locationCode || 'æªæå®' }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æ´åºç©æè¯¦æ
--> |
| | | <div class="info-section"> |
| | | <h4 class="section-title"> |
| | | <i class="el-icon-s-grid"></i> |
| | | æ´åºç©æè¯¦æ
|
| | | </h4> |
| | | <div class="info-grid"> |
| | | <div class="info-item"> |
| | | <label>ç©æç¼ç ï¼</label> |
| | | <span class="info-value">{{ wholeOutInfo.materielCode }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <label>ç©æåç§°ï¼</label> |
| | | <span class="info-value">{{ wholeOutInfo.materielName }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <label>æ¹æ¬¡å·ï¼</label> |
| | | <span class="info-value">{{ wholeOutInfo.batchNo }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <label>æ´åºæ°éï¼</label> |
| | | <span class="info-value highlight">{{ wholeOutInfo.assignQuantity }} {{ wholeOutInfo.unit |
| | | }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <label>å½ååºåï¼</label> |
| | | <span class="info-value">{{ wholeOutInfo.currentStock || wholeOutInfo.originalQuantity }} {{ |
| | | wholeOutInfo.unit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- æä½æç¤º --> |
| | | <div class="operation-tip"> |
| | | <i class="el-icon-info"></i> |
| | | <span>确认æ§è¡æ´åºæä½åï¼æ¤æä½å°ä¸æ¬¡æ§æ£éè¯¥ç©æçææåºåã</span> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="wholeOutDialogVisible = false" size="medium">åæ¶</el-button> |
| | | <el-button type="warning" @click="executeWholeOut" :loading="executeLoading" size="medium"> |
| | | <i class="el-icon-check"></i> |
| | | 确认æ´åº |
| | | </el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | 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', |
| | | data() { |
| | | return { |
| | |
| | | confirmDialogVisible: false, |
| | | confirmMessage: '', |
| | | currentAction: null, |
| | | executeLoading: false |
| | | executeLoading: false, |
| | | matMixed: true, |
| | | wholeOutDialogVisible: false, |
| | | wholeOutInfo: null, |
| | | globalLoading: false, |
| | | loadingInstance: null |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | this.$router.back() |
| | | return |
| | | } |
| | | |
| | | // å 载订åä¿¡æ¯ |
| | | this.loadOrderInfo() |
| | | |
| | | // èªå¨èç¦å°æçç è¾å
¥æ¡ |
| | | this.$nextTick(() => { |
| | | if (this.$refs.palletInput) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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) { |
| | | |
| | | loadPalletData() { |
| | | } finally { |
| | | this.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | |
| | | async loadPalletData() { |
| | | if (!this.scanForm.palletCode) { |
| | | this.unpickedData = [] |
| | | return |
| | | } |
| | | |
| | | try { |
| | | this.loadUnpickedData(); |
| | | this.loadPickedData(); |
| | | this.showFullScreenLoading() |
| | | await Promise.all([ |
| | | this.loadUnpickedData(), |
| | | this.loadPickedData() |
| | | ]); |
| | | |
| | | } catch (error) { |
| | | console.error('å è½½æçæ°æ®å¤±è´¥:', error) |
| | | this.unpickedData = [] |
| | | } finally { |
| | | this.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | loadUnpickedData() { |
| | | try { |
| | | return new Promise((resolve, reject) => { |
| | | this.http.post(`/api/Outbound/QueryPickingTasks?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => { |
| | | if (response.status) { |
| | | if (response.data.length > 0) { |
| | | this.unpickedData = response.data |
| | | if (response.data.outStockLockInfos.length > 0) { |
| | | this.unpickedData = response.data.outStockLockInfos; |
| | | this.matMixed = response.data.isMatMixed; |
| | | this.calculateUnpickedStats() |
| | | |
| | | // æ£æ¥æ¯å¦éè¦æ´åºç¡®è®¤ |
| | | this.$nextTick(() => { |
| | | if (this.hasWholeOut()) { |
| | | this.showWholeOutConfirm() |
| | | } |
| | | }) |
| | | // èªå¨èç¦å°ç©ææ¡ç è¾å
¥æ¡ |
| | | this.$nextTick(() => { |
| | | if (this.$refs.materialInput) { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.warning('该æçæ æªæ£éä»»å¡') |
| | | if (flag) { |
| | | this.$message.warning('该æçæ æªæ£éä»»å¡') |
| | | } |
| | | this.unpickedData = [] |
| | | } |
| | | resolve() |
| | | } else { |
| | | this.$message.error(response.message || 'è·åæçæ°æ®å¤±è´¥') |
| | | this.unpickedData = [] |
| | | reject(response.message || 'è·åæçæ°æ®å¤±è´¥') |
| | | } |
| | | } |
| | | ) |
| | | |
| | | } catch (error) { |
| | | console.error('å è½½æªæ£éæ°æ®å¤±è´¥:', error) |
| | | } |
| | | }).catch(error => { |
| | | reject(error) |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | loadPickedData() { |
| | | try { |
| | | return new Promise((resolve, reject) => { |
| | | this.http.post(`/api/Outbound/QueryPickedList?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => { |
| | | if (response.status) { |
| | | if (response.data.length > 0) { |
| | | this.pickedData = response.data |
| | | this.calculatePickedStats() |
| | | } else { |
| | | this.$message.warning('该æçæ æªæ£éä»»å¡') |
| | | this.unpickedData = [] |
| | | this.pickedData = [] |
| | | } |
| | | resolve() |
| | | } else { |
| | | this.$message.error(response.message || 'è·åæçæ°æ®å¤±è´¥') |
| | | this.unpickedData = [] |
| | | this.pickedData = [] |
| | | reject(response.message || 'è·åæçæ°æ®å¤±è´¥') |
| | | } |
| | | } |
| | | ) |
| | | |
| | | } catch (error) { |
| | | console.error('å 载已æ£éæ°æ®å¤±è´¥:', error) |
| | | } |
| | | }).catch(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.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) { |
| | | 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.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | |
| | |
| | | this.confirmDialogVisible = true |
| | | }, |
| | | |
| | | executeConfirm() { |
| | | async executeConfirm() { |
| | | this.executeLoading = true |
| | | this.showFullScreenLoading() |
| | | |
| | | try { |
| | | let apiUrl = '' |
| | | let params = { |
| | | orderNo: this.orderNo, |
| | | palletCode: this.scanForm.palletCode |
| | | palletCode: this.scanForm.palletCode, |
| | | station: stationManager.getStation() |
| | | } |
| | | |
| | | 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.hideFullScreenLoading() |
| | | } |
| | | }, |
| | | |
| | | handleDialogClose() { |
| | | if (!this.executeLoading) { |
| | | this.confirmDialogVisible = false |
| | | } |
| | | }, |
| | | |
| | | // æ´åºç¡®è®¤ç¸å
³æ¹æ³ |
| | | showWholeOutConfirm() { |
| | | // è·åéè¦æ´åºçç©æä¿¡æ¯ |
| | | const wholeOutItem = this.unpickedData.find(item => item.assignQuantity === item.originalQuantity); |
| | | if (wholeOutItem) { |
| | | this.wholeOutInfo = { |
| | | palletCode: this.scanForm.palletCode, |
| | | locationCode: wholeOutItem.locationCode, |
| | | materielCode: wholeOutItem.materielCode, |
| | | materielName: wholeOutItem.materielName, |
| | | batchNo: wholeOutItem.batchNo, |
| | | assignQuantity: wholeOutItem.assignQuantity, |
| | | currentStock: wholeOutItem.currentStock, |
| | | originalQuantity: wholeOutItem.originalQuantity, |
| | | unit: wholeOutItem.unit |
| | | }; |
| | | this.wholeOutDialogVisible = true; |
| | | } |
| | | }, |
| | | |
| | | handleWholeOutDialogClose() { |
| | | if (!this.executeLoading) { |
| | | this.wholeOutDialogVisible = false; |
| | | this.wholeOutInfo = null; |
| | | } |
| | | }, |
| | | |
| | | async executeWholeOut() { |
| | | if (!this.wholeOutInfo) { |
| | | this.$message.error('æ´åºä¿¡æ¯æ æ'); |
| | | return; |
| | | } |
| | | |
| | | this.executeLoading = true; |
| | | this.showFullScreenLoading(); |
| | | |
| | | try { |
| | | // è°ç¨æ´åºæ¥å£ï¼è¿é使ç¨ç©æç¼ç ä½ä¸ºæ¡ç |
| | | const response = await this.http.post('/api/Outbound/CompleteOutboundWithPallet', { |
| | | orderNo: this.orderNo, |
| | | palletCode: this.scanForm.palletCode, |
| | | operator: this.getUserName() |
| | | }); |
| | | if (response.status) { |
| | | this.$message.success('æ´åºæä½æå'); |
| | | this.wholeOutDialogVisible = false; |
| | | this.wholeOutInfo = null; |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(response.message || 'æ´åºæä½å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('æ´åºæä½å¤±è´¥'); |
| | | } finally { |
| | | this.executeLoading = false; |
| | | this.hideFullScreenLoading(); |
| | | } |
| | | }, |
| | | |
| | |
| | | }) |
| | | } catch (error) { |
| | | if (error !== 'cancel') { |
| | | console.error('æ¤é失败:', error) |
| | | this.$message.error('æ¤é失败') |
| | | } |
| | | } |
| | |
| | | }, |
| | | |
| | | refreshPickedTable() { |
| | | this.loadPickedData() |
| | | this.loadPickedData().catch(error => { |
| | | console.error('å·æ°å·²æ£éå表失败:', error) |
| | | }) |
| | | }, |
| | | |
| | | resetMaterialBarcode() { |
| | |
| | | return user.userName || user.username || 'æªç»å½ç¨æ·' |
| | | } |
| | | } catch (error) { |
| | | console.error('è·åç¨æ·ä¿¡æ¯å¤±è´¥:', error) |
| | | } |
| | | |
| | | return 'æªç»å½ç¨æ·' |
| | | }, |
| | | |
| | | // 计ç®åæ£æ»æ° |
| | | calculateTotalAssignQuantity() { |
| | | return this.unpickedData.reduce((sum, item) => { |
| | | return sum + (item.assignQuantity || 0) |
| | | }, 0) |
| | | }, |
| | | |
| | | // 计ç®å·²åæ£æ»æ° |
| | | calculateTotalSortedQuantity() { |
| | | return this.unpickedData.reduce((sum, item) => { |
| | | return sum + (item.sortedQuantity || 0) |
| | | }, 0) |
| | | }, |
| | | |
| | | // è®¡ç®æªåæ£æ»æ° |
| | | calculateTotalUnsortedQuantity() { |
| | | return this.unpickedData.reduce((sum, item) => { |
| | | const assignQty = item.assignQuantity || 0 |
| | | const sortedQty = item.sortedQuantity || 0 |
| | | return sum + Math.max(0, assignQty - sortedQty) |
| | | }, 0) |
| | | }, |
| | | |
| | | // æ£æ¥æ¯å¦å
嫿´åº |
| | | hasWholeOut() { |
| | | return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed; |
| | | }, |
| | | |
| | | // 计ç®å©ä½åºå |
| | | calculateRemainingStock(row) { |
| | | const currentStock = row.currentStock || 0 |
| | | const assignQty = row.assignQuantity || 0 |
| | | return Math.max(0, currentStock - assignQty) |
| | | }, |
| | | |
| | | // è·ååºåç¶æç±»å |
| | | getStockStatusType(row) { |
| | | const currentStock = row.currentStock || 0 |
| | | const assignQty = row.assignQuantity || 0 |
| | | const sortedQty = row.sortedQuantity || 0 |
| | | |
| | | if (sortedQty >= assignQty) { |
| | | return 'success' // 已宿 |
| | | } else if (currentStock < assignQty) { |
| | | return 'danger' // åºåä¸è¶³ |
| | | } else { |
| | | return 'warning' // è¿è¡ä¸ |
| | | } |
| | | }, |
| | | |
| | | // è·ååºåç¶æææ¬ |
| | | getStockStatusText(row) { |
| | | const currentStock = row.currentStock || 0 |
| | | const assignQty = row.assignQuantity || 0 |
| | | const sortedQty = row.sortedQuantity || 0 |
| | | |
| | | if (sortedQty >= assignQty) { |
| | | return '已宿' |
| | | } else if (currentStock < assignQty) { |
| | | return 'åºåä¸è¶³' |
| | | } else { |
| | | return '忣ä¸' |
| | | } |
| | | }, |
| | | |
| | | 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) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .el-dialog__header { |
| | | margin: 0; |
| | | } |
| | | </style> |
| | | |
| | | <style scoped> |
| | | .picking-container { |
| | | padding: 20px; |
| | | background-color: #f5f5f5; |
| | | min-height: 100vh; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | /* 订åä¿¡æ¯å¡ç */ |
| | |
| | | ::v-deep .el-descriptions__content { |
| | | color: #606266; |
| | | } |
| | | |
| | | /* è¡¨æ ¼å¢å¼ºæ ·å¼ */ |
| | | ::v-deep .el-table th { |
| | | background-color: #fafafa; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | ::v-deep .el-table .el-text { |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* æ ç¾æ ·å¼å¢å¼º */ |
| | | ::v-deep .el-tag--small { |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* æç¤ºä¿¡æ¯æ ·å¼å¢å¼º */ |
| | | .scan-alert ::v-deep .el-alert__content { |
| | | width: 100%; |
| | | } |
| | | |
| | | .scan-alert ::v-deep .el-alert__description { |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | /* 忣ç»è®¡ä¿¡æ¯æ ·å¼ */ |
| | | .picking-stats { |
| | | margin-top: 20px; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .stats-container { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | align-items: center; |
| | | } |
| | | |
| | | .stat-item { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .stat-item .el-tag { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 6px 12px; |
| | | font-size: 13px; |
| | | border-radius: 20px; |
| | | } |
| | | |
| | | .stat-item .el-tag i { |
| | | margin-right: 6px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .stat-item b { |
| | | margin-left: 4px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* åå²çº¿æ ·å¼ */ |
| | | ::v-deep .el-divider__text { |
| | | background-color: #f5f5f5; |
| | | padding: 0 20px; |
| | | } |
| | | |
| | | /* æçåºåä¿¡æ¯æ ·å¼ */ |
| | | .pallet-inventory { |
| | | margin-top: 20px; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .inventory-container { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .inventory-table { |
| | | width: 100%; |
| | | } |
| | | |
| | | .inventory-table ::v-deep .el-table__header { |
| | | background-color: #f0f9ff; |
| | | } |
| | | |
| | | .inventory-table ::v-deep .el-table__header th { |
| | | background-color: #e1f3ff; |
| | | color: #1f2937; |
| | | font-weight: 600; |
| | | font-size: 12px; |
| | | padding: 8px 0; |
| | | } |
| | | |
| | | .inventory-table ::v-deep .el-table__body td { |
| | | padding: 6px 0; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .inventory-table ::v-deep .el-table__row { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .inventory-table ::v-deep .el-table__row:hover { |
| | | background-color: #f0f9ff; |
| | | } |
| | | |
| | | /* åºåè¡¨æ ¼ä¸çæ ç¾æ ·å¼ */ |
| | | .inventory-table ::v-deep .el-tag--mini { |
| | | font-size: 11px; |
| | | padding: 1px 6px; |
| | | height: 18px; |
| | | line-height: 16px; |
| | | } |
| | | |
| | | /* æ´åºç¡®è®¤å¼¹çªæ ·å¼ */ |
| | | ::v-deep .whole-out-dialog { |
| | | border-radius: 8px; |
| | | } |
| | | |
| | | ::v-deep .whole-out-dialog .el-dialog__header { |
| | | background: linear-gradient(135deg, #E6A23C 0%, #d9971a 100%); |
| | | color: white; |
| | | padding: 15px 20px; |
| | | border-radius: 8px 8px 0 0; |
| | | } |
| | | |
| | | ::v-deep .whole-out-dialog .el-dialog__title { |
| | | color: white; |
| | | font-weight: bold; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | ::v-deep .whole-out-dialog .el-dialog__headerbtn .el-dialog__close { |
| | | color: white; |
| | | font-size: 18px; |
| | | } |
| | | |
| | | .whole-out-content { |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .whole-out-alert { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .whole-out-alert ::v-deep .el-alert__description { |
| | | margin-top: 5px; |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | |
| | | .info-section { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .section-title { |
| | | color: #303133; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | margin-bottom: 10px; |
| | | padding-bottom: 5px; |
| | | border-bottom: 2px solid #E6A23C; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .section-title i { |
| | | margin-right: 8px; |
| | | color: #E6A23C; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | .info-grid { |
| | | display: grid; |
| | | grid-template-columns: 1fr 1fr; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 8px 0; |
| | | border-bottom: 1px solid #f0f0f0; |
| | | } |
| | | |
| | | .info-item label { |
| | | font-weight: 500; |
| | | color: #606266; |
| | | min-width: 80px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .info-item .info-value { |
| | | color: #303133; |
| | | font-size: 14px; |
| | | flex: 1; |
| | | } |
| | | |
| | | .info-item .info-value.highlight { |
| | | color: #E6A23C; |
| | | font-weight: bold; |
| | | font-size: 15px; |
| | | } |
| | | |
| | | .operation-tip { |
| | | background-color: #fff7e6; |
| | | border: 1px solid #ffd591; |
| | | border-radius: 6px; |
| | | padding: 12px 15px; |
| | | margin-top: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .operation-tip i { |
| | | color: #E6A23C; |
| | | margin-right: 8px; |
| | | font-size: 16px; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .operation-tip span { |
| | | color: #606266; |
| | | font-size: 14px; |
| | | line-height: 1.5; |
| | | } |
| | | |
| | | /* ååºå¼è°æ´ */ |
| | | @media (max-width: 768px) { |
| | | .info-grid { |
| | | grid-template-columns: 1fr; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .info-item { |
| | | padding: 6px 0; |
| | | } |
| | | |
| | | .info-item label { |
| | | min-width: 70px; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .info-item .info-value { |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | |
| | | /* Element Plus Loading é®ç½©å±æ ·å¼ä¿®å¤ */ |
| | | ::v-deep .custom-loading { |
| | | background-color: rgba(0, 0, 0, 0.7) !important; |
| | | z-index: 9999 !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; |
| | | } |
| | | |
| | | ::v-deep .el-loading-text { |
| | | color: #ffffff !important; |
| | | font-weight: bold !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; |
| | | } |
| | | |
| | | /* ç¡®ä¿å®¹å¨ç¸å¯¹å®ä½ */ |
| | | .picking-container { |
| | | position: relative !important; |
| | | min-height: 100vh; |
| | | } |
| | | </style> |