hejianhao
2025-02-25 bba11a405d15e42ac13a9f85344baabf26d10a94
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
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
<template>
    <view class="px-31 pt-38">
        <view v-if="Object.keys(info).length != 0" class="br-19 bs-1 pt-21 pb-35 px-27 bgcolor2 relative transition-h"
            :class="unfoldFlag ? 'max-9999' : 'max-300'">
            <view>
                <view class="flex a-center j-between fs-23 lh-33 font-bold">
                    <view>诉求号:{{ info.serialNumber }}</view>
                    <view class="color1">{{ ["正在办理", "延期办理", "超时办理", "已办结", "群众撤销", "上报待审核", "上级驳回"][info.status] }}
                    </view>
                </view>
                <view class="mx-13 mt-33 pt-35 pb-33 px-27 br-19 flex a-center j-between bgcolor1">
                    <view class="fs-27 lh-38 color2">{{ info.detailedAddress }}</view>
                    <image src="@/static/detailImg/dwei.png" class="w-31 h-31 shrink0" />
                </view>
                <view v-if="!unfoldFlag" class="flex a-center j-between mt-31 mx-13">
                    <view class="flex-column a-center">
                        <view class="fs-27 lh-38 font-bold">问题类型</view>
                        <view class="mt-8 fs-23 lh-42 txt-center px-31 font-w400 color3 bgcolor3 border1">{{
                            info.problemType }}</view>
                    </view>
                    <view class="flex-column a-center">
                        <view class="fs-27 lh-38 font-bold">群众</view>
                        <view class="fs-27 lh-38 mt-10">{{ info.name }}</view>
                    </view>
                    <view class="flex-column a-center">
                        <view class="fs-27 lh-38 font-bold">联系电话</view>
                        <view class="fs-27 lh-38 mt-10">{{ info.contactNumber }}</view>
                    </view>
                </view>
                <view v-else class="mt-33">
                    <view class="fs-27 lh-77 flex j-between">
                        <view class="shrink0 color2 font-w400">
                            <view>创建时间</view>
                            <view>问题类型</view>
                            <view>群众</view>
                            <view>联系电话</view>
                            <view>详细地址</view>
                        </view>
                        <view class="font-bold txt-aligin-r" style="max-width: 404rpx;">
                            <view>{{ info.createTime }}</view>
                            <view>{{ info.problemType }}</view>
                            <view>{{ info.name }}</view>
                            <view>{{ info.contactNumber }}</view>
                            <view class="lh-35">{{ info.detailedAddress }}</view>
                        </view>
                    </view>
                    <view class="line-box my-35"></view>
                    <view class="fs-27 lh-38 font-bold mx-31">问题描述</view>
                    <view class="br-8 bgcolor4 py-29 mt-27 fs-27">
                        <view class="ml-31">{{ info.descriptionTitle }}</view>
                        <view class="line-box my-27"></view>
                        <view class="mx-31 color2">
                            {{ info.descriptionContent }}
                        </view>
                    </view>
                    <view class="fs-27 mt-35 lh-38 font-bold">描述图片</view>
                    <view class="flex wrap mt-27">
                        <view @tap="viewImage(item)" class="relative mr-15" v-for="item in info.images.split(',')"
                            :key="item">
                            <image :src="item" class="w-140 h-140 shrink0 br-8" />
                            <view class="absolute w-140 h-140 bgcolor5 top0 left0 br-8 flex a-center j-center">
                                <image @tap="viewImage(item)" src="@/static/Appeal/amplify.png" class="w-19 h-19" />
                            </view>
                        </view>
                    </view>
                    <view class="fs-27 mt-37 lh-38 font-bold">描述视频</view>
                    <view class="flex wrap mt-27">
                        <view @tap="openVideo(item)" class="relative mr-15" v-for="item in info.videos.split(',')"
                            :key="item">
                            <video id="myVideo" class="w-140 h-140 mt-19 shrink0" disabled :controls="false"
                                :show-center-play-btn="false" :src="item" />
                            <view class="videoOpen" @click.stop="openVideo(item)">
                                <image src="../../static/detailImg/open.png" class="video shrink0" mode="aspectFill">
                                </image>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <view @tap="unfold" class="absolute" style="bottom:-90rpx;left: 50%;transform: translate(-50%,-50%);">
                <image v-if="!unfoldFlag" src="@/static/unfold.png" class="h-54 w-156" />
                <image v-if="unfoldFlag" src="@/static/packUp.png" class="h-54 w-156" />
            </view>
        </view>
        <view class="br-19 mt-76 bs-1 pt-35 pb-33">
            <view class="fs-27 lh-38 font-bold ml-31">处理状态</view>
            <view @tap="showList = true" class="br-15 py-15 pl-31 mx-31 pr-27 mt-27 flex j-between a-center border2"
                :class="(rulsFlag && !status) && 'bgcolor-border'">
                <view :class="!status && 'color6'">{{ status ? status : '请选择当前处理状态' }}</view>
                <image src="/static/location/back.png" class="h-23 w-15" style="transform: rotate(-90deg);" />
            </view>
            <view v-if="rulsFlag && !status" class="flex a-center mt-19 ml-31">
                <image src="@/static/noNull.png" class="w-35 h-35 mr-13 shrink0" />
                <view class="fs-23 color99">处理状态不能为空</view>
            </view>
            <view class="fs-27 lh-38 font-bold ml-31 mt-38">办结结果描述</view>
            <view class="mt-23 br-38 pt-31 pb-16 pl-31 pr-29 fs-23 color5 bgcolor8">
                <view class="flex mb-15">
                    <view class="w-8 h-8 br50 shrink0 mr-12 mt-12 bgcolor7"></view>
                    <view>处理措施:记录为解决该问题所采取的具体措施,包括政策宣传、沟通协调、现场处理等方式。</view>
                </view>
                <view class="flex mb-15">
                    <view class="w-8 h-8 br50 shrink0 mr-12 mt-12 bgcolor7"></view>
                    <view>处理时间:记录处理该问题的时间节点,包括开始处理时间、处理完成时间等。</view>
                </view>
                <view class="flex mb-15">
                    <view class="w-8 h-8 br50 shrink0 mr-12 mt-12 bgcolor7"></view>
                    <view>参与人员:记录参与处理该问题的人员名单,包括走访人员、相关部门工作人员等。</view>
                </view>
                <view class="flex mb-15">
                    <view class="w-8 h-8 br50 shrink0 mr-12 mt-12 bgcolor7"></view>
                    <view>结果概述:简要描述问题的处理结果,是否得到有效解决,是否达到走访对象的期望等。</view>
                </view>
                <view class="flex mb-15">
                    <view class="w-8 h-8 br50 shrink0 mr-12 mt-12 bgcolor7"></view>
                    <view>后续跟进:如需进一步跟进或处理,记录后续跟进的计划、时间节点及责任人员。</view>
                </view>
            </view>
            <view class="mx-31">
                <textarea v-model="completionDescription" class="pt-25 pl-31 mt-27 fs-27 br-8 bgcolor4"
                    :class="(rulsFlag && !completionDescription) && 'bgcolor-border'"
                    style="height: 365rpx;width: calc(100% - 31rpx);" placeholder="请按上述标准描述处理结果" />
                <view v-if="rulsFlag && !completionDescription" class="flex a-center mt-19">
                    <image src="@/static/noNull.png" class="w-35 h-35 mr-13 shrink0" />
                    <view class="fs-23 color99">办结结果描述不能为空</view>
                </view>
                <view class="fs-27 mt-38 lh-38 font-bold">图片</view>
                <view class="flex wrap mt-27">
                    <view class="relative mr-15" v-for="(item, index) in localImageUrls" :key="index">
                        <image v-if="item != 'loading'" :src="item" class="w-140 h-140 shrink0 br-8" />
                        <view v-if="item != 'loading'" class="absolute w-140 h-140 bgcolor5 top0 left0 br-8">
                            <view class="absolute flex a-center j-between px-34"
                                style="top: 50%;left: 50%;transform: translate(-50%,-50%);width: calc(100% - 68rpx);">
                                <image @tap="viewImage(item)" src="@/static/Appeal/amplify.png" class="w-19 h-19" />
                                <image @tap="delImg(item)" src="@/static/Appeal/trash.png" class="w-19 h-19" />
                            </view>
                        </view>
                    </view>
                    <view v-if="completionImages.includes('loading')"
                        class="w-140 h-140 flex a-center j-center mr-15 border2 br-8">
                        <u-loading-icon></u-loading-icon>
                    </view>
                    <image @tap="uploadImg(1)" src="/static/Appeal/add.png" class="w-140 h-140 shrink0" />
                </view>
                <view class="fs-27 mt-37 lh-38 font-bold">视频</view>
                <view class="flex wrap mt-27">
                    <view class="imgOrVedio" v-for="(ite, ind) in completionVideos" :key="ind">
                        <video v-if="ite != 'loading'" id="myVideo" class="videoImg shrink0" disabled :controls="false"
                            :show-center-play-btn="false" :src="ite">
                        </video>
                        <view v-if="ite != 'loading'" class="absolute w-140 h-140 bgcolor5 top0 left0 br-8 zIndex999">
                            <view class="absolute flex a-center j-between"
                                style="top: 50%;left: 50%;transform: translate(-50%,-50%);">
                                <image @tap="openVideo(ite)" src="@/static/detailImg/open.png" class="w-140 h-140" />
                            </view>
                            <image @tap="delVideo(ite)" src="@/static/Appeal/trash.png"
                                class="absolute w-19 h-19 zIndex999" style="top: 8rpx;right: 8rpx;" />
                        </view>
                    </view>
                    <view v-if="completionVideos.includes('loading')"
                        class="w-140 h-140 flex a-center j-center mr-15 border2 br-8">
                        <u-loading-icon></u-loading-icon>
                    </view>
                    <image @tap="uploadImg(2)" src="@/static/Appeal/add.png" class="w-140 h-140 shrink0" />
                </view>
                <view class="fs-27 lh-38 mt-40 font-bold">其他说明</view>
                <textarea v-model="completionOtherDescription" class="pt-25 pl-31 mt-27 fs-27 br-8 bgcolor4"
                    style="height: 365rpx;width: calc(100% - 31rpx);" placeholder="请输入补充说明内容" />
            </view>
        </view>
        <view @click.stop="submit" class="mt-38 fs-35 lh-96 br-48 txt-center font-bold bgcolor6 color4">提交办结结果</view>
        <view class="safe-box"></view>
        <u-picker :show="showList" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker>
    </view>
