From a81ef02fb222b9d3615632fc8cf2e53d9676220d Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期四, 18 十二月 2025 15:20:29 +0800
Subject: [PATCH] 1
---
项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue | 379 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 350 insertions(+), 29 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 16b62c5..7301271 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,5 +1,6 @@
<template>
- <div class="picking-container">
+ <div class="picking-container" v-loading="globalLoading" element-loading-text="澶勭悊涓�..."
+ element-loading-background="rgba(255, 255, 255, 0.8)">
<!-- 椤堕儴璁㈠崟淇℃伅 -->
<el-card class="order-info-card" shadow="never">
<div class="order-header">
@@ -35,8 +36,8 @@
<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>
@@ -105,7 +106,7 @@
</el-tag>
</div>
<div class="stat-item">
- <el-tag type="success" size="medium" effect="dark">
+ <el-tag :type="hasWholeOut() ? 'success' : 'warning'" size="medium" effect="dark">
<i class="el-icon-box"></i>
鏄惁鏁村嚭锛歿{ hasWholeOut() ? '鏄�' : '鍚�' }}
</el-tag>
@@ -304,12 +305,91 @@
</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";
export default {
components: { printView },
name: 'OutPicking',
@@ -342,7 +422,10 @@
confirmMessage: '',
currentAction: null,
executeLoading: false,
- matMixed: true
+ matMixed: true,
+ wholeOutDialogVisible: false,
+ wholeOutInfo: null,
+ globalLoading: false
}
},
computed: {
@@ -370,30 +453,40 @@
})
},
- loadPalletData() {
+ async loadPalletData() {
if (!this.scanForm.palletCode) {
this.unpickedData = []
return
}
try {
- this.loadUnpickedData();
- this.loadPickedData();
+ this.globalLoading = true
+ await Promise.all([
+ this.loadUnpickedData(),
+ this.loadPickedData()
+ ]);
} catch (error) {
console.error('鍔犺浇鎵樼洏鏁版嵁澶辫触:', error)
this.unpickedData = []
+ } finally {
+ this.globalLoading = false
}
},
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.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) {
@@ -404,20 +497,21 @@
this.$message.warning('璇ユ墭鐩樻棤鏈嫞閫変换鍔�')
this.unpickedData = []
}
+ resolve()
} else {
this.$message.error(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
this.unpickedData = []
+ reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
}
- }
- )
-
- } catch (error) {
- console.error('鍔犺浇鏈嫞閫夋暟鎹け璐�:', error)
- }
+ }).catch(error => {
+ console.error('鍔犺浇鏈嫞閫夋暟鎹け璐�:', 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) {
@@ -426,16 +520,17 @@
} else {
this.pickedData = []
}
+ resolve()
} else {
this.$message.error(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
this.pickedData = []
+ reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
}
- }
- )
-
- } catch (error) {
- console.error('鍔犺浇宸叉嫞閫夋暟鎹け璐�:', error)
- }
+ }).catch(error => {
+ console.error('鍔犺浇宸叉嫞閫夋暟鎹け璐�:', error)
+ reject(error)
+ })
+ })
},
// 璁$畻鏈嫞閫�
@@ -473,8 +568,6 @@
if (this.scanForm.palletCode) {
// this.$message.success(`鎵樼洏鐮�: ${this.scanForm.palletCode}`)
this.loadPalletData()
-
-
}
},
@@ -501,6 +594,7 @@
}
this.confirmLoading = true
+ this.globalLoading = true
try {
this.http.post('/api/Outbound/CompleteOutboundWithBarcode', {
@@ -527,6 +621,7 @@
this.$message.error('鎷i�夌‘璁ゅけ璐�')
} finally {
this.confirmLoading = false
+ this.globalLoading = false
}
},
@@ -554,14 +649,16 @@
executeConfirm() {
this.executeLoading = true
+ this.globalLoading = true
try {
let apiUrl = ''
let params = {
orderNo: this.orderNo,
- palletCode: this.scanForm.palletCode
+ palletCode: this.scanForm.palletCode,
+ station: stationManager.getStation()
}
-
+ console.log(params);
if (this.currentAction === 'emptyBox') {
apiUrl = '/api/Outbound/EmptyBox'
} else if (this.currentAction === 'returnToWarehouse') {
@@ -585,12 +682,75 @@
this.$message.error('鎿嶄綔澶辫触')
} finally {
this.executeLoading = false
+ this.globalLoading = false
}
},
handleDialogClose() {
if (!this.executeLoading) {
this.confirmDialogVisible = false
+ }
+ },
+
+ // 鏁村嚭纭鐩稿叧鏂规硶
+ showWholeOutConfirm() {
+ // 鑾峰彇闇�瑕佹暣鍑虹殑鐗╂枡淇℃伅
+ const wholeOutItem = this.unpickedData.find(item => item.assignQuantity === item.originalQuantity);
+ console.log('wholeOutItem:', wholeOutItem);
+ 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;
+ }
+ },
+
+ executeWholeOut() {
+ if (!this.wholeOutInfo) {
+ this.$message.error('鏁村嚭淇℃伅鏃犳晥');
+ return;
+ }
+
+ this.executeLoading = true;
+ this.globalLoading = true;
+
+ try {
+ // 璋冪敤鏁村嚭鎺ュ彛锛岃繖閲屼娇鐢ㄧ墿鏂欑紪鐮佷綔涓烘潯鐮�
+ 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 || '鏁村嚭鎿嶄綔澶辫触');
+ }
+ });
+ } catch (error) {
+ console.error('鏁村嚭鎿嶄綔澶辫触:', error);
+ this.$message.error('鏁村嚭鎿嶄綔澶辫触');
+ } finally {
+ this.executeLoading = false;
+ this.globalLoading = false;
}
},
@@ -636,7 +796,9 @@
},
refreshPickedTable() {
- this.loadPickedData()
+ this.loadPickedData().catch(error => {
+ console.error('鍒锋柊宸叉嫞閫夊垪琛ㄥけ璐�:', error)
+ })
},
resetMaterialBarcode() {
@@ -704,7 +866,8 @@
// 妫�鏌ユ槸鍚﹀寘鍚暣鍑�
hasWholeOut() {
- return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && this.matMixed;
+ console.log('妫�鏌ユ暣鍑虹姸鎬�:', this.unpickedData.some(item => item.assignQuantity === item.originalQuantity));
+ return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed;
},
// 璁$畻鍓╀綑搴撳瓨
@@ -758,11 +921,19 @@
}
</script>
+<style>
+.el-dialog__header {
+ margin: 0;
+}
+</style>
+
<style scoped>
.picking-container {
padding: 20px;
background-color: #f5f5f5;
min-height: 100vh;
+ position: relative;
+ overflow: hidden;
}
/* 璁㈠崟淇℃伅鍗$墖 */
@@ -1071,4 +1242,154 @@
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 .el-loading-mask {
+ background-color: rgba(255, 255, 255, 0.8);
+ z-index: 2000;
+}
+
+::v-deep .el-loading-spinner {
+ z-index: 2001;
+}
+
+::v-deep .el-loading-text {
+ color: #409EFF;
+ font-weight: bold;
+ font-size: 14px;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3