checkDetail.vue
5.11 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
<template>
<view class="container">
<Navbar title="入户安检信息" canBack></Navbar>
<view class="checkCardCss">
<basisCellCard title="安检基础信息" :list="list"></basisCellCard>
</view>
<view class="photoCardCss">
<basisCellCard title="现场照片" v-if="imgParams.xctpImgList.length">
<!-- <u-grid :border="false" @click="goToAppPage" col="0"> -->
<!-- <u-grid-item class="margin-top-sm"> -->
<u-upload :fileList="imgParams.xctpImgList" name="1" width="70px" :height="'70px'" :deletable="false"
:maxCount="1"></u-upload>
<!-- <u-image :showLoading="true" :src="item.url?item.url:''" width="70px" height="70px"></u-image> -->
<!-- </u-grid-item> -->
<!-- </u-grid> -->
</basisCellCard>
</view>
<view class="operationCardCss" v-show="imgParams.czgImg.length">
<basisCellCard title="操作工签名">
<view class="margin-top">
<u-upload :fileList="imgParams.czgImg" name="2" width="85vw" height="80px" :deletable="false"
:maxCount="1"></u-upload>
<!-- 目前使用upload回显,upload回显支持base64或blob模式 -->
<!-- <u-image width="100%" height="80px" :src="imgParams.czgImg"
@click="handlePreview(imgParams.czgImg)"></u-image> -->
</view>
</basisCellCard>
</view>
<view class="userCardCss" v-show="imgParams.khqmImg.length">
<basisCellCard title="用户签名">
<view class="margin-top">
<u-upload :fileList="imgParams.khqmImg" name="3" width="85vw" height="80px" :deletable="false"
:maxCount="1"></u-upload>
<!-- 目前使用upload回显,upload回显支持base64或blob模式 -->
<!-- <u-image width="100%" height="80px" :src="imgParams.khqmImg"
@click="handlePreview(imgParams.khqmImg)"></u-image> -->
</view>
</basisCellCard>
</view>
</view>
</template>
<script>
import basisCellCard from '@/components/basisCellCard/basisCellCard'
export default {
components: {
basisCellCard
},
data() {
return {
list: [{
name: '被检查单位',
value: '孝感市某某餐饮酒店',
key: 'fAjdz'
}, {
name: '检查单位',
value: '孝感市众兴液化石油气有限责任公司',
key: 'fJcczmc'
}, {
name: '检查时间',
value: '2024年1月22日',
key: 'fCjsj'
}, {
name: '检查结果',
value: 'fAjjl',
key: 'fAjjl',
type: 'tag',
bgColor: '#E6F7F7',
color: '#00AEAA',
borderColor: "#E6F7F7"
}, {
name: '整改时间',
value: 'FWxsj',
}, {
name: '检查情况',
value: '液化石没气钢瓶',
key: 'fAjjl'
}, {
name: '检查意见',
value: 'FWxjgbz',
}],
imgParams: {
czgImg: [],
khqmImg: [],
xctpImgList: []
}
};
},
async onLoad(options) {
console.log('打印options', options)
if (options.id) {
await this.getDetailInfo(options.id);
}
},
methods: {
async getDetailInfo(id) {
let that = this;
let result = await this.$api.securityCheckApi.getMyselfAjDetail(id);
let {code, value} = result;
if (code == 200) {
let {aj} = value;
console.log("安检", value);
this.list = this.$assignValues(aj, this.list);
this.list.map((item) => {
if (item.name == '整改时间' && !aj.FWxsj) {
item.value = '无'
}
if (item.name == '检查意见' && !aj.FWxjgbz) {
item.value = '无'
}
// if (item.name == '整改时间' || item.name == '检查意见') {
// item.value = '无'
// }
})
let fxczpJson = aj.fXcpz;
let xcImgList = JSON.parse(fxczpJson);
xcImgList.map(async (item, index) => {
let url = await that.$getPhotoUrl(item.response.fileId);
this.imgParams.xctpImgList.push({
url: url,
fileId: item.response.fileId
})
})
console.log('打印imgList', that.imgParams.xctpImgList);
let czgqmImg = JSON.parse(aj.fCzgqm);
let czgurl = await this.$getPhotoUrl(czgqmImg[0].response.fileId);
this.imgParams.czgImg.push({
url: czgurl,
})
let khqmImg = JSON.parse(aj.fKhqm);
let khurl = await this.$getPhotoUrl(khqmImg[0].response.fileId);
this.imgParams.khqmImg = [{
url: khurl
}]
}
},
goToAppPage() {
},
//预览图片
handlePreview(url, index) {
// console.log(url);
this.$previewPicture(url, index);
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding-bottom: 10px;
}
.checkCardCss {
margin: 10px;
}
.photoCardCss {
margin: 10px;
}
.operationCardCss {
margin: 10px;
::v-deep uni-image > div,
uni-image > img {
background-size: 100px !important;
}
}
.userCardCss {
margin: 10px;
::v-deep uni-image > div,
uni-image > img {
background-size: 100px !important;
}
}
</style>