</template>
 
<script>
    import {
        saveResult,
        getComplaintDetail
    } from './service'
    import config from '@/config/index.js'
    export default {
        data() {
            return {
                showList: false,
                columns: [
                    ['已办结', '群众撤销']
                ],
                unfoldFlag: false, //是否展开
                id: '', //诉求id
                info: {}, //工单详情
                completionDescription: '', //办结结果描述
                localImageUrls: [], //本地回显的图片
                completionImages: [], //办结结果图片
                completionOtherDescription: '', //其他说明
                completionVideos: [], //办结结果视频
                status: '', //处理状态
                againCklicFlag: true,
                rulsFlag: false,
            }
        },
        onLoad(params) {
            this.id = params.id
            getComplaintDetail({
                id: params.id
            }).then(res => {
                this.info = res.data
            })
        },
        methods: {
            submit() {
                if (!this.status) {
                    this.rulsFlag = true
                    return uni.showToast({
                        title: '请选择当前处理状态',
                        icon: 'none',
                        mask: true
                    })
                }
                if (!this.completionDescription) {
                    this.rulsFlag = true
                    return uni.showToast({
                        title: '请填写办结结果描述',
                        icon: 'none',
                        mask: true
                    })
                }
                if (this.completionImages.length == 0) {
                    return uni.showToast({
                        title: '请上传办结结果图片',
                        icon: 'none',
                        mask: true
                    })
                }
                if (this.completionVideos.length == 0) {
                    return uni.showToast({
                        title: '请上传办结结果视频',
                        icon: 'none',
                        mask: true
                    })
                }
                saveResult({
                    id: this.id,
                    status: this.status == '已办结' ? 3 : 4,
                    completionDescription: this.completionDescription,
                    completionImages: this.completionImages.join(','),
                    completionOtherDescription: this.completionOtherDescription,
                    completionVideos: this.completionVideos.join(',')
                }).then(res => {
                    if (res.code == 200) {
                        uni.showToast({
                            title: '提交成功',
                            icon: 'success',
                            mask: true
                        })
                        setTimeout(() => {
                            uni.navigateBack()
                        }, 1500)
                    } else {
                        uni.showToast({
                            title: res.msg,
                            icon: 'none',
                            mask: true
                        })
                    }
                })
            },
            confirm({
                value
            }) {
                this.status = value[0]
                this.showList = false
            },
            cancel() {
                this.showList = false
            },
            unfold() {
                this.unfoldFlag = !this.unfoldFlag
            },
            delImg(item) {
                this.localImageUrls = this.localImageUrls.filter(i => i != item)
                this.completionImages = this.completionImages.filter(i => i != item)
            },
            delVideo(item) {
                this.completionVideos = this.completionVideos.filter(i => i != item)
            },
            viewImage(item) {
                uni.previewImage({
                    urls: [item]
                })
            },
            uploadImg(type) {
                if (!this.againCklicFlag) return
                this.againCklicFlag = false
                if (type == 1) {
                    uni.chooseImage({
                        count: 1,
                        success: (chooseImageRes) => {
                            this.completionImages.push('loading')
                            this.againCklicFlag = true
                            let imgPathList = chooseImageRes.tempFilePaths;
                            if (imgPathList.length > 0) {
                                uni.uploadFile({
                                    url: config.imageUrl,
                                    filePath: imgPathList[0],
                                    timeout: 1000 * 45,
                                    name: 'file',
                                    header: {
                                        Authorization: config.uploadToken
                                    },
                                    success: (res) => {
                                        if (JSON.parse(res.data).code == 200) {
                                            this.completionImages = this.completionImages.filter(
                                                item => item !=
                                                'loading')
                                            this.$nextTick(() => {
                                                this.completionImages.push(JSON.parse(res
                                                        .data)
                                                    .data)
                                                this.localImageUrls.push(imgPathList[0])
                                            })
                                        } else {
                                            this.againCklicFlag = true
                                            this.completionImages = this.completionImages.filter(
                                                item => item != 'loading')
                                            uni.showToast({
                                                title: '上传失败,请重新上传',
                                                icon: 'none',
                                                mask: true
                                            })
                                        }
                                    },
                                    fail: (err) => {
                                        this.againCklicFlag = true
                                        this.completionImages = this.completionImages.filter(
                                            item => item != 'loading')
                                        uni.showToast({
                                            title: '上传失败,请重新上传',
                                            icon: 'none',
                                            mask: true
                                        })
                                    }
                                })
                            }
                        },
                    })
                } else {
                    uni.chooseVideo({
                        camera: 'back',
                        success: (res) => {
                            this.completionVideos.push('loading')
                            this.againCklicFlag = true
                            const tempFilePath = res.tempFilePath;
                            uni.uploadFile({
                                url: config.imageUrl,
                                filePath: tempFilePath,
                                timeout: 1000 * 45,
                                name: 'file',
                                header: {
                                    Authorization: config.uploadToken
                                },
                                success: (res) => {
                                    if (JSON.parse(res.data).code == 200) {
                                        this.completionVideos = this.completionVideos.filter(
                                            item => item !=
                                            'loading')
                                        this.$nextTick(() => {
                                            this.completionVideos.push(JSON.parse(res.data)
                                                .data)
                                        })
                                    } else {
                                        this.againCklicFlag = true
                                        this.completionVideos = this.completionVideos.filter(
                                            item => item != 'loading')
                                        uni.showToast({
                                            title: '上传失败,请重新上传',
                                            icon: 'none',
                                            mask: true
                                        })
                                    }
                                },
                                fail: (err) => {
                                    this.againCklicFlag = true
                                    this.completionVideos = this.completionVideos.filter(
                                        item => item != 'loading')
                                    uni.showToast({
                                        title: '上传失败,请重新上传',
                                        icon: 'none',
                                        mask: true
                                    })
                                }
                            })
                        }
                    })
                }
            },
            // 去大屏播放视频
            openVideo(url) {
                uni.navigateTo({
                    url: `/pages/work-detail/maxVideo?url=${url}`
                })
            },
        }
    }
