张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
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
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
<template>
  <div class="main">
    <div class="main_header">
      <div class="header_item">
        <span class="header_label header_labels">环号:</span>
        <el-input
          v-model="ringNum"
          clearable
          placeholder="请输入环号"
        ></el-input>
      </div>
      <div class="header_item">
        <el-button
          v-if="showButton('search')"
          icon="el-icon-search"
          @click="searchQualityTracingList(true)"
          >查询</el-button>
      </div>
    </div>
    <div class="main_content">
      <div class="main_content_item">
        <div class="item_table">
          <div class="item_table_title">
            <div>管片列表</div>
            <div>
              <span>环号:</span>
              <span class="title_value">{{ titleRingNum }}</span>
            </div>
            <div>
              <span>项目名称:</span>
              <span class="title_value">{{ projectName }}</span>
            </div>
          </div>
          <div class="item_table_content">
            <el-table
              v-loading="loading"
              :data="pipeList"
              height="100%"
              highlight-current-row
              @current-change="handleCurrentChange"
            >
              <el-table-column
                prop="pipeNum"
                label="管片条形码"
                align="center"
                width="200"
              ></el-table-column>
              <el-table-column
                prop="turnName"
                label="转向"
                align="center"
                width="60"
              ></el-table-column>
              <el-table-column
                prop="reinforcementName"
                label="配筋"
                align="center"
                width="60"
              ></el-table-column>
              <el-table-column
                prop="groutingHolesName"
                label="注浆孔"
                align="center"
                width="70"
              ></el-table-column>
              <el-table-column
                prop="blockNumName"
                label="块号"
                align="center"
                width="60"
              ></el-table-column>
              <el-table-column
                prop="mouldNum"
                label="模具"
                align="center"
              ></el-table-column>
            </el-table>
          </div>
          <div class="item_table_footer">
            <el-pagination
              small
              background
              @current-change="changePageNum"
              @size-change="changePageSize"
              :current-page="pageNum"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="pageSize"
              layout="total, prev, pager, next, jumper"
              :total="total"
            >
            </el-pagination>
          </div>
        </div>
        <div class="item_image">
          <img src="../../assets/pipe_canvas.png" height="100%" width="100%">
        </div>
      </div>
      <div class="main_content_item" v-loading="infoLoading">
        <div class="item_info_header">溯源信息</div>
        <div class="item_info_title">钢筋笼信息追溯</div>
        <div class="item_info_table">
          <div
            class="info_table_item--block"
            v-for="item in rebarInfoAscend"
            :key="item.id"
          >
            <div>{{ item.label }}</div>
            <div>
              {{
                steel[item.value]
              }}
            </div>
          </div>
        </div>
        <div class="item_info_title">钢筋笼信息</div>
        <div class="item_info_table">
          <div
            class="info_table_item--block"
            v-for="item in rebarInfo"
            :key="item.id"
          >
            <div>{{ item.label }}</div>
            <div>
              {{
                pipeDataInfo.steelInfo ? pipeDataInfo.steelInfo[item.value] : ""
              }}
            </div>
          </div>
        </div>
        <div class="item_info_title">搅拌站原料信息(单位:吨)</div>
        <div class="item_info_table">
          <div
            class="info_table_item--block"
            v-for="item in pipeDataInfo.mixInfos || []"
            :key="item.id"
          >
            <div>{{ item.materialName }}</div>
            <div>{{ item.materialValue }}</div>
          </div>
        </div>
        <div class="item_info_title">蒸养信息</div>
        <div class="item_table_title">
          <div>第一蒸养窑</div>
          <div>
            <span>升温温度:</span>
            <span class="title_value">23</span>
          </div>
          <div>
            <span>恒温温度:</span>
            <span class="title_value">23</span>
          </div>
          <div>
            <span>降温温度:</span>
            <span class="title_value">23</span>
          </div>
          <div>
            <span>适度:</span>
            <span class="title_value">23</span>
          </div>
        </div>
        <div id="charts-view" class="item_info_charts"></div>
        <div class="item_info_title">水养信息</div>
        <div class="item_info_data">
          <div class="data_title">{{waterCulInfo.waterCultivatedName || ''}}</div>
          <div class="item_info_data--item">
            <div>
              <span>入池时间:</span>
              <span class="data_value">{{waterCulInfo.createTime || ''}}</span>
            </div>
            <div>
              <span>入池温度:</span>
              <span class="data_value"></span>
            </div>
          </div>
          <div class="item_info_data--item">
            <div>
              <span>出池时间:</span>
              <span class="data_value">{{waterCulInfo.outTime || ''}}</span>
            </div>
            <div>
              <span>出池温度:</span>
              <span class="data_value"></span>
            </div>
            <div>
              <span>水养时间:</span>
              <span class="data_value">{{waterCulInfo.diffDescript || ''}}</span>
            </div>
          </div>
        </div>
        <div class="item_info_title">堆场信息</div>
        <div class="item_info_data">
          <div class="data_title">{{repoInfo.repoName}}</div>
          <div class="item_info_data--item">
            <div>
              <span>入库时间:</span>
              <span class="data_value">{{repoInfo.createTime}}</span>
            </div>
            <div>
              <span>出库时间:</span>
              <span class="data_value">{{repoInfo.outRepoTime}}</span>
            </div>
            <div>
              <span>喷淋周期:</span>
              <span class="data_value"></span>
            </div>
          </div>
        </div>
        <div class="item_info_title">发运信息</div>
        <div class="item_info_data">
          <div class="item_info_data--item">
            <div>
              <span>出库人:</span>
              <span class="data_value"></span>
            </div>
            <div>
              <span>发运车辆车牌号:</span>
              <span class="data_value"></span>
            </div>
            <div>
              <span>司机姓名:</span>
              <span class="data_value"></span>
            </div>
          </div>
          <div class="item_info_data--item">
            <div>
              <span>收货人电话:</span>
              <span class="data_value"></span>
            </div>
            <div>
              <span>运输时间:</span>
              <span class="data_value"></span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import { buttonPinia } from "../../pinia";
