linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
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
<template>
    <view class="container">
        <view class="basic">
            <box-title title="基本信息" class="box-title"></box-title>
            <view class="info">
                <lineItem :dataInfo="basicData"></lineItem>
            </view>
        </view>
 
        <view class="planegraph" v-if="foImageUrls.length">
            <box-title title="四个一工程照片" class="box-title"></box-title>
            <view class="flex-wrap">
                <view v-for="(i,k) in foImageUrls" :key="k" class="ml-20 mt-20" @click="previewImg(i,foImageUrls)">
                    <u-image :src="i" width="80" height="80"></u-image>
                </view>
            </view>
        </view>
        <view class="planegraph" v-if="fireFacsImageUrls.length">
            <box-title title="灭火器照片" class="box-title"></box-title>
            <view class="flex-wrap">
                <view v-for="(i,k) in fireFacsImageUrls" :key="k" class="ml-20 mt-20"
                    @click="previewImg(i,fireFacsImageUrls)">
                    <u-image :src="i" width="80" height="80"></u-image>
                </view>
            </view>
        </view>
        <view class="planegraph" v-if="scImageUrls.length">
            <box-title title="安全通道照片" class="box-title"></box-title>
            <view class="flex-wrap">
                <view v-for="(i,k) in scImageUrls" :key="k" class="ml-20 mt-20" @click="previewImg(i,scImageUrls)">
                    <u-image :src="i" width="80" height="80"></u-image>
                </view>
            </view>
        </view>
        <view class="planegraph" v-if="patrolImageUrls.length">
            <box-title title="周边巡查照片" class="box-title"></box-title>
            <view class="flex-wrap">
                <view v-for="(i,k) in patrolImageUrls" :key="k" class="ml-20 mt-20"
                    @click="previewImg(i,patrolImageUrls)">
                    <u-image :src="i" width="80" height="80"></u-image>
                </view>
            </view>
        </view>
        <view class="planegraph" v-if="antiCollisionImageUrls.length">
            <box-title title="防撞装置照片" class="box-title"></box-title>
            <view class="flex-wrap">
                <view v-for="(i,k) in antiCollisionImageUrls" :key="k" class="ml-20 mt-20"
                    @click="previewImg(i,antiCollisionImageUrls)">
                    <u-image :src="i" width="80" height="80"></u-image>
                </view>
            </view>
        </view>
        <view class="planegraph" v-if="haImageUrls.length">
            <box-title title="高空抛物监控照片" class="box-title"></box-title>
            <view class="flex-wrap">
                <view v-for="(i,k) in haImageUrls" :key="k" class="ml-20 mt-20" @click="previewImg(i,haImageUrls)">
                    <u-image :src="i" width="80" height="80"></u-image>
                </view>
            </view>
        </view>
        <view class="examine">
            <box-title title="审核信息" class="box-title"></box-title>
            <view class="row flex j-c-s-b a-i-c">
                <text>审核状态</text>
                <text class="row-right">{{form.confirmFlag}}</text>
            </view>
            <view class="row flex j-c-s-b a-i-c" v-if="remark">
                <text class="f-28">审核状态</text>
                <text class="row-right">{{remark}}</text>
            </view>
            <!-- <view class="info">
                <u-form labelWidth="70" :model="form" ref="form" class="form">
                    <u-form-item label="审核状态" @click="isPickerShow = true" class="form-item" :border-bottom="true">
                        <u--input v-model="form.confirmFlag" disabled disabledColor="#ffffff" placeholder="请选择审核状态"
                            :border="false"></u--input>
                        <u-icon slot="right" name="arrow-right"></u-icon>
                    </u-form-item>
                    <u-form-item label="备注" class="form-item" v-if="selectStatus == 3">
                        <u--input type="textarea" v-model="remark"></u--input>
                    </u-form-item>
                </u-form>
            </view> -->
        </view>
        <!-- <view class="bottom-btn" v-if="(roleType == 1 && status == 1) || (roleType == 2 && status == 2)">
            <u-button type="primary" @click="submit">提交审核</u-button>
        </view> -->
        <footer-btn v-if="roleType == 2 && status == 3" text="重新编辑" @click="navToEdit"></footer-btn>
        <audit-action @handle="submit" v-if="roleType == 1 && status == 1"></audit-action>
 
        <u-picker :closeOnClickOverlay="true" @close="isPickerShow = false" :show="isPickerShow" ref="uPicker"
            :columns="columns" keyName="name" @cancel="isPickerShow = false" @confirm="handleConfirm"></u-picker>
    </view>
