From fd073a00f6813eada92b08f1884b115295ac1177 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 17 六月 2025 17:15:58 +0800
Subject: [PATCH] 添加版权注释

---
 项目代码/WMS/WIDESEA_WMSClient/src/views/Home.vue |  352 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 323 insertions(+), 29 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
index a5a6e05..cbf4d15 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/Home.vue"
@@ -1,43 +1,337 @@
 <template>
-  <div class="indexModel">
-    <div class="item_top">
-      <label-top></label-top>
-    </div>
-    <div class="item_center">
-      <label-center></label-center>
+  <div>
+    <!-- height:40px -->
+    <div class="title">搴撲綅骞抽潰鍥�</div>
+
+    <!-- <div>鍙樉绀轰竴涓尯鍩熺殑涓�涓爢鍨涙満瀵瑰簲鐨勭姸鎬�</div> -->
+    <div class="main" :style="{ height: mian_height }">
+      <!-- 骞抽潰鍥炬樉绀哄尯鍩� -->
+      <div class="right">
+        <div v-for="layer in locationData" :key="layer.index">
+          <div class="row_tip">绗瑊{ layer.index }}灞�</div>
+          <div class="row" v-for="row in layer.rows" :key="row.index">
+            <el-tooltip
+              v-for="col in row.cols"
+              :key="col.column"
+              effect="dark"
+              placement="top"
+              :show-after="200"
+              :hide-after="0"
+            >
+              <template #content v-if="col.locationStatus == 99">
+                <!-- <div>璐т綅鐘舵�侊細{{ getStatusText(col.locationStatus) }}</div> -->
+                <div>鐗╂枡鍚嶇О锛� {{ col.materielName }}</div>
+                <!-- <div>鐗╂枡缂栧彿锛� {{ col.materielCode }}</div> -->
+                <div>鏁伴噺锛歿{ col.quantity }}鎵�</div>
+                <!-- <div>鎵樼洏鍙凤細{{ col.palletCode }}</div> -->
+              </template>
+              <template #content v-else-if="col.locationStatus == 0">
+                <div>绌鸿揣浣�</div>
+              </template>
+              <template #content v-else>
+                <div>
+                  璐т綅鍚嶇О锛歿{
+                    col.row + "鎺�" + col.column + "鍒�" + col.layer + "灞�"
+                  }}
+                </div>
+                <div>璐т綅鐘舵�侊細{{ getStatusText(col.locationStatus) }}</div>
+                <div>鐗╂枡鍚嶇О锛� {{ col.materielName }}</div>
+                <div>鐗╂枡缂栧彿锛� {{ col.materielCode }}</div>
+                <div>鎵瑰彿锛歿{ col.orderNo }}</div>
+                <div>鏌滃彿锛歿{ col.batchNo }}</div>
+                <div>鏁伴噺锛歿{ col.quantity }}鎵�</div>
+                <!-- <div>鎵樼洏鍙凤細{{ col.palletCode }}</div> -->
+                <div>鍏ュ簱鏃堕棿锛歿{ col.inDate }}</div>
+                <div>鍚敤鐘舵�侊細{{ getEnableStatusText(col.enalbeStatus) }}</div>
+              </template>
+              <div
+                class="item"
+                :style="{ 'background-color': GetBgColor(col) }"
+              >
+                {{ row.index }}-{{ col.column }}-{{ layer.index }}
+              </div>
+            </el-tooltip>
+          </div>
+        </div>
+      </div>
+
+      <!-- 閫夋嫨鎻愮ず鍖哄煙 -->
+      <div class="left">
+        <!-- <div>鍖哄煙锛�</div>
+        <el-select
+          size="mini"
+          filterable
+          v-model="Area.shelf_code"
+          placeholder="璇烽�夋嫨"
+        >
+          <el-option
+            v-for="item in slectData"
+            :value="item.shelf_code"
+            :label="item.house_name"
+            :key="item.house_name"
+          ></el-option>
+        </el-select> -->
+        <!-- <div class="tipText">鍫嗗灈鏈猴細</div>
+        <el-select
+          size="mini"
+          clearable
+          filterable
+          @change="SCChange"
+          v-model="Area.tunnel"
+          placeholder="璇烽�夋嫨"
+        >
+          <el-option
+            v-for="item in scList"
+            :value="item"
+            :label="item"
+            :key="item"
+          ></el-option>
+        </el-select> -->
+        <!-- <div class="tipText">灞傦細</div>
+        <el-select
+          size="mini"
+          clearable
+          filterable
+          @change="SCChange"
+          v-model="Area.layer"
+          placeholder="璇烽�夋嫨"
+        >
+          <el-option
+            v-for="item in layers"
+            :value="item"
+            :label="item"
+            :key="item"
+          ></el-option>
+        </el-select> -->
+        <br />
+        <ElButton type="success" class="btn" @click="GetViewData"
+          >鍒锋柊</ElButton
+        >
+
+        <div style="margin-top: 80px">
+          <!-- <div style="color: red">搴撲綅鎺掑簭璇存槑锛氭帓-鍒�-灞�</div>
+          <div style="color: red">1+2鎺掍负闀胯揣浣�,3鎺掍负鐭揣浣�</div>
+          <div style="color: red">1涓牸瀛�=12涓揣浣嶆渶澶氬彲鏀�12鎵�</div> -->
+          <div>璇存槑</div>
+          <div v-for="item in infoMsg" :key="item.bgcolor">
+            <div class="infoMsg" :style="{ 'background-color': item.bgcolor }">
+              {{ item.msg }}
+            </div>
+          </div>
+        </div>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
-import { ref, reactive } from 'vue'
-import LabelTop from '../components/index/LabelTop.vue'
-import LabelCenter from '../components/index/LabelCenter.vue';
-export default {
-  components: { LabelTop,LabelCenter },
-  setup() {
-    return {
+import { ElButton } from "element-plus";
 
-    }
-  }
-}
+export default {
+  data() {
+    return {
+      slectData: [],
+      scList: [],
+      layers: [],
+      Area: { house_name: "", tunnel: "", shelf_code: "" },
+      mian_height: "",
+      infoMsg: [
+        { bgcolor: "lightgreen", msg: "绌鸿揣浣�", state: 0 },
+        { bgcolor: "orange", msg: "鏈夎揣", state: "Stored" },
+        { bgcolor: "#2BB3D5", msg: "鎵ц涓�", state: "InAssigned" },
+        { bgcolor: "#ccc", msg: "绂佺敤", state: "Lock" },
+        { bgcolor: "red", msg: "寮傚父", state: "error" },
+        { bgcolor: "#b7ba6b", msg: "绌烘墭", state: 99 },
+      ],
+      locationData: [],
+    };
+  },
+  computed: {
+    GetBgColor() {
+      return (col) => {
+        var bgColor = "#b7ba6b";
+        //浼樺厛鏄剧ず绂佺敤鐘舵��
+        if (col.enalbeStatus == 3) {
+          this.infoMsg.forEach((el) => {
+            if (el.state == "Lock") {
+              bgColor = el.bgcolor;
+            }
+          });
+        } else {
+          this.infoMsg.forEach((el) => {
+            if (
+              col.locationStatus == 4 ||
+              col.locationStatus == 6 ||
+              col.locationStatus == 7
+            ) {
+              if (el.state == "InAssigned") {
+                bgColor = el.bgcolor;
+              }
+            } else if (col.locationStatus == 2 || col.locationStatus == 3) {
+              if (el.state == "Stored") {
+                bgColor = el.bgcolor;
+              }
+            } else if (el.state == col.locationStatus) {
+              bgColor = el.bgcolor;
+            }
+          });
+        }
+        return bgColor;
+      };
+    },
+  },
+  watch: {
+    //鍒囨崲搴撳尯
+    "Area.shelf_code"(newValue, oldValue) {
+      this.scList = [];
+      this.layers = [];
+      this.slectData.forEach((e) => {
+        if (e.areaName == newValue) {
+          this.Area.tunnel = e.tunnel[0];
+          this.scList = e.tunnel;
+          this.Area.layer = "绗�" + e.layers[0] + "灞�";
+          this.layers = e.layers;
+        }
+      });
+      this.GetViewData();
+    },
+  },
+  methods: {
+    getTooltipContent(col) {
+      return `鐘舵��: ${this.getStatusText(col.locationStatus)}
+              鍚敤鐘舵��: ${this.getEnableStatusText(col.enalbeStatus)}
+              鎵樼洏鍙�: ${col.palletNo || "鏃�"}`;
+    },
+    getStatusText(status) {
+      const statusMap = {
+        0: "绌洪棽",
+        1: "鎸囧畾鍏ュ簱",
+        2: "鏈夎揣",
+        3: "婊¤揣",
+        4: "鍏ュ簱涓�",
+        5: "鎸囧畾鍑哄簱",
+        6: "鍑哄簱涓�",
+        7: "绉诲簱涓�",
+        99: "绌烘墭鐩�",
+      };
+      return statusMap[status] || "鏈煡鐘舵��";
+    },
+    getEnableStatusText(status) {
+      const enableMap = {
+        0: "姝e父",
+        1: "鍙叆",
+        2: "鍙嚭",
+        3: "绂佺敤",
+      };
+      return enableMap[status] || "鏈煡";
+    },
+    GetViewData() {
+      var _this = this;
+      this.http
+        .post("/api/StockView/GetLocationStockView", {}, "鏌ヨ涓�")
+        .then((x) => {
+          _this.locationData = x.data;
+          // console.log("鍚庣杩斿洖:", x.data);
+          // console.log("杩斿洖鏁版嵁:", _this.locationData);
+        });
+    },
+    // 鍒囨崲鍫嗗灈鏈�
+    SCChange() {
+      this.GetViewData();
+    },
+  },
+  mounted() {
+    var mainHeight = document.getElementById("vol-main");
+    this.mian_height = mainHeight.offsetHeight - 40 + "px";
+    var _this = this;
+    //鍔犺浇涓嬫媺閫夐」
+    this.http
+      .get("/api/LocationInfo/GetLocationLayer", {}, "鏌ヨ涓�")
+      .then((x) => {
+        _this.slectData = x;
+        //鍔犺浇绗竴涓尯鍩燂紝绗竴涓爢鍨涙満
+        _this.Area.shelf_code = _this.slectData[0].areaName;
+        _this.scList = _this.slectData[0].tunnel;
+        _this.layers = _this.slectData[0].layers;
+      });
+    this.GetViewData();
+  },
+  components: { ElButton },
+};
 </script>
 
 <style scoped>
