From e4e304318532574e418bc01b5a45b8836dac3e1a Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期四, 11 十二月 2025 23:26:20 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/AllocateStockSelect.vue | 18 +
项目代码/WIDESEA_WMSClient/src/views/Login.vue | 253 ++++++++++++++++----
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue | 23 +
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoService.cs | 4
项目代码/WIDESEA_WMSClient/src/uitils/stationManager.js | 100 ++++++++
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs | 56 ---
项目代码/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue | 19 +
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs | 66 ++++-
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue | 17 +
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue | 6
项目代码/WIDESEA_WMSClient/src/views/Index.vue | 11
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue | 6
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs | 124 +++++----
13 files changed, 528 insertions(+), 175 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
index 5afa986..7c06d28 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/StockSelect.vue"
@@ -173,7 +173,7 @@
<script>
import VolBox from "@/components/basic/VolBox.vue";
import { ElMessage } from "element-plus";
-
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
export default {
components: { VolBox },
data() {
@@ -216,6 +216,17 @@
],
};
},
+ onMounted() {
+ // 浠庢湰鍦板瓨鍌ㄥ姞杞戒繚瀛樼殑绔欏彴鍊�
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
+ if (savedStation) {
+ outboundForm.selectedPlatform = savedStation;
+ } else if (stationOptions.length > 0) {
+ // 濡傛灉娌℃湁淇濆瓨鐨勫�硷紝浣跨敤绗竴涓�夐」
+ //stationValue.value = stationOptions[0].value;
+ }
+ },
methods: {
open(row) {
this.row = row;
@@ -247,8 +258,14 @@
if (this.selection.length === 0) {
return ElMessage.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
+
// 閲嶇疆琛ㄥ崟閬垮厤娈嬬暀鍊�
this.outboundForm.selectedPlatform = "";
+ const savedStation = stationManager.getStation();
+
+ if (savedStation) {
+ outboundForm.selectedPlatform = savedStation;
+ }
this.showOutboundDialog = true;
},
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocateStockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocateStockSelect.vue"
index 1e1c625..103eb4f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocateStockSelect.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllocateStockSelect.vue"
@@ -126,7 +126,7 @@
<script>
import VolBox from "@/components/basic/VolBox.vue";
import { ElMessage } from "element-plus";
-
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
export default {
components: { VolBox },
data() {
@@ -161,6 +161,17 @@
],
};
},
+ onMounted() {
+ // 浠庢湰鍦板瓨鍌ㄥ姞杞戒繚瀛樼殑绔欏彴鍊�
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
+ if (savedStation) {
+ outboundForm.selectedPlatform = savedStation;
+ } else if (stationOptions.length > 0) {
+ // 濡傛灉娌℃湁淇濆瓨鐨勫�硷紝浣跨敤绗竴涓�夐」
+ //stationValue.value = stationOptions[0].value;
+ }
+ },
methods: {
open(row) {
this.row = row;
@@ -193,6 +204,11 @@
}
// 閲嶇疆琛ㄥ崟閬垮厤娈嬬暀鍊�
this.outboundForm.selectedPlatform = "";
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
+ if (savedStation) {
+ this.outboundForm.selectedPlatform = savedStation;
+ }
this.showOutboundDialog = true;
},
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue"
index b525dbb..7e59689 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockSelect.vue"
@@ -126,7 +126,7 @@
<script>
import VolBox from "@/components/basic/VolBox.vue";
import { ElMessage } from "element-plus";
-
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
export default {
components: { VolBox },
data() {
@@ -160,6 +160,17 @@
],
};
},
+ onMounted() {
+ // 浠庢湰鍦板瓨鍌ㄥ姞杞戒繚瀛樼殑绔欏彴鍊�
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
+ if (savedStation) {
+ outboundForm.selectedPlatform.value = savedStation;
+ } else if (stationOptions.length > 0) {
+ // 濡傛灉娌℃湁淇濆瓨鐨勫�硷紝浣跨敤绗竴涓�夐」
+ //stationValue.value = stationOptions[0].value;
+ }
+ },
methods: {
open(row) {
this.row = row;
@@ -192,6 +203,10 @@
}
// 閲嶇疆琛ㄥ崟閬垮厤娈嬬暀鍊�
this.outboundForm.selectedPlatform = "";
+ const savedStation = stationManager.getStation();
+ if (savedStation) {
+ outboundForm.selectedPlatform = savedStation;
+ }
this.showOutboundDialog = true;
},
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
index 0537356..6c0819e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/allocateOrderDetail.vue"
@@ -112,6 +112,7 @@
import SelectedStock from "./SelectedStock.vue";
import { h,createVNode, render,reactive } from 'vue';
import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElMessage } from 'element-plus';
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
export default {
components: { VolBox, VolForm, StockSelect, SelectedStock },
data() {
@@ -344,6 +345,11 @@
const formData = reactive({
selectedPlatform: platformOptions[0].value // 榛樿缁戝畾銆岀珯鍙�3銆嶇殑value
});
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
+ if (savedStation) {
+ formData.selectedPlatform = savedStation;
+ }
// 3. 鍔ㄦ�佸垱寤哄脊绐楃粍浠�
const vnode = createVNode(ElDialog, {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue"
index 222779e..4b220dc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/newAllocateOrderDetail.vue"
@@ -131,6 +131,7 @@
import { h,createVNode, render,reactive } from 'vue';
import { ElDialog , ElForm, ElFormItem, ElSelect,ElOption, ElButton, ElInput, ElMessage } from 'element-plus';
import { th } from 'element-plus/es/locale';
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
export default {
components: { VolBox, VolForm, StockSelect, SelectedStock,NoStockOut},
@@ -381,7 +382,10 @@
const formData = reactive({
selectedPlatform: platformOptions[0].value // 榛樿缁戝畾銆岀珯鍙�3銆嶇殑value
});
-
+ const savedStation = stationManager.getStation();
+ if (savedStation) {
+ formData.selectedPlatform = savedStation;
+ }
// 3. 鍔ㄦ�佸垱寤哄脊绐楃粍浠�
const vnode = createVNode(ElDialog, {
title: '鍑哄簱鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴',
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue"
index cc9b8be..1c48097 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue"
@@ -129,6 +129,7 @@
import StockSelect from "./StockSelect.vue";
import SelectedStock from "./SelectedStock.vue";
import NoStockOut from "./NoStockOut.vue";
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
import { h, createVNode, render, reactive } from "vue";
import {
ElDialog,
@@ -316,6 +317,17 @@
dictionaryList: null,
};
},
+ onMounted() {
+ // 浠庢湰鍦板瓨鍌ㄥ姞杞戒繚瀛樼殑绔欏彴鍊�
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
+ if (savedStation) {
+ outboundForm.selectedPlatform = savedStation;
+ } else if (stationOptions.length > 0) {
+ // 濡傛灉娌℃湁淇濆瓨鐨勫�硷紝浣跨敤绗竴涓�夐」
+ //stationValue.value = stationOptions[0].value;
+ }
+ },
methods: {
toggleAssignStockColumn() {
const assignStockColumn = this.tableColumns.find(
@@ -390,6 +402,8 @@
});
},
outbound() {
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
if (this.selection.length === 0) {
return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
@@ -404,6 +418,9 @@
selectedPlatform: platformOptions[0].value,
});
+ if (savedStation) {
+ formData.selectedPlatform = savedStation;
+ }
const vnode = createVNode(
ElDialog,
{
@@ -532,6 +549,8 @@
render(vnode, mountNode);
},
outboundbatch() {
+ const savedStation = stationManager.getStation();
+ console.log(savedStation);
if (this.selection.length === 0) {
return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
}
@@ -549,7 +568,9 @@
selectedPlatform: platformOptions[0].value,
outboundDecimal: "",
});
-
+ if (savedStation) {
+ formData.selectedPlatform = savedStation;
+ }
const vnode = createVNode(
ElDialog,
{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/uitils/stationManager.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/uitils/stationManager.js"
new file mode 100644
index 0000000..2899b76
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/uitils/stationManager.js"
@@ -0,0 +1,100 @@
+// 鏈湴瀛樺偍閿悕
+export const STATION_STORAGE_KEY = "wms_selected_station";
+
+/**
+ * 绔欏彴绠$悊鍣� - 鎻愪緵绔欏彴淇℃伅鐨勬寔涔呭寲瀛樺偍鍜岃幏鍙�
+ */
+export const stationManager = {
+ /**
+ * 淇濆瓨绔欏彴淇℃伅鍒版湰鍦板瓨鍌�
+ * @param {string} station - 绔欏彴鍊�
+ */
+ saveStation(station) {
+ try {
+ // 浣跨敤localStorage杩涜鎸佷箙鍖栧瓨鍌�
+ localStorage.setItem(STATION_STORAGE_KEY, station);
+
+ // 鍚屾椂淇濆瓨鍒皊essionStorage锛屼綔涓哄鐢�
+ sessionStorage.setItem(STATION_STORAGE_KEY, station);
+
+ // 瑙﹀彂鑷畾涔変簨浠讹紝閫氱煡鍏朵粬缁勪欢绔欏彴宸叉洿鏂�
+ window.dispatchEvent(new CustomEvent('station-changed', {
+ detail: { station }
+ }));
+
+ console.log(`绔欏彴宸蹭繚瀛�: ${station}`);
+ } catch (error) {
+ console.error("淇濆瓨绔欏彴淇℃伅澶辫触:", error);
+ }
+ },
+
+ /**
+ * 鑾峰彇淇濆瓨鐨勭珯鍙颁俊鎭�
+ * @returns {string|null} 绔欏彴鍊兼垨null
+ */
+ getStation() {
+ try {
+ // 浼樺厛浠巐ocalStorage鑾峰彇
+ let station = localStorage.getItem(STATION_STORAGE_KEY);
+
+ // 濡傛灉localStorage娌℃湁锛屽皾璇曚粠sessionStorage鑾峰彇
+ if (!station) {
+ station = sessionStorage.getItem(STATION_STORAGE_KEY);
+ }
+
+ return station;
+ } catch (error) {
+ console.error("鑾峰彇绔欏彴淇℃伅澶辫触:", error);
+ return null;
+ }
+ },
+
+ /**
+ * 娓呴櫎绔欏彴淇℃伅
+ */
+ clearStation() {
+ try {
+ localStorage.removeItem(STATION_STORAGE_KEY);
+ sessionStorage.removeItem(STATION_STORAGE_KEY);
+ console.log("绔欏彴淇℃伅宸叉竻闄�");
+ } catch (error) {
+ console.error("娓呴櫎绔欏彴淇℃伅澶辫触:", error);
+ }
+ },
+
+ /**
+ * 鐩戝惉绔欏彴鍙樺寲
+ * @param {Function} callback - 鍙樺寲鍥炶皟鍑芥暟
+ * @returns {Function} 鍙栨秷鐩戝惉鐨勫嚱鏁�
+ */
+ onStationChange(callback) {
+ const handler = (event) => {
+ if (callback && typeof callback === 'function') {
+ callback(event.detail.station);
+ }
+ };
+
+ window.addEventListener('station-changed', handler);
+
+ // 杩斿洖鍙栨秷鐩戝惉鐨勫嚱鏁�
+ return () => {
+ window.removeEventListener('station-changed', handler);
+ };
+ },
+
+ /**
+ * 鑾峰彇绔欏彴鏄剧ず鏍囩
+ * @param {string} value - 绔欏彴鍊�
+ * @param {Array} options - 绔欏彴閫夐」鏁扮粍
+ * @returns {string} 绔欏彴鏍囩
+ */
+ getStationLabel(value, options) {
+ if (!value || !options) return value || '';
+
+ const option = options.find(opt => opt.value === value);
+ return option ? option.label : value;
+ }
+};
+
+// 榛樿瀵煎嚭
+export default stationManager;
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Index.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Index.vue"
index a087196..7084e70 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Index.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Index.vue"
@@ -24,7 +24,7 @@
</div>
<div class="vol-container" :style="{ left: menuWidth - 1 + 'px' }">
<div class="vol-header">
- <div class="project-name">WMS</div>
+ <div class="project-name">WMS {{ stationValue.replace('-1','') }}绔欏彴</div>
<div class="header-text">
<div class="h-link">
<a
@@ -203,6 +203,7 @@
import VolMenu from "@/components/basic/VolElementMenu.vue";
import Message from "./index/Message.vue";
import MessageConfig from "./index/MessageConfig.js";
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
var imgUrl = require("@/assets/imgs/wms_x.png");
var $this;
var $interval;
@@ -241,7 +242,12 @@
},
setup(props, context) {
let client = ref(null);
-
+ const stationValue = ref("");
+ const savedStation = stationManager.getStation();
+ console.log("Saved Station:", savedStation);
+ if (savedStation) {
+ stationValue.value = savedStation;
+ }
// 鑾峰彇鍏ㄥ眬灞炴�у拰鏂规硶
const { proxy } = getCurrentInstance();
@@ -686,6 +692,7 @@
visibleItem,
closeTabsMenu,
closeTabs,
+ stationValue,
currentMenuId,
};
},
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Login.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Login.vue"
index 6283b76..d810f15 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Login.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/Login.vue"
@@ -29,9 +29,27 @@
placeholder="璇疯緭鍏ュ瘑鐮�"
/>
</div>
+
+ <div class="item station-select-item">
+ <div class="input-icon el-icon-lock"></div>
+ <el-select
+ v-model="stationValue"
+ placeholder="閫夋嫨绔欏彴"
+ class="station-select"
+ @change="handleStationChange"
+ >
+ <el-option
+ v-for="item in stationOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ </div>
+
+
<div class="item">
<div class="input-icon el-icon-mobile"></div>
-
<input
v-focus
type="text"
@@ -56,72 +74,61 @@
<span v-else>姝e湪鐧诲綍...</span>
</el-button>
</div>
-
- <!-- 璐﹀彿淇℃伅 -->
- <!-- <div class="account-info">
- <p>婕旂ず璐﹀彿锛歛dmin666 瀵嗙爜:123456</p>
- <p>鏈湴璐﹀彿锛歛dmin 瀵嗙爜:123456</p>
- <p><a href="https://jq.qq.com/?_wv=1027&k=Sqstuy0M" style="text-decoration: none"
- target="_blank">QQ3缇�:743852316</a>
-
- <a href="http://v2.volcore.xyz/document/guide" style="text-decoration: none" target="_blank">妗嗘灦鏂囨。</a>
- </p>
- </div> -->
- <!-- 閾炬帴浣嶇疆 -->
- <!-- <div class="app-link" >
- <a href="#" style="text-decoration: none">绉诲姩绔壂鐮�</a>
- <a>
- <i class="el-icon-chat-dot-round"></i> 灏忕▼搴�
- <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/wechat.jpg" /></a>
- <a>
- <i class="el-icon-apple"></i>
- Android
- <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/Android.png" /></a>
- <a>
- <i class="el-icon-document"></i>
- H5
- <img src="https://app-1256993465.cos.ap-nanjing.myqcloud.com/H5.png" /></a>
- </div> -->
</div>
-
- <!-- 椤甸潰搴曢儴 -->
- <!-- <div class="login-footer">
- <a style="text-decoration: none" href="https://beian.miit.gov.cn/" target="_blank">浜琁CP澶�19056538鍙�-1</a>
-
-
- <a href="https://dotnet9.com/" style="text-decoration: none" target="blank">Dotnet9</a>
- <a href="https://space.bilibili.com/525836469" style="text-decoration: none" target="blank">NET瑙嗛鏁欑▼(寰蒋MVP-ACE褰曞埗)</a>
- <a href="https://www.cctalk.com/m/group/90268531" style="text-decoration: none" target="blank">VOL妗嗘灦瑙嗛</a>
- <a href="http://120.48.115.252:9990" style="text-decoration: none" target="blank">瑙嗛婕旂ず鍦板潃</a>
- </div> -->
<img class="login-bg" src="/static/login_bg.png" />
</div>
</template>
-
-<script >
+<script>
import {
defineComponent,
ref,
reactive,
toRefs,
getCurrentInstance,
+ onMounted,
} from "vue";
import { useRouter, useRoute } from "vue-router";
import store from "../store/index";
import http from "@/../src/api/http.js";
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
export default defineComponent({
setup(props, context) {
store.commit("clearUserInfo", "");
const loading = ref(false);
const codeImgSrc = ref("");
+ const value = ref("");
const userInfo = reactive({
userName: "",
password: "",
verificationCode: "",
UUID: undefined,
});
+ const stationValue = ref("");
+ const stationOptions = reactive([
+ { label: "绔欏彴2", value: "2-1" },
+ { label: "绔欏彴3", value: "3-1" },
+ ]);
+ // 鍒濆鍖栫珯鍙板��
+ onMounted(() => {
+ // 浠庢湰鍦板瓨鍌ㄥ姞杞戒繚瀛樼殑绔欏彴鍊�
+ const savedStation = stationManager.getStation();
+ if (savedStation) {
+ stationValue.value = savedStation;
+ } else if (stationOptions.length > 0) {
+ // 濡傛灉娌℃湁淇濆瓨鐨勫�硷紝浣跨敤绗竴涓�夐」
+ stationValue.value = stationOptions[0].value;
+ }
+ });
+ const handleStationChange = (value) => {
+ // 淇濆瓨绔欏彴閫夋嫨鍒版湰鍦板瓨鍌�
+ if (value) {
+ stationManager.saveStation(value);
+ // 涔熶繚瀛樺埌Vuex/store涓紝鏂逛究鍏ㄥ眬璁块棶
+ store.commit("setStation", value);
+ }
+ };
const getVierificationCode = () => {
http.get("/api/User/getVierificationCode").then((x) => {
@@ -130,7 +137,7 @@
});
};
getVierificationCode();
-
+
let appContext = getCurrentInstance().appContext;
let $message = appContext.config.globalProperties.$message;
let router = useRouter();
@@ -141,6 +148,13 @@
if (!userInfo.verificationCode) {
return $message.error("璇疯緭鍏ラ獙璇佺爜");
}
+
+ // 纭繚绔欏彴鍊煎凡淇濆瓨
+ if (stationValue.value) {
+ stationManager.saveStation(stationValue.value);
+ store.commit("setStation", stationValue.value);
+ }
+
loading.value = true;
http.post("/api/User/login", userInfo, "姝e湪鐧诲綍....").then((result) => {
if (!result.status) {
@@ -150,7 +164,7 @@
}
$message.success("鐧诲綍鎴愬姛,姝e湪璺宠浆!");
store.commit("setUserInfo", result.data);
-
+
router.push({ path: "/" });
});
};
@@ -170,6 +184,9 @@
userInfo,
loginPress,
openUrl,
+ stationOptions,
+ stationValue,
+ handleStationChange,
};
},
directives: {
@@ -196,12 +213,9 @@
width: 50%;
display: flex;
flex-direction: column;
- // margin-right: 150px;
z-index: 999;
.form-user {
- // margin: 25px 0;
-
.item {
border-radius: 5px;
border: 1px solid #ececec;
@@ -210,19 +224,31 @@
background: #ffff;
height: 45px;
padding-left: 20px;
- display: flex;
+ align-items: center;
+
+ &.station-select-item {
+ padding-left: 0;
+
+ .input-icon {
+ margin-left: 20px;
+ min-width: 20px;
+ }
+ }
.code {
position: relative;
cursor: pointer;
width: 74px;
padding: 5px 10px 0 0;
+ display: flex;
+ align-items: center;
}
.input-icon {
- line-height: 45px;
color: #7a7a7a;
padding-right: 20px;
+ display: flex;
+ align-items: center;
}
}
}
@@ -241,12 +267,27 @@
margin: 0;
padding: 0;
color: #323233;
- line-height: inherit;
text-align: left;
border: 0;
outline: none;
font-size: 16px;
- line-height: 20px;
+ height: 100%;
+ line-height: normal;
+ }
+
+ select {
+ background: white;
+ display: block;
+ box-sizing: border-box;
+ width: 100%;
+ min-width: 0;
+ margin: 0;
+ padding: 0;
+ color: #323233;
+ text-align: left;
+ border: 0;
+ outline: none;
+ font-size: 16px;
}
}
@@ -270,7 +311,6 @@
font-weight: bolder;
font-size: 20px;
letter-spacing: 2px;
-
position: relative;
display: flex;
@@ -309,10 +349,120 @@
color: transparent;
font-size: 25px;
}
+
+// 涓嬫媺妗嗚嚜瀹氫箟鏍峰紡 - 绉婚櫎鎵�鏈変氦浜掓晥鏋�
+.station-select {
+ width: 100%;
+ height: 100%;
+ flex: 1;
+
+ :deep(.el-input) {
+ height: 100%;
+ cursor: pointer; // 娣诲姞鎸囬拡鏄剧ず涓哄彲鐐瑰嚮
+ }
+
+ :deep(.el-input__wrapper) {
+ height: 100%;
+ box-shadow: none;
+ border: none;
+ padding: 0;
+ background: transparent;
+
+ // 绉婚櫎鎵�鏈塰over銆乫ocus鏁堟灉
+ &:hover, &:focus, &.is-focus {
+ box-shadow: none !important;
+ outline: none !important;
+ border: none !important;
+ }
+ }
+
+ :deep(.el-input__inner) {
+ height: 100%;
+ padding-left: 10px;
+ padding-top: 10px;
+ font-size: 16px;
+ color: #323233;
+ cursor: pointer; // 娣诲姞鎸囬拡鏄剧ず涓哄彲鐐瑰嚮
+
+ &::placeholder {
+ color: #c0c4cc;
+ }
+ }
+
+ :deep(.el-input__suffix) {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ }
+
+ :deep(.el-select__caret) {
+ height: 100%;
+ display: flex;
+ align-items: center;
+ margin-right: 10px;
+ }
+
+ // 绉婚櫎鏁翠釜缁勪欢涓婄殑浠讳綍hover鍜宖ocus鏍峰紡
+ &:hover, &:focus, &.is-focus {
+ :deep(.el-input__wrapper) {
+ box-shadow: none !important;
+ outline: none !important;
+ border: none !important;
+ }
+ }
+}
+
+// 淇敼鍏ㄥ眬鐨勪笅鎷夋鏍峰紡
+:deep(.el-select-dropdown) {
+ border: 1px solid #ececec;
+ border-radius: 5px;
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+
+ .el-select-dropdown__item {
+ height: 45px;
+ line-height: 45px;
+ font-size: 16px;
+ color: #323233;
+ padding: 0 20px;
+
+ &:hover {
+ background-color: #f5f7fa;
+ }
+
+ &.selected {
+ color: #3a6cd1;
+ font-weight: normal;
+ background-color: #f0f7ff;
+ }
+ }
+
+ // 闅愯棌婊氬姩鏉℃垨璋冩暣婊氬姩鏉℃牱寮�
+ &::-webkit-scrollbar {
+ width: 6px;
+ }
+
+ &::-webkit-scrollbar-track {
+ background: #f1f1f1;
+ border-radius: 3px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background: #c1c1c1;
+ border-radius: 3px;
+ }
+}
+
+// 绉婚櫎鎵�鏈塱nput鐨刦ocus鍜宧over鏍峰紡
+input {
+ &:hover, &:focus {
+ border: none !important;
+ outline: none !important;
+ box-shadow: none !important;
+ }
+}
</style>
<style lang="less" scoped>
.app-link {
- // font-weight: bolder;
text-align: center;
padding-top: 5px;
font-size: 12px;
@@ -343,7 +493,6 @@
top: -130px;
width: 120px;
left: -22px;
-
border: 1px solid #b1b1b1;
}
}
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_IStockService/IStockInfoService.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_IStockService/IStockInfoService.cs"
index f01c5ae..986e031 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_IStockService/IStockInfoService.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_IStockService/IStockInfoService.cs"
@@ -26,5 +26,9 @@
List<StockSelectViewDTO> GetSelectViewDTOs(string orderNo, string materielCode);
+ List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, string supplyCode, string wearhouseCode, string factoryCode);
+
+ List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes, string wearhouseCode, string factoryCode);
+
}
}
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_OutboundService/OutboundOrderDetailService.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_OutboundService/OutboundOrderDetailService.cs"
index bf49e91..664827c 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_OutboundService/OutboundOrderDetailService.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_OutboundService/OutboundOrderDetailService.cs"
@@ -78,13 +78,14 @@
// 鎸夌墿鏂欏拰鎵规鍒嗙粍澶勭悊
var groupDetails = outboundOrderDetails
- .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode })
+ .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode,x.WarehouseCode })
.Select(x => new
{
MaterielCode = x.Key.MaterielCode,
BatchNo = x.Key.BatchNo,
SupplyCode = x.Key.SupplyCode,
Details = x.ToList(),
+ WarehouseCode=x.Key.WarehouseCode,
TotalNeedQuantity = CalculateReassignNeedQuantity(x.ToList())
})
.Where(x => x.TotalNeedQuantity > 0)
@@ -93,9 +94,9 @@
foreach (var item in groupDetails)
{
var needQuantity = item.TotalNeedQuantity;
-
+
// 鑾峰彇鍙敤搴撳瓨锛堟寜鍏堣繘鍏堝嚭鎺掑簭锛�
- List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode);
+ List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode,item.WarehouseCode, outboundOrder.FactoryArea);
if (!stockInfos.Any())
{
@@ -311,12 +312,13 @@
// 鎸夌墿鏂欏拰鎵规鍒嗙粍澶勭悊锛堣繖閲屽彧鏈変竴涓槑缁嗭級
var groupDetails = new List<Dt_OutboundOrderDetail> { orderDetail }
- .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode })
+ .GroupBy(x => new { x.MaterielCode, x.BatchNo, x.SupplyCode ,x.WarehouseCode})
.Select(x => new
{
MaterielCode = x.Key.MaterielCode,
BatchNo = x.Key.BatchNo,
SupplyCode = x.Key.SupplyCode,
+ WarehouseCode=x.Key.WarehouseCode,
Details = x.ToList(),
TotalNeedQuantity = batchQuantity // 浣跨敤鍒嗘壒鏁伴噺
})
@@ -328,7 +330,7 @@
var needQuantity = item.TotalNeedQuantity;
// 鑾峰彇鍙敤搴撳瓨锛堟寜鍏堣繘鍏堝嚭鎺掑簭锛�
- List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode);
+ List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, item.SupplyCode,item.WarehouseCode,outboundOrder.FactoryArea);
if (!stockInfos.Any())
{
throw new Exception($"鐗╂枡[{item.MaterielCode}]鎵规[{item.BatchNo}]鏈壘鍒板彲鍒嗛厤搴撳瓨");
@@ -669,47 +671,7 @@
if (remainingNeedQuantity > 0)
{
- //// 鍙�夛細杩欓噷鍙互鏍规嵁涓氬姟闇�姹傚喅瀹氭槸鍚﹀厑璁歌嚜鍔ㄥ垎閰�
- //// 濡傛灉瑕佹眰涓ユ牸鎸夌敤鎴烽�夋嫨鍑哄簱锛屽彲浠ユ姏鍑哄紓甯�
- //// throw new Exception($"鐢ㄦ埛閫夋嫨鐨勫簱瀛樻暟閲忎笉瓒筹紝杩橀渶{remainingNeedQuantity}锛岃閲嶆柊閫夋嫨");
-
- //// 濡傛灉闇�瑕佽嚜鍔ㄥ垎閰嶏紝璁板綍鏃ュ織
- //_logger.LogInformation($"鐢ㄦ埛閫夋嫨鐨勫簱瀛樻暟閲忎笉瓒筹紝杩橀渶{remainingNeedQuantity}锛岀郴缁熷皢鑷姩鍒嗛厤");
-
- //List<Dt_StockInfo> autoStocks = _stockService.StockInfoService.GetUseableStocks(
- // outboundOrderDetail.MaterielCode,
- // outboundOrderDetail.BatchNo,
- // "");
-
- //// 鎺掗櫎鐢ㄦ埛宸查�夋嫨涓斿凡鍒嗛厤鐨勬墭鐩�
- //var assignedPalletCodes = outStocks.Select(x => x.PalletCode).ToList();
- //autoStocks = autoStocks
- // .Where(x => !assignedPalletCodes.Contains(x.PalletCode))
- // .ToList();
-
- //var (autoAssignStocks, stockAllocations) = _stockService.StockInfoService.GetOutboundStocks(
- // autoStocks,
- // outboundOrderDetail.MaterielCode,
- // remainingNeedQuantity,
- // out decimal residueQuantity);
-
- //if (autoAssignStocks != null && autoAssignStocks.Any())
- //{
- // outStocks.AddRange(autoAssignStocks);
-
- // // 涓鸿嚜鍔ㄥ垎閰嶇殑搴撳瓨鍒涘缓閿佸畾璁板綍
- // var autoLockInfos = CreateLockInfosForAutoAssign(outboundOrder, outboundOrderDetail, autoAssignStocks, stockAllocations);
- // outStockLockInfos.AddRange(autoLockInfos);
-
- // // 鏇存柊宸插垎閰嶆暟閲�
- // decimal autoAssignedQuantity = remainingNeedQuantity - residueQuantity;
- // totalAssignedFromUserSelection += autoAssignedQuantity;
- // remainingNeedQuantity = residueQuantity; // 鏇存柊鍓╀綑闇�姹�
- //}
- //else if (remainingNeedQuantity > 0)
- //{
- // _logger.LogWarning($"鑷姩鍒嗛厤澶辫触锛屽墿浣欓渶姹倇remainingNeedQuantity}鏃犳硶婊¤冻");
- //}
+
}
// 鏇存柊閿佸畾鏁伴噺
@@ -762,6 +724,8 @@
.Where(d => d.MaterielCode == detail.MaterielCode &&
(d.StockQuantity - d.OutboundQuantity) > 0 &&
d.Barcode == barcode); // 鍙垎閰嶆寚瀹氭潯鐮�
+
+ query = query.Where(x => x.WarehouseCode == detail.WarehouseCode);
if (!string.IsNullOrEmpty(detail.BatchNo))
{
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_StockService/StockInfoDetailService.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_StockService/StockInfoDetailService.cs"
index 704f65d..6070052 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_StockService/StockInfoDetailService.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_StockService/StockInfoDetailService.cs"
@@ -33,16 +33,42 @@
public PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options)
{
- // 1. 鑾峰彇鍩虹鍒嗛〉鏁版嵁
- PageGridData<Dt_StockInfoDetail> pageData = base.GetPageData(options);
- List<Dt_StockInfoDetail> filteredDetails = pageData.Rows.ToList(); // 鍏堟嫹璐濆師濮嬫暟鎹�
+ string wheres = ValidatePageOptions(options);
+
+ var sugarQueryable = Db.Queryable<Dt_StockInfoDetail>().InnerJoin<Dt_StockInfo>((detail, item) => detail.StockId == item.Id);
+
+ Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties);
+ List<OrderByModel> orderByModels = new List<OrderByModel>();
+ foreach (var item in orderbyDic)
+ {
+ if (item.Key.ToLower() == "id")
+ {
+ OrderByModel orderByModel = new()
+ {
+ FieldName = "detail."+item.Key,
+ OrderByType = item.Value
+ };
+ }
+ else
+ {
+ OrderByModel orderByModel = new()
+ {
+ FieldName = item.Key,
+ OrderByType = item.Value
+ };
+ }
+ //orderByModels.Add(orderByModel);
+ }
+ int totalCount = 0;
+ List<SearchParameters> searchParametersList = new List<SearchParameters>();
+
if (!string.IsNullOrEmpty(options.Wheres))
{
try
{
- List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
- if (searchParametersList?.Any() == true)
+ searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
+ if (searchParametersList != null && searchParametersList.Any())
{
foreach (var param in searchParametersList)
{
@@ -50,20 +76,7 @@
if (param.Name.Equals(nameof(Dt_StockInfo.PalletCode).FirstLetterToLower(), StringComparison.OrdinalIgnoreCase)
&& !string.IsNullOrEmpty(param.Value?.ToString()))
{
- // 浼樺寲锛氭壒閲忔煡璇紙濡傛灉鏈夊涓墭鐩樼爜锛岃繖閲屼篃鍙互鎵╁睍锛�
- string palletCode = param.Value.ToString().Trim();
- var targetStock = _stockinfoRepository.QueryFirst(x => x.PalletCode == palletCode);
-
- // 绌哄�兼牎楠岋細鏈壘鍒板搴旀墭鐩樼殑搴撳瓨锛岀洿鎺ヨ繃婊や负绌�
- if (targetStock != null)
- {
- filteredDetails = filteredDetails.Where(x => x.StockId == targetStock.Id).ToList();
- }
- else
- {
- filteredDetails = new List<Dt_StockInfoDetail>();
- }
- break; // 鍗曚釜鎵樼洏鐮佹煡璇紝鍖归厤鍚庨��鍑哄惊鐜�
+ sugarQueryable = sugarQueryable.Where((detail, item) => item.PalletCode.Contains(param.Value));
}
}
}
@@ -73,48 +86,43 @@
}
}
- List<int> stockIds = filteredDetails.Select(detail => detail.StockId).Distinct().ToList();
- var stockDict = _stockinfoRepository.QueryData(x => stockIds.Contains(x.Id))
- .ToDictionary(x => x.Id, x => x.PalletCode ?? "鏃犳墭鐩樼紪鍙�");
+ var data = sugarQueryable
+ .WhereIF(!wheres.IsNullOrEmpty(), wheres)
+ .OrderBy(orderByModels)
+ .Select((detail, item) => new StockInfoDetailWithPalletDto
+ {
+ Id = detail.Id,
+ StockId = detail.StockId,
+ MaterielCode = detail.MaterielCode,
+ MaterielName = detail.MaterielName,
+ OrderNo = detail.OrderNo,
+ BatchNo = detail.BatchNo,
+ ProductionDate = detail.ProductionDate,
+ EffectiveDate = detail.EffectiveDate,
+ SerialNumber = detail.SerialNumber,
+ StockQuantity = detail.StockQuantity,
+ OutboundQuantity = detail.OutboundQuantity,
+ Status = detail.Status,
+ Unit = detail.Unit,
+ InboundOrderRowNo = detail.InboundOrderRowNo,
+ SupplyCode = detail.SupplyCode,
+ WarehouseCode = detail.WarehouseCode,
+ Barcode = detail.Barcode,
+ BusinessType = detail.BusinessType,
+ Remark = detail.Remark,
+ Creater = detail.Creater,
+ CreateDate = detail.CreateDate,
+ Modifier = detail.Modifier,
+ ModifyDate = detail.ModifyDate,
+ PalletCode = item.PalletCode
+ })
+ .ToPageList(options.Page, options.Rows, ref totalCount);
- List<StockInfoDetailWithPalletDto> dtoList = filteredDetails
- .Select(detail => new StockInfoDetailWithPalletDto
- {
- Id = detail.Id,
- StockId = detail.StockId,
- MaterielCode = detail.MaterielCode,
- MaterielName = detail.MaterielName,
- OrderNo = detail.OrderNo,
- BatchNo = detail.BatchNo,
- ProductionDate = detail.ProductionDate,
- EffectiveDate = detail.EffectiveDate,
- SerialNumber = detail.SerialNumber,
- StockQuantity = detail.StockQuantity,
- OutboundQuantity = detail.OutboundQuantity,
- Status = detail.Status,
- Unit = detail.Unit,
- InboundOrderRowNo = detail.InboundOrderRowNo,
- SupplyCode = detail.SupplyCode,
- WarehouseCode = detail.WarehouseCode,
- Barcode = detail.Barcode,
- BusinessType = detail.BusinessType,
- Remark = detail.Remark,
- Creater = detail.Creater,
- CreateDate = detail.CreateDate,
- Modifier = detail.Modifier,
- ModifyDate = detail.ModifyDate,
- PalletCode = stockDict.TryGetValue(detail.StockId, out var palletCode) ? palletCode : "鏃犳墭鐩樼紪鍙�"
- })
- .ToList();
- return new PageGridData<StockInfoDetailWithPalletDto>
- {
- Rows = dtoList.Where(x=>x.PalletCode != "鏃犳墭鐩樼紪鍙�").ToList(),
- Total = pageData.Total,
- Summary = pageData.Summary
- };
+ return new PageGridData<StockInfoDetailWithPalletDto>(totalCount, data);
+
}
}
- }
+}
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_StockService/StockInfoService.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_StockService/StockInfoService.cs"
index f7d9ebc..1f2ce30 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_StockService/StockInfoService.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_StockService/StockInfoService.cs"
@@ -224,6 +224,51 @@
return GetStockInfos(materielCode, batchNo, supplyCode, locationCodes);
}
+
+ public List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, string supplyCode, string wearhouseCode, string factoryCode)
+ {
+ List<string> locationCodes = _locationInfoService.GetCanOutLocationCodes();
+
+ return GetStockInfos(materielCode, batchNo, supplyCode, locationCodes,wearhouseCode,factoryCode);
+ }
+
+ public List<Dt_StockInfo> GetStockInfos(string materielCode, string lotNo, string supplyCode, List<string> locationCodes, string wearhouseCode, string factoryCode)
+ {
+ if (string.IsNullOrWhiteSpace(wearhouseCode))
+ {
+ throw new ArgumentNullException("浠撳簱涓嶈兘涓虹┖");
+ }
+ if (string.IsNullOrWhiteSpace(factoryCode))
+ {
+ throw new ArgumentNullException("鍘傚尯涓嶈兘涓虹┖");
+ }
+ var query = Db.Queryable<Dt_StockInfo>()
+ .Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()
+ // && x.StockStatus == (int)StockStatusEmun.姝e父)
+ ).Includes(x => x.Details);
+ query = query.Where(x => x.Details.Any(d => d.WarehouseCode == wearhouseCode));
+ query = query.Where(x => x.Details.Any(d => d.FactoryArea == factoryCode));
+ if (!string.IsNullOrEmpty(materielCode))
+ {
+ query = query.Where(x => x.Details.Any(d => d.MaterielCode == materielCode));
+ }
+
+ if (!string.IsNullOrEmpty(lotNo))
+ {
+ query = query.Where(x => x.Details.Any(d => d.BatchNo == lotNo));
+ }
+
+ if (!string.IsNullOrEmpty(supplyCode))
+ {
+ query = query.Where(x => x.Details.Any(d => d.SupplyCode == supplyCode));
+ }
+
+ return query.OrderBy(x => x.CreateDate).ToList();
+ //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode));
+ //ISugarQueryable<Dt_StockInfo> sugarQueryable1 = Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode));
+ //return sugarQueryable.InnerJoin(sugarQueryable1, (a, b) => a.LocationCode == b.LocationCode).Select((a, b) => b).OrderBy(a => a.CreateDate).Includes(a => a.Details).ToList();
+ }
+
public Dt_StockInfo GetPalletStockInfo(int locationType)
{
@@ -295,15 +340,15 @@
//}
- var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Includes(x=>x.Details) .Where(x => x.Details.Any(o=>o.OrderId==orderId)).First();
+ var outboundOrder = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrder>().Includes(x => x.Details).Where(x => x.Details.Any(o => o.OrderId == orderId)).First();
if (outboundOrder == null)
{
throw new Exception($"鏈壘鍒板崟鎹紪鍙蜂负{outboundOrder.UpperOrderNo}鐨勫嚭搴撳崟淇℃伅");
}
- return GetStockSelectViews(outboundOrder.Id,orderdetailid, materielCode);
+ return GetStockSelectViews(outboundOrder.Id, orderdetailid, materielCode);
}
- public List<StockSelectViewDTO> GetStockSelectViews(int orderId,int orderdetailid, string materielCode)
+ public List<StockSelectViewDTO> GetStockSelectViews(int orderId, int orderdetailid, string materielCode)
{
Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == orderId);
if (outboundOrder == null)
@@ -312,7 +357,7 @@
}
// 鑾峰彇鍑哄簱鍗曟槑缁嗭紝鐢ㄤ簬纭畾闇�瑕佺殑鎵规鍜屼緵搴斿晢
- var orderDetails = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrderDetail>().Where(x =>x.Id==orderdetailid && x.OrderId == orderId && x.MaterielCode == materielCode).ToList();
+ var orderDetails = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrderDetail>().Where(x => x.Id == orderdetailid && x.OrderId == orderId && x.MaterielCode == materielCode).ToList();
if (!orderDetails.Any())
{
@@ -333,18 +378,16 @@
// 鎵ц鏌ヨ骞舵寜鍏堣繘鍏堝嚭鎺掑簭
var Qstocks = stockQuery.Where(x => x.Details.Any(d => d.MaterielCode == materielCode && d.StockQuantity > d.OutboundQuantity));
+ Qstocks = stockQuery.Where(x => x.Details.Any(d => d.FactoryArea == outboundOrder.FactoryArea));
+ Qstocks = stockQuery.Where(x => x.Details.Any(d => d.WarehouseCode == orderDetail.WarehouseCode));
if (!string.IsNullOrEmpty(orderDetail.BatchNo))
{
-
Qstocks = stockQuery.Where(x => x.Details.Any(d => d.BatchNo == orderDetail.BatchNo));
-
}
if (!string.IsNullOrEmpty(orderDetail.SupplyCode))
{
-
Qstocks = stockQuery.Where(x => x.Details.Any(d => d.SupplyCode == orderDetail.SupplyCode));
-
}
var stocks = Qstocks.OrderBy(x => x.CreateDate).ToList();
@@ -425,17 +468,16 @@
// 鎵ц鏌ヨ骞舵寜鍏堣繘鍏堝嚭鎺掑簭
var Qstocks = stockQuery.Where(x => x.Details.Any(d => d.MaterielCode == materielCode && d.StockQuantity > d.OutboundQuantity));
+ Qstocks = stockQuery.Where(x => x.Details.Any(d => d.FactoryArea == outboundOrder.FactoryArea));
+ Qstocks = stockQuery.Where(x => x.Details.Any(d => d.WarehouseCode == orderDetail.WarehouseCode));
+
if (!string.IsNullOrEmpty(orderDetail.BatchNo))
{
-
Qstocks = stockQuery.Where(x => x.Details.Any(d => d.BatchNo == orderDetail.BatchNo));
-
}
if (!string.IsNullOrEmpty(orderDetail.SupplyCode))
{
-
Qstocks = stockQuery.Where(x => x.Details.Any(d => d.SupplyCode == orderDetail.SupplyCode));
-
}
var stocks = Qstocks.OrderBy(x => x.CreateDate).ToList();
--
Gitblit v1.9.3