liulijun
2025-11-17 da4257bc32483409af02a06dd342c6981ec786ec
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<template>
  <div id="box">
    <div class="container">
      <div class="boxTop">
        <div class="boxOrder">
          <div>
            <div style="margin-top: -10px">
              <span>
                <icon
                  name="align-left"
                  class="text-icon"
                  style="margin-left: 5px"
                ></icon>
              </span>
              <span class="fs-xl text mb-1 pl-3" style="font-size: 20px;font-weight: bold;"
                >工单信息</span
              >
            </div>
            <div style="margin-top: 10px">
              <div class="row" style="font-weight: bold">
                <div class="cell">工单号</div>
                <div class="cell">标准压力(t)</div>
                <div class="cell">保压时间(h)</div>
                <div class="cell">饼总层数</div>
                <div class="cell">标准直径(mm)</div>
                <div class="cell">实际直径(mm)</div>
                <div class="cell">测宽结果</div>
                <div class="cell" style="border-right: none;">工单状态</div>
              </div>
              <div class="body">
                <div class="cell">{{ OrderInfo.work_order_no }}</div>
                <div class="cell">{{ OrderInfo.pressure }}</div>
                <div class="cell">{{ OrderInfo.holding_time }}</div>
                <div class="cell">{{ OrderInfo.total_layer }}</div>
                <div class="cell">{{ OrderInfo.diameter_res }}</div>
                <div class="cell">{{ OrderInfo.measure_diameter_res }}</div>
                <div class="cell"><span style="display: block;width: 60px;height: 25px;margin: 4px auto;border: 2px solid gray;" :class="getTolerance(OrderInfo.is_tolerance)"></span></div>
                <div class="cell" style="border-right: none;" :class="OrderInfo.status==1?'ing':'end'">{{ OrderInfo.status==1?"工单进行中":"工单已完成" }}</div>
              </div>
            </div>
          </div>
          
          <!-- <dv-water-level-pond :config="line" style="width:100px;height:85px;position: absolute;right: 85px;top: 20px;" /> -->
          
        </div>
        <div class="boxTitle">
          <span
            style="
              width: 5px;
              height: 30px;
              background-color: #f34336;
              display: block;
            "
          ></span>
          <span
            style="
              display: block;
              padding-left: 15px;
              font-size: 20px;
              font-weight: bold;
            "
            >设备状态</span
          >
        </div>
        <div style="display: flex;position: absolute;left: 10px;top: 112px; width:1400px;justify-content: space-between;">
          <dv-border-box-13 class="box" title="垒饼机">
            <div class="boxItem">
              <div class="boxLeft">
                <img src="../assets/LB.png" width="150" height="150" style="" />
              </div>
              <div class="boxRight">
                <div
                  style="
                    font-size: 22px;
                    font-weight: bold;
                    color: red;
                    width: 160px;
                    margin-top: 20px;
                  "
                >
                  垒饼机
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >心跳信号:</span
                  >
                  <span style="display: block; width: 50px;height: 25px;text-align: left;margin: 5px 0px;" :class="LbjInfo.rboolHeart==true?'success':'info'"></span>
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >当前设备编号:</span
                  >
                  <span style="display: block; width: 100px; text-align: left"
                    >{{ LbjInfo.rintMCPDeviceID }}</span
                  >
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >当前设备状态:</span
                  >
                  <span style="display: block; width: 100px; text-align: left"
                    >{{ GetDeviceStatus(LbjInfo.rintMCPDeviceStatus) }}</span
                  >
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >当前设备流程:</span
                  >
                  <span style="display: block; width: 100px; text-align: left"
                    >{{ GetLbjStepNumber(LbjInfo.rintMCPAutoStepNumber) }}</span
                  >
                </div>
              </div>
            </div>
          </dv-border-box-13>
          <dv-border-box-13 class="box" title="翻转机">
            <div class="boxItem">
              <div class="boxLeft">
                <img src="../assets/FZ.png" width="150" height="150" style="" />
              </div>
              <div class="boxRight">
                <div
                  style="
                    font-size: 22px;
                    color: red;
                    font-weight: bold;
                    width: 180px;
                    margin-top: 20px;
                  "
                >
                  翻转机
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >心跳信号:</span
                  >
                  <span style="display: block; width: 50px;height: 25px;text-align: left;margin: 5px 0px;" :class="FzjInfo.rboolRCP1Heart==true?'success':'info'"></span>
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >当前设备编号:</span
                  >
                  <span style="display: block; width: 100px; text-align: left"
                    >{{ FzjInfo.rintRCP1DeviceID }}</span
                  >
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >当前设备状态:</span
                  >
                  <span style="display: block; width: 100px; text-align: left"
                    >{{ GetDeviceStatus(FzjInfo.rintRCP1DeviceStatus) }}</span
                  >
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right"
                    >当前设备流程:</span
                  >
                  <span style="display: block; width: 100px; text-align: left"
                    >{{ GetFzjStepNumber(FzjInfo.rintRCP1AutoStepNumber) }}</span
                  >
                </div>
              </div>
            </div>
          </dv-border-box-13>
          <dv-border-box-13 class="box" title="机械手">
            <div class="boxItem">
              <div class="boxLeft">
                <img src="../assets/JX.png" width="150" height="150" style="" />
              </div>
              <div class="boxRight">
                <div
                  style="
                    font-size: 22px;
                    color: red;
                    font-weight: bold;
                    width: 180px;
                    margin-top: 20px;
                  "
                >
                  机械手
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right">心跳信号:</span>
                  <span style="display: block; width: 50px;height: 25px;text-align: left;margin: 5px 0px;" :class="JxsInfo.rboolRCP2Heart==true?'success':'info'"></span>
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right">当前设备编号:</span>
                  <span style="display: block; width: 100px; text-align: left">{{ JxsInfo.rintRCP2DeviceID }}</span>
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right">当前设备状态:</span>
                  <span style="display: block; width: 100px; text-align: left">{{ GetJxsDeviceStatus(JxsInfo.rintRCP2DeviceStatus) }}</span>
                </div>
                <div class="boxitem_down">
                  <span style="display: block; width: 160px; text-align: right">当前设备流程:</span>
                  <span style="display: block; width: 100px; text-align: left">{{ GetJxsStepNumber(JxsInfo.rintRCP2AutoStepNumber) }}</span>
                </div>
              </div>
            </div>
          </dv-border-box-13>
        </div>
      </div>
    </div>
  </div>
