From ce1292c9cf37195b6abd2699dfc5d6cb3e143c9b Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 12 四月 2026 23:38:19 +0800
Subject: [PATCH] feat(MES): 添加MES接口相关实体和DTO JS扩展文件至JSX格式并更新配置

---
 Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.jsx |  170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 170 insertions(+), 0 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.jsx b/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.jsx
new file mode 100644
index 0000000..133cbc5
--- /dev/null
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.jsx
@@ -0,0 +1,170 @@
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+
+let extension = {
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: '',
+    gridBody: '',
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '',
+  buttons: { view: [], box: [], detail: [] },
+  methods: {
+    onInit() {
+      // 娣诲姞MES鎿嶄綔鍒�
+      this.columns.push({
+        title: '鎿嶄綔',
+        field: '鎿嶄綔',
+        align: 'center',
+        width: 280,
+        fixed: 'right',
+        render: (h, { row, column, index }) => {
+          // 閿佸畾鐘舵�佷笉鏄剧ず鎸夐挳
+          // 鐘舵��: 7=鍑哄簱閿佸畾, 9=绉诲簱閿佸畾, 99=缁勭洏鎾ら攢, 199=鍏ュ簱鎾ら攢
+          const lockedStatuses = [7, 9, 99, 199];
+          if (lockedStatuses.includes(row.status)) {
+            return <span style="color: #909399">鏆傛棤鍙墽琛屾搷浣�</span>;
+          }
+
+          return (
+            <div>
+              <el-button
+                type="primary"
+                size="small"
+                onClick={($e) => { this.handleBind(row); }}
+              >缁戝畾</el-button>
+              <el-button
+                type="warning"
+                size="small"
+                style="margin-left: 6px"
+                onClick={($e) => { this.handleUnbind(row); }}
+              >瑙g粦</el-button>
+              <el-button
+                type="danger"
+                size="small"
+                style="margin-left: 6px"
+                onClick={($e) => { this.handleNgReport(row); }}
+              >NG涓婃姤</el-button>
+            </div>
+          );
+        }
+      });
+    },
+
+    // 鎵樼洏鐢佃姱缁戝畾鎿嶄綔
+    async handleBind(row) {
+      try {
+        await this.$confirm(`纭鎵ц鐢佃姱缁戝畾鎿嶄綔锛焅n鐢佃姱鐮侊細${row.serialNumber}`, "缁戝畾纭", {
+          confirmButtonText: "纭",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        });
+
+        const result = await this.http.post("/api/StockInfoDetail/bindContainer", {
+          palletCode: row.palletCode || "P001",
+          sfcList: [row.serialNumber],
+          location: row.location || "",
+          operationType: 1
+        }, "姝e湪璋冪敤MES鎺ュ彛...");
+
+        if (result.status) {
+          this.$Message.success(result.message || "鐢佃姱缁戝畾鎴愬姛");
+          this.$refs.table.load();
+        } else {
+          this.$error(result.message || "鐢佃姱缁戝畾澶辫触");
+        }
+      } catch (error) {
+        if (error !== "cancel") {
+          this.$error(error.message || "缃戠粶閿欒锛岃绋嶅悗閲嶈瘯");
+        }
+      }
+    },
+
+    // 鎵樼洏鐢佃姱瑙g粦鎿嶄綔
+    async handleUnbind(row) {
+      try {
+        await this.$confirm(`纭鎵ц鐢佃姱瑙g粦鎿嶄綔锛焅n鐢佃姱鐮侊細${row.serialNumber}`, "瑙g粦纭", {
+          confirmButtonText: "纭",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        });
+
+        const result = await this.http.post("/api/StockInfoDetail/unbindContainer", {
+          palletCode: row.palletCode || "P001",
+          sfcList: [row.serialNumber]
+        }, "姝e湪璋冪敤MES鎺ュ彛...");
+
+        if (result.status) {
+          this.$Message.success(result.message || "鐢佃姱瑙g粦鎴愬姛");
+          this.$refs.table.load();
+        } else {
+          this.$error(result.message || "鐢佃姱瑙g粦澶辫触");
+        }
+      } catch (error) {
+        if (error !== "cancel") {
+          this.$error(error.message || "缃戠粶閿欒锛岃绋嶅悗閲嶈瘯");
+        }
+      }
+    },
+
+    // 鎵樼洏NG鐢佃姱涓婃姤鎿嶄綔
+    async handleNgReport(row) {
+      try {
+        await this.$confirm(`纭鎵цNG鐢佃姱涓婃姤鎿嶄綔锛焅n鐢佃姱鐮侊細${row.serialNumber}`, "NG涓婃姤纭", {
+          confirmButtonText: "纭",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
+        });
+
+        const result = await this.http.post("/api/StockInfoDetail/containerNgReport", {
+          palletCode: row.palletCode || "P001",
+          ngSfcList: [{
+            sfc: row.serialNumber,
+            ngCode: "NG001",
+            ngEquipmentCode: "WCS_001",
+            ngResourceCode: "RESOURCE_001"
+          }]
+        }, "姝e湪璋冪敤MES鎺ュ彛...");
+
+        if (result.status) {
+          this.$Message.success(result.message || "NG涓婃姤鎴愬姛");
+          this.$refs.table.load();
+        } else {
+          this.$error(result.message || "NG涓婃姤澶辫触");
+        }
+      } catch (error) {
+        if (error !== "cancel") {
+          this.$error(error.message || "缃戠粶閿欒锛岃绋嶅悗閲嶈瘯");
+        }
+      }
+    },
+
+    onInited() {
+      // 妗嗘灦鍒濆鍖栭厤缃悗
+    },
+    searchBefore(param) {
+      return true;
+    },
+    searchAfter(result) {
+      return true;
+    },
+    addBefore(formData) {
+      return true;
+    },
+    updateBefore(formData) {
+      return true;
+    },
+    rowClick({ row, column, event }) {
+      this.$refs.table.$refs.table.toggleRowSelection(row);
+    },
+    modelOpenAfter(row) {
+      // 鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚�
+    }
+  }
+};
+
+export default extension;

--
Gitblit v1.9.3