From 3cad4e97ce4784887c9802a07d2cf79ffe16bbc7 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 31 三月 2026 17:11:21 +0800
Subject: [PATCH] #出入库模式

---
 src/main/webapp/components/DevpCard.js |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/src/main/webapp/components/DevpCard.js b/src/main/webapp/components/DevpCard.js
index d8daf18..d9eb322 100644
--- a/src/main/webapp/components/DevpCard.js
+++ b/src/main/webapp/components/DevpCard.js
@@ -1,3 +1,5 @@
+var stationTracePageVersion = "20260319_station_trace_layout_v2";
+
 Vue.component("devp-card", {
   template: `
     <div class="mc-root">
@@ -31,7 +33,9 @@
           </label>
           <div class="mc-action-row">
             <button type="button" class="mc-btn" @click="controlCommand">涓嬪彂</button>
+            <button type="button" class="mc-btn mc-btn-soft" @click="clearPathCommand">娓呰矾寰�</button>
             <button type="button" class="mc-btn mc-btn-soft" @click="resetCommand">澶嶄綅</button>
+            <button type="button" class="mc-btn mc-btn-ghost" @click="openStationTracePage">杩愯杞ㄨ抗</button>
             <button v-if="showFakeTraceEntry" type="button" class="mc-btn mc-btn-ghost" @click="openFakeTracePage">浠跨湡杞ㄨ抗</button>
           </div>
         </div>
@@ -172,6 +176,15 @@
     orDash: function (value) {
       return MonitorCardKit.orDash(value);
     },
+    formatIoMode: function (value) {
+      if (value === 1 || value === "1") {
+        return "鍏ュ簱";
+      }
+      if (value === 2 || value === "2") {
+        return "鍑哄簱";
+      }
+      return "--";
+    },
     getStatusLabel: function (item) {
       return item && item.autoing ? "鑷姩" : "鎵嬪姩";
     },
@@ -252,12 +265,16 @@
       }
       window.open(baseUrl + "/views/watch/fakeTrace.html", "_blank");
     },
+    openStationTracePage: function () {
+      window.open(baseUrl + "/views/watch/stationTrace.html?v=" + stationTracePageVersion, "_blank");
+    },
     buildDetailEntries: function (item) {
       return [
         { label: "缂栧彿", value: this.orDash(item.stationId) },
         { label: "宸ヤ綔鍙�", value: this.orDash(item.taskNo) },
         { label: "鐩爣绔�", value: this.orDash(item.targetStaNo) },
         { label: "妯″紡", value: item.autoing ? "鑷姩" : "鎵嬪姩" },
+        { label: "鍑哄叆搴撴ā寮�", value: this.formatIoMode(item.ioMode) },
         { label: "鏈夌墿", value: MonitorCardKit.yesNo(item.loading) },
         { label: "鍙叆", value: MonitorCardKit.yesNo(item.inEnable) },
         { label: "鍙嚭", value: MonitorCardKit.yesNo(item.outEnable) },
@@ -269,10 +286,26 @@
         { label: "鏉$爜", value: this.orDash(item.barcode), code: true, type: "barcode" },
         { label: "閲嶉噺", value: this.orDash(item.weight) },
         { label: "浠诲姟鍙啓鍖�", value: this.orDash(item.taskWriteIdx) },
+        { label: "缂撳瓨鍖烘暟鎹�", value: this.formatTaskBufferItems(item.taskBufferItems), code: true },
         { label: "鏁呴殰浠g爜", value: this.orDash(item.error) },
         { label: "鏁呴殰淇℃伅", value: this.orDash(item.errorMsg) },
+        { label: "绯荤粺鍛婅", value: this.orDash(item.systemWarning) },
         { label: "鎵╁睍鏁版嵁", value: this.orDash(item.extend) }
       ];
+    },
+    formatTaskBufferItems: function (items) {
+      if (!Array.isArray(items) || items.length === 0) {
+        return "--";
+      }
+      return items.map(function (item) {
+        var slotIdx = item && item.slotIdx != null ? item.slotIdx : "?";
+        var taskNo = item && item.taskNo != null ? item.taskNo : 0;
+        var targetStaNo = item && item.targetStaNo != null ? item.targetStaNo : 0;
+        if (!taskNo && !targetStaNo) {
+          return slotIdx + ": 绌�";
+        }
+        return slotIdx + ": " + taskNo + " -> " + targetStaNo;
+      }).join(" | ");
     },
     postControl: function (url, payload) {
       $.ajax({
@@ -462,6 +495,9 @@
     controlCommand: function () {
       this.postControl("/station/command/move", this.controlParam);
     },
+    clearPathCommand: function () {
+      this.postControl("/station/command/clearPath", this.controlParam);
+    },
     resetCommand: function () {
       this.postControl("/station/command/reset", this.controlParam);
     }

--
Gitblit v1.9.1