From a7bd6e538027d876b3122f21c3b1d34663fb2f07 Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期日, 25 一月 2026 14:18:51 +0800
Subject: [PATCH] 优化前端,修复库存托盘编号重复和WCS任务重发

---
 项目代码/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js |  193 ++++++++++++++++++++++++++++++------------------
 1 files changed, 120 insertions(+), 73 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js"
index 79d6b35..13dc359 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/basic/locationInfo.js"
@@ -1,28 +1,31 @@
-
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
-import gridBody from './extend/GetLocationStatus.vue'
+import gridBody from "./extend/GetLocationStatus.vue";
+import { h } from "vue";
+import RoadwaySelector from "../../components/basic/RoadwaySelector.vue";
 let extension = {
   components: {
     //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-    gridHeader: '',
+    gridHeader: "",
     gridBody: gridBody,
-    gridFooter: '',
+    gridFooter: "",
     //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
-    modelHeader: '',
-    modelBody: '',
-    modelFooter: ''
+    modelHeader: "",
+    modelBody: "",
+    modelFooter: "",
   },
-  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  tableAction: "", //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
   buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
   methods: {
     //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
     onInit() {
-      let EnableBtn = this.buttons.find(x => x.value == 'Enable');
+      let EnableBtn = this.buttons.find((x) => x.value == "Enable");
       if (EnableBtn) {
         EnableBtn.onClick = function () {
           let rows = this.$refs.table.getSelected();
           if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
-          var keys = rows.map(x => { return x.id });
+          var keys = rows.map((x) => {
+            return x.id;
+          });
           this.http
             .post("api/LocationInfo/LocationEnableStatus", keys, "鏁版嵁澶勭悊涓�")
             .then((x) => {
@@ -30,14 +33,16 @@
               this.$message.success("鎿嶄綔鎴愬姛");
               this.refresh();
             });
-        }
+        };
       }
-      let DisableBtn = this.buttons.find(x => x.value == 'Disable');
+      let DisableBtn = this.buttons.find((x) => x.value == "Disable");
       if (DisableBtn) {
         DisableBtn.onClick = function () {
           let rows = this.$refs.table.getSelected();
           if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
-          var keys = rows.map(x => { return x.id });
+          var keys = rows.map((x) => {
+            return x.id;
+          });
           this.http
             .post("api/LocationInfo/LocationDisableStatus", keys, "鏁版嵁澶勭悊涓�")
             .then((x) => {
@@ -45,36 +50,57 @@
               this.$message.success("鎿嶄綔鎴愬姛");
               this.refresh();
             });
-        }
+        };
       }
-      let EnableRoadwayBtn = this.buttons.find(
+let EnableRoadwayBtn = this.buttons.find(
         (x) => x.value == "EnableRoadway",
       );
       if (EnableRoadwayBtn) {
         EnableRoadwayBtn.onClick = function () {
-          this.$prompt("璇烽�夋嫨宸烽亾 (1-5)", "鎻愮ず", {
+          this.$msgbox({
+            title: "璇烽�夋嫨宸烽亾", // 鍒犻櫎"鎻愮ず"涓や釜瀛�
+            message: `
+        <div>
+          <select id="roadwaySelect" style="width: 400px; height: 30px;">
+            <option value="1">宸烽亾 1</option>
+            <option value="2">宸烽亾 2</option>
+            <option value="3">宸烽亾 3</option>
+            <option value="4">宸烽亾 4</option>
+            <option value="5">宸烽亾 5</option>
+          </select>
+        </div>
+      `,
+            showCancelButton: true,
             confirmButtonText: "纭畾",
             cancelButtonText: "鍙栨秷",
-            inputPattern: /^[1-5]$/,
-            inputErrorMessage: "璇疯緭鍏�1-5涔嬮棿鐨勬暟瀛�",
-          })
-            .then(({ value }) => {
-              this.http
-                .post(
-                  `api/LocationInfo/EnableAllLocationsInRoadway?roadwayNo=${value}`,
-                  null,
-                  "鏁版嵁澶勭悊涓�",
-                )
-                .then((x) => {
-                  console.log(x);
-                  if (!x.status) return this.$message.error(x.message);
-                  this.$message.success(x.message || "鎿嶄綔鎴愬姛");
-                  this.refresh();
-                });
-            })
-            .catch(() => {
-              this.$message.info("宸插彇娑堟搷浣�");
-            });
+            dangerouslyUseHTMLString: true,
+            beforeClose: (action, instance, done) => {
+              if (action === "confirm") {
+                const select = document.getElementById("roadwaySelect");
+                const value = select ? select.value : "1";
+
+                this.http
+                  .post(
+                    `api/LocationInfo/EnableAllLocationsInRoadway?roadwayNo=${value}`,
+                    null,
+                    "鏁版嵁澶勭悊涓�",
+                  )
+                  .then((x) => {
+                    console.log(x);
+                    if (!x.status) return this.$message.error(x.message);
+                    this.$message.success(x.message || "鎿嶄綔鎴愬姛");
+                    this.refresh();
+                    done();
+                  })
+                  .catch(() => {
+                    done();
+                  });
+              } else {
+                this.$message.info("宸插彇娑堟搷浣�");
+                done();
+              }
+            },
+          });
         };
       }
 
@@ -83,45 +109,66 @@
       );
       if (DisableRoadwayBtn) {
         DisableRoadwayBtn.onClick = function () {
-          this.$prompt("璇烽�夋嫨宸烽亾 (1-5)", "鎻愮ず", {
+          this.$msgbox({
+            title: "璇烽�夋嫨宸烽亾", // 鍒犻櫎"鎻愮ず"涓や釜瀛�
+            message: `
+        <div>
+          <select id="roadwaySelect" style="width: 400px; height: 30px;">
+            <option value="1">宸烽亾 1</option>
+            <option value="2">宸烽亾 2</option>
+            <option value="3">宸烽亾 3</option>
+            <option value="4">宸烽亾 4</option>
+            <option value="5">宸烽亾 5</option>
+          </select>
+        </div>
+      `,
+            showCancelButton: true,
             confirmButtonText: "纭畾",
             cancelButtonText: "鍙栨秷",
-            inputPattern: /^[1-5]$/,
-            inputErrorMessage: "璇疯緭鍏�1-5涔嬮棿鐨勬暟瀛�",
-          })
-            .then(({ value }) => {
-              this.http
-                .post(
-                  `api/LocationInfo/DisableAllLocationsInRoadway?roadwayNo=${value}`,
-                  null, 
-                  "鏁版嵁澶勭悊涓�",
-                )
-                .then((x) => {
-                  if (!x.status) return this.$message.error(x.message);
-                  this.$message.success(x.message || "鎿嶄綔鎴愬姛");
-                  this.refresh();
-                });
-            })
-            .catch(() => {
-              this.$message.info("宸插彇娑堟搷浣�");
-            });
+            dangerouslyUseHTMLString: true,
+            beforeClose: (action, instance, done) => {
+              if (action === "confirm") {
+                const select = document.getElementById("roadwaySelect");
+                const value = select ? select.value : "1";
+
+                this.http
+                  .post(
+                    `api/LocationInfo/DisableAllLocationsInRoadway?roadwayNo=${value}`,
+                    null,
+                    "鏁版嵁澶勭悊涓�",
+                  )
+                  .then((x) => {
+                    if (!x.status) return this.$message.error(x.message);
+                    this.$message.success(x.message || "鎿嶄綔鎴愬姛");
+                    this.refresh();
+                    done();
+                  })
+                  .catch(() => {
+                    done();
+                  });
+              } else {
+                this.$message.info("宸插彇娑堟搷浣�");
+                done();
+              }
+            },
+          });
         };
       }
-      this.columns.push({
-        field: '鎿嶄綔',
-        title: '鎿嶄綔',
-        width: 90,
-        fixed: 'right',
-        align: 'center',
-        formatter: (row) => {
-          return (
-            '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>'
-          );
-        },
-        click: (row) => {
-          this.$refs.gridBody.open(row);
-        }
-      });
+      // this.columns.push({
+      //   field: '鎿嶄綔',
+      //   title: '鎿嶄綔',
+      //   width: 90,
+      //   fixed: 'right',
+      //   align: 'center',
+      //   formatter: (row) => {
+      //     return (
+      //       '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>'
+      //     );
+      //   },
+      //   click: (row) => {
+      //     this.$refs.gridBody.open(row);
+      //   }
+      // });
     },
     onInited() {
       //妗嗘灦鍒濆鍖栭厤缃悗
@@ -156,7 +203,7 @@
       //(3)this.editFormFields.瀛楁='xxx';
       //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
       //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
-    }
-  }
+    },
+  },
 };
 export default extension;

--
Gitblit v1.9.3