懒羊羊
2024-01-23 4f91e27a1a497b5ed9de6be2267a8a57085e7c82
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
<template>
  <div class="content-box2">
    <dv-border-box-6>
    <div>
        <div class="top-top">工单编号</div>
<!--        <div class="top-bottom">{{orderDetail.workOrderNo}}</div>-->
      <div class="top-bottom selectBottom">
 
      <el-select class="mySelect" v-model="value" @change="handleSelectChange" placeholder="请选择">
          <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
      </el-select>
      </div>
    </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">产品名称</div>
        <div style="font-size: 20px;margin-top: 75px;margin-left: 30px;color: #71CAFC">{{orderDetail.materialName}}</div>
      </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">计划数量</div>
        <div class="top-bottom blue">{{orderDetail.planQty}}</div>
      </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">出料数量</div>
        <div class="top-bottom blue">{{orderDetail.actualQty}}个</div>
      </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">NG数量</div>
        <div class="top-bottom blue">{{orderDetail.NgNumber}}个</div>
      </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">合格率</div>
        <div class="top-bottom orange">{{orderDetail.passRate}}%</div>
      </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">完成率</div>
        <div class="top-bottom orange">{{orderDetail.completionRate}}%</div>
      </div>
    </dv-border-box-6>
    <dv-border-box-6>
      <div>
        <div class="top-top">剩余时间(小时)</div>
        <div class="top-bottom blue">{{orderDetail.remainder}}</div>
      </div>
    </dv-border-box-6>
  </div>
</template>
 
<script>
export default {
  name: "top",
  data() {
    return {
      orderDetail: {
        "materialName":"Ebike中置电机总成(MIGIC C1 36V)",
        "planQty":30,
        "completionRate":100,
        "workOrderNo":"M202311220006",
        "actualQty":30,
        "remainder":0,
        "NgNumber":0,
        "passRate":100
      },
      options: [{
        value: 'M202311220001',
        label: 'M202311220001',
      }, {
        value: 'M202311220002',
        label: 'M202311220002'
      }, {
        value: 'M202311220003',
        label: 'M202311220003'
      }, {
        value: 'M202311220004',
        label: 'M202311220004'
      }, {
        value: 'M202311220005',
        label: 'M202311220005'
      }],
      value: ''
    }
  },
  mounted() {
    this.orderListInit();
    this.tops();
    this.changeTiming();
    this.value = this.options[0].value; // 设置默认选中第一个选项
  },
  methods: {
    // eslint-disable-next-line no-unused-vars
    handleSelectChange(value) {
      // 触发自定义事件
      this.$bus.$emit('refresh-components', value)
      this.tops();
    },
    tops(){
      // this.orderListInit();
      console.log(this.value);
      this.$http.get('http://172.20.1.10:8080/productionOrdeInfo/topData?workOrderNo='+this.value)
      // this.$http.get('http://127.0.0.1:8080/productionOrdeInfo/topData?workOrderNo='+this.value)
          .then((response)=>{
            this.orderDetail = response.data.data;
            console.log(response.data.data);
          })
    },
    orderListInit(){
      this.$http.get('http://172.20.1.10:8080/productionOrdeInfo/orderDescListFive')
      // this.$http.get('http://127.0.0.1:8080/productionOrdeInfo/orderDescListFive')
          .then((response)=>{
            this.options = response.data.data;
            this.value = this.options[0].value; // 设置默认选中第一个选项
 
          })
    },
    changeTiming() {
      setInterval(() => {
        this.tops();
        this.orderListInit();
      }, 300000)
    },
  }
}
</script>
 
<style scoped>
  .content-box2{
    height: 200px;
    display: grid;
    grid-template-columns: 3fr 3fr 3fr 3fr 3fr 3fr 3fr 3fr;
  }
  .top-top{
    font-size: 25px;
    text-align: center;
    margin-top: 40px;
  }
  .top-bottom{
    font-size: 30px;
    text-align: center;
    margin-top: 80px;
  }
  .adaptive-font-size {
    font-size: calc(1vw + 1vh + 1vmin);
  }
   /deep/.el-input__inner {
     background-color: #0f1325;
     color: #71CAFC;
     font-size: 20px;
     border: 1px solid #0f1325;
   }
  .blue{
    color: #71CAFC;
  }
  .orange{
    color: #FB9D7E;
  }
  .red{
    color: #FF0000;
  }
  .green{
    color: #00FF00;
  }
  .content-box{
    height: 200px;
    display: grid;
    grid-template-columns: 3fr 3fr 3fr 3fr 3fr 3fr 3fr 3fr;
  }
  .content-box1{
  }
  .el-select .el-input,
  .el-select-dropdown .el-select-dropdown__item {
    font-size: 16px;
  }
  .selectBottom{
    width: 90%;
    margin-left: 10px;
    margin-top: 70px;
  }
  /*.mySelect{*/
  /*  */
  /*}*/
</style>