</script>
 
<style scoped lang="scss">
    .bs-1 {
        box-shadow: 0rpx 0rpx 27rpx 0rpx rgba(0, 0, 0, 0.1);
    }
 
    .color1 {
        color: #FF4948;
    }
 
    .color2 {
        color: rgba(0, 0, 0, .8);
    }
 
    .color3 {
        color: #FAAD14;
    }
 
    .color4 {
        color: #FFFFFF;
    }
 
    .color5 {
        color: #FC8D55;
    }
 
    .color6 {
        color: rgba(0, 0, 0, 0.24);
    }
 
    .color99 {
        color: #FB9A0E;
    }
 
    .bgcolor-border {
        background: rgba(255, 253, 241, 1) !important;
        border: 2rpx solid #FFE58F !important;
    }
 
    .bgcolor1 {
        background: linear-gradient(270deg, rgba(255, 241, 0, 0.5) 0%, rgba(255, 249, 172, 0.25) 48%, rgba(255, 255, 255, 0.2) 100%, #FFFFFF 100%);
    }
 
    .bgcolor2 {
        background: linear-gradient(180deg, #FFDCDB 0%, rgba(255, 255, 255, 0) 91rpx);
    }
 
    .bgcolor3 {
        background: #FFFBE6;
    }
 
    .bgcolor4 {
        background: #F8F8F8;
    }
 
    .bgcolor5 {
        background: rgba(0, 0, 0, .23);
    }
 
    .bgcolor6 {
        background: linear-gradient(270deg, #FC8D55 0%, #FF4948 100%);
    }
 
    .bgcolor7 {
        background-color: rgba(252, 141, 85, 1);
    }
 
    .bgcolor8 {
        background: #FFFBE6;
    }
 
    .border1 {
        border: 2rpx solid #FFF1B8;
    }
 
    .border2 {
        border: 2rpx solid rgba(0, 0, 0, 0.15);
    }
 
    .safe-box {
        height: env(safe-area-inset-bottom);
    }
 
    .line-box {
        box-shadow: 0rpx 0rpx 27rpx 0rpx rgba(0, 0, 0, 0.1);
        height: 2rpx;
        background: rgba(0, 10, 26, 0.07);
    }
 
    .transition-h {
        transition: max-height 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
 
    .max-300 {
        max-height: 300rpx;
    }
 
    .max-9999 {
        max-height: 9999rpx;
    }
 
    .videoOpen {
        position: absolute;
        top: 10rpx;
        left: 0;
        z-index: 99;
        width: 140rpx;
        height: 140rpx;
        border-radius: 8rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 19rpx;
 
        .video {
            z-index: 999;
            width: 140rpx;
            height: 140rpx;
        }
    }
 
    .imgOrVedio {
        margin-right: 17rpx;
        position: relative;
 
        .img {
            width: 140rpx;
            height: 140rpx;
            border-radius: 8rpx;
            margin-top: 19rpx;
        }
 
        .videoOpen {
            position: absolute;
            top: 10rpx;
            left: 0;
            z-index: 99;
            width: 140rpx;
            height: 140rpx;
            border-radius: 8rpx;
            display: flex;
            align-items: center;
            justify-content: center;
 
            .video {
                z-index: 999;
                width: 140rpx;
                height: 140rpx;
            }
        }
    }
 
    .videoImg {
        width: 140.38rpx;
        height: 140.38rpx;
        border-radius: 7.69rpx;
        position: relative;
    }
 
    #myVideo {
        z-index: 1;
    }
 
    .zIndex999 {
        z-index: 999;
    }
 
    /deep/.u-popup__content {
        border-radius: 16rpx 16rpx 0rpx 0rpx;
    }
 
    /deep/ .u-toolbar {
        border-bottom: 2rpx solid RGBA(243, 243, 243, 1);
    }
 
    /deep/ .u-toolbar__wrapper__cancel {
        font-weight: 400;
        font-size: 30rpx;
        color: #FF4948 !important;
    }
 
    /deep/ .u-toolbar__wrapper__confirm {
        font-weight: 400;
        font-size: 30rpx;
        color: #FF4948 !important;
    }
</style>