</template>
  
  <script>
import axios from "@/api/ajax.js";
export default {
  data() {
    return {
      line: {
        data: [86],
        shape: 'roundRect',
        waveOpacity:0.2,
        colors:['#00baff']
      },
      config: {
        header: [
          '<span style="font-size:18px;">层数</span>',
          '<span style="font-size:18px;">标准饼厚</span>',
          '<span style="font-size:18px;">累计饼厚</span>',
          '<span style="font-size:18px;">本层饼厚</span>'
        ],
        data: [
          [
            '<span style="color:#67e0e3;">1层</span>',
            '<span style="color:#9fe6b8;">60mm</span>',
            '<span style="color:#fb7293;">60mm</span>',
          ],
          [
            '<span style="color:#67e0e3;">1层</span>',
            '<span style="color:#9fe6b8;">60mm</span>',
            '<span style="color:#fb7293;">60mm</span>',
          ]
        ],
        waitTime: 5000,
        columnWidth: [85,115,115,115],
        align: ["center", "center", "center", "center"]
      },
      OrderInfo: {
 
      },
      LbjInfo:{
 
      },
      FzjInfo:{
 
      },
      JxsInfo:{
 
      },
      IsInterval:true,
      IsPlc:true,
    };
  },
  mounted() {
    this.GetPLCData();
    this.GetOrderInfos();
  },
  methods: {
    GetOrderInfos() {
      axios.post("/api/dt_WorkOrder/getWorkOrderInfo", null, "").then((res) => {
        if (res.data.status) {
          if(res.data.data==null && this.OrderInfo!=null){
            this.OrderInfo.status=2;
            return;
          }
          this.OrderInfo = res.data.data;
          if(this.IsInterval){
            setInterval(() => {
              this.GetOrderInfos();
            },5000);
            this.IsInterval=false;
          }
        }
      });
    },
    GetPLCData() {
      axios.post("/api/dt_WorkOrder/getPLCData", null, "").then((res) => {
        if (res.data.status) {
          var data=res.data.data;
          if(data==null)
            return console.log("data值为空");
          this.LbjInfo=data.lbj_data;
          this.FzjInfo=data.fzj_data;
          this.JxsInfo=data.zljxs_Data;
        }
        if(this.IsPlc){
            setInterval(() => {
              this.GetPLCData();
            },1500);
            this.IsPlc=false;
        }
      });
    },
    GetLbjStepNumber(val){
      switch (val) {
        case 0:
          return "无";
        case 1:
          return "回待机位";
        case (val>=10 && val<=19):
          return "测高中";
        case (val>=20 && val<=29):
          return "测高完成后返回中";
        case (val>=100 && val<=110):
          return "压紧中";
        default:
          break;
      }
    },
    GetFzjStepNumber(val){
      switch (val) {
        case 0:
          return "无";
        case 1:
          return "回待机位";
        case (val>=10 && val<=19):
          return "正向送饼中";
        case (val>=20 && val<=29):
          return "反向送饼中";
        default:
          break;
      }
    },
    GetJxsStepNumber(val){
      switch (val) {
        case 0:
          return "无";
        case 1:
          return "设备待机中";
        case 2:
          return "设备运动中";
        default:
          break;
      }
    },
    GetDeviceStatus(val){
      switch (val) {
        case 1:
          return "自动作业";
        case 2:
          return "自动待机";
        case 3:
          return "故障";
        case 4:
          return "手动";
        default:
          break;
      }
    },
    GetJxsDeviceStatus(val){
      switch (val) {
        case 1:
          return "速度模式";
        case 2:
          return "力矩模式";
        case 3:
          return "位置模式";
        case 4:
          return "故障";
        default:
          break;
      }
    },
    getTolerance(val){
      if(val==true){
        return 'success';
      }else if(val==false){
        return 'error';
      }else{
        return null;
      }
    }
  },
};
</script>
  <style lang="scss" scoped>