export default {
  data() {
    return {
      ringNum: "", // 环号
      projectName: "",
      titleRingNum: "",
      loading: false,
      infoLoading: false,
      pageNum: 1,
      pageSize: 10,
      total: 0,
      rebarInfoAscend: [{
        id: 1,
        value: 'steelName',
        label: '钢筋名称'
      },{
        id: 2,
        value: 'steelModel',
        label: '钢筋型号'
      },{
        id: 3,
        value: '',
        label: '批次号'
      },{
        id: 4,
        value: '',
        label: '报告编号'
      },{
        id: 5,
        value: 'createTime',
        label: '使用时间'
      }], // 钢筋信息追溯
      rebarInfo: [
        {
          id: 1,
          value: "produceNumber",
          label: "钢筋笼条形码",
        },
        {
          id: 2,
          value: "sizeName",
          label: "尺寸",
        },
        {
          id: 3,
          value: "reinforcementName",
          label: "配筋",
        },
        {
          id: 4,
          value: "blockNumName",
          label: "类型",
        },
        {
          id: 5,
          value: "printTime",
          label: "打印日期",
        },
        {
          id: 6,
          value: "qualityTime",
          label: "质检时间",
        },
      ], // 钢筋笼信息
      pipeCourse: [{
        id: 1,
        value: '',
        label: '入模时间'
      },{
        id: 2,
        value: '',
        label: '入模人'
      },{
        id: 3,
        value: '',
        label: '出模时间'
      },{
        id: 4,
        value: '',
        label: '出模人'
      },{
        id: 5,
        value: '',
        label: '质检时间'
      },{
        id: 6,
        value: '',
        label: '质检人'
      }], // 管片过程信息
      materialsList: [{
        id: 1,
        value: '',
        label: ''
      }], // 原料信息
      waterCulInfo: {
        waterCultivatedName: '',
        createTime: '',
        diffDescript: '',
        outTime: '',
      }, // 水养
      repoInfo: {}, // 堆场
      pipeList: [],
      steel: {},
      pipeDataInfo: {}, // 管片详情信息
    };
  },
  mounted() {
    this.searchQualityTracingList(true);
  },
  methods: {
    // 查询质量追溯信息列表
    searchQualityTracingList(bol) {
      if (bol) {
        this.pageNum = 1;
      }
      this.loading = true;
      this.pipeList = [];
      this.projectName = "";
      this.titleRingNum = "";
      this.$api.DuctpiecePLM.searchQualityTracingList({
        ringNum: this.ringNum,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
      })
        .then((res) => {
          if (res.success) {
            this.projectName = res.data.proName;
            this.titleRingNum = res.data.ringNum;
            this.pipeList = res.data.pageInfo.list;
            this.total = res.data.pageInfo.total;
          }
          this.loading = false;
        })
        .catch(() => {
          this.loading = false;
        });
    },
    // 创建echarts图表
    createCharts() {
      const chartsData = {
        names: ["温度", "比例"],
        lineX: [
          "2012年",
          "2013年",
          "2014年",
          "2015年",
          "2016年",
          "2017年",
          "2018年",
          "2019年",
          "2020年",
          "2021年",
          "2022年",
          "2023年",
          "2024年",
          "2025年",
          "2026年",
          "2027年",
          "2028年",
          "2029年",
          "2030年",
          "2031年",
          "2032年",
          "2033年",
          "2034年",
          "2035年",
        ],
        value: [
          [
            45, 35, 33, 53, 95, 36, 27, 38, 19, 11, 31, 12, 43, 24,
            16, 23, 57, 32, 19, 30, 57, 32, 19, 30,
          ],
          [
            60, 55, 80, 92, 30, 80, 12, 80, 20, 53, 32, 28, 65, 45,
            65, 35, 48, 18, 23, 98, 92, 30, 80, 12,
          ],
        ],
      };
      const colorData = ['rgba(29, 203, 190', 'rgba(51, 170, 231'];
      const seriesData = colorData.map((item, index) => {
        return {
          name: chartsData.names[index],
          type: 'line',
          color: colorData[index] + ')',
          yAxisIndex: index,
          smooth: false,
          areaStyle: {
            normal: {
              color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                offset: 0,
                color: colorData[index] + ', 0.8)'
              }, {
                offset: 0.8,
                color: colorData[index] + ', 0)'
              }], false),
              shadowColor: 'rgba(0, 0, 0, 0.2)',
              shadowBlur: 10
            }
          },
          symbol: 'circle',
          symbolSize: 0,
          data: chartsData.value[index]
        }
      })
      const charts = this.$echarts.init(document.getElementById("charts-view"));
      charts.clear();
      charts.setOption({
        // backgroundColor: "#0d235e",
        tooltip: {
          trigger: "axis",
          formatter: function (params) {
            var relVal = params[0].name;
            for (var i = 0; i < params.length; i++) {
              if (params[i].componentIndex === 0) {
                relVal +=
                  "<br/>" +
                  params[i].marker +
                  params[i].seriesName +
                  " : " +
                  params[i].value +
                  "℃";
              } else {
                relVal +=
                  "<br/>" +
                  params[i].marker +
                  params[i].seriesName +
                  " : " +
                  params[i].value +
                  "%";
              }
            }
            return relVal;
          },
        },
        legend: {
          show: false,
        },
        grid: {
          top: "20%",
          left: "0",
          right: "0",
          bottom: "14%",
          containLabel: true,
        },
        dataZoom: [{
          type: 'slider',
          bottom: '4%',
          start: 0,
          end: 24,
          height: 8,
          fillerColor: '#1DCBBE',
          backgroundColor: '#0E386D',
          borderColor: '#264575',
          moveHandleSize: 2,
          showDataShadow: false,
          textStyle: {
            color: "#CAD3E0",
          }
        }],
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: chartsData.lineX,
          axisLabel: {
            textStyle: {
              color: "#CAD3E0",
            },
            formatter: function (params) {
              return params.split(" ")[0];
            },
          },
          axisLine: {
            lineStyle: {
              width: 2,
              color: "#264575",
            },
          },
        },
        yAxis: [
          {
            name: "单位(℃)",
            type: "value",
            max: 100,
            splitNumber: 6,
            nameTextStyle: {
              color: "#CAD3E0",
            },
            axisLabel: {
              formatter: "{value}",
              textStyle: {
                color: "#CAD3E0",
              },
            },
            splitLine: {
              lineStyle: {
                width: 1,
                color: "#28477C",
              },
            },
            axisLine: {
              show: true,
              lineStyle: {
                width: 2,
                color: "#28477C",
              },
            },
          },
          {
            name: "单位(%)",
            type: "value",
            max: 100,
            splitNumber: 6,
            nameTextStyle: {
              color: "#CAD3E0",
            },
            axisLabel: {
              formatter: "{value}",
              textStyle: {
                color: "#CAD3E0",
              },
            },
            splitLine: {
              lineStyle: {
                width: 1,
                color: "#28477C",
              },
            },
            axisLine: {
              show: true,
              lineStyle: {
                width: 2,
                color: "#28477C",
              },
            },
          }
        ],
        series: seriesData,
      });
    },
    // 点击选择行
    handleCurrentChange(row) {
      this.pipeDataInfo = {};
      this.createCharts();
      if (!row) return;
      this.infoLoading = true;
      this.$api.DuctpiecePLM.getPipeDetailData({
        pipeNum: row.pipeNum,
      })
        .then((res) => {
          if (res.success) {
            this.pipeDataInfo = res.data;
            this.steel = res.data.steel[0];
            this.waterCulInfo = res.data.waterCulInfo ? res.data.waterCulInfo : this.waterCulInfo;
            this.repoInfo = res.data.repoInfo ? res.data.repoInfo : {};
          }
          this.infoLoading = false;
        })
        .catch(() => {
          this.infoLoading = false;
          this.$message.error("未查询到详情信息!");
        });
    },
    // 切换页数
    changePageNum(page) {
      this.pageNum = page;
      this.searchQualityTracingList();
    },
    // 切换每页条数
    changePageSize(size) {
      this.pageSize = size;
      this.searchQualityTracingList();
    },
    // 判断按钮权限信息
    showButton(str) {
      const pinia = buttonPinia();
      return pinia.$state.buttonInfo.includes(str);
    }
  },
};
</script>
 
