1
展杰
2023-12-09 943fc558a942ce0d83748cc55f4ddd2bcb4ba02d
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
<template>
    <view>
        <uni-card v-for="item in inspections"  @click="gotoInfo(item)" class="card-box" >
        <view :class="new Date().getTime()-new Date(item.BEGIN_TIME).getTime()>(3600000*item.FREQUENCY)?'red':''">
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>检验单号:</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.TASK_NO}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>检验单创建时间:</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.BEGIN_TIME}}</label>
                </u-col>
            </u-row>
            <view class="f_type">
                {{item.FTYPE}}
            </view>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>机台号:</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.MACHINE_NO}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px" v-if="item.PROC_NAME">
                <u-col span="2">
                    <label>工序名称:</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.PROC_NAME}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>产品名称:</label>
                </u-col>
                <u-col>
                    <label>{{item.ITEM_NO}} | {{item.ITEM_NAME}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>图号颜色:</label>
                </u-col>
                <u-col>
                    <label>{{item.ENGINEERING_NO}} / {{item.COLOR_NAME}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>规格材质:</label>
                </u-col>
                <u-col>
                    <label>{{item.MODEL}} / {{item.MATERIAL}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px" v-if="item.OPERATE_MAN">
                <u-col span="2">
                    <label>操作员:</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.OPERATE_MAN}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>检验类型:</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.FTYPE}}</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>检验频率(H):</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.FREQUENCY}}小时</label>
                </u-col>
            </u-row>
            <u-row customStyle="margin-bottom: 10px">
                <u-col span="2">
                    <label>下次检验时间</label>
                </u-col>
                <u-col span="4">
                    <label>{{item.NEXT_TIME}}</label>
                </u-col>
            </u-row>
        </view>
 
        </uni-card>
        <u-toast ref="uToast" />
    </view>
</template>
 
<script>
import { getInspectionList } from '../../api/inspection'
    export default {
        data() {
            return {
                inspections: [],
                moduleKey:0
            }
        },
        onLoad() {
            this.getInspections()
        },
        onPullDownRefresh() {
            this.getInspections()
            setTimeout(function () {
                uni.stopPullDownRefresh();
            }, 1000);
        },
        //onShow:function(){
        //    this.getInspections()
        //},
        methods: {
            getInspections() {
                getInspectionList().then(res => {
                    console.log(res)
                    if(!res.result) {
                        this.$refs.uToast.show({
                            message: res.msg,
                            type: 'error'
                        })
                        return
                    }
                    this.inspections = res.data
                })
            },
            gotoInfo(e) {
                console.log(e)
                uni.navigateTo({
                    url:'/pages/inspection/inspectionInfo?item='+ encodeURIComponent(JSON.stringify(e).replace(/\%/g, '%25').replace(/\ /g,'%20').replace(/\?/g,'%3F').replace(/\+/g,'%2B').replace(/\&/g,'%26')) ,
                })
            },
            reload(){
                this.$nextTick(()=>{
                    this.$refs.uToast.show({
                        message: "提交成功",
                        type: 'success'
                    })
                    this.getInspections()
                })
            },
            
        }
    }
</script>
 
<style>
 
    .red{
        color: red;
    }
    .card-box{
        position: relative;
    }
    .f_type{
        position: absolute;
        right: 13%;
        top:12%;
        width: 20px;
        line-height: 100px;
        font-size: 8vh;
        margin: 0 auto;
    }
</style>