wuyouming666
2023-09-05 c7df23be1f204458883088c18cbe33a451b8e50d
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<style>
* {
    margin: 0;
    padding: 0;
}
 
.occupy {
    height: 100%;
    width: 10%;
    background-color: white;
    margin: 0px 8px 0px 8px;
    border: 1px black solid;
    text-align: center;
    padding: 5px;
}
 
.el-col {
    margin-top: 4px;
}
 
.biao {
    font-size: 12px;
}
 
.zhi {
    font-size: 18px;
    font-weight: bold;
}
 
.el-main {
    padding: 3px;
    min-height: 40vh;
}
.el-footer {
    max-height: 60vh;
    padding: 0px;
    margin: 0px;
}
.green {
    background-color: green;
}
 
.blue {
    background-color: blue;
}
 
.red {
    background-color: red;
}
 
.yellow {
    background-color: yellow;
}
 
.black {
    background-color: black;
}
 
.gezi {
    height: 23px;
    width: 1.74px;
}
 
.gezi:nth-child(22) {
    margin-left: 4px;
}
 
.gezi:nth-child(43) {
    margin-left: 4px;
}
 
.gezi:nth-child(64) {
    margin-left: 4px;
}
 
.gezi:nth-child(85) {
    margin-left: 4px;
}
 
.block {
    min-height: 50vh;
    max-width: 100vw;  
    background-image: url('xmjc.png');
    margin: 0px;
    background-repeat:no-repeat ;
    background-size:100% 100%;
    background-attachment:local;
}
</style>
<template>
    <el-container>
        <!-- <el-header style="padding: 10px;"></el-header> -->
        <el-main>
            <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                <el-input style="width:15%;" placeholder="Enter the glass lD"></el-input>
                <el-button type="primary">Manually feed the glass</el-button>
                <el-input style="width:15%;" placeholder="Enter the order number" v-model="order"></el-input>
                <el-button type="warning" @click="getOrder()">Exit the glass by order number</el-button>
            </div>
            <div>
                <el-table :data="this.tasklist1" border style="width: 100%">
                    <el-table-column prop="glassId" label="Coming out glass ID"></el-table-column>
                    <el-table-column prop="cage" label="The Grille number being used"></el-table-column>
                    <el-table-column label="Order number">orderNo</el-table-column>
                    <el-table-column prop="address" label="Length and width"></el-table-column>
                    <el-table-column prop="address" label="coating"></el-table-column>
                </el-table>
                <el-table :data="this.tasklist2" border style="width: 100%">
                    <el-table-column prop="glassId" label="Incoming glass ID"></el-table-column>
                    <el-table-column prop="cage" label="The Grille number being used"></el-table-column>
                    <el-table-column label="Order number">orderNo</el-table-column>
                    <el-table-column prop="address" label="Length and width"></el-table-column>
                    <el-table-column prop="address" label="coating"></el-table-column>
                </el-table>
            </div>
            <div style="padding: 10px;display: flex;height:85px;">
                <div v-for="item in tableData" :key="item['cageno']" class="occupy">
                    <el-col style="text-align:left;font-weight: bold;">#{{ item['cage'] }}</el-col>
                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
                        <span class="biao">Usage</span><span class="zhi">{{ item['cell'] }}%</span>
                    </el-col>
                    <hr style="width:80%;margin: 0 auto;" />
                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
                        <span class="biao">Space (Pieces)</span><span class="zhi">{{ item['state'] }}</span>
                    </el-col>
                </div>
            </div>
        </el-main>
        <el-footer> 
                <div class="block" style="text-align: center;position: relative;">
                    <div style="display:flex;position: absolute;float:left;z-index: 999;top:71px;left:136px;">
                        <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"></div>
                    </div>
                    <div style="display:flex;position: absolute;float:left;z-index: 999;top:71px;left:366px;">
                        <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"></div>
                    </div>
                    <div style="display:flex;position: absolute;float:left;z-index: 999;top:96px;left:136px;">
                        <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"></div>
                    </div>
                    <div style="display:flex;position: absolute;float:left;z-index: 999;top:96px;left:366px;">
                        <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"></div>
                    </div>
                </div> 
        </el-footer>
    </el-container>
</template>
  
<script>
 
import { home, home2, loadtask, InsertOrder } from "../../api/home";
 
 
export default {
    data() {
        return {
            tableData: [],
            cagelist1: [],
            cagelist2: [],
            cagelist3: [],
            cagelist4: [],
            form: {},
            task1: 3,
            task2: 4,
            tasklist1: [],
            tasklist2: [],
            src: "./img/xmjc.png",
            order: ""
        };
    },
    created() {
        this.load();
    },
    methods: {
        load() {
            home().then(res => {
                this.tableData = res.data.list;
            });
            home2().then(res => {
                this.cagelist1 = res.data.list1;
                this.cagelist2 = res.data.list2;
                this.cagelist3 = res.data.list3;
                this.cagelist4 = res.data.list4;
            });
            loadtask(this.task1).then(res => {
                this.tasklist1 = res.data.list;
            });
            loadtask(this.task2).then(res => {
                this.tasklist2 = res.data.list;
            });
        },
        getStatusClass(state) {
            //每各格子不同状态不同颜色
            if (state == 0) {
                return "green gezi";
            } else if (state == 1) {
                return "blue gezi";
            } else if (state == 2) {
                return "yellow gezi";
            } else if (state == 3) {
                return "red gezi";
            } else {
                return "black gezi";
            }
        },
        getOrder() {
            if(this.order!=""){
                InsertOrder(this.order).then(res => {
                    if (res.data.message == 200) {
                        this.$message.success("Operation successful");
                    } else {
                        this.$message.success("operation failed");
                    }
                    this.load();
                });
            }
            
        }
    }
};
 
 
</script>