-.indexModel {
-  height: 88vh;
-  background-color: #f1f1f1;
-  color: #303133;
+.left {
+  height: 100%;
+  float: left;
+  width: 18%;
+  /* background: lightblue; */
+  padding-top: 20px;
+  padding-left: 20px;
 }
-.indexModel .item_top{
-  height: 20vh;
-  width: 98%;
-  margin: 0vh 1%;
+
+.right {
+  padding: 9px;
+  height: 98%;
+  overflow-y: auto;
+  overflow-x: auto;
+  float: left;
+  width: 82%;
+  padding-top: 5px;
 }
-.indexModel .item_center{
-  height: 68vh;
-  width: 98%;
-  margin: 0vh 1%;
-  
+
+.title {
+  text-align: center;
+  padding: 5px 0px;
+  font-size: 20px;
+  font-weight: bold;
+  width: 82%;
+}
+
+.row_tip {
+  font-size: 16px;
+  padding-left: 5px;
+}
+
+.row {
+  overflow: auto;
+  margin-bottom: 11px;
+}
+
+.item {
+  float: left;
+  width: 66px;
+  height: 38px;
+  margin: 3px;
+  background-color: lightblue;
+  text-align: center;
+  font-size: 14px;
+  border-radius: 3px;
+  line-height: 38px;
+}
+
+.tipText {
+  margin-top: 10px;
+}
+
+.btn {
+  margin-top: 15px;
+}
+
+.infoMsg {
+  float: left;
+  width: 63px;
+  height: 35px;
+  margin: 3px;
+  text-align: center;
+  font-size: 14px;
+  border-radius: 3px;
+  line-height: 38px;
+}
+</style>
+
+<style>
+.el-input {
+  width: 180px;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3