From 696edbff3c8812e4b820f624d66a02ae6ddb1a06 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 16 四月 2026 13:40:18 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
---
项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue | 609 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 430 insertions(+), 179 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
index 7301271..2ce2088 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
@@ -1,6 +1,7 @@
<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">
@@ -8,9 +9,12 @@
<i class="el-icon-document"></i>
<span class="order-label">璁㈠崟鍙凤細</span>
<span class="order-value">{{ orderNo }}</span>
+ <span class="order-label" style="margin-left: 20px;">浜х嚎鍚嶇О锛�</span>
+ <span class="order-value">{{ orderInfo?.departmentName || '' }}</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>
@@ -153,14 +157,6 @@
</el-table-column>
<el-table-column prop="unit" label="鍗曚綅" width="60" />
<el-table-column prop="locationCode" label="搴撲綅" />
- <!-- <el-table-column label="鎿嶄綔" width="80" align="center">
- <template #default="scope">
- <el-button type="text" size="small" @click="quickPick(scope.row)"
- :disabled="!scanForm.palletCode">
- 鎷i��
- </el-button>
- </template>
- </el-table-column> -->
</el-table>
<div class="table-footer">
@@ -218,13 +214,19 @@
<el-table-column prop="createDate" label="鎷i�夋椂闂�" width="160" />
<el-table-column prop="originalBarcode" label="鍘熺墿鏂欑爜" width="160" />
<el-table-column prop="newBarcode" label="鏂扮墿鏂欑爜" width="160" />
- <!-- <el-table-column label="鎿嶄綔" width="80" align="center">
- <template #default="scope">
- <el-button type="text" size="small" @click="undoPick(scope.row)">
- 鎾ら攢
- </el-button>
- </template>
- </el-table-column> -->
+ <el-table-column label="鎿嶄綔" width="100" align="center">
+ <template #default="scope">
+ <el-button
+ type="danger"
+ size="small"
+ icon="el-icon-refresh-left"
+ @click="handleReversePicking(scope.row)"
+ :disabled="reverseLoading"
+ >
+ 鎾ら攢
+ </el-button>
+ </template>
+ </el-table-column>
</el-table>
<div class="table-footer">
@@ -240,53 +242,6 @@
</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>
@@ -387,9 +342,14 @@
</template>
<script>
-
import printView from "@/extension/outbound/extend/printView.vue"
import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
+import { ElLoading } from 'element-plus'
+
+// 瀵煎叆闊抽鏂囦欢锛堥�傞厤src/assets鐩綍锛寃ebpack鑷姩澶勭悊锛�
+const successAudioSrc = require('@/assets/audio/success.mp3');
+const errorAudioSrc = require('@/assets/audio/error.mp3');
+
export default {
components: { printView },
name: 'OutPicking',
@@ -425,7 +385,12 @@
matMixed: true,
wholeOutDialogVisible: false,
wholeOutInfo: null,
- globalLoading: false
+ globalLoading: false,
+ loadingInstance: null,
+ // 闊抽瀹炰緥锛堢紦瀛橈紝閬垮厤閲嶅鍒涘缓锛�
+ successAudio: null,
+ errorAudio: null,
+ reverseLoading: false
}
},
computed: {
@@ -435,22 +400,129 @@
},
mounted() {
this.initPage()
+ // 鍒濆鍖栭煶棰戝疄渚嬶紙鎳掑姞杞斤紝浠呭垱寤轰竴娆★級
+ this.initAudioInstance()
+ },
+ beforeDestroy() {
+ // 閿�姣侀煶棰戝疄渚嬶紝閲婃斁璧勬簮
+ this.successAudio = null
+ this.errorAudio = null
},
methods: {
+ // 鍒濆鍖栭煶棰戝疄渚嬶紙鏍稿績锛氶�傞厤src/assets璺緞锛岀紦瀛樺疄渚嬶級
+ initAudioInstance() {
+ // 鎴愬姛闊抽瀹炰緥
+ if (!this.successAudio) {
+ this.successAudio = new Audio(successAudioSrc)
+ this.successAudio.onerror = (err) => {
+ console.error('銆愭垚鍔熼煶棰戙�戝姞杞藉け璐�', err)
+ }
+ }
+ if (!this.errorAudio) {
+ this.errorAudio = new Audio(errorAudioSrc)
+ this.errorAudio.onerror = (err) => {
+ console.error('銆愰敊璇煶棰戙�戝姞杞藉け璐�', err)
+ }
+ }
+ },
+
+ async getOrderNoByPallet(palletCode) {
+ if (!palletCode) {
+ this.$message.warning('鎵樼洏鍙蜂笉鑳戒负绌�');
+ return null;
+ }
+
+ try {
+ this.showFullScreenLoading();
+ // 璋冪敤鑾峰彇璁㈠崟鍙风殑鎺ュ彛
+ const response = await this.http.get(`/api/OutboundOrder/GetOrderNoByPalletCode?palletCode=${palletCode}`);
+
+ if (response.status && response.data) {
+ const validOrderNo = response.data;
+ this.playSuccessAudio();
+ this.$message.success(`鎴愬姛鑾峰彇璁㈠崟鍙凤細${validOrderNo}`);
+ return validOrderNo;
+ } else {
+ this.playErrorAudio();
+ const errorMsg = response.message || '璇ユ墭鐩樺彿鏈叧鑱斾换浣曡鍗�';
+ this.$message.error(errorMsg);
+ this.$nextTick(() => {
+ if (this.$refs.palletInput) {
+ this.$refs.palletInput.focus();
+ this.$refs.palletInput.select(); // 閫変腑鍏ㄩ儴鍐呭
+ }
+ });
+ return null;
+ }
+ } catch (error) {
+ this.playErrorAudio();
+ const errorMsg = `鑾峰彇璁㈠崟鍙峰紓甯革細${error.message || '缃戠粶閿欒'}`;
+ this.$message.error(errorMsg);
+ console.error("銆愭墭鐩樺彿鏌ヨ鍗曞彿鎺ュ彛寮傚父銆�", error);
+ this.$nextTick(() => {
+ if (this.$refs.palletInput) {
+ this.$refs.palletInput.focus();
+ this.$refs.palletInput.select(); // 閫変腑鍏ㄩ儴鍐呭
+ }
+ });
+ return null;
+ } finally {
+ this.hideFullScreenLoading();
+ }
+ },
+
+
+ // 鎾斁鎴愬姛闊抽
+ playSuccessAudio() {
+ try {
+ // 閲嶇疆鎾斁杩涘害锛堥伩鍏嶉噸澶嶆挱鏀炬椂闊抽鏈粨鏉燂級
+ this.successAudio.currentTime = 0
+ // 鎾斁锛堝吋瀹规祻瑙堝櫒鑷姩鎾斁绛栫暐闄愬埗锛�
+ this.successAudio.play().catch((err) => {
+ console.warn('鎴愬姛闊抽鎾斁澶辫触锛堟祻瑙堝櫒鑷姩鎾斁绛栫暐闄愬埗锛�', err)
+ })
+ } catch (err) {
+ console.error('鎾斁鎴愬姛闊抽寮傚父', err)
+ }
+ },
+ playErrorAudio() {
+ try {
+ this.errorAudio.currentTime = 0
+ this.errorAudio.play().catch((err) => {
+ console.warn('閿欒闊抽鎾斁澶辫触锛堟祻瑙堝櫒鑷姩鎾斁绛栫暐闄愬埗锛�', err)
+ })
+ } catch (err) {
+ console.error('鎾斁閿欒闊抽寮傚父', err)
+ }
+ },
initPage() {
// 浠庤矾鐢卞弬鏁拌幏鍙栬鍗曞彿
this.orderNo = this.$route.query.orderNo || ''
- if (!this.orderNo) {
- this.$message.error('璁㈠崟鍙蜂笉鑳戒负绌�')
- 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() {
@@ -460,55 +532,94 @@
}
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() {
- 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.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) {
- this.$refs.materialInput.focus()
- }
- })
- } else {
- this.$message.warning('璇ユ墭鐩樻棤鏈嫞閫変换鍔�')
- this.unpickedData = []
+ return new Promise((resolve, reject) => {
+ // 鍏堟竻绌轰箣鍓嶇殑鎻愮ず锛岄伩鍏嶉噸澶嶆彁绀�
+ this.$message.closeAll();
+
+ this.http.post(`/api/Outbound/QueryPickingTasks?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => {
+ if (response.status) {
+ // 鎯呭喌1锛氭湁鏈嫞閫夋暟鎹�
+ if (response.data.outStockLockInfos && response.data.outStockLockInfos.length > 0) {
+ this.unpickedData = response.data.outStockLockInfos;
+ this.matMixed = response.data.isMatMixed;
+ this.orderOver = response.data.orderOver;
+ this.calculateUnpickedStats()
+
+ // 妫�鏌ユ暣鍑虹‘璁�
+ this.$nextTick(() => {
+ if (this.hasWholeOut()) {
+ this.showWholeOutConfirm()
}
- resolve()
- } else {
- this.$message.error(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
- this.unpickedData = []
- reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
- }
- }).catch(error => {
- console.error('鍔犺浇鏈嫞閫夋暟鎹け璐�:', error)
- reject(error)
- })
- })
- },
+ })
+
+ // 鑱氱劍鐗╂枡鏉$爜杈撳叆妗�
+ this.$nextTick(() => {
+ if (this.$refs.materialInput) {
+ this.$refs.materialInput.focus()
+ }
+ })
+ }
+ // 鎯呭喌2锛氭棤鏈嫞閫夋暟鎹�
+ else {
+ this.unpickedData = [];
+ this.calculateUnpickedStats(); // 閲嶇疆缁熻鏁版嵁
+
+ // 鍙嬪ソ鎻愮ず + 浜や簰浼樺寲
+ this.$message.success({
+ message: `鎵樼洏銆�${this.scanForm.palletCode}銆戝凡鎷i�夊畬鎴愶紝鏆傛棤鎷i�夎褰昤,
+ duration: 3000, // 鎻愮ず鏄剧ず3绉�
+ showClose: true // 鍏佽鎵嬪姩鍏抽棴
+ });
+
+ // 娓呯┖鐗╂枡鏉$爜骞惰仛鐒﹀洖鎵樼洏鐮佽緭鍏ユ
+ this.scanForm.materialBarcode = '';
+ this.$nextTick(() => {
+ if (this.$refs.palletInput) {
+ this.$refs.palletInput.focus();
+ }
+ });
+ }
+ resolve();
+ }
+ // 鎯呭喌3锛氭帴鍙h繑鍥炲け璐�
+ else {
+ this.unpickedData = [];
+ this.calculateUnpickedStats();
+
+ this.$message.error({
+ message: response.message || `鑾峰彇鎵樼洏銆�${this.scanForm.palletCode}銆戞嫞閫夋暟鎹け璐,
+ duration: 5000,
+ showClose: true
+ });
+ reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触');
+ }
+ }).catch(error => {
+ // 鎯呭喌4锛氱綉缁�/璇锋眰寮傚父
+ this.unpickedData = [];
+ this.calculateUnpickedStats();
+
+ this.$message.error({
+ message: `鑾峰彇鎵樼洏銆�${this.scanForm.palletCode}銆戞嫞閫夋暟鎹紓甯革細${error.message || '缃戠粶閿欒锛岃閲嶈瘯'}`,
+ duration: 5000,
+ showClose: true
+ });
+ reject(error);
+ })
+ })
+},
loadPickedData() {
return new Promise((resolve, reject) => {
@@ -519,15 +630,16 @@
this.calculatePickedStats()
} else {
this.pickedData = []
+
}
resolve()
+
} else {
this.$message.error(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
this.pickedData = []
reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
}
}).catch(error => {
- console.error('鍔犺浇宸叉嫞閫夋暟鎹け璐�:', error)
reject(error)
})
})
@@ -564,10 +676,76 @@
this.pickedTotal = this.pickedCount
},
- handlePalletScan() {
- if (this.scanForm.palletCode) {
- // this.$message.success(`鎵樼洏鐮�: ${this.scanForm.palletCode}`)
- this.loadPalletData()
+ handlePalletScan(flag = true) {
+ const palletCode = this.scanForm.palletCode.trim();
+ if (!palletCode) {
+ return;
+ }
+
+ this.$nextTick(() => {
+ if (this.$refs.palletInput) {
+ this.$refs.palletInput.focus();
+ this.$refs.palletInput.select(); // 閫変腑鍏ㄩ儴鍐呭
+ }
+ });
+ // 鍏堟牴鎹墭鐩樺彿鑾峰彇璁㈠崟鍙�
+ this.getOrderNoByPallet(palletCode).then((orderNo) => {
+ if (orderNo) {
+ // 璧嬪�艰鍗曞彿锛屼緵鍚庣画閫昏緫浣跨敤
+ this.orderNo = orderNo;
+ // 鍒锋柊璁㈠崟淇℃伅
+ this.loadOrderInfo();
+ }
+ this.loadPalletData(flag);
+ });
+ },
+
+ async handleReversePicking(row) {
+ // 1. 浜屾纭
+ try {
+ await this.$confirm(
+ '纭畾瑕佹挙閿�杩欐潯鎷i�夎褰曞悧锛熸挙閿�鍚庡簱瀛樺皢鎭㈠锛屽嚭搴撳崟鐘舵�佷篃浼氬悓姝ユ洿鏂�',
+ '鎾ら攢纭',
+ {
+ type: 'warning',
+ confirmButtonText: '纭鎾ら攢',
+ cancelButtonText: '鍙栨秷',
+ closeOnClickModal: false
+ }
+ );
+
+ // 2. 鎵ц鎾ら攢
+ this.reverseLoading = true;
+ this.showFullScreenLoading();
+
+ // 3. 璋冪敤鎾ら攢鎺ュ彛锛堥�傞厤浣犲悗绔殑鎾ら攢鎺ュ彛鍦板潃锛�
+ const response = await this.http.post('/api/Outbound/ReversePickingWithBarcode', {
+ Barcode: row.originalBarcode || row.newBarcode, // 浼樺厛鍙栧師鏉$爜锛屾棤鍒欏彇鏂版潯鐮�
+ OrderNo: this.orderNo,
+ PalletCode: row.palletCode || this.scanForm.palletCode,
+ Operator: this.getUserName(),
+ OrderType: this.orderInfo?.orderType || 0 // 璁㈠崟绫诲瀷锛屾棤鍒欎紶0
+ });
+
+ // 4. 澶勭悊缁撴灉
+ if (response.status) {
+ this.$message.success('鎾ら攢鎷i�夋垚鍔�');
+ this.playSuccessAudio(); // 鎾斁鎴愬姛闊抽
+ // 鍒锋柊鏁版嵁鍒楄〃
+ await this.loadPalletData(false);
+ } else {
+ this.$message.error(response.message || '鎾ら攢鎷i�夊け璐�');
+ this.playErrorAudio();
+ }
+ } catch (error) {
+ // 鍙栨秷纭涓嶆姤閿�
+ if (error !== 'cancel') {
+ this.$message.error('鎾ら攢鎷i�夊け璐ワ細' + (error.message || '缃戠粶寮傚父'));
+ this.playErrorAudio();
+ }
+ } finally {
+ this.reverseLoading = false;
+ this.hideFullScreenLoading();
}
},
@@ -587,41 +765,43 @@
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('鎷i�夌‘璁ゆ垚鍔�')
- this.resetMaterialBarcode()
- // this.loadUnpickedData()
- // this.loadPickedData()
- this.loadPalletData()
- } else {
- this.$message.error(response.message || '鎷i�夌‘璁ゅけ璐�')
- }
})
+ 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('鎷i�夌‘璁ゆ垚鍔�')
+ // 鎺ュ彛鎴愬姛锛氭挱鏀炬垚鍔熼煶棰�
+ this.playSuccessAudio()
+ this.resetMaterialBarcode()
+ await this.loadPalletData(false)
+ } else {
+ this.$message.error(response.message || '鎷i�夌‘璁ゅけ璐�')
+ this.scanForm.materialBarcode = '';
+ this.playErrorAudio()
+ }
} catch (error) {
- console.error('鎷i�夌‘璁ゅけ璐�:', error)
this.$message.error('鎷i�夌‘璁ゅけ璐�')
+ this.scanForm.materialBarcode = '';
+ this.playErrorAudio()
} finally {
this.confirmLoading = false
- this.globalLoading = false
+ this.hideFullScreenLoading()
}
},
@@ -647,9 +827,9 @@
this.confirmDialogVisible = true
},
- executeConfirm() {
+ async executeConfirm() {
this.executeLoading = true
- this.globalLoading = true
+ this.showFullScreenLoading()
try {
let apiUrl = ''
@@ -658,31 +838,26 @@
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()
+ } else {
+ this.$message.error(response.message || '鎿嶄綔澶辫触')
+ }
} catch (error) {
- console.error('鎿嶄綔澶辫触:', error)
this.$message.error('鎿嶄綔澶辫触')
} finally {
this.executeLoading = false
- this.globalLoading = false
+ this.hideFullScreenLoading()
}
},
@@ -696,7 +871,6 @@
showWholeOutConfirm() {
// 鑾峰彇闇�瑕佹暣鍑虹殑鐗╂枡淇℃伅
const wholeOutItem = this.unpickedData.find(item => item.assignQuantity === item.originalQuantity);
- console.log('wholeOutItem:', wholeOutItem);
if (wholeOutItem) {
this.wholeOutInfo = {
palletCode: this.scanForm.palletCode,
@@ -720,37 +894,35 @@
}
},
- 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();
}
},
@@ -778,16 +950,10 @@
})
} catch (error) {
if (error !== 'cancel') {
- console.error('鎾ら攢澶辫触:', error)
this.$message.error('鎾ら攢澶辫触')
}
}
},
-
- // handleUnpickedRowClick(row) {
- // // 鐐瑰嚮鏈嫞閫夎鏃惰嚜鍔ㄥ~鍏呯墿鏂欐潯鐮�
- // this.scanForm.materialBarcode = row.materielCode
- // },
refreshUnpickedTable() {
if (this.scanForm.palletCode) {
@@ -835,7 +1001,6 @@
return user.userName || user.username || '鏈櫥褰曠敤鎴�'
}
} catch (error) {
- console.error('鑾峰彇鐢ㄦ埛淇℃伅澶辫触:', error)
}
return '鏈櫥褰曠敤鎴�'
@@ -866,8 +1031,7 @@
// 妫�鏌ユ槸鍚﹀寘鍚暣鍑�
hasWholeOut() {
- console.log('妫�鏌ユ暣鍑虹姸鎬�:', this.unpickedData.some(item => item.assignQuantity === item.originalQuantity));
- return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed;
+ return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed && !this.orderOver
},
// 璁$畻鍓╀綑搴撳瓨
@@ -910,12 +1074,46 @@
getStatusType(status) {
const statusMap = {
0: 'info', // 寰呭鐞�
- 10: 'warning', // 杩涜涓�
+ 1: 'warning', // 杩涜涓�
20: 'primary', // 鎷i�変腑
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
+ // 鍚屾椂涔熸祴璇曞叏灞弆oading
+ this.showFullScreenLoading()
+ setTimeout(() => {
+ this.globalLoading = false
+ this.hideFullScreenLoading()
+ }, 3000)
}
}
}
@@ -1378,18 +1576,71 @@
}
/* 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(255, 255, 255, 0.8);
- z-index: 2000;
+ background-color: rgba(0, 0, 0, 0.7) !important;
+ z-index: 9999 !important;
}
::v-deep .el-loading-spinner {
- z-index: 2001;
+ z-index: 10000 !important;
}
::v-deep .el-loading-text {
- color: #409EFF;
- font-weight: bold;
- font-size: 14px;
+ 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;
+}
+
+/* 纭繚瀵硅瘽妗嗕笉浼氶伄鐩杔oading */
+::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>
\ No newline at end of file
--
Gitblit v1.9.3