</template>
 
<script>
    import boxTitle from "@/subPackage/workbench/components/boxTitle/index.vue"
    import lineItem from '../components/lineItem.vue'
    import {
        getSchoolReportingDetail,
        setSchoolReporting
    } from '@/api/reporting/reporting'
    import auditAction from '../components/actionBtn.vue'
    export default {
        components: {
            boxTitle,
            lineItem,
            auditAction
        },
        data() {
            return {
                basicData: [
                    // {
                    //     label: '社区名称',
                    //     name: "districtName",
                    //     value: '未完善'
                    // },
                    {
                        label: '校园名称',
                        name: 'campusName',
                        value: '未完善'
                    },
                    {
                        label: '自查时间',
                        name: 'checkTime',
                        value: '未完善'
                    },
                    {
                        label: '自查人姓名',
                        name: 'checkUserName',
                        value: '未完善'
                    },
                    {
                        label: '自查位置',
                        name: 'location',
                        value: '未完善'
                    },
                    {
                        label: '四个一工程',
                        name: 'fourOne',
                        value: '未完善'
                    },
                    {
                        label: '消防设施种类',
                        name: 'fireFacsType',
                        value: '未完善'
                    },
                    {
                        label: '消防器材数量',
                        name: 'fireFacsNums',
                        value: '未完善'
                    },
                    {
                        label: '安全通道状态',
                        name: 'scStatus',
                        value: '未完善'
                    },
                    {
                        label: '大门是否装备防撞装置',
                        name: 'antiCollision',
                        value: '未完善'
                    },
                    {
                        label: '专职保安人员',
                        name: 'fullSoNums',
                        value: '未完善'
                    },
                    {
                        label: '兼职保安人员',
                        name: 'partSoNums',
                        value: '未完善'
                    },
                    {
                        label: '学校监控总数',
                        name: 'monitorNums',
                        value: '未完善'
                    },
                    {
                        label: '监控是否全覆盖',
                        name: 'monitorOver',
                        value: '未完善'
                    },
                    {
                        label: '高空抛物监控',
                        name: 'highAltitudeMonitor',
                        value: '未完善'
                    },
                ],
                form: {
                    confirmFlag: '待审核',
                    confirmNotion: ''
                },
                isPickerShow: false,
                columns: [
                    [{
                            name: "待审核",
                            status: 1
                        },
                        {
                            name: "审核通过",
                            status: 2
                        },
                        {
                            name: "审核不通过",
                            status: 3
                        },
                    ]
                ],
                currentId: '',
                currentData: {},
                taskId: "",
                foImageUrls: [], //四个一工程照片
                fireFacsImageUrls: [], //灭火器图片
                scImageUrls: [], // 安全通道图片
                patrolImageUrls: [], //周边巡查照片
                antiCollisionImageUrls: [], //防撞装置照片
                haImageUrls: [], //高空抛物监控照片
                selectStatus: "",
                remark: "",
                roleType: "",
                status: 1,
                id: ""
            }
        },
        onLoad(option) {
            this.taskId = option.id;
            let roleName = uni.getStorageSync("activeRole").roleName
            if (roleName == "居民") {
                this.roleType = 2
            } else {
                this.roleType = 1
            }
        },
 
        onShow() {
            this.getDetailInfo();
        },
 
 
        methods: {
 
            getIndex(type) {
                let list = this.columns[0];
                for (let i = 0, ii = list.length; i < ii; i++) {
                    if (type == list[i].status) {
                        this.$set(this.form, "confirmFlag", list[i].name)
                        // this.defaultIndex = [i]
                    }
                }
            },
 
 
            getDetailInfo() {
                getSchoolReportingDetail({
                    taskId: this.taskId
                }).then(res => {
                    console.log(res);
                    let data = res.data;
                    this.id = data.id;
                    this.basicData.forEach(item => {
                        item.value = data[item.name] || "未完善"
                    })
                    this.status = data.confirmFlag;
                    this.remark = data.confirmNotion;
                    this.getIndex(data.confirmFlag)
                    this.foImageUrls = this.$setImageUrl(data.foImageUrls);
                    this.fireFacsImageUrls = this.$setImageUrl(data.fireFacsImageUrls);
                    this.patrolImageUrls = this.$setImageUrl(data.patrolImageUrls);
                    this.antiCollisionImageUrls = this.$setImageUrl(data.antiCollisionImageUrls);
                    this.haImageUrls = this.$setImageUrl(data.haImageUrls);
                    this.scImageUrls = this.$setImageUrl(data.scImageUrls);
                })
            },
 
            previewImg(current, urls) {
                uni.previewImage({
                    current,
                    urls
                })
            },
 
            handleConfirm(e) {
                this.form.confirmFlag = e.value[0].name;
                this.selectStatus = e.value[0].status;
                this.isPickerShow = false
            },
            submit(val) {
                let data = {
                    id: this.id,
                    taskId: this.taskId,
                    // status: this.selectStatus,
                    status: val.type,
                    // remark: this.remark
                    confirmNotion: val.remark
                }
                // if (this.selectStatus == 3 && !this.remark) {
                //     uni.showToast({
                //         title: "请输入拒绝原因",
                //         icon: "none"
                //     })
                //     return;
                // }
                setSchoolReporting(data).then(res => {
                    if (res.code !== 200) {
                        uni.showToast({
                            title: '更新失败',
                            icon: 'error'
                        })
 
                    } else {
                        uni.showToast({
                            title: '提交成功',
                        })
                        this.reLoadPrePage();
                    }
                })
            },
            //刷新上一页数据后返回
            reLoadPrePage() {
                let pages = getCurrentPages();
                let prePage = pages[pages.length - 2];
                prePage.$vm.currentPage = 1;
                prePage.$vm.list = [];
                prePage.$vm.getList();
                uni.navigateBack();
            },
            navToEdit() {
                uni.navigateTo({
                    url: `/subPackage/label/school?id=${this.taskId}`
                })
            }
        }
    }
</script>
 
<style lang="scss">
    .container {
        padding: 0 20rpx 130rpx;
 
        .box-title {
            margin-bottom: 15rpx;
        }
 
        .info {
            .title {
                font-size: 30rpx;
                padding-left: 10rpx;
            }
 
            .images-box {
                padding: 20rpx;
                min-height: 100rpx;
                background-color: #fff;
            }
        }
 
        .form {
            background-color: #fff;
 
            .form-item {
                padding: 0 20rpx;
 
                &:first-child {
                    border-bottom: 1rpx solid #f6f6ff;
                }
            }
        }
 
        .bottom-btn {
            position: fixed;
            left: 0;
            bottom: 0;
            padding: 20rpx;
            width: calc(100% - 40rpx);
            background-color: #fff;
            z-index: 9999;
        }
    }
 
    /deep/ .u-form-item__body__left__content__label,
    /deep/ .uni-input-placeholder {
        font-size: 30rpx;
    }
 
    .row {
        padding: 20rpx 10rpx;
        font-size: 30rpx;
        border-bottom: 1px solid #eff1f3;
 
        .row-right {
            color: #969799;
        }
    }
</style>