registrationDetail.vue
9.8 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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<template>
<view class="registration_detail" :style="vuex_theme">
<view class="box student_info">
<view class="title">学生信息</view>
<view class="item">
<text>学生姓名</text>
<text>{{registrationDetail.studentName}}</text>
</view>
<view class="item">
<text>手机号</text>
<text>{{registrationDetail.studentPhone}}</text>
</view>
<view class="item">
<text>学号</text>
<text>{{registrationDetail.studentNumber}}</text>
</view>
<view class="item">
<text>班级</text>
<text>{{registrationDetail.classInfo}}</text>
</view>
<view class="icon_item">
<u-icon size="32rpx" label="实习计划" labelSize="28rpx" labelColor="#909097"
:name="vuex_baseImgUrl && `${vuex_baseImgUrl}internshipProgramIcon.png`"></u-icon>
<text>{{registrationDetail.planName}}</text>
</view>
<view class="border_top item">
<text>申请时间</text>
<text>{{timeFormat(registrationDetail.applyTime, 'yyyy-mm-dd hh:MM')}}</text>
</view>
</view>
<view class="box company_info">
<view class="title">单位信息</view>
<view class="icon_item">
<u-icon size="32rpx" label="实习单位" labelSize="28rpx" labelColor="#909097"
:name="vuex_baseImgUrl && `${vuex_baseImgUrl}internshipUnitIcon.png`"></u-icon>
<text>{{registrationDetail.companyName}}</text>
</view>
<view class="icon_item">
<u-icon size="32rpx" label="实习岗位" labelSize="28rpx" labelColor="#909097"
:name="vuex_baseImgUrl && `${vuex_baseImgUrl}internshipJobIcon.png`"></u-icon>
<text>{{registrationDetail.jobName}}</text>
</view>
<view class="border_top item">
<text>联系人</text>
<text>{{jobDetail.contactName}}</text>
</view>
<view class="item">
<text>联系电话</text>
<text>{{jobDetail.contactPhone}}</text>
</view>
<view class="item">
<text>所在地区</text>
<text>{{address}}</text>
</view>
<view class="item">
<text>详细地址</text>
<text>{{jobDetail.workSite}}</text>
</view>
</view>
<view v-if="registrationDetail.entryAttachments" class="box">
<view class="title">报名材料</view>
<view class="time">
{{timeFormat(registrationDetail.entryAttachments.createdTime, 'yyyy-mm-dd hh:MM')}} 上传
</view>
<view class="marks">
{{registrationDetail.entryAttachments.remarks}}
</view>
<view class="cl">
<view v-if="attachments&&attachments.length>0" class="fj">
<view v-for="(item,index) in attachments " @click="openLink(item)">
<view class="fj_item">
<image class="img" src="/static/img/internship/link.png"></image>
<text class="look">{{item.filename}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="box status">
<view class="title">状态</view>
<view class="item">
<text>审核状态</text>
<text>{{reviewStatus}}</text>
</view>
<view class="item">
<text>审核人</text>
<text>{{registrationDetail.auditTeacherName}}</text>
</view>
<view class="item">
<text>接受状态</text>
<text>{{receiveStatus}}</text>
</view>
</view>
<view class="footer" v-if="registrationDetail.status == 'wait'">
<view class="left_btn">
<c-button type="cancel" text="审核拒绝" @click="handelCancel">
</c-button>
</view>
<view class="right_btn">
<c-button type="confirm" text="审核通过" @click="hancelSubmit">
</c-button>
</view>
</view>
</view>
</template>
<script>
import {
getRegistrationDetailApi,
putRegistrationReviewApi,
getImgUrlApi,
} from '@/config/api.js';
export default {
data() {
return {
registrationDetail: {},
attachments: [],
attachmentsFile: [],
}
},
onLoad(option) {
getRegistrationDetailApi(option.id).then(data => {
if (data) {
console.log(data)
this.registrationDetail = data
this.handleAttachments()
}
})
},
onShow(options) {
},
computed: {
jobDetail: function() {
let {
jobDetail = {}
} = this.registrationDetail
return jobDetail;
},
address: function() {
return this.jobDetail && this.jobDetail.province ?
`${this.jobDetail.province}/${this.jobDetail.city}/${this.jobDetail.district}` : '';
},
reviewStatus: function() {
return this.registrationDetail.status == 'apply' ? '待报名' :
this.registrationDetail.status == 'wait' ? '待审核' :
this.registrationDetail.status == 'pass' ? '已审核' :
this.registrationDetail.status == 'reject' ? '已拒绝' : '';
},
receiveStatus: function() {
return this.registrationDetail.receiveStatus == 'received' ? '已接收' :
this.registrationDetail.receiveStatus == 'wait' ? '待处理' :
this.registrationDetail.receiveStatus == 'reject' ? '已拒绝' :
'';
},
},
methods: {
handleAttachments() {
if (this.registrationDetail.entryAttachments) {
if (this.registrationDetail.entryAttachments.attachments) {
this.attachments = JSON.parse(this.registrationDetail.entryAttachments.attachments)
}
if (this.registrationDetail.entryAttachments.attachmentsFile) {
this.attachmentsFile = JSON.parse(this.registrationDetail.entryAttachments.attachmentsFile)
}
this.attachments = this.attachments.concat(this.attachmentsFile)
console.log(this.attachments)
}
},
timeFormat(timestamp, format = 'yyyy-mm-dd') {
return timestamp > 0 ? uni.$u.timeFormat(timestamp, format) : '--'
},
handelCancel() {
putRegistrationReviewApi({
ids: [this.registrationDetail.id],
status: 'reject',
}).then(data => {
if (data) {
uni.navigateBack({
delta: 1
});
}
})
},
hancelSubmit() {
putRegistrationReviewApi({
ids: [this.registrationDetail.id],
status: 'pass',
}).then(data => {
if (data) {
uni.navigateBack({
delta: 1
});
}
})
},
openLink(e) {
var _this = this
uni.showLoading({
title: '努力加载中~',
mask: true
})
getImgUrlApi({
bucket: e.bucket,
filePath: e.object
}).then(data => {
console.log("data...", data)
if (e.mime_type.indexOf("image") != -1) {
_this.openImage(data.url)
} else {
uni.downloadFile({
url: data.url,
success: function(res) {
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log('打开文档成功');
},
complete: function() {
uni.hideLoading();
}
});
}
});
}
})
},
openImage(imgPath) {
let array = new Array(1).fill(imgPath);
uni.previewImage({
urls: array,
success(res) {
uni.hideLoading();
console.log('openImage success');
},
fail(res) {
uni.hideLoading();
console.log('openImage fail:', res);
}
});
},
}
}
</script>
<style lang="scss" scoped>
.registration_detail {
width: 100%;
min-height: 100%;
height: auto;
padding: 20rpx 0 194rpx 0;
background-color: #F7F7F7;
.box {
width: 630rpx;
margin: 0 auto 20rpx;
padding: 30rpx 30rpx 12rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
.title {
font-size: 32rpx;
line-height: 32rpx;
color: #202131;
margin: 0 0 30rpx 0;
}
.title::before {
content: "";
display: inline-block;
width: 6rpx;
height: 32rpx;
background-color: var(--primary-color);
margin: 0 12rpx 0 0;
position: relative;
top: 4rpx;
border-radius: 8rpx;
}
.icon_item {
display: flex;
flex-flow: row nowrap;
margin: 0 0 24rpx 0;
text {
display: inline-block;
width: 460rpx;
font-size: 28rpx;
line-height: 48rpx;
color: #202131;
margin: 0 0 0 40rpx;
}
}
.item {
margin: 0 0 24rpx 0;
text:first-child {
display: inline-block;
width: 112rpx;
text-align: justify;
text-align-last: justify;
font-size: 28rpx;
line-height: 48rpx;
color: #909097;
vertical-align: top;
}
text:last-child {
display: inline-block;
width: 440rpx;
font-size: 28rpx;
line-height: 48rpx;
color: #202131;
margin: 0 0 0 78rpx;
}
}
.border_top {
border-top: 2rpx solid #E2E2E8;
padding: 28rpx 0 0 0;
}
.time {
margin-top: 10rpx;
font-size: 26rpx;
}
.marks {
margin-top: 16rpx;
font-size: 30rpx;
}
.fj {
margin-top: 16rpx;
// padding: 24rpx 32rpx 20rpx;
background-color: #fff;
.fj_item {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.img {
width: 24rpx;
height: 24rpx;
}
.look {
width: 90%;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
white-space: normal;
word-break: break-all;
word-wrap: break-word;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: var(--primary-color);
padding-left: 15rpx;
}
}
}
.footer {
width: 100%;
height: 96rpx;
padding: 28rpx 30rpx;
background: #FFFFFF;
position: fixed;
bottom: 0;
left: 0;
z-index: 99;
border-top: 2rpx solid #E2E2E8;
view {
display: inline-block;
}
.left_btn {
width: 330rpx;
margin: 0 30rpx 0 0;
}
.right_btn {
width: 330rpx;
}
}
}
</style>