1
huangxiaoqiang
2025-04-16 9757426ed62d7d4b1479dc0a431002f676983d6b
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
<template>
  <div id="centerRight1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span>
          <icon name="chart-line" class="text-icon"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2">当前生产任务</span>
        </div>
      </div>
      <div class="d-flex jc-center body-box">
        <dv-scroll-board class="dv-scr-board" :config="config" />
      </div>
    </div>
  </div>
</template>
  <script>
import axios from "@/api/ajax.js";
import { addListener } from "process";
export default {
  data() {
    return {
      config: {
        header: [ "物料编号", "任务创建时间","上料时间", "状态"],
        data: [
          [
            "TX0101092",
            "2024/3/30 15:59:58",
            "2024/3/30 15:59:58",
            "生产中",
          ]
        ],
        rowNum: 10, //表格行数
        waitTime: 5000,
        // headerHeight: 30,
        // headerBGC: "#002B46", //表头
        // oddRowBGC: "#002B46", //奇数行
        // evenRowBGC: "#042B53", //偶数行
        index: true,
        columnWidth: [100,160, 160, 160,160],
        align: ["center"],
      },
    };
  },
  mounted() {
    this.GetProductionTask();
    setInterval(() => {
      this.GetProductionTask();
    }, 5000);
  },
  methods: {
    GetProductionTask() {
      axios.post("/api/dt_product/GetProductionTask", null, "").then((x) => {
        if (x.data.status) {
          var data = x.data.data;
          var arr = []; //存储需要的数据
          this.config.data = []; //清空原数据
          var that = this;
          for (let index = 0; index < data.length; index++) {
            arr.push(data[index].product_remark); //物料编号
            arr.push(data[index].product_createtime); //上料时间
            arr.push(data[index].product_updatetime); //上料时间
            arr.push(data[index].product_state); //状态
            that.config.data.push(arr);
            arr = []; //清空
          }
          this.config = {
            header: ["物料编号", "任务创建时间","上料时间", "状态"],
            data: that.config.data,
            rowNum: 10, //表格行数
            waitTime: 5000,
            index: true,
            // columnWidth: [100,220, 280, 160],
            columnWidth: [100,160, 160, 160,160],
            align: ["center"],
          };
        }
      });
    },
  },
};
</script>
  <style lang="scss" scoped>
$box-height: 520px;
$box-width: 660px;
#centerRight1 {
  padding: 16px;
  padding-top: 10px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;
  .bg-color-black {
    height: $box-height - 30px;
    border-radius: 10px;
  }
  .text {
    color: #ffffff;
    font-size: 12pt;
  }
  .body-box {
    border-radius: 10px;
    .dv-scr-board {
      width: 630px;
      height: 460px;
    }
  }
}
</style>