From e0a1c1f6925a70f377abc855659b527e18454e95 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期五, 12 十二月 2025 13:56:13 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 22 +++--
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue | 68 +++++++++++++++-
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue | 112 +++++++++++++++++++++++++++
3 files changed, 186 insertions(+), 16 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
index d80b08e..7105202 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/EmptyTrayInbound.vue"
@@ -11,7 +11,7 @@
<el-form-item label="鎵樼洏鏉$爜:">
<el-input v-model="form.palletCode" placeholder="璇锋壂鎻�/杈撳叆鎵樼洏鏉$爜" @keyup.enter="submit" @keyup.13="submit"
- clearable maxlength="50" @paste="handlePaste" @input="handleInput" />
+ clearable maxlength="50" @paste="handlePaste" @input="handleInput" ref="boxCodeInput" />
</el-form-item>
</el-form>
</template>
@@ -47,6 +47,9 @@
open() {
this.show = true
this.getData();
+ this.$nextTick(() => {
+ this.focusInput()
+ })
},
async getData() {
@@ -61,6 +64,7 @@
async submit() {
if (!this.form.palletCode) {
this.$message.warning('璇疯緭鍏ユ墭鐩樻潯鐮�')
+ this.focusInput()
return
}
@@ -81,14 +85,20 @@
)
if (status) {
- this.$message.success("缁勭洏鎴愬姛")
- this.show = false
- this.$emit('refresh')
+ this.$message.success("缁勭洏鎴愬姛");
+ // 娓呯┖杈撳叆妗嗘暟鎹�
+ this.form.palletCode = '';
+ // 鑱氱劍骞堕�変腑杈撳叆妗�
+ this.focusAndSelectInput();
} else {
- this.$message.error(message || '鎿嶄綔澶辫触')
+ this.$message.error(message || '鎿嶄綔澶辫触');
+ // 澶辫触鏃朵笉娓呯悊鏁版嵁锛屼絾鑱氱劍骞堕�変腑杈撳叆妗嗭紝鏂逛究淇敼
+ this.focusAndSelectInput();
}
} catch (error) {
- this.$message.error('璇锋眰寮傚父')
+ this.$message.error('璇锋眰寮傚父');
+ // 寮傚父鏃朵篃涓嶆竻鐞嗘暟鎹�
+ this.focusAndSelectInput();
}
},
@@ -101,6 +111,52 @@
handlePaste(e) {
// 绮樿创鏃惰嚜鍔ㄦ彁浜�
setTimeout(this.submit, 100)
+ },
+
+ // 鑱氱劍骞堕�変腑杈撳叆妗�
+ focusAndSelectInput() {
+ this.$nextTick(() => {
+ setTimeout(() => {
+ const inputRef = this.$refs.boxCodeInput;
+ if (inputRef) {
+ // Element Plus/Element UI 鐨勫鐞嗘柟寮�
+ const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
+ if (inputEl) {
+ inputEl.focus();
+ inputEl.select();
+ }
+ }
+ }, 100);
+ });
+ },
+
+ // 鍙仛鐒﹁緭鍏ユ锛堜笉娓呯┖鏁版嵁锛�
+ focusInput() {
+ this.$nextTick(() => {
+ const inputRef = this.$refs.boxCodeInput;
+ if (inputRef) {
+ const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
+ inputEl?.focus();
+ }
+ });
+ },
+
+ // 娓呯┖琛ㄥ崟鏁版嵁
+ clearForm() {
+ this.form.palletCode = '';
+ // 涓嶆竻绌� locationType锛屼繚鎸佸尯鍩熼�夋嫨
+ }
+ },
+ watch: {
+ show(val) {
+ if (val) {
+ this.$nextTick(() => {
+ this.focusInput()
+ })
+ } else {
+ // 鍏抽棴寮圭獥鏃舵竻绌鸿〃鍗�
+ this.clearForm();
+ }
}
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
index 290038c..61170fd 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
@@ -103,6 +103,32 @@
<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">
@@ -110,7 +136,6 @@
<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">鏈粍鐩� {{ totalStockCount }}</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>
@@ -177,6 +202,10 @@
error: '',
debugMode: false,
currentFocus: 'warehouse',
+
+ unpalletBarcodes:[],
+ unpalletBarcodesLoading: false,
+ unpalletMaterials: [], // 鏈粍鐩樿缁嗘暟鎹垪琛�
// 鎵爜鏋浉鍏冲彉閲�
scanCode: '',
@@ -257,6 +286,7 @@
this.initwarehouseTypes(); // 鍒濆鍖栦粨搴�
this.initLocationTypes(); // 鍒濆鍖栦粨搴撳尯鍩�
this.fetchStockStatistics(); // 鍔犺浇缁熻鏁版嵁
+ this.fetchUnpalletMaterialDetails();
}, 300);
});
}
@@ -276,6 +306,7 @@
this.backData = [];
this.$refs.palletForm?.reset();
this.fetchStockStatistics(); // 鍗曟嵁鍙峰彉浜嗭紝鍒锋柊缁熻
+ this.fetchUnpalletMaterialDetails();
}
}
},
@@ -316,6 +347,43 @@
callback(new Error('璇烽�夋嫨浠撳簱鍖哄煙'));
} else {
callback();
+ }
+ },
+
+ // 鏍规嵁鏉$爜鍒楄〃鑾峰彇璇︾粏鏁版嵁
+ async fetchUnpalletMaterialDetails() {
+ try {
+ // 灏濊瘯璋冪敤鎺ュ彛鑾峰彇璇︾粏鏁版嵁
+ // 娉ㄦ剰锛氬鏋滆繖涓帴鍙d笉瀛樺湪锛屽彲浠ユ敞閲婃帀鎴栨牴鎹疄闄匒PI璋冩暣
+ const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo='+this.docNo, {
+
+ });
+
+ console.log('鏈粍鐩樻暟鎹�:', response.data);
+
+
+ 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 {
+ // 濡傛灉鎺ュ彛杩斿洖鏍煎紡涓嶅悓锛屽皾璇曞叾浠栨柟寮�
+ // 濡傛灉鎺ュ彛涓嶅瓨鍦紝杩欓噷浼氳繘鍏atch锛岃缃负绌烘暟缁�
+ this.unpalletMaterials = [];
+ }
+ } catch (err) {
+ console.warn('鑾峰彇鏈粍鐩樿缁嗘暟鎹帴鍙e彲鑳戒笉瀛樺湪锛屼娇鐢ㄦ潯鐮佸垪琛ㄦ樉绀猴細', err);
+ // 濡傛灉鎺ュ彛涓嶅瓨鍦紝灏嗘潯鐮佸垪琛ㄨ浆鎹负绠�鍗曠殑鏄剧ず鏍煎紡
+ // 鎴栬�呬繚鎸佷负绌猴紝璁╃敤鎴风煡閬撻渶瑕侀�夋嫨浠撳簱鍜屽尯鍩熸潵鏌ョ湅璇︾粏鏁版嵁
+ this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({
+ barcode: barcode,
+ materielCode: '-',
+ batchNo: '-',
+ stockQuantity: '-',
+ unit: '-',
+ supplyCode: '-',
+ warehouseType: '-'
+ }));
}
},
/**
@@ -399,6 +467,7 @@
console.log('浠撳簱鍖哄煙楠岃瘉閫氳繃:', value);
// 鍖哄煙閫夋嫨鍚庯紝鑷姩鑱氱劍鍒版墭鐩樿緭鍏ユ
this.focusLocationSelect();
+ // 鍒锋柊鏈粍鐩樻暟鎹紙鏍规嵁閫夋嫨鐨勪粨搴撳拰鍖哄煙杩囨护锛�
}
});
}, 100);
@@ -555,6 +624,8 @@
this.trayBarcode = '';
this.barcode = '';
this.materials = [];
+ this.unpalletBarcodes = [];
+ this.unpalletMaterials = [];
this.loading = false;
this.error = '';
this.scanCode = '';
@@ -814,6 +885,13 @@
});
});
+ const removeIndex = this.unpalletMaterials.findIndex(item => item.barcode === currentBarcode);
+ if (removeIndex > -1) {
+ this.unpalletMaterials.splice(removeIndex, 1); // 鍒犻櫎鏈粍鐩樺搴旀暟鎹�
+ this.unpalletBarcodes = this.unpalletMaterials.map(item => item.barcode || ''); // 鏇存柊鏉$爜鏁扮粍
+ this.totalStockCount = Math.max(0, this.totalStockCount - 1);
+ }
+
this.$message({
message: `鎴愬姛娣诲姞鏉$爜: ${currentBarcode}`,
type: 'success',
@@ -1297,5 +1375,37 @@
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>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
index 7f0e000..9d1cce9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
@@ -645,15 +645,19 @@
{
resultDTO.UniqueUnit = "";
}
- var validDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(s => s.OrderNo == orderNo).ToList();
- resultDTO.StockSumQuantity = orderDetail.Details.Sum(d => d.OrderQuantity);
- resultDTO.StockCount = orderDetail.Details.Count;
- if (validDetails.Any())
- {
- resultDTO.StockSumQuantity -= validDetails.Sum(d => d.StockQuantity);
- // 鏄庣粏璁板綍鏁帮細绗﹀悎鏉′欢鐨勬湁鏁堣褰曟潯鏁�
- resultDTO.StockCount -= validDetails.Count;
- }
+ var inbound =_inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == orderNo);
+ var inboundDetails = _inboundOrderDetailRepository.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inbound.First().Id).ToList();
+ resultDTO.StockSumQuantity = inboundDetails.Where(x=>x.ReceiptQuantity==0).Sum(x=>x.OrderQuantity);
+ resultDTO.StockCount = inboundDetails.Where(x => x.ReceiptQuantity == 0).Count();
+ //var validDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(s => s.OrderNo == orderNo).ToList();
+ //resultDTO.StockSumQuantity = orderDetail.Details.Sum(d => d.OrderQuantity);
+ //resultDTO.StockCount = orderDetail.Details.Count;
+ //if (validDetails.Any())
+ //{
+ // resultDTO.StockSumQuantity -= validDetails.Sum(d => d.StockQuantity);
+ // // 鏄庣粏璁板綍鏁帮細绗﹀悎鏉′欢鐨勬湁鏁堣褰曟潯鏁�
+ // resultDTO.StockCount -= validDetails.Count;
+ //}
return content.OK("", resultDTO);
}
catch (Exception ex)
--
Gitblit v1.9.3