ScanInfo.vue
8.48 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
<template>
<page-layout :title="this.top_title" logo="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png">
<a-card style="margin-top: 24px" :bordered="false" title="基础信息">
<pdf-preview ref="pdfPreview"></pdf-preview>
<detail-list>
<detail-list-item term="终端客户">{{this.terminalCustomer}}</detail-list-item>
<detail-list-item term="项目名称">{{this.projectName}}</detail-list-item>
<detail-list-item term="区域(工位)名称">{{this.areaName}}</detail-list-item>
<detail-list-item term="柜体名称">{{this.arkName}}</detail-list-item>
<detail-list-item term="工作令号">{{this.workno}}</detail-list-item>
<detail-list-item term="电气成套料号">{{this.electricalNo}}</detail-list-item>
<detail-list-item term="上级编码">{{this.pnos}}</detail-list-item>
<detail-list-item term="电气图号">{{this.electricPictureno}}</detail-list-item>
</detail-list>
<detail-list title="供电参数">
<detail-list-item term="设备功率">{{this.equipmentPower}}</detail-list-item>
<detail-list-item term="输入电压">{{this.inputVoltage}}</detail-list-item>
<detail-list-item term=" 频率">{{this.frequency}}</detail-list-item>
</detail-list>
<a-card type="inner" title="设计与生产记录">
<detail-list title="" size="small">
<detail-list-item term="制作工程师:">{{this.productionEngineer}}</detail-list-item>
<detail-list-item term="完成时间"></detail-list-item>
<detail-list-item term="校验工程师:">{{this.inspectionEngineer}}</detail-list-item>
</detail-list>
</a-card>
</a-card>
<a-card style="margin-top: 24px" :bordered="false" title="附件">
<a-card type="inner" title="">
<detail-list :title="this.title" size="small" :col="1">
<template>
<div v-if="areaElectricalDrawingsUrl!=''" style="float: left;width:104px;height:104px;margin-right: 10px;margin: 0 8px 8px 0;">
<div style="width: 100%;height: 100%;position: relative;padding: 8px;" @click="pdfPreview('1')">
<img style="width: 100%;" src="~@/assets/pdf4.jpg">
</div>
</div>
</template>
</detail-list>
<a-divider style="margin: 16px 0" />
<detail-list :title="this.title2" size="small" :col="1">
<template>
<div v-if="usersManualUrl!=''" style="float: left;width:104px;height:104px;margin-right: 10px;margin: 0 8px 8px 0;">
<div style="width: 100%;height: 100%;position: relative;padding: 8px;" @click="pdfPreview('2')">
<img style="width: 100%;" src="~@/assets/pdf4.jpg">
</div>
</div>
</template>
</detail-list>
<a-divider style="margin: 16px 0" />
<detail-list :title="this.title3" size="small" :col="2">
<template>
<div v-if="maintenanceManualUrl!=''" style="float: left;width:104px;height:104px;margin-right: 10px;margin: 0 8px 8px 0;">
<div style="width: 100%;height: 100%;position: relative;padding: 8px;" @click="pdfPreview('3')">
<img style="width: 100%;" src="~@/assets/pdf4.jpg">
</div>
</div>
</template>
</detail-list>
</a-card>
</a-card>
</page-layout>
</template>
<script>
import { mixinDevice } from '@/utils/mixin.js'
import PageLayout from '@/components/page/PageLayout'
import DetailList from '@/components/tools/DetailList'
import ARow from 'ant-design-vue/es/grid/Row'
import PdfPreview from "./modules/PdfPreview";
import { getEleInfoByOnlyCode} from '@/api/api'
const DetailListItem = DetailList.Item
export default {
name: "ScanInfo",
components: {
PageLayout,
DetailList,
DetailListItem,
ARow,
PdfPreview
},
mixins: [mixinDevice],
data () {
return {
activeTabKey: '1',
terminalCustomer: '',
projectName: '',
areaName: '',
arkName: '',
workno: '',
pnos: '',
electricalNo: '',
equipmentPower: '',
inputVoltage: '',
inspectionEngineer: '',
production_engineer: '',
productionEngineer: '',
electricPictureno: '',
frequency: '',
id:'',
imgs:[],
key:0,
top_title:'物料编码',
title:'区域电气图纸',
title2: '使用说明书',
title3: '维修与保养手册',
usersManualUrl:'',
maintenanceManualUrl:'',
areaElectricalDrawingsUrl:'',
}
},
created(){
var params = {};
location.search.substr(1).split('&').forEach( function(item){
var s = item.split('=');
params[s[0]]=s[1];
});
localStorage.setItem('id',params.id);
this.id=params.id;
let params2 = {
'onlyCode':this.id
}
getEleInfoByOnlyCode(params2).then(res => {
if (res.success) {
this.top_title=this.top_title+":"+res.result.code
this.terminalCustomer=res.result.terminalCustomer
this.projectName=res.result.projectName
this.areaName=res.result.areaName
this.arkName=res.result.arkName
this.workno=res.result.workno
this.pnos=res.result.pnos
this.electricalNo=res.result.electricalNo
this.equipmentPower=res.result.equipmentPower
this.inputVoltage=res.result.inputVoltage
this.inspectionEngineer=res.result.inspectionEngineer
this.frequency=res.result.frequency
this.productionEngineer=res.result.productionEngineer
this.electricPictureno=res.result.electricPictureno
this.imgs.push({id:1, base64:res.result.areaElectricalDrawings});
if (res.result.areaElectricalDrawings!=''&&res.result.areaElectricalDrawings!=undefined){
var arr=res.result.areaElectricalDrawings.split(',');
this.title=this.title+":"+arr[0];
this.areaElectricalDrawingsUrl=arr[1]
}
if (res.result.usersManual!=''&&res.result.usersManual!=undefined){
var arr2=res.result.usersManual.split(',');
this.title2=this.title2+":"+arr2[0];
this.usersManualUrl=arr2[1]
}
if (res.result.maintenanceManual!=''&&res.result.maintenanceManual!=undefined){
var arr3=res.result.maintenanceManual.split(',');
this.title3=this.title3+":"+arr3[0];
this.maintenanceManualUrl=arr3[1]
}
}
})
} ,
methods:{
pdfPreview:function(type){
var url='http://mts.huahengweld.com/jeecg-boot/generic/web/viewer.html?file=';
if (type=='1'){
url=url+this.areaElectricalDrawingsUrl
}else if(type=='2'){
url=url+this.usersManualUrl
}else{
url=url+this.maintenanceManualUrl
}
// window.open(url, '_blank')
this.$refs.pdfPreview.previewFiles(url)
},
}
}
</script>
<style lang="less" scoped>
.detail-layout {
margin-left: 44px;
}
.text {
color: rgba(0, 0, 0, .45);
}
.heading {
color: rgba(0, 0, 0, .85);
font-size: 20px;
}
.no-data {
color: rgba(0, 0, 0, .25);
text-align: center;
line-height: 64px;
font-size: 16px;
i {
font-size: 24px;
margin-right: 16px;
position: relative;
top: 3px;
}
}
.mobile {
.detail-layout {
margin-left: unset;
}
.text {
}
.status-list {
text-align: left;
}
}
.table-operator {
margin-bottom: 10px
}
.clName .ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle {
width: 10px !important;
}
.clName .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
background-color: #1890FF !important;
}
</style>
<style scoped>
.float_left {
display: inline-block;
/*float: left;*/
margin-bottom: 0.4rem;
overflow: hidden;
}
.add_upload .add_upload_button {
position: relative;
width: 4.5rem;
height: 4.5rem;
border: none;
background: rgb(236,236,236);
}
.add_upload .add_upload_icon {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.add_upload .add_upload_file {
width: 100%;
height: 100%;
opacity: 0;
font-size: 0;
}
.add_upload_imgBox .add_upload_imgDiv {
position: relative;
width: 4.5rem;
height: 4.5rem;
margin: 0 .0rem .0rem 0;
margin-left: 0.4rem;
background-color: pink;
}
.add_upload_imgBox .add_upload_imgDiv img {
width: 100%;
height: 100%;
margin-top: .2rem;
}
.add_upload_imgBox .add_upload_close {
position: absolute;
top: -0.2rem;
right: 0;
width: 20%;
height: 20%;
}
.add_upload_imgBox .add_upload_close img {
width: 100%;
height: 100%;
margin-top: 0.5rem;
}
</style>