From a29bf360f42cc3c6942a0ef6604f0ac84ab54a7c Mon Sep 17 00:00:00 2001
From: liulijun <liulijun@hnkhzn.com>
Date: 星期四, 19 三月 2026 17:19:36 +0800
Subject: [PATCH] 修复老厂排程在没生成任务就不更新缺料状态的问题,按照要求修改库位平面图
---
项目代码/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs | 6
项目代码/WMS/WMSClient/src/views/Home.vue | 586 ++++++++++++++++++++------
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs | 12
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs | 17
项目代码/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs | 41 +
项目代码/WMS/WMSClient/src/views/outbound/outSGOrder.vue | 127 +++--
项目代码/WMS/WMSClient/src/views/outbound/outSGOrderDetail.vue | 386 ++++++++---------
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 19
项目代码/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs | 111 ++--
9 files changed, 839 insertions(+), 466 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/Home.vue"
index ce24a69..07854b1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/Home.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/Home.vue"
@@ -27,9 +27,9 @@
class="full-width">
<el-option v-for="item in warehouseList" :value="item" :label="item" :key="item"></el-option>
</el-select>
- <h4>璐т綅鎺�</h4>
- <el-select size="mini" @change="SCChange" v-model="Area.row" placeholder="璇烽�夋嫨鎺�" class="full-width">
- <el-option v-for="item in scList" :value="item" :label="'绗�' + item + '鎺�'" :key="item"></el-option>
+ <h4>宸烽亾</h4>
+ <el-select size="mini" @change="SCChange" v-model="Area.roadwayNo" placeholder="璇烽�夋嫨宸烽亾" class="full-width">
+ <el-option v-for="item in scList" :value="item" :label="item" :key="item"></el-option>
</el-select>
<el-button type="success" class="refresh-btn" @click="GetViewData">
鍒锋柊
@@ -50,25 +50,37 @@
<!-- 璐т綅灞曠ず鍖哄煙 -->
<div v-if="loading" class="loading-container">
- <el-icon class="is-loading">
- <Loading />
- </el-icon>
<span>鍔犺浇涓�...</span>
</div>
- <div v-else-if="locationData.length === 0" class="empty-container">
+ <div
+ v-else-if="(!locationData.row1 || locationData.row1.length === 0) && (!locationData.row2 || locationData.row2.length === 0)"
+ class="empty-container">
<el-empty description="鏆傛棤鏁版嵁" />
</div>
<div v-else>
<div class="location-view">
- <div class="layer-container" v-for="(item, index) in locationData" :key="index">
- <h3 class="layer-title">绗瑊{ item.layer }}灞�</h3>
- <div class="row">
+ <!-- 绗�1鎺掞紙涓滈潰锛� -->
+ <div class="roadway-section">
+ <h2 class="roadway-title">{{ Area.roadwayNo }} 绗�1宸烽亾绗�1鎺�(涓滈潰:鍖�>鍗�)</h2>
+ <div class="row" v-for="(item, index) in locationData.row1" :key="'row1-' + index">
<div class="location-cell" :style="{ 'background-color': GetBgColor(column) }"
- v-for="(column, index) in item.locationObj" :key="index" @mouseenter="showTooltip(column, $event)"
- @mouseleave="hideTooltip">
- {{ column.row }}-{{ column.column }}-{{ column.layer }}
+ v-for="(column, colIndex) in item.locationObj" :key="'row1-' + item.layer + '-' + colIndex"
+ @mouseenter="showTooltip(column, $event)" @mouseleave="hideTooltip">
+ {{ getRoadwayNo(column) }}-{{ column.column }}-{{ column.layer }}
+ </div>
+ </div>
+ </div>
+
+ <!-- 绗�2鎺掞紙瑗块潰锛� -->
+ <div class="roadway-section">
+ <h2 class="roadway-title">{{ Area.roadwayNo }} 绗�1宸烽亾绗�2鎺�(瑗块潰:鍖�>鍗�)</h2>
+ <div class="row" v-for="(item, index) in locationData.row2" :key="'row2-' + index">
+ <div class="location-cell" :style="{ 'background-color': GetBgColor(column) }"
+ v-for="(column, colIndex) in item.locationObj" :key="'row2-' + item.layer + '-' + colIndex"
+ @mouseenter="showTooltip(column, $event)" @mouseleave="hideTooltip">
+ {{ getRoadwayNo(column) }}-{{ column.column }}-{{ column.layer }}
</div>
</div>
</div>
@@ -79,36 +91,30 @@
top: tooltipPosition.y + 'px',
}">
<div v-if="currentLocation">
- <p><strong>浠撳簱:</strong>{{ Area.warehouse || "鏈�夋嫨" }}</p>
- <p><strong>璐т綅鍙�:</strong>{{ currentLocation.locationCode }}</p>
- <!-- <p><strong>鏂欑鍙�:</strong>{{ currentLocation.barCode ? currentLocation.barCode : "鏃犳枡绠�" }}</p> -->
+ <p><strong>浠撳簱:</strong><span>{{ Area.warehouse || "鏈�夋嫨" }}</span></p>
+ <p><strong>璐т綅鍙�:</strong><span>{{ currentLocation.locationCode }}</span></p>
<!-- 鏍规嵁浠撳簱绫诲瀷鏄剧ず涓嶅悓鐨勬爣绛惧拰鍐呭 -->
- <p v-if="Area.warehouse === '鍘熸枡搴�'">
- <strong>RFID:</strong>{{ this.rfidData[currentLocation.locationCode] || "鏃�" }}
- </p>
- <p v-else-if="Area.warehouse === '鎴愬搧搴�'">
- <strong>鎵樼洏鍙�:</strong>{{ this.rfidData[currentLocation.locationCode] || "鏃�" }}
- </p>
- <p v-else>
- <strong>鏍囪瘑:</strong>{{ this.rfidData[currentLocation.locationCode] || "鏃�" }}
- </p>
+ <!-- 鍘熸枡搴撴樉绀哄唴瀹� -->
+ <div v-if="Area.warehouse === '鍘熸枡搴�'">
+ <p><strong>绾稿嵎:</strong><span>{{ currentLocation.paperRoll || "鏃�" }}</span></p>
+ <p><strong>闂ㄥ箙:</strong><span>{{ currentLocation.width ? currentLocation.width + "m" : "鏃�" }}</span></p>
+ <p><strong>鏉$爜:</strong><span>{{ currentLocation.barcode || "鏃�" }}</span></p>
+ <p><strong>RFID:</strong><span>{{ currentLocation.rfid || "鏃�" }}</span></p>
+ </div>
+ <!-- 鎴愬搧搴撴樉绀哄唴瀹� -->
+ <div v-else-if="Area.warehouse === '鎴愬搧搴�'">
+ <p><strong>鎴愬搧鍚嶇О:</strong><span>{{ currentLocation.productName || currentLocation.paperRoll || "鏃�" }}</span></p>
+ <p><strong>鎴愬搧鏁伴噺:</strong><span>{{ currentLocation.quantity || currentLocation.width || "鏃�" }}</span></p>
+ <p><strong>鎵樼洏鍙�:</strong><span>{{ currentLocation.rfid || currentLocation.rfidCode ||
+ this.rfidData[currentLocation.locationCode] || "鏃�" }}</span></p>
+ </div>
<p>
- <strong>鎺掑垪灞�:</strong> {{ currentLocation.row }}鎺抺{
- currentLocation.column
- }}鍒梴{ currentLocation.layer }}灞�
+ <strong>鎺掑垪灞�:</strong> <span>{{ currentLocation.row }}鎺抺{ currentLocation.column }}鍒梴{ currentLocation.layer
+ }}灞�</span>
</p>
- <p><strong>鐘舵��:</strong> {{ getStatusText(currentLocation) }}</p>
- <!-- <p>
- <strong>绂佺敤:</strong>
- {{ currentLocation.location_lock == 3 ? "鏄�" : "鍚�" }}
- </p> -->
- <!-- <p v-if="currentLocation.location_state > 0">
- <strong>鐗╂枡缂栫爜:</strong>
- {{ currentLocation.material_code || "鏃�" }}
- </p>
- <p v-if="currentLocation.location_state > 0">
- <strong>鏁伴噺:</strong> {{ currentLocation.quantity || "鏃�" }}
- </p> -->
+ <p><strong>鐘舵��:</strong> <span>{{ getStatusText(currentLocation) }}</span></p>
+ <p><strong>鍏ュ簱鏃ユ湡:</strong><span>{{ currentLocation.inDate ? new Date(currentLocation.inDate).toLocaleString() :
+ "鏃�" }}</span></p>
</div>
</div>
</div>
@@ -116,53 +122,68 @@
</template>
<script>
-import { ElButton, Loading } from "element-plus";
+import { ElButton } from "element-plus";
export default {
data() {
- return {
- slectData: [],
- scList: [],
- warehouseList: ["鍘熸枡搴�", "鎴愬搧搴�"],
- warehouseMap: {
- "鍘熸枡搴�": 1,
- "鎴愬搧搴�": 2
- },
- Area: {
- warehouse: "鍘熸枡搴�",
- row: "",
- shelf_code: ""
- },
- mian_height: "",
- loading: false,
- infoMsg: [
- { bgcolor: "lightgreen", msg: "绌洪棽", state: 0 },
- { bgcolor: "orange", msg: "鏈夎揣", state: 100 },
- { bgcolor: "#2BB3D5", msg: "閿佸畾", state: 1 },
- { bgcolor: "yellow", msg: "绌洪棽閿佸畾", state: 20 },
- { bgcolor: "purple", msg: "鏈夎揣閿佸畾", state: 10 },
- ],
- locationData: [],
- showTooltipFlag: false,
- currentLocation: null,
- tooltipPosition: { x: 0, y: 0 },
- rfidData: {}, // 瀛樺偍璐т綅缂栧彿涓嶳FID鐨勬槧灏勫叧绯�
- };
- },
+ return {
+ slectData: [],
+ scList: [],
+ allRoadways: [], // 淇濆瓨鎵�鏈夊贩閬撳垪琛�
+ warehouseList: ["鍘熸枡搴�", "鎴愬搧搴�"],
+ warehouseMap: {
+ "鍘熸枡搴�": 1,
+ "鎴愬搧搴�": 2
+ },
+ // 宸烽亾绫诲瀷鏄犲皠
+ roadwayTypeMap: {
+ "鍘熸枡搴�": ["SC01_YL", "SC02_YL", "SC03_YLDual", "SC04_YLDual", "SC05_YLDual"],
+ "鎴愬搧搴�": ["SC01_CP", "SC02_CP", "SC03_CP", "SC04_CP", "SC05_CP"]
+ },
+ Area: {
+ warehouse: "鍘熸枡搴�",
+ roadwayNo: "",
+ shelf_code: ""
+ },
+ mian_height: "",
+ loading: false,
+ infoMsg: [
+ { bgcolor: "#f0f0f0", msg: "绌洪棽", state: 0 },
+ { bgcolor: "#90ee90", msg: "鏈夎揣", state: 100 },
+ { bgcolor: "#a0a0a0", msg: "绌洪棽閿佸畾", state: 20 },
+ { bgcolor: "#228b22", msg: "鏈夎揣閿佸畾", state: 10 },
+ { bgcolor: "#2BB3D5", msg: "涓撶敤璐т綅", state: 3 },
+ ],
+ locationData: [],
+ showTooltipFlag: false,
+ currentLocation: null,
+ tooltipPosition: { x: 0, y: 0 },
+ rfidData: {}, // 瀛樺偍璐т綅缂栧彿涓嶳FID鐨勬槧灏勫叧绯�
+ };
+ },
computed: {
GetBgColor() {
return (col) => {
var bgColor = "";
- //浼樺厛鏄剧ず绂佺敤鐘舵��
- if (col.location_lock > 0) {
- this.infoMsg.forEach((el) => {
- if (el.state === col.location_lock) {
- bgColor = el.bgcolor;
- }
- });
- }
- else {
- return "lightgreen";
+ //鏍规嵁鐘舵�佽缃鑹�
+ switch (col.location_lock) {
+ case 0: //绌洪棽
+ bgColor = "#f0f0f0"; //寰堟祬鐏�
+ break;
+ case 20: //绌洪棽閿佸畾
+ bgColor = "#a0a0a0"; //娣辩伆
+ break;
+ case 100: //鏈夎揣
+ bgColor = "#90ee90"; //娴呯豢
+ break;
+ case 10: //鏈夎揣閿佸畾
+ bgColor = "#228b22"; //娣辩豢
+ break;
+ case 3: //涓撶敤搴撲綅
+ bgColor = "#2BB3D5"; //钃濊壊(涓嶅彉)
+ break;
+ default:
+ bgColor = "#f0f0f0"; //榛樿寰堟祬鐏�
}
return bgColor;
};
@@ -187,16 +208,25 @@
console.log("RFID鏌ヨAPI杩斿洖缁撴灉:", response);
if (response.status && response.data) {
console.log(`鎴愬姛鑾峰彇${response.data.length}鏉FID璁板綍`);
- // 鏇存柊rfidData鏄犲皠
+
+ // 灏哛FID鏁版嵁杞崲涓轰互locationCode涓洪敭鐨勬槧灏�
+ const rfidDataMap = {};
response.data.forEach((item, index) => {
try {
// 妫�鏌ュ瓧娈靛悕锛屾敮鎸佸ぇ灏忓啓涓ょ鏍煎紡
const locationCode = item.LocationCode || item.locationCode;
- const rfidCode = item.RfidCode || item.rfidCode;
-
if (item && locationCode !== undefined) {
- console.log(`鏇存柊RFID鏁版嵁: ${locationCode} -> ${rfidCode}`);
- this.rfidData[locationCode] = rfidCode;
+ rfidDataMap[locationCode] = {
+ paperRoll: item.PaperRoll || item.paperRoll || "",
+ productName: item.ProductName || item.productName || item.PaperRoll || item.paperRoll || "", // 浼樺厛浣跨敤ProductName瀛楁
+ width: item.Width || item.width || 0,
+ quantity: item.Quantity || item.quantity || item.Width || item.width || 0, // 浼樺厛浣跨敤Quantity瀛楁
+ barcode: item.Barcode || item.barcode || "",
+ rfid: item.RfidCode || item.rfidCode || "",
+ rfidCode: item.RfidCode || item.rfidCode || "", // 纭繚rfidCode瀛楁瀛樺湪
+ status: item.Status || item.status || 0,
+ inDate: item.InDate || item.inDate || null
+ };
} else {
console.warn(`璺宠繃鏃犳晥鐨凴FID鏁版嵁椤�(${index}):`, item);
}
@@ -204,7 +234,58 @@
console.error(`澶勭悊RFID鏁版嵁椤�(${index})鏃跺嚭閿�:`, error, item);
}
});
- console.log("鏇存柊鍚庣殑rfidData:", this.rfidData);
+
+ console.log("RFID鏁版嵁鏄犲皠:", rfidDataMap);
+
+ // 鏇存柊璐т綅鏁版嵁锛屽皢RFID淇℃伅鍚堝苟鍒板搴旂殑璐т綅瀵硅薄涓�
+
+ // 澶勭悊绗�1鎺掓暟鎹�
+ if (this.locationData.row1) {
+ this.locationData.row1.forEach(layer => {
+ layer.locationObj.forEach(location => {
+ const rfidInfo = rfidDataMap[location.locationCode];
+ if (rfidInfo) {
+ // 鏇存柊璐т綅瀵硅薄鐨勫瓧娈�
+ location.paperRoll = rfidInfo.paperRoll;
+ location.productName = rfidInfo.productName; // 鏂板鎴愬搧鍚嶇О瀛楁
+ location.width = rfidInfo.width;
+ location.quantity = rfidInfo.quantity; // 鏂板鎴愬搧鏁伴噺瀛楁
+ location.barcode = rfidInfo.barcode;
+ location.rfid = rfidInfo.rfid;
+ location.rfidCode = rfidInfo.rfidCode; // 鏂板rfidCode瀛楁
+ location.status = rfidInfo.status;
+ location.inDate = rfidInfo.inDate;
+ // 鏇存柊rfidData鏄犲皠锛堜繚鎸佸悜鍚庡吋瀹癸級
+ this.rfidData[location.locationCode] = rfidInfo.rfid || rfidInfo.rfidCode; // 浣跨敤rfid鎴杛fidCode浣滀负鎵樼洏鍙�
+ }
+ });
+ });
+ }
+
+ // 澶勭悊绗�2鎺掓暟鎹�
+ if (this.locationData.row2) {
+ this.locationData.row2.forEach(layer => {
+ layer.locationObj.forEach(location => {
+ const rfidInfo = rfidDataMap[location.locationCode];
+ if (rfidInfo) {
+ // 鏇存柊璐т綅瀵硅薄鐨勫瓧娈�
+ location.paperRoll = rfidInfo.paperRoll;
+ location.productName = rfidInfo.productName; // 鏂板鎴愬搧鍚嶇О瀛楁
+ location.width = rfidInfo.width;
+ location.quantity = rfidInfo.quantity; // 鏂板鎴愬搧鏁伴噺瀛楁
+ location.barcode = rfidInfo.barcode;
+ location.rfid = rfidInfo.rfid;
+ location.rfidCode = rfidInfo.rfidCode; // 鏂板rfidCode瀛楁
+ location.status = rfidInfo.status;
+ location.inDate = rfidInfo.inDate;
+ // 鏇存柊rfidData鏄犲皠锛堜繚鎸佸悜鍚庡吋瀹癸級
+ this.rfidData[location.locationCode] = rfidInfo.rfid || rfidInfo.rfidCode; // 浣跨敤rfid鎴杛fidCode浣滀负鎵樼洏鍙�
+ }
+ });
+ });
+ }
+
+ console.log("鏇存柊鍚庣殑璐т綅鏁版嵁:", this.locationData);
} else {
console.log("RFID鏌ヨAPI杩斿洖鐘舵�佸け璐ユ垨鏁版嵁涓虹┖");
}
@@ -219,6 +300,7 @@
this.loading = true;
this.rfidData = {}; // 娓呯┖涔嬪墠鐨凴FID鏁版嵁
+ this.locationData = { row1: [], row2: [] }; // 鍒濆鍖栨柊鐨勬暟鎹粨鏋�
let warehouseId = 0;
if (this.Area.warehouse) {
@@ -226,25 +308,90 @@
console.log(`褰撳墠閫夋嫨鐨勪粨搴�: ${this.Area.warehouse}, 瀵瑰簲鐨剋arehouseId: ${warehouseId}`);
}
- console.log(`璋冪敤GetLocationStatus API: row=${_this.Area.row}, warehouseId=${warehouseId}`);
-
+ console.log(`璋冪敤GetLocationStatus API: roadwayNo=${_this.Area.roadwayNo}, warehouseId=${warehouseId}`);
+
this.http
- .post(`/api/LocationInfo/GetLocationStatus?row=${_this.Area.row}&warehouseId=${warehouseId}`, {}, "鏌ヨ涓�")
+ .post(`/api/LocationInfo/GetLocationStatus?roadwayNo=${_this.Area.roadwayNo}&warehouseId=${warehouseId}`, {}, "鏌ヨ涓�")
.then((x) => {
console.log("GetLocationStatus API杩斿洖缁撴灉:", x);
- this.locationData = x.data || [];
-
+ if (x.data) {
+ this.locationData = x.data;
+
+ // 瀵圭1鎺掓暟鎹繘琛屾帓搴�
+ if (this.locationData.row1) {
+ // 鎸夊眰鍙蜂粠楂樺埌浣庢帓搴�
+ this.locationData.row1.sort((a, b) => parseInt(b.layer) - parseInt(a.layer));
+
+ // 瀵规瘡灞傚唴鐨勮揣浣嶆寜鍒楀彿浠庡寳鍒板崡鎺掑簭锛�01-64锛�
+ this.locationData.row1.forEach(layer => {
+ layer.locationObj.sort((a, b) => {
+ // 纭繚鍒楀彿鎸夋暟瀛楅『搴忔帓鍒�
+ const colA = parseInt(a.column);
+ const colB = parseInt(b.column);
+ return colA - colB;
+ });
+ });
+ }
+
+ // 瀵圭2鎺掓暟鎹繘琛屽悓鏍风殑鎺掑簭
+ if (this.locationData.row2) {
+ // 鎸夊眰鍙蜂粠楂樺埌浣庢帓搴�
+ this.locationData.row2.sort((a, b) => parseInt(b.layer) - parseInt(a.layer));
+
+ // 瀵规瘡灞傚唴鐨勮揣浣嶆寜鍒楀彿浠庡寳鍒板崡鎺掑簭锛�01-64锛�
+ this.locationData.row2.forEach(layer => {
+ layer.locationObj.sort((a, b) => {
+ // 纭繚鍒楀彿鎸夋暟瀛楅『搴忔帓鍒�
+ const colA = parseInt(a.column);
+ const colB = parseInt(b.column);
+ return colA - colB;
+ });
+ });
+ }
+ }
+
// 鎻愬彇鎵�鏈夎揣浣嶇紪鍙�
let locationCodes = [];
- this.locationData.forEach(layer => {
- layer.locationObj.forEach(location => {
- locationCodes.push(location.locationCode);
+
+ // 鎻愬彇绗�1鎺掕揣浣嶇紪鍙�
+ if (this.locationData.row1) {
+ this.locationData.row1.forEach(layer => {
+ layer.locationObj.forEach(location => {
+ locationCodes.push(location.locationCode);
+ // 鍒濆鍖栨瘡涓揣浣嶇殑RFID鐩稿叧瀛楁
+ if (!location.paperRoll) location.paperRoll = "鏃�";
+ if (!location.productName) location.productName = "鏃�";
+ if (!location.width) location.width = 0;
+ if (!location.quantity) location.quantity = 0;
+ if (!location.barcode) location.barcode = "鏃�";
+ if (!location.rfid) location.rfid = "鏃�";
+ if (!location.rfidCode) location.rfidCode = "鏃�";
+ if (!location.inDate) location.inDate = null;
+ });
});
- });
-
+ }
+
+ // 鎻愬彇绗�2鎺掕揣浣嶇紪鍙�
+ if (this.locationData.row2) {
+ this.locationData.row2.forEach(layer => {
+ layer.locationObj.forEach(location => {
+ locationCodes.push(location.locationCode);
+ // 鍒濆鍖栨瘡涓揣浣嶇殑RFID鐩稿叧瀛楁
+ if (!location.paperRoll) location.paperRoll = "鏃�";
+ if (!location.productName) location.productName = "鏃�";
+ if (!location.width) location.width = 0;
+ if (!location.quantity) location.quantity = 0;
+ if (!location.barcode) location.barcode = "鏃�";
+ if (!location.rfid) location.rfid = "鏃�";
+ if (!location.rfidCode) location.rfidCode = "鏃�";
+ if (!location.inDate) location.inDate = null;
+ });
+ });
+ }
+
console.log(`浠庤揣浣嶆暟鎹腑鎻愬彇鍒�${locationCodes.length}涓揣浣嶇紪鍙穈);
console.log("鎻愬彇鐨勮揣浣嶇紪鍙�:", locationCodes);
-
+
// 璋冪敤API鑾峰彇RFID淇℃伅
this.getRfidInfo(locationCodes, warehouseId);
})
@@ -261,9 +408,24 @@
SCChange() {
this.GetViewData();
},
+ // 鏍规嵁浠撳簱绫诲瀷杩囨护宸烽亾鍒楄〃
+ filterRoadwaysByWarehouse(warehouse) {
+ const allowedRoadways = this.roadwayTypeMap[warehouse] || [];
+ this.scList = this.allRoadways.filter(roadway => allowedRoadways.includes(roadway));
+
+ // 濡傛灉褰撳墠閫変腑鐨勫贩閬撲笉鍦ㄨ繃婊ゅ悗鐨勫垪琛ㄤ腑锛岄噸缃�夋嫨
+ if (this.Area.roadwayNo && !this.scList.includes(this.Area.roadwayNo)) {
+ this.Area.roadwayNo = this.scList[0] || "";
+ } else if (!this.Area.roadwayNo && this.scList.length > 0) {
+ this.Area.roadwayNo = this.scList[0];
+ }
+ },
+
// 鍒囨崲浠撳簱
onWarehouseChange() {
- // 鍒囨崲浠撳簱鏃堕噸缃帓閫夋嫨
+ // 鏍规嵁浠撳簱绫诲瀷杩囨护宸烽亾鍒楄〃
+ this.filterRoadwaysByWarehouse(this.Area.warehouse);
+ // 閲嶇疆鎺掗�夋嫨鍚庤幏鍙栨暟鎹�
this.GetViewData();
},
showTooltip(location, event) {
@@ -283,21 +445,127 @@
},
getStatusText(location) {
- // if (location.location_lock === 3) return "绂佺敤";
if (location.location_lock === 0) return "绌洪棽";
if (location.location_lock === 1) return "閿佸畾";
if (location.location_lock === 100) return "鏈夎揣";
if (location.location_lock === 20) return "绌洪棽閿佸畾";
if (location.location_lock === 10) return "鏈夎揣閿佸畾";
- // if (location.location_state > 0 && location.location_state < 100)
- // return "閿佸畾";
return "鍏朵粬";
+ },
+ getRoadwayNo(column) {
+ // 鏍规嵁鐢ㄦ埛瑕佹眰鐨勮鍒欑敓鎴愭爣鍑嗗寲宸烽亾鍙�
+ // 宸烽亾/鎺掞細浠庝笢鍒拌タ 11銆�12銆�21銆�22銆�31銆�32銆�41銆�42銆�51銆�52
+ // 鍒楋細浠庡寳鍒板崡 01鈥�64
+ // 灞傦細01鈥�10
+
+ if (column && column.locationCode && column.row) {
+ // 鎻愬彇鍘熷宸烽亾鍙凤紝濡係C01_YL
+ const locationCode = column.locationCode;
+ const row = column.row;
+ const originalRoadwayNo = locationCode.split('-')[0];
+
+ // 鏍规嵁鍘熷宸烽亾鍙峰拰琛屽彿鏄犲皠鍒版爣鍑嗗寲宸烽亾鍙�
+ const standardizedRoadwayMap = {
+ // 鍘熸枡搴撳贩閬撴槧灏�
+ // SC01_YL, 绗�1鎺� -> 11锛岀2鎺� -> 12
+ 'SC01_YL': {
+ '01': '11',
+ '1': '11',
+ '02': '12',
+ '2': '12'
+ },
+ // SC02_YL, 绗�1鎺� -> 21锛岀2鎺� -> 22
+ 'SC02_YL': {
+ '01': '21',
+ '1': '21',
+ '02': '22',
+ '2': '22'
+ },
+ // SC03_YLDual, 绗�1鎺� -> 31锛岀2鎺� -> 32
+ 'SC03_YLDual': {
+ '01': '31',
+ '1': '31',
+ '02': '32',
+ '2': '32'
+ },
+ // SC04_YLDual, 绗�1鎺� -> 41锛岀2鎺� -> 42
+ 'SC04_YLDual': {
+ '01': '41',
+ '1': '41',
+ '02': '42',
+ '2': '42'
+ },
+ // SC05_YLDual, 绗�1鎺� -> 51锛岀2鎺� -> 52
+ 'SC05_YLDual': {
+ '01': '51',
+ '1': '51',
+ '02': '52',
+ '2': '52'
+ },
+ // 鎴愬搧搴撳贩閬撴槧灏�
+ // SC01_CP, 绗�1鎺� -> 11锛岀2鎺� -> 12
+ 'SC01_CP': {
+ '01': '11',
+ '1': '11',
+ '02': '12',
+ '2': '12'
+ },
+ // SC02_CP, 绗�1鎺� -> 21锛岀2鎺� -> 22
+ 'SC02_CP': {
+ '01': '21',
+ '1': '21',
+ '02': '22',
+ '2': '22'
+ },
+ // SC03_CP, 绗�1鎺� -> 31锛岀2鎺� -> 32
+ 'SC03_CP': {
+ '01': '31',
+ '1': '31',
+ '02': '32',
+ '2': '32'
+ },
+ // SC04_CP, 绗�1鎺� -> 41锛岀2鎺� -> 42
+ 'SC04_CP': {
+ '01': '41',
+ '1': '41',
+ '02': '42',
+ '2': '42'
+ },
+ // SC05_CP, 绗�1鎺� -> 51锛岀2鎺� -> 52
+ 'SC05_CP': {
+ '01': '51',
+ '1': '51',
+ '02': '52',
+ '2': '52'
+ }
+ };
+
+ // 浠巆olumn.row鑾峰彇琛屽彿锛屾敞鎰廲olumn.row鏄甫鍓嶅闆剁殑瀛楃涓�
+ const rowStr = row;
+
+ // 鏌ユ壘鏄犲皠
+ if (standardizedRoadwayMap[originalRoadwayNo]) {
+ const rowMap = standardizedRoadwayMap[originalRoadwayNo];
+ if (rowMap[rowStr]) {
+ return rowMap[rowStr];
+ }
+ // 灏濊瘯涓嶅甫鍓嶅闆剁殑鎯呭喌
+ const rowStrWithoutZero = rowStr.replace(/^0/, '');
+ if (rowMap[rowStrWithoutZero]) {
+ return rowMap[rowStrWithoutZero];
+ }
+ }
+
+ // 濡傛灉娌℃湁鍖归厤鐨勬槧灏勶紝杩斿洖鍘熷宸烽亾鍙�
+ return originalRoadwayNo;
+ }
+ return '';
},
getWarehouseName(location) {
if (location.warehouseId === 1) return "鍘熸枡搴�";
if (location.warehouseId === 2) return "鎴愬搧搴�";
return "鏈煡浠撳簱";
- },
+ }
},
mounted() {
var mainHeight = document.getElementById("vol-main");
@@ -307,27 +575,28 @@
var _this = this;
//鍔犺浇涓嬫媺閫夐」
this.http.post("/api/LocationInfo/GetRow", {}, "鏌ヨ涓�").then((x) => {
- //鍔犺浇绗竴涓尯鍩燂紝绗竴鎺�
- // _this.Area.shelf_code = _this.slectData[0].shelf_code;
- _this.scList = x.data;
+ //淇濆瓨鎵�鏈夊贩閬�
+ _this.allRoadways = x.data;
+ //鏍规嵁褰撳墠浠撳簱绫诲瀷杩囨护宸烽亾
+ _this.filterRoadwaysByWarehouse(_this.Area.warehouse);
if (_this.scList.length > 0) {
- _this.Area.row = _this.scList[0];
+ _this.Area.roadwayNo = _this.scList[0];
}
_this.GetViewData();
});
},
- components: { ElButton, Loading },
+ components: { ElButton }
};
</script>
<style scoped>
.container {
- display: flex;
- flex-direction: column;
- height: 100%;
- width: 100%;
- padding: 10px;
- }
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ width: 100%;
+ padding: 10px;
+}
.header {
text-align: center;
@@ -384,41 +653,53 @@
}
.location-view {
- flex: 1;
- width: 100%;
- max-width: 100%;
- overflow: auto;
- padding: 10px;
- background-color: white;
- border-radius: 4px;
- }
-
-.layer-container {
- margin-bottom: 25px;
-}
-
-.layer-title {
- margin: 0 0 10px 0;
- font-size: 16px;
- color: #333;
+ flex: 1;
+ width: 470%;
+ max-width: 470%;
+ overflow: auto;
+ padding: 20px;
+ background-color: #f5f7fa;
+ border-radius: 8px;
}
.row {
display: flex;
- flex-wrap: wrap;
margin-bottom: 8px;
cursor: pointer;
+ flex-wrap: nowrap;
}
.location-cell {
- width: 85px;
- height: 38px;
- margin: 3px;
+ width: 120px;
+ height: 50px;
+ margin: 5px;
text-align: center;
- font-size: 14px;
- border-radius: 3px;
- line-height: 38px;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+ font-size: 16px;
+ border-radius: 4px;
+ line-height: 50px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
+ border: 1px solid #ccc;
+ background-color: #f9f9f9;
+}
+
+/* 宸烽亾鍖哄煙鏍峰紡 */
+.roadway-section {
+ margin-bottom: 40px;
+ padding: 20px;
+ background-color: white;
+ border-radius: 6px;
+ border: 1px solid #eaeaea;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+}
+
+.roadway-title {
+ margin: 0 0 20px 0;
+ font-size: 24px;
+ font-weight: bold;
+ color: #2c3e50;
+ text-align: left;
+ padding-bottom: 15px;
+ border-bottom: 3px solid #409EFF;
}
.location-tooltip {
@@ -427,22 +708,37 @@
background-color: white;
border: 1px solid #ddd;
border-radius: 4px;
- padding: 10px;
+ padding: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
pointer-events: none;
- max-width: 250px;
+ min-width: 280px;
+ max-width: 320px;
}
.location-tooltip p {
- margin: 5px 0;
- font-size: 13px;
- line-height: 1.4;
+ margin: 6px 0;
+ font-size: 14px;
+ line-height: 1.5;
+ display: flex;
+ align-items: center;
}
.location-tooltip strong {
display: inline-block;
- width: 70px;
- color: #666;
+ width: 80px;
+ color: #555;
+ font-weight: 600;
+ text-align: right;
+ margin-right: 12px;
+ flex-shrink: 0;
+}
+
+.location-tooltip span {
+ display: inline-block;
+ color: #333;
+ font-weight: 500;
+ flex: 1;
+ text-align: left;
}
.form-group {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
index ff2917e..b43a08a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrder.vue"
@@ -139,69 +139,84 @@
align: "left",
},
{
- field: "materialNos",
- title: "鐗╂枡缂栧彿",
- type: "string",
- width: 160,
- align: "left",
- formatter: (row) => {
- const materialNos = row.materialNos;
- if (!materialNos) return materialNos;
-
- // 鏋勫缓鐗╂枡缂烘枡鐘舵�佹槧灏�
- const lackStatusMap = new Map();
-
- // 娉ㄦ剰锛氬瓧娈靛悕宸茬粡琚浆鎹负椹煎嘲鍛藉悕娉�
- const statusField = row.materialLackStatus;
- if (statusField) {
- const statusPairs = statusField.split(',');
- statusPairs.forEach(pair => {
- const [materialNo, isLack] = pair.split(':');
- lackStatusMap.set(materialNo.trim(), isLack.trim() === 'true');
- });
- }
-
- // 澶勭悊鐗╂枡缂栧彿锛屾牴鎹姸鎬佽缃鑹�
- const materialList = materialNos.split('/');
- const formattedMaterials = materialList.map(materialNo => {
+ field: "materialNos",
+ title: "鐗╂枡缂栧彿",
+ type: "string",
+ width: 160,
+ align: "left",
+ formatter: (row) => {
+ const materialNos = row.materialNos;
+ if (!materialNos) return materialNos;
+
+ // 澶勭悊鐗╂枡缂栧彿锛屾牴鎹瘡涓墿鏂欑殑瀹為檯鐘舵�佹樉绀洪鑹�
+ const materialList = materialNos.split('/');
+ let formattedMaterials = [];
+
+ // 濡傛灉鏈夌墿鏂欑己鏂欑姸鎬佸瓧绗︿覆锛屾牴鎹瘡涓墿鏂欑殑鐘舵�佹樉绀洪鑹�
+ if (row.materialLackStatus) {
+ // 瑙f瀽鐗╂枡缂烘枡鐘舵�佸瓧绗︿覆锛氱墿鏂欑紪鍙�:鐘舵��,鐗╂枡缂栧彿:鐘舵��
+ const statusPairs = row.materialLackStatus.split(',');
+ // 鑾峰彇鎵�鏈夌墿鏂欑殑缂烘枡鐘舵�佸垪琛紝淇濇寔鍘熷椤哄簭
+ const lackStatusList = statusPairs.map(pair => {
+ const [, isLack] = pair.split(':');
+ return isLack.trim() === 'true';
+ });
+
+ // 涓烘瘡涓墿鏂欑紪鍙疯缃鑹诧紝淇濇寔鍘熷椤哄簭
+ formattedMaterials = materialList.map((materialNo, index) => {
const trimmedMaterialNo = materialNo.trim();
- const isLack = lackStatusMap.get(trimmedMaterialNo) || false;
+ const isLack = lackStatusList[index] || false;
if (isLack) {
return `<span style="color: red;">${trimmedMaterialNo}</span>`;
}
return trimmedMaterialNo;
});
-
- return formattedMaterials.join('/');
- }
- },
- {
- field: "materialWides",
- title: "骞呭",
- type: "string",
- width: 100,
- align: "left",
- formatter: (row) => {
- const value = row.materialWides;
- if (value && typeof value === 'string') {
- return value.replace(/\.\d+$/, '');
- }
- return value;
- }
- },
- {
- field: "isLackMaterial",
- title: "鏄惁缂烘枡",
- type: "string",
- width: 100,
- align: "center",
- formatter: (row) => {
+ } else {
+ // 濡傛灉娌℃湁鐗╂枡缂烘枡鐘舵�佷俊鎭紝浣跨敤璁㈠崟绾у埆鐨勭己鏂欑姸鎬�
const isLack = Boolean(row.isLackMaterial);
- const text = isLack ? "鏄�" : "鍚�";
- const bgColor = isLack ? '#ff4d4f' : '#52c41a';
- return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`;
+ if (isLack) {
+ return `<span style="color: red;">${materialNos}</span>`;
+ }
+ formattedMaterials = materialList;
}
- },
+
+ return formattedMaterials.join('/');
+ }
+ },
+ {
+ field: "materialWides",
+ title: "骞呭",
+ type: "string",
+ width: 100,
+ align: "left",
+ formatter: (row) => {
+ const value = row.materialWides;
+ if (value && typeof value === 'string') {
+ return value.replace(/\.\d+$/, '');
+ }
+ return value;
+ }
+ },
+ {
+ field: "boardFluteNos",
+ title: "妤炲埆",
+ type: "string",
+ width: 100,
+ align: "left"
+ },
+ {
+ field: "isLackMaterial",
+ title: "鏄惁缂烘枡",
+ type: "string",
+ width: 100,
+ align: "center",
+ formatter: (row) => {
+ const isLack = Boolean(row.isLackMaterial);
+ const text = isLack ? "鏄�" : "鍚�";
+ const bgColor = isLack ? '#ff4d4f' : '#52c41a';
+ return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`;
+ }
+ },
]);
const detail = ref({
cnName: "鍑哄簱鏄庣粏鍗�",
@@ -281,7 +296,7 @@
align: "left",
edit: { type: "string" },
required: true,
-
+
},
{
field: "xqLen",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrderDetail.vue"
index 3285c1d..edeb32a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/views/outbound/outSGOrderDetail.vue"
@@ -1,221 +1,211 @@
-
<template>
- <view-grid
- ref="grid"
- :columns="columns"
- :detail="detail"
- :editFormFields="editFormFields"
- :editFormOptions="editFormOptions"
- :searchFormFields="searchFormFields"
- :searchFormOptions="searchFormOptions"
- :table="table"
- :extend="extend"
- >
- </view-grid>
- </template>
- <script>
- import extend from "@/extension/outbound/outSGOrderDetail.js";
- import { ref, defineComponent } from "vue";
- export default defineComponent({
- setup() {
- const table = ref({
- key: "id",
- footer: "Foots",
- cnName: "鍑哄簱鍗曟槑缁�",
- name: "outSGOrderDetail",
- url: "/OutSGOrderDetail/",
- sortName: "id",
- });
- const editFormFields = ref({
- deviceCode: "",
- deviceName: "",
- deviceType: "",
- deviceStatus: "",
- deviceIp: "",
- devicePort: "",
- devicePlcType: "",
- deviceRemark: "",
- });
- const editFormOptions = ref([
- [
- {
- title: "璁惧缂栧彿",
- required: true,
- field: "deviceCode",
- type: "string",
- },
- {
- title: "璁惧鍚嶇О",
- required: true,
- field: "deviceName",
- type: "string",
- },
- {
- title: "璁惧绫诲瀷",
- required: true,
- field: "deviceType",
- type: "string",
- },
- {
- title: "璁惧鐘舵��",
- required: true,
- field: "deviceStatus",
- type: "string",
- },
- ],
- [
- { title: "璁惧IP", required: true, field: "deviceIp", type: "string" },
- {
- title: "璁惧绔彛",
- required: true,
- field: "devicePort",
- type: "string",
- },
- {
- title: "PLC绫诲瀷",
- required: true,
- field: "devicePlcType",
- type: "string",
- },
- {
- title: "澶囨敞",
- field: "deviceRemark",
- type: "string",
- },
- ],
- ]);
- const searchFormFields = ref({
- deviceCode: "",
- deviceType: "",
- deviceStatus: "",
- });
- const searchFormOptions = ref([
- [
- { title: "璁惧缂栧彿", field: "deviceCode" },
- { title: "璁惧绫诲瀷", field: "deviceType" },
- { title: "璁惧鐘舵��", field: "deviceStatus" },
- ],
- ]);
- const columns = ref([
- {
- field: "id",
- title: "Id",
- type: "int",
- width: 90,
- hidden: true,
- readonly: true,
- align: "left",
- },
+ <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
+ :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
+ :table="table" :extend="extend">
+ </view-grid>
+</template>
+<script>
+import extend from "@/extension/outbound/outSGOrderDetail.js";
+import { ref, defineComponent } from "vue";
+export default defineComponent({
+ setup() {
+ const table = ref({
+ key: "id",
+ footer: "Foots",
+ cnName: "鍑哄簱鍗曟槑缁�",
+ name: "outSGOrderDetail",
+ url: "/OutSGOrderDetail/",
+ sortName: "id",
+ });
+ const editFormFields = ref({
+ deviceCode: "",
+ deviceName: "",
+ deviceType: "",
+ deviceStatus: "",
+ deviceIp: "",
+ devicePort: "",
+ devicePlcType: "",
+ deviceRemark: "",
+ });
+ const editFormOptions = ref([
+ [
{
- field: "outSGOrderId",
- title: "鍑哄簱鍗曚富閿�",
+ title: "璁惧缂栧彿",
+ required: true,
+ field: "deviceCode",
type: "string",
- width: 90,
- align: "left",
- hidden: true,
},
{
- field: "MaterialNo",
- title: "鐗╂枡缂栧彿",
+ title: "璁惧鍚嶇О",
+ required: true,
+ field: "deviceName",
type: "string",
- width: 150,
- align: "left",
},
{
- field: "materielName",
- title: "鐗╂枡鍚嶇О",
+ title: "璁惧绫诲瀷",
+ required: true,
+ field: "deviceType",
type: "string",
- width: 150,
- align: "left",
},
{
- field: "batchNo",
- title: "鎵规鍙�",
- type: "decimal",
- width: 90,
- align: "left",
- },
- {
- field: "orderQuantity",
- title: "鍗曟嵁鏁伴噺",
+ title: "璁惧鐘舵��",
+ required: true,
+ field: "deviceStatus",
type: "string",
- width: 90,
- align: "left",
},
+ ],
+ [
+ { title: "璁惧IP", required: true, field: "deviceIp", type: "string" },
{
- field: "lockQuantity",
- title: "閿佸畾鏁伴噺",
- type: "int",
- width: 120,
- align: "left",
- },
- {
- field: "overOutQuantity",
- title: "宸插嚭鏁伴噺",
+ title: "璁惧绔彛",
+ required: true,
+ field: "devicePort",
type: "string",
- width: 200,
- align: "left",
},
{
- field: "orderDetailStatus",
- title: "璁㈠崟鏄庣粏鐘舵��",
+ title: "PLC绫诲瀷",
+ required: true,
+ field: "devicePlcType",
type: "string",
- width: 180,
- align: "left",
},
{
- field: "creater",
- title: "鍒涘缓浜�",
- type: "string",
- width: 90,
- align: "left",
- },
- {
- field: "createDate",
- title: "鍒涘缓鏃堕棿",
- type: "datetime",
- width: 160,
- align: "left",
- },
- {
- field: "modifier",
- title: "淇敼浜�",
- type: "string",
- width: 100,
- align: "left",
- },
- {
- field: "modifyDate",
- title: "淇敼鏃堕棿",
- type: "datetime",
- width: 160,
- align: "left",
- },
- {
- field: "remark",
title: "澶囨敞",
+ field: "deviceRemark",
type: "string",
- width: 100,
- align: "left",
},
- ]);
- const detail = ref({
- cnName: "#detailCnName",
- table: "",
- columns: [],
- sortName: "",
- });
- return {
- table,
- extend,
- editFormFields,
- editFormOptions,
- searchFormFields,
- searchFormOptions,
- columns,
- detail,
- };
- },
- });
- </script>
-
\ No newline at end of file
+ ],
+ ]);
+ const searchFormFields = ref({
+ deviceCode: "",
+ deviceType: "",
+ deviceStatus: "",
+ });
+ const searchFormOptions = ref([
+ [
+ { title: "璁惧缂栧彿", field: "deviceCode" },
+ { title: "璁惧绫诲瀷", field: "deviceType" },
+ { title: "璁惧鐘舵��", field: "deviceStatus" },
+ ],
+ ]);
+ const columns = ref([
+ {
+ field: "id",
+ title: "Id",
+ type: "int",
+ width: 90,
+ hidden: true,
+ readonly: true,
+ align: "left",
+ },
+ {
+ field: "outSGOrderId",
+ title: "鍑哄簱鍗曚富閿�",
+ type: "string",
+ width: 90,
+ align: "left",
+ hidden: true,
+ },
+ {
+ field: "MaterialNo",
+ title: "鐗╂枡缂栧彿",
+ type: "string",
+ width: 150,
+ align: "left",
+ },
+ {
+ field: "materielName",
+ title: "鐗╂枡鍚嶇О",
+ type: "string",
+ width: 150,
+ align: "left",
+ },
+ {
+ field: "batchNo",
+ title: "鎵规鍙�",
+ type: "decimal",
+ width: 90,
+ align: "left",
+ },
+ {
+ field: "orderQuantity",
+ title: "鍗曟嵁鏁伴噺",
+ type: "string",
+ width: 90,
+ align: "left",
+ },
+ {
+ field: "lockQuantity",
+ title: "閿佸畾鏁伴噺",
+ type: "int",
+ width: 120,
+ align: "left",
+ },
+ {
+ field: "overOutQuantity",
+ title: "宸插嚭鏁伴噺",
+ type: "string",
+ width: 200,
+ align: "left",
+ },
+ {
+ field: "orderDetailStatus",
+ title: "璁㈠崟鏄庣粏鐘舵��",
+ type: "string",
+ width: 180,
+ align: "left",
+ },
+ {
+ field: "creater",
+ title: "鍒涘缓浜�",
+ type: "string",
+ width: 90,
+ align: "left",
+ },
+ {
+ field: "createDate",
+ title: "鍒涘缓鏃堕棿",
+ type: "datetime",
+ width: 160,
+ align: "left",
+ },
+ {
+ field: "modifier",
+ title: "淇敼浜�",
+ type: "string",
+ width: 100,
+ align: "left",
+ },
+ {
+ field: "modifyDate",
+ title: "淇敼鏃堕棿",
+ type: "datetime",
+ width: 160,
+ align: "left",
+ },
+ {
+ field: "remark",
+ title: "澶囨敞",
+ type: "string",
+ width: 100,
+ align: "left",
+ },
+ ]);
+ const detail = ref({
+ cnName: "#detailCnName",
+ table: "",
+ columns: [],
+ sortName: "",
+ });
+ return {
+ table,
+ extend,
+ editFormFields,
+ editFormOptions,
+ searchFormFields,
+ searchFormOptions,
+ columns,
+ detail,
+ };
+ },
+});
+</script>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs"
index 0f6bef4..7319aee 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Base/LocationInfoService.cs"
@@ -1,4 +1,4 @@
-锘縰sing HslCommunication.WebSocket;
+using HslCommunication.WebSocket;
using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
using SqlSugar;
@@ -44,7 +44,7 @@
}
/// <summary>
- /// 鏌ヨ璐т綅瀵瑰簲鐨凴FID
+ /// 鏌ヨ璐т綅瀵瑰簲鐨凴FID鍙婂簱瀛樹俊鎭�
/// </summary>
/// <param name="locationCodes"></param>
/// <returns></returns>
@@ -60,28 +60,47 @@
if (warehouseId == 1)
{
- // 鏌ヨ鍘熸枡搴揇t_StockInfo琛紝鑾峰彇RFID淇℃伅
+ // 鏌ヨ鍘熸枡搴揇t_StockInfo琛紝鑾峰彇RFID鍙婂簱瀛樹俊鎭�
var rawMaterialRfidList = _stockInfoRepository.QueryData()
.Where(x => locationCodes.Contains(x.LocationCode))
- .Select(x => new { x.LocationCode, x.RfidCode })
+ .Select(x => new {
+ locationCode = x.LocationCode,
+ rfidCode = x.RfidCode,
+ paperRoll = x.MaterielName, // 绾稿嵎鍚嶇О
+ width = x.MaterielWide, // 闂ㄥ箙锛堝箙瀹斤級
+ barcode = x.PalletCode, // 绾稿嵎鏉$爜
+ status = x.StockStatus, // 鐘舵��
+ inDate = x.CreateDate // 鍏ュ簱鏃堕棿锛堝垱寤烘椂闂达級
+ })
.ToList();
- var rfidList = rawMaterialRfidList.ToList();
// 杩斿洖缁撴灉
- return WebResponseContent.Instance.OK(data: rfidList);
+ return WebResponseContent.Instance.OK(data: rawMaterialRfidList);
}
if (warehouseId == 2)
{
- // 鏌ヨ鎴愬搧搴揇t_ProStockInfo琛紝鑾峰彇PalletCode淇℃伅
- var finishedProductRfidList =_proStockInfoRepository.QueryData()
+ // 鏇挎崲鍘熸湁鐨� .Select(x => new { ... Detail = x.proStockInfoDetails?.FirstOrDefault() ... }) 浠g爜鍧�
+ var finishedProductRfidList = _proStockInfoRepository.Db.Queryable<Dt_ProStockInfo>()
+ .Includes(x => x.proStockInfoDetails)
.Where(x => locationCodes.Contains(x.LocationCode))
- .Select(x => new { x.LocationCode, RfidCode = x.PalletCode })
+ .ToList()
+ .Select(x => new
+ {
+ locationCode = x.LocationCode,
+ rfidCode = x.PalletCode,
+ paperRoll = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].ProductName : string.Empty,
+ productName = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].ProductName : string.Empty,
+ width = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].StockQty : 0,
+ quantity = (x.proStockInfoDetails != null && x.proStockInfoDetails.Count > 0) ? x.proStockInfoDetails[0].StockQty : 0,
+ barcode = x.PalletCode,
+ status = x.StockStatus,
+ inDate = x.CreateDate
+ })
.ToList();
- var rfidList = finishedProductRfidList.ToList();
// 杩斿洖缁撴灉
- return WebResponseContent.Instance.OK(data: rfidList);
+ return WebResponseContent.Instance.OK(data: finishedProductRfidList);
}
// 濡傛灉娌℃湁鍖归厤鐨勪粨搴揑D锛岃繑鍥炵┖鍒楄〃
return WebResponseContent.Instance.OK(data: new List<object>());
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
index 897dfba..dbd3926 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutSGOrder.cs"
@@ -85,6 +85,12 @@
public string MaterialWides { get; set; }
/// <summary>
+ /// 妤炲埆
+ /// </summary>
+ [SugarColumn(IsIgnore = true, ColumnDescription = "妤炲埆")]
+ public string BoardFluteNos { get; set; }
+
+ /// <summary>
/// 鏄惁缂烘枡
/// </summary>
[SugarColumn(IsIgnore = true, ColumnDescription = "鏄惁缂烘枡")]
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
index 96cb2e0..685fdff 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderDetailService.cs"
@@ -153,7 +153,24 @@
}
+ // 鍒嗛厤瀹屾垚鍚庯紝妫�鏌ユ瘡涓鍗曟槑缁嗙殑鍒嗛厤鎯呭喌锛岃缃纭殑鐘舵��
+ foreach (var detail in details)
+ {
+ decimal assignedQuantity = outStockLockInfos.Where(x => x.OrderDetailId == detail.Id).Sum(x => x.AssignQuantity);
+ if (assignedQuantity > 0)
+ {
+ // 宸茬粡鍒嗛厤鍒板簱瀛橈紝鏍囪涓洪潪缂烘枡鐘舵�侊紙鏈紑濮嬶級
+ detail.OutSGOrderDetailStatus = OutOrderStatusEnum.鏈紑濮�.ObjToInt();
+ }
+ else
+ {
+ // 鏈垎閰嶅埌搴撳瓨锛屾爣璁颁负缂烘枡
+ detail.OutSGOrderDetailStatus = OutOrderStatusEnum.缂烘枡.ObjToInt();
+ }
+ }
+
locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Where(x=>!x.LocationCode.IsNullOrEmpty() && !locationInfos.Select(x=>x.LocationCode).Contains(x.LocationCode)).Select(x => x.LocationCode).ToList()));
+
}
return (outStocks, outboundOrderDetails, outStockLockInfos, locationInfos, message);
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
index a6bb559..9284f59 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutSGOrderService.cs"
@@ -59,13 +59,16 @@
// 鑾峰彇鎵�鏈夎鍗旾D
var orderIds = pageData.Rows.Select(o => o.Id).ToList();
- // 鎵归噺鏌ヨ鎵�鏈夊叧鑱旂殑鏄庣粏锛岃繃婊ゆ帀鐗╂枡缂栧彿涓虹┖鐨勬暟鎹�
+ // 鎵归噺鏌ヨ鎵�鏈夊叧鑱旂殑鏄庣粏锛屾寜OutSGOrderId鍗囧簭銆両d闄嶅簭鎺掑簭锛屼笌璁㈠崟鏄庣粏椤甸潰淇濇寔涓�鑷�
var allDetails = BaseDal.Db.Queryable<Dt_OutSGOrderDetail>()
.Where(d => orderIds.Contains(d.OutSGOrderId))
+ .OrderBy(d => d.OutSGOrderId)
+ .OrderByDescending(d => d.Id)
.ToList();
- // 鎸夎鍗旾D鍒嗙粍
- var detailsByOrderId = allDetails.GroupBy(d => d.OutSGOrderId).ToDictionary(g => g.Key, g => g.ToList());
+ // 鎸夎鍗旾D鍒嗙粍锛屾瘡缁勬槑缁嗘寜Id闄嶅簭鎺掑簭锛屼笌璁㈠崟鏄庣粏椤甸潰淇濇寔涓�鑷�
+ var detailsByOrderId = allDetails.GroupBy(d => d.OutSGOrderId)
+ .ToDictionary(g => g.Key, g => g.OrderByDescending(d => d.Id).ToList());
// 澶勭悊姣忎釜璁㈠崟
foreach (var order in pageData.Rows)
@@ -91,6 +94,9 @@
? uniqueWidths[0]
: string.Join("/", uniqueWidths);
+ // 璁剧疆妤炲埆锛屽彧鏄剧ず涓�涓紙鍥犱负鎵�鏈夋鍒浉鍚岋級
+ order.BoardFluteNos = details.FirstOrDefault()?.BoardFluteNo ?? "";
+
// 璁剧疆鏄惁缂烘枡锛氬鏋滄湁浠讳綍涓�涓槑缁嗘槸缂烘枡鐘舵�侊紝灏辫缃负true
// 寮曠敤WIDESEA_Common.OrderEnum鍛藉悕绌洪棿鏉ヤ娇鐢∣utOrderStatusEnum鏋氫妇
order.IsLackMaterial = details.Any(d => d.OutSGOrderDetailStatus == 3); // 3鏄己鏂欑姸鎬佺殑鏋氫妇鍊�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index 389fb59..3c8e22f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -1,4 +1,4 @@
-锘�
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -706,7 +706,7 @@
}
content.Message = result.Item6;
//澶勭悊鍑哄簱鏁版嵁
- return GenerateOutboundTaskDataUpdate(tasks, stockInfos, outSGOrderDetails, outStockLockInfos, locationInfos);
+ return GenerateOutboundTaskDataUpdate(tasks, stockInfos, outSGOrderDetails, outStockLockInfos, locationInfos, result.Item6);
}
catch (Exception ex)
{
@@ -743,6 +743,14 @@
//鍒嗛厤搴撳瓨
(List<Dt_StockInfo>, List<Dt_OutSGOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>,string) result = _outboundService.OutSGOrderDetailService.AssignStockOutbound(outSGOrderDetails);
+
+ //淇濆瓨缂烘枡鐘舵�侊紝鏃犺鏄惁鐢熸垚浜嗕换鍔�
+ var shortageDetails = result.Item2.Where(x => x.OutSGOrderDetailStatus == OutOrderStatusEnum.缂烘枡.ObjToInt()).ToList();
+ if (shortageDetails.Any())
+ {
+ _outboundRepository.OutSGOrderDetailRepository.UpdateData(shortageDetails);
+ }
+
if (result.Item1 != null && result.Item1.Count > 0)
{
//鑾峰彇浠诲姟
@@ -773,7 +781,8 @@
}
else
{
- throw new Exception("鏃犲簱瀛�");
+ //娌℃湁搴撳瓨锛屼絾宸茬粡鍦ˋssignStockOutbound鏂规硶涓爣璁颁簡缂烘枡鐘舵�侊紝骞朵笖宸茬粡淇濆瓨
+ orderDetails = result.Item2;
}
return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos, result.Item5);
@@ -782,7 +791,7 @@
/// 澶勭悊鍑哄簱鏁版嵁
/// </summary>
/// <returns></returns>
- public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutSGOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null)
+ public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutSGOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null, string message = "")
{
try
{
@@ -822,7 +831,7 @@
}
_unitOfWorkManage.CommitTran();
PushTasksToWCS(tasks);
- return WebResponseContent.Instance.OK();
+ return WebResponseContent.Instance.OK(message);
}
catch (Exception ex)
{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs"
index 40d503e..b56f0c3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs"
@@ -1,4 +1,4 @@
-锘縰sing HslCommunication.WebSocket;
+using HslCommunication.WebSocket;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -90,69 +90,84 @@
/// <summary>
/// 鏌ヨ鏉′欢璐т綅
/// </summary>
- /// <param name="row"></param>
+ /// <param name="roadwayNo"></param>
/// <param name="warehouseId"></param>
/// <returns></returns>
[HttpPost, HttpGet, Route("GetLocationStatus")]
- public WebResponseContent GetLocationStatus(int row, int warehouseId = 0)
+ public WebResponseContent GetLocationStatus(string roadwayNo, int warehouseId = 0)
{
- List<int> layers;
- if (warehouseId == 0)
+ // 瀹氫箟杩斿洖鏁版嵁缁撴瀯
+ var result = new
{
- layers = _repository.QueryData(x => x.Row == row).Select(x => x.Layer).Distinct().ToList();
- }
- else
+ row1 = new List<object>(), // 宸烽亾绗�1鎺掞紙涓滈潰锛�
+ row2 = new List<object>() // 宸烽亾绗�2鎺掞紙瑗块潰锛�
+ };
+
+ // 鏌ヨ宸烽亾涓嬫墍鏈夎揣浣�
+ var locations = _repository.QueryData(x => x.RoadwayNo == roadwayNo);
+
+ // 鑾峰彇鎵�鏈夊眰锛屾寜浠庨珮鍒颁綆鎺掑簭
+ var layers = locations.Select(x => x.Layer).Distinct().OrderByDescending(x => x).ToList();
+
+ // 澶勭悊姣忎竴灞�
+ foreach (var layer in layers)
{
- layers = _repository.QueryData(x => x.Row == row && x.WarehouseId == warehouseId).Select(x => x.Layer).Distinct().ToList();
- }
-
- List<object> listObj = new List<object>();
- foreach (var item in layers)
- {
- object locationObj;
- if (warehouseId == 0)
- {
- locationObj = _repository.QueryData(x => x.Row == row && x.Layer == item)
- .OrderBy(x => x.Columns)
- .Select(x => new
- {
- layer = x.Layer.ToString().PadLeft(2, '0'),
- row = x.Row.ToString().PadLeft(2, '0'),
- column = x.Columns.ToString().PadLeft(2, '0'),
- locationCode = x.LocationCode,
- location_lock = x.LocationStatus
- }).ToList();
- }
- else
- {
- locationObj = _repository.QueryData(x => x.Row == row && x.Layer == item && x.WarehouseId == warehouseId)
- .OrderBy(x => x.Columns)
- .Select(x => new
- {
- layer = x.Layer.ToString().PadLeft(2, '0'),
- row = x.Row.ToString().PadLeft(2, '0'),
- column = x.Columns.ToString().PadLeft(2, '0'),
- locationCode = x.LocationCode,
- location_lock = x.LocationStatus
- }).ToList();
- }
-
- object obj = new { layer = item, locationObj };
- listObj.Add(obj);
+ // 鑾峰彇褰撳墠灞傜殑璐т綅
+ var layerLocations = locations.Where(x => x.Layer == layer);
+
+ // 绗�1鎺掓暟鎹紙涓滈潰锛�
+ var row1Locations = layerLocations.Where(x => x.Row == 1)
+ .OrderBy(x => x.Columns)
+ .Select(x => new
+ {
+ layer = x.Layer.ToString().PadLeft(2, '0'),
+ row = x.Row.ToString().PadLeft(2, '0'),
+ column = x.Columns.ToString().PadLeft(2, '0'),
+ locationCode = x.LocationCode,
+ location_lock = x.LocationStatus
+ }).ToList();
+
+ // 绗�2鎺掓暟鎹紙瑗块潰锛�
+ var row2Locations = layerLocations.Where(x => x.Row == 2)
+ .OrderBy(x => x.Columns)
+ .Select(x => new
+ {
+ layer = x.Layer.ToString().PadLeft(2, '0'),
+ row = x.Row.ToString().PadLeft(2, '0'),
+ column = x.Columns.ToString().PadLeft(2, '0'),
+ locationCode = x.LocationCode,
+ location_lock = x.LocationStatus
+ }).ToList();
+
+ // 娣诲姞鍒扮粨鏋滀腑
+ result.row1.Add(new { layer, locationObj = row1Locations });
+ result.row2.Add(new { layer, locationObj = row2Locations });
}
- return WebResponseContent.Instance.OK("鎴愬姛", listObj);
+ return WebResponseContent.Instance.OK("鎴愬姛", result);
}
/// <summary>
- /// 鏌ヨ鍏ㄩ儴璐т綅
+ /// 鏌ヨ鍏ㄩ儴宸烽亾
/// </summary>
/// <returns></returns>
[HttpPost, HttpGet, Route("GetRow")]
public WebResponseContent GetRow()
{
- List<int> listRow = _repository.QueryData().Select(x => x.Row).Distinct().ToList();
- return WebResponseContent.Instance.OK("鎴愬姛", listRow);
+ // 淇濇寔鍏煎鏃ф帴鍙o紝杩斿洖宸烽亾鍒楄〃
+ List<string> roadwayList = _repository.QueryData().Select(x => x.RoadwayNo).Distinct().ToList();
+ return WebResponseContent.Instance.OK("鎴愬姛", roadwayList);
+ }
+
+ /// <summary>
+ /// 鏌ヨ鍏ㄩ儴宸烽亾
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost, HttpGet, Route("GetRoadway")]
+ public WebResponseContent GetRoadway()
+ {
+ List<string> roadwayList = _repository.QueryData().Select(x => x.RoadwayNo).Distinct().ToList();
+ return WebResponseContent.Instance.OK("鎴愬姛", roadwayList);
}
/// <summary>
--
Gitblit v1.9.3