snInfo.vue
9.49 KB
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
<template>
<a-card>
<div class="content">
<div class="logo">
<div>
<img style="width: 100%;height:100%" src="../../assets/huaheng.png" alt=""/>
</div>
</div>
<div class="top">
<div class="top-d">
<div class="top-d-w">
<label class="lab-left"
style="font-weight: 800;
margin-left: -1.4vw;
font-size: 4vw;">货叉信息</label>
</div>
<div class="top-d-w">
<label class="lab-left">项目名称:</label>
<label>{{ snData.projectName }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">工作令:</label>
<label>{{ snData.workno }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">设备类型:</label>
<label>{{ snData.devicetype }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">生产工厂:</label>
<label>{{ snData.factorytype }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">SN:</label>
<label>{{ snData.sn }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">项目编号:</label>
<label>{{ snData.field0172 }}</label>
</div>
</div>
</div>
<div class="header">
<div class="top-d">
<div class="top-d-w">
<label class="lab-left"
style="font-weight: 800;
margin-left: -1.4vw;
font-size: 4vw;">客户信息</label>
</div>
<div class="top-d-w">
<label class="lab-left">客户名称:</label>
<label>{{ snData.field0048 }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">交期要求:</label>
<label>{{ snData.field0050 }}</label>
</div>
<div class="top-d-w">
<label class="lab-left">合同编号:</label>
<label>{{ snData.field0068 }}</label>
</div>
</div>
</div>
<div class="header" v-if="isdataSource">
<div class="top-d">
<div class="top-d-w">
<label class="lab-left"
style="font-weight: 800;
margin-left: -1.4vw;
font-size: 4vw;">历史运行数据</label>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:customRow="clickThenSelect"
:dataSource="dataSource">
<span slot="forktype2" slot-scope="status">
<a-tag :key="forktype2">
{{ forktype2Text(forktype2) }}
</a-tag>
</span>
<span slot="taskstatus" slot-scope="taskstatus">
<a-tag :key="taskstatus">
{{ taskstatusText(taskstatus) }}
</a-tag>
</span>
</a-table>
</div>
</div>
<div class="header" v-if="isreportData">
<div class="top-d">
<div class="top-d-w">
<label class="lab-left" style="font-weight: 800;
margin-left: -1.4vw;
font-size: 4vw;"
>测试报告</label>
</div>
<table border="1" align="left">
<tr>
<td>平均原点偏移(mm)</td>
<td>{{ reportData.averageOriginOffsetValue }}</td>
</tr>
<tr>
<td>平均伸叉最大速度(m/min)</td>
<td>{{ reportData.averageMaxSpeedValue }}[比较值: {{ reportData.averageMaxSpeed }}]</td>
</tr>
<tr>
<td>平均回叉最大速度(m/min)</td>
<td>{{ reportData.maxSpeedOfRetractionForkValue }} [比较值:{{ reportData.maxSpeedOfRetractionFork }}]
</td>
</tr>
<tr>
<td>平均伸叉偏移(mm)</td>
<td>{{ reportData.extensionForkOffsetValue }} [比较值:
左极限{{
reportData.leftlimit
}};右极限{{ reportData.rightlimit }}]
</td>
</tr>
<tr>
<td>平均伸叉到位挠度(mm)</td>
<td>{{ reportData.extensionForkArrivedDeflectionValue }}</td>
</tr>
</table>
</div>
</div>
<!-- 表格 -->
<!-- <div class="center">我是表格</div>-->
<div class="bottom">
<div class="bottom-d" v-if="snData.azurl">
<div style="height: 10%; ">安装视频</div>
<div style="height: 90%;margin-top:1vh;">
<video controls autoplay loop muted playsinlin
:src="snData.azurl"></video>
</div>
</div>
<div class="bottom-d" v-if="snData.byurl">
<div style="height: 10%; ">保养视频</div>
<div style="height: 90%;margin-top:1vh;">
<video controls autoplay loop muted playsinlin
:src="snData.byurl"></video>
</div>
</div>
</div>
</div>
<task-info ref="taskForm"></task-info>
</a-card>
</template>
<script>
import {getSnInfo} from '@/api/api';
import taskInfo from "./modules/taskInfo";
import TaskInfo from "./modules/taskInfo";
export default {
name: "snInfo",
components: {TaskInfo},
data() {
return {
sn: '',
snData: [],
reportData: [],
isreportData: false,
dataSource: [],
isdataSource: false,
components: {taskInfo},
columns: [
{
title: '货叉型号',
align: "center",
dataIndex: 'containercode',
key: 'containercode',
ellipsis: true
},
//{
// title: '货叉类型',
// align: 'center',
// dataIndex: 'forktype2',
// key: 'forktype2',
// ellipsis: true,
// scopedSlots: {customRender: 'forktype2'}},
{
title: '目标运行数',
align: 'center',
dataIndex: 'targetnumber',
key: 'targetnumber',
ellipsis: true
}, {
title: '实际运行数',
align: 'center',
dataIndex: 'runnumber',
key: 'runnumber',
ellipsis: true,
}, {
title: '任务状态',
align: 'center',
dataIndex: 'taskstatus',
key: 'taskstatus',
ellipsis: true,
scopedSlots: {customRender: 'taskstatus'}
}
],
}
},
created() {
var params = {};
location.search.substr(1).split('&').forEach(function (item) {
var s = item.split('=');
params[s[0]] = s[1];
});
this.sn = params.sn
let params2 = {
'sn': this.sn
}
getSnInfo(params2).then(res => {
this.snData = res.result.projectsn;
this.reportData = res.result.report;
this.dataSource = res.result.taskForkList;
if (JSON.stringify(this.reportData) != "{}") {
this.isreportData = true
}
if (JSON.stringify(this.dataSource) != "{}") {
this.isdataSource = true
}
})
},
methods: {
forktype2Text(type) {
if (type == '1') {
return '单伸'
} else {
return '双伸'
}
},
taskstatusText(status) {
if (status == '1') {
return '任务创建'
} else if (status == '15') {
return '任务执行中'
} else if (status == '100') {
return '任务完成'
}
},
clickThenSelect(record, index) {
return {
on: {
click: () => {
this.$refs.taskForm.edit(record);
}
}
}
},
}
}
</script>
<style lang="less" scoped>
.content {
width: 99.1%;
height: 100%;
border: 1px solid #fff;
margin: 0 auto;
background-color: #fff;
overflow: auto;
}
.logo {
height: 5%;
margin-top: 10px;
div {
width: 50%;
height: 100%;
text-align: center;
margin: 0 auto;
}
}
.top-d {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
margin: 1vh 0;
//border: 1px solid red;
.top-d-w {
display: flex;
height: 25%;
}
}
.lab-left {
font-size: 3.2vw;
text-align: center;
width: 30%;
// border: 1px saddlebrown solid;
font-weight: 600;
}
.lab-left2 {
font-size: 3.5vw;
text-align: center;
/* width: 60%; */
margin-left: 0.1vw;
font-weight: 600;
}
.labe-right-text {
font-size: 3vw;
}
.lab-right {
width: 90%;
border: 1px rgb(86, 70, 157) solid;
}
.top {
width: 95%;
height: 15%;
border: 1px solid #eee;
border-radius: 10px;
background: #f7f7f7;
text-align: center;
margin: 0 auto;
margin-top: 10px;
}
.header {
width: 95%;
height: 15%;
border: 1px solid #eee;
border-radius: 10px;
background: #f7f7f7;
text-align: center;
margin: 0 auto;
margin-top: 10px;
}
.center {
width: 95%;
height: 25%;
border: 1px solid #eee;
border-radius: 10px;
background: #f7f7f7;
text-align: center;
margin: 0 auto;
margin-top: 10px;
}
.bottom {
width: 95%;
height: 45%;
border: 1px solid #eee;
border-radius: 10px;
background: #f7f7f7;
text-align: center;
margin: 0 auto;
margin-top: 10px;
.bottom-d {
height: 50%;
}
video {
width: 97.5%;
height: 95%;
padding-left: 0.6vw;
padding-right: 0.6vw;
border-radius: 7px;
padding-top: 0.6vw;
object-fit: cover;
}
}
</style>