$box-height: 420px;
$box-width: 1420px;
#box {
  padding: 16px;
  padding-top: 10px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;
}
.container {
  height: 750px;
  width: 100%;
}
.boxTop {
  width: 100%;
  height: 300px;
  padding-top: 20px;
  display: flex;
}
.boxTop .box {
  margin-top: 38px;
  width: 450px;
  height: 260px;
}
.boxItem {
  display: flex;
  background-color: rgb(0, 59, 81,0.6);
  width: 435px;
  margin: 15px auto;
  height: 240px;
  z-index: 0;
  border-radius: 0% 5%;
}
.boxitem_down {
  display: flex;
  font-size: 20px;
  color: whitesmoke;
}
.boxLeft {
  margin-top: 50px;
  margin-left: 10px;
  width: 150px;
  height: 150px;
}
.boxRight {
  margin-left: 10px;
  width: 300px;
  height: 260px;
}
.boxRight div {
  line-height: 35px;
  text-align: right;
}
.boxOrderHeight {
  height: 40px;
  line-height: 30px;
  width: 150px;
  position: absolute;
  left: 22px;
  top: 120px;
  display: flex;
}
.boxTitle {
  height: 40px;
  line-height: 30px;
  width: 150px;
  position: absolute;
  left: 20px;
  top: 115px;
  display: flex;
}
.boxOrder {
  margin-top: -10px;
}
.row {
  display: flex;
  background-color: rgb(0, 186, 255);
  color: #fff;
  height: 30px;
  line-height: 30px;
  font-size: 18px;
}
.cell {
  width: 160px;
  border-right: #fff 1px solid;
  text-align: center;
}
.body {
  display: flex;
  background-color: rgb(0, 59, 81);
  color: #fff;
  height: 32px;
  line-height: 32px;
}
.rows {
  display: flex;
  background-color: rgb(0, 186, 255);
  color: #fff;
  height: 30px;
  line-height: 30px;
  font-size: 18px;
}
.bodys {
  display: flex;
  background-color: rgb(0, 59, 81);
  color: #fff;
  height: 32px;
  line-height: 32px;
}
.error{
  background-color: red;
}
.success{
  background-color: #67c23a;
}
.info{
  background-color: lightgray;
}
.ing{
  color: #ffff00;
}
.end{
  color: #67c23a;
}
</style>