mergeVipDetail.vue
7.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
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
<template>
<view>
<uni-collapse>
<uni-collapse-item :title="n.personInfo?.name" open v-for="n in list" :key="n.id">
<view class="collapseBody">
<!-- n.oldIdcCode -->
<view>
<label>姓名:</label>
{{n.personInfo?.name}}
<text class="text-danger">{{ n.oldPersonInfo?.name }}</text>
</view>
<view>
<label>会员编号:</label>
{{n.personInfo?.perCode}}
<text class="text-danger">{{ n.oldPersonInfo?.perCode }}</text>
</view>
<view style="display: flex;">
<label>有效期:</label>
<view>
<view v-if="n.personInfo?.valiDateTime">
<text v-if="n.personInfo?.beginTime">{{n.personInfo?.beginTime?.slice(0,10)}}</text>
<text v-if="n.personInfo?.beginTime">至</text>
<text>{{n.personInfo?.valiDateTime?.slice(0,10)}}</text>
</view>
<view class="text-danger" v-if="n.oldPersonInfo?.valiDateTime">
<text v-if="n.oldPersonInfo?.beginTime">{{ n.oldPersonInfo?.beginTime?.slice(0,10)}}</text>
<text v-if="n.oldPersonInfo?.beginTime">至</text>
<text v-if="n.oldPersonInfo?.valiDateTime">{{n.oldPersonInfo?.valiDateTime?.slice(0,10)}}</text>
</view>
<view class="text-danger" v-else>--</view>
</view>
</view>
<view style="display: flex;">
<label>证件号:</label>
<view>
{{ n.originIdcCode }}
<view class="text-danger">{{ n.oldIdcCode }}</view>
</view>
</view>
<view>
<label>级位详情:</label>
<view v-if="n.personInfo?.jiList.length>0" class="mt10">
<uni-table border stripe>
<uni-tr>
<uni-th width="50">序号</uni-th>
<uni-th >级位</uni-th>
<uni-th>证书编号</uni-th>
</uni-tr>
<uni-tr v-for="(tr,index) in n.personInfo.jiList" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{szToHz(tr.level)}}级</uni-td>
<uni-td>{{tr.certCode}}</uni-td>
</uni-tr>
</uni-table>
</view>
<text v-else class="text-primary">无级位记录</text>
<view v-if="n.oldPersonInfo?.jiList.length>0" class="mt10">
<uni-table border stripe>
<uni-tr>
<uni-th width="50"><text class="text-danger">序号</text></uni-th>
<uni-th><text class="text-danger">级位</text></uni-th>
<uni-th><text class="text-danger">证书编号</text></uni-th>
</uni-tr>
<uni-tr v-for="(tr,index) in n.oldPersonInfo.jiList" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{szToHz(tr.level)}}级</uni-td>
<uni-td>{{tr.certCode}}</uni-td>
</uni-tr>
</uni-table>
</view>
<text v-else class="text-danger">无级位记录</text>
</view>
<view>
<label>段位详情:</label>
<view v-if="n.personInfo?.duanList.length>0" class="mt10">
<uni-table border stripe>
<uni-tr>
<uni-th width="50">序号</uni-th>
<uni-th>段位</uni-th>
<uni-th>证书编号</uni-th>
</uni-tr>
<uni-tr v-for="(tr,index) in n.personInfo.duanList" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{szToHz(tr.level)}}段</uni-td>
<uni-td>{{tr.certCode}}</uni-td>
</uni-tr>
</uni-table>
</view>
<text v-else class="text-primary">无段位记录</text>
<view v-if="n.oldPersonInfo?.duanList.length>0" class="mt10">
<uni-table border stripe>
<uni-tr>
<uni-th width="50"><text class="text-danger">序号</text></uni-th>
<uni-th><text class="text-danger">段位</text></uni-th>
<uni-th><text class="text-danger">证书编号</text></uni-th>
</uni-tr>
<uni-tr v-for="(tr,index) in n.oldPersonInfo.duanList" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{szToHz(tr.level)}}段</uni-td>
<uni-td>{{tr.certCode}}</uni-td>
</uni-tr>
</uni-table>
</view>
<text v-else class="text-danger">无段位记录</text>
</view>
<view v-if="n.fileUrl">
<label>证明材料:</label>
<text class="text-primary" @click="showImg(n)">
下载
</text>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import {
szToHz
} from '@/common/utils.js'
import config from '@/config.js'
const queryParams = ref({})
const total = ref(0)
const list = ref([])
const popup = ref(null)
const type = ref('')
const form = ref({})
onLoad((option) => {
if (option.rangeId) {
queryParams.value.rangeId = option.rangeId
getList()
}
})
function getList() {
uni.showLoading({
title: '加载中'
})
api.infoMergeList(queryParams.value).then(res => {
list.value = res.rows
list.value.forEach(item => {
item.fileUrl = JSON.parse(item.fileUrl)
})
total.value = res.total
uni.hideLoading()
})
}
function handleChange(a, b) {
type.value = b
form.value = a
console.log(form.value.newName)
popup.value.open()
}
function handleDelete(row) {
uni.showModal({
content: `确认删除会员${row.newName}`,
success: function(res) {
if (res.confirm) {
api.infoMod([row.id]).then(res => {
uni.showToast({
title: '操作成功'
})
getList()
})
}
}
})
}
function showImg(n) {
var str = config.baseUrl_api + n.fileUrl[0]?.url
if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
<style scoped lang="scss">
.flexbox {
padding: 30rpx 30rpx 0
}
.danger-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.collapseBody {
background: #fff;
padding:0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
view {
margin: 0 0 20rpx;
label {
width: 5em;
color: #999;
display: inline-block;
text-align: right;
}
}
}
.popBody {
background: #fff;
padding: 30rpx;
}
</style>