<style lang="scss" scoped>
@import "../../style/layout-main.scss";
.main {
  .main_content {
    overflow-y: auto !important;
  }
}
 
.main_content {
  display: flex;
 
  .main_content_item {
    padding: 0 10px;
    width: 60%;
    height: min-content;
    font-size: 12px;
 
    &:first-child {
      width: 40%;
    }
 
    &:last-child {
      padding: 15px;
      background: url("../../assets/info_bg.png") no-repeat;
      background-size: 100% 100%;
    }
 
    .item_table {
      display: flex;
      flex-direction: column;
      height: 400px;
      background: rgba($color: #0f3d8b, $alpha: 0.3);
      border: 1px solid #084480;
 
      .item_table_content {
        flex: 1;
      }
 
      .item_table_footer {
        margin: 10px 0;
        text-align: right;
      }
    }
 
    .item_table_title {
      display: flex;
      align-items: center;
      padding: 10px 20px;
      margin-bottom: 10px;
      color: #ffffff;
      background: url("../../assets/table_title.png") no-repeat;
      background-size: 100% 100%;
 
      .title_value {
        color: #34afed;
      }
 
      & > div {
        padding: 0 20px 0 10px;
 
        &:first-child {
          font-weight: 600;
        }
      }
    }
 
    .item_image {
      margin-top: 15px;
      // height: 550px;
      background: rgba($color: #0f3d8b, $alpha: 0.3);
      border: 1px solid #084480;
    }
 
    .item_info_header {
      padding: 5px 10px;
      color: #ffffff;
      text-align: center;
      letter-spacing: 2px;
      background: url("../../assets/info_title.png") no-repeat;
      background-size: 100% 100%;
    }
 
    .item_info_title {
      position: relative;
      padding: 0 0 5px 10px;
      margin: 15px;
      color: #34afed;
      font-size: 14px;
      font-weight: 600;
      font-style: oblique;
      border-bottom: 1px solid;
      border-image: linear-gradient(to right, #5ba1c4 10%, #314c6c 25%);
      border-image-slice: 1;
 
      &::before {
        content: "";
        position: absolute;
        left: -5px;
        bottom: -2px;
        height: 4px;
        border: 2px solid #39B5FE;
        border-width: 0 4px;
        width: calc(100% + 12px);
      }
    }
 
    .item_info_table {
      display: flex;
      color: #dae9ff;
      border: 1px solid #34afed;
      min-height: 50px;
 
      .info_table_item--block {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        white-space: nowrap;
 
        & > div {
          width: 100%;
          padding: 5px 10px;
          height: 25px;
          text-align: center;
          background: rgba($color: #0d4586, $alpha: 0.8);
 
          &:last-child {
            background: none;
            border-top: 1px solid #34afed;
          }
        }
 
        &:nth-child(odd) {
          border-left: 1px solid #34afed;
          border-right: 1px solid #34afed;
        }
 
        &:last-child {
          border-right: 1px solid #34afed;
        }
      }
    }
 
    .item_table_zdzd {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 50px;
 
      .zdzd_item {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        margin: 0 15px;
        height: 100%;
        width: calc(100% / 3.5);
        color: #FFFFFF;
        font-size: 14px;
        font-weight: 600;
        font-style: oblique;
        background: url('../../assets/zdzd.png') no-repeat;
        background-size: 100% 100%;
 
        &:first-child {
          margin-left: 0;
        }
 
        &:last-child {
          margin-right: 0;
        }
      }
    }
 
    .item_info_charts {
      height: 160px;
    }
 
    .item_info_data {
      padding: 10px;
      color: #cad3e0;
      background: url("../../assets/info_bgs.png") no-repeat;
      background-size: 100% 100%;
 
      .data_title {
        position: relative;
        padding: 0 10px;
        margin-bottom: 5px;
        color: #34afed;
        font-weight: 600;
        font-style: oblique;
 
        &::before {
          content: "";
          position: absolute;
          top: 50%;
          left: 0;
          transform: translateY(-50%);
          width: 3px;
          height: 80%;
          background: #34afed;
        }
      }
 
      .item_info_data--item {
        display: flex;
 
        & > div {
          width: calc(100% / 3);
          padding: 2px 10px 2px 0;
        }
 
        .data_value {
          color: #34afed;
        }
      }
    }
  }
}
::v-deep .el-table__body tr.current-row > td.el-table__cell {
  background-color: #34afed;
}
</style>