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
<template>
    <view style="padding: 20rpx 40rpx;">
        <view>
            <view v-for="item in HTechParams" style="padding-bottom: 20rpx;">
                <view class="row-head">{{ item["分组名称"] }}</view>
                <uni-row :gutter="3" class="row-content">
                    <uni-col class="equal-height-col" :span="8" v-for="unit in item['参数列表']">
                        <view style="font-size: 28rpx; text-align: center; padding: 8rpx 0;">
                            {{ unit.HTechParamName }}:&nbsp;{{unit.HResult}}
                        </view>
                    </uni-col>
                </uni-row>
            </view>
        </view>
    </view>
</template>
 
<script>
    import {
        CommonUtils
    } from '@/utils/common';
    import {
        getUserInfo
    } from '@/utils/auth';
    import timerManager from '@/utils/timer';
    export default {
        data() {
            return {
                HTimerID: 'Sc_EquipTechParamQueryTimer',
                HTechParams: []
            };
        },
        methods: {
            async loadBillMain(HEquipID, showLoading=true) {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/getSB_EquipTechParamBillListByEquipID",
                        data: {
                            HEquipID: HEquipID,
                        },
                        showLoading: showLoading
                    })
 
                    let {
                        data,
                        count,
                        Message,
                        code
                    } = res.data
 
                    if (code == 1) {
                        this.HTechParams = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取源单信息失败: ${Message}`
                        })
                    }
 
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取源单信息失败: ${err}`
                    })
                }
            },
            
        },
        onLoad(e) {
            let {
                HEquipID
            } = e
            this.loadBillMain(HEquipID)
            this.HEquipID = HEquipID
        },
        onShow() {
          // 初始化定时器 定时访问设备工艺参数
          timerManager.createTimer(this.HTimerID, () => {
              this.loadBillMain(this.HEquipID, false)
          }, 60000, 'interval')  
        },
        beforeDestroy() {
            timerManager.clearAllTimers()
        },
        onUnload() {
            timerManager.clearAllTimers();
        }
    }
</script>
 
<style lang="scss">
    .row-head {
        border-radius: 10rpx 10rpx 0 0;
        background-color: rgb(0, 125, 255);
        color: rgb(255, 255, 255);
        font-weight: bold;
        padding: 12rpx 16rpx;
        font-family: "PingFang SC", "Microsoft YaHei", sans-serifs;
    }
 
    .row-content {
        width: 100%;
        padding: 15rpx;
        background: #f5f5f5;
        word-break: break-all;
        display: flex;
        align-items: stretch;
        flex-wrap: wrap;
        border-collapse: collapse;
        border: #f0f0f0 2px solid;
    }
 
    .row-content:last-child {
        border-radius: 0 0 10rpx 10rpx;
    }
 
    .equal-height-col {
        display: flex;
        height: inherit;
        padding: 1rpx;
        justify-content: center;
        color: rgba(51, 51, 51, 1.0);
        font-family: "PingFang SC", "Microsoft YaHei", sans-serifs;
    }
</style>