z8018
2025-02-18 4c7b1c96e1cbab323817a0057ce484a572822e19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
  <div style="display: grid; grid-template-columns: 94% 5%">
    <el-tabs
      tab-position="left"
      style="margin-left: 1%; width: 98%"
      v-model="activeName"
      @tab-click="handleClick"
    >
      <el-tab-pane
        v-for="item in locationLayer"
        :key="item.value"
        :label="item.label"
        :name="item.value"
        :lazy="true"
      >
        <div v-if="isLoad(item.value)">
          <stock-plan
            v-for="(tunnels, index) in locationConfigs"
            :key="index"
            :gridColumnNum="tunnels.colNum"
            :gridRowNum="tunnels.rowNum"
            :locationList="tunnels.locationList"
            :tunnelRowNo="tunnels.tunnelRowNo"
            :tunnel="tunnels.tunnel"
            :layer="item.value"
          ></stock-plan>
        </div>
      </el-tab-pane>
    </el-tabs>
    <div style="margin-top: 10%; height: 90%; margin-left: 20%">
      <div
        style="
          margin-top: 30%;
          margin-left: 20%;
          border: 1px solid lightskyblue;
          color: #000000;
          height: 32px;
          width: 32px;
        "
      ></div>
      <div style="margin-left: 20%"><span>空闲</span></div>
      <div
        style="
          margin-top: 30%;
          margin-left: 20%;
          border: 1px solid lightskyblue;
          color: #000000;
          height: 32px;
          width: 32px;
        "
      >
        <img src="../../../public/Stored.png" width="30px" />
      </div>
      <div><span>有货占用</span></div>
      <div
        style="
          margin-top: 30%;
          margin-left: 20%;
          border: 1px solid lightskyblue;
          color: #000000;
          height: 32px;
          width: 32px;
        "
      >
        <img src="../../../public/Inbound.png" width="30px" />
      </div>
      <div><span>入库占用</span></div>
      <div
        style="
          margin-top: 30%;
          margin-left: 20%;
          border: 1px solid lightskyblue;
          color: #000000;
          height: 32px;
          width: 32px;
        "
      >
        <img src="../../../public/Outbound.png" width="30px" />
      </div>
      <div><span>出库锁定</span></div>
      <div
        style="
          margin-top: 30%;
          margin-left: 20%;
          border: 1px solid lightskyblue;
          color: #000000;
          height: 32px;
          width: 32px;
        "
      >
        <img src="../../../public/Lock.png" width="30px" />
      </div>
      <div style="margin-left: 20%"><span>锁定</span></div>
      <div
        style="
          margin-top: 30%;
          margin-left: 20%;
          border: 1px solid lightskyblue;
          color: #000000;
          height: 32px;
          width: 32px;
        "
      >
        <img src="../../../public/Error.png" width="30px" />
      </div>
      <div style="margin-left: 20%"><span>禁用</span></div>
    </div>
  </div>
</template>
<script>
import { ref, reactive } from "vue";
import StockPlan from "./StockPlan.vue";
export default {
  data() {
    return {
      activeName: 1,
      locationConfigs: [],
      locationLayer: [],
    };
  },
  components: {
    StockPlan,
  },
  created() {
    this.http
      .post("/api/locationInfo/GetLocationLayer", "", "加载中")
      .then((x) => {
        if (x.status) {
          this.locationLayer = x.data;
          // setTimeout(() => {
          //   this.initLocation(1);
          //   this.activeName = "1";
          // }, 1000);
        } else {
          this.$Message.error(x.message);
        }
      });
  },
  beforeDestroy() {},
  mounted() {},
  methods: {
    handleClick(tab, event) {
      this.initLocation(tab.props.name);
    },
 
    initLocation(layer) {
      console.log(this.activeName);
      this.http
        .post(
          "/api/locationInfo/GetLocationConfigs?layer=" + layer,
          "",
          "加载中"
        )
        .then((x) => {
          if (x.status) {
            this.locationConfigs = x.data;
          } else {
            this.$Message.error(x.message);
          }
        });
    },
    isLoad(layer) {
      let config = this.locationConfigs.find((x) => x.layer === layer);
      if (config) {
        return true;
      }
      return false;
    },
  },
};
</script>