叶松
2023-11-21 6eaaba4f97028d581df3e019a7705d60b398c26e
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
<template>
    <view class="home_index">
        <view class="home_content">
            <u-navbar
                title="整改详情"
                bgColor="transparent"
                leftIconColor="#fff"
                titleStyle="text-align:left;width:100%;color:#fff;margin-left:40px;"
                :autoBack="true">
            </u-navbar>
            <view class="home_top_bg"></view>
            <!-- <view class="notice_header">
                <u-image class="notice_header_icon" src="@/static/time_header.png" width="88rpx" height="88rpx"></u-image>
                <view class="notice_header_time">整改截止时间:<span>2022-10-09 10:00</span></view>
            </view> -->
            <view class="notice_main" v-if="stateBtn === '1'">
                <view class="notice_main_headers">{{noticeDetails.inspectName}}</view>
                <view class="notice_main_matter">
                    <view class="notice_matter_items">
                        <view class="notice_matter_titles">问题内容:</view>
                        <view class="notice_matter_datas">{{noticeDetails.inspectContent}}</view>
                    </view>
                    <view style="height:450px;overflow: auto;">
                        <view class="notice_matter_phone" v-for="(item,index) in ArrNotice" :key="index">
                            <!-- <u-image :src="`https://szpipe.thhy-tj.com/${item.imgPath}`" ></u-image> -->
                            <u-album :urls="[`https://szpipe.thhy-tj.com/${item.imgPath}`]"></u-album>
                        </view>
                    </view>
                    <view class="items_tyle" style="margin:10px 0">
                        <view style="color: #333333;font-size: 17px;margin-bottom:10px;">整改内容:</view>
                        <u--textarea v-model="inspectContent" placeholder="请输入整改内容" height="100"></u--textarea>
                    </view>
                    <view class="notice_matter_items">
                        <view class="notice_matter_titles">上传整改后照片:</view>
                    </view>
                    <view class="notice_matter_uoplod">
                        <u-upload
                            :fileList="imageList"
                            @afterRead="afterRead"
                            @delete="deleteImage"
                            name="6"
                            :maxCount="1"
                            width="150"
                            height="150">
                            <image src="@/static/upload_image.png" mode="widthFix" style="width: 64px!important;height:100px!important;display: flex;justify-content: center;"></image>
                            <view style="text-align: center;font-size: 16px;color: #666666;">上传照片</view>
                        </u-upload>
                    </view>
                </view>
            </view>
            <view class="notice_footer_btn" v-if="stateBtn === '1'">
                <u-button type="primary" text="提交" color="#1976FF" @click="submintBtn"></u-button>
            </view>
            <view class="notice_details" v-else>
                <view class="notice_main_headers">{{noticeDetails.inspectName}}</view>
                <view class="notice_main_matter">
                    <view class="notice_matter_items">
                        <view class="notice_matter_titles">问题内容:</view>
                        <view class="notice_matter_datas">{{noticeDetails.inspectContent}}</view>
                    </view>
                    <view style="height:450px;overflow: auto;">
                        <view class="notice_matter_phone" v-for="(item,index) in ArrNotice" :key="index">
                            <!-- <u-image :src="`https://szpipe.thhy-tj.com/${item.imgPath}`" @click="clickImgs"></u-image> -->
                            <u-album :urls="[`https://szpipe.thhy-tj.com/${item.imgPath}`]"></u-album>
                        </view>
                    </view>
                    <view class="notice_matter_items" style="margin-top:10px">
                        <view class="notice_matter_titles">整改结果:</view>
                        <view class="notice_matter_datas">{{noticeDetails.inspectContent}}</view>
                    </view>
                    <view style="overflow: auto;height:100%">
                        <view class="notice_matter_phone" v-for="(item,index) in overArrNotice" :key="index">
                            <!-- <u-image :src="`https://szpipe.thhy-tj.com/${item.imgPath}`" ></u-image> -->
                            <u-album :urls="[`https://szpipe.thhy-tj.com/${item.imgPath}`]"></u-album>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import {basrUrl} from '@/api/http.js'
    import { throttle } from '../../plugins/public.js';
    export default {
        data(){
            return{
                stateBtn:null,//1:待整改 2:已整改
                imageList:[],//上传的图片
                noticeDetails:null,//整改详情
                secureInspectId:null,//id
                overArrNotice:[],//整改结果图片
                ArrNotice:[],//未整改图片
                inspectContent:"",//整改内容
            }
        },
        onLoad(option) {
            this.stateBtn = option.isState
            this.secureInspectId = option.secureInspectId
            this.getDetailsInfo(option.secureInspectId)
        },
        methods:{
            //点击图片
            clickImgs(val){
                console.log(val)
            },
            //提交按钮
            submintBtn: throttle(function() {
                if(this.imageList.length!==0 &&this.inspectContent!==""){
                    const params ={
                        secureInspectId:this.secureInspectId,
                        feedbackContent:this.inspectContent,
                        isType:2
                    }
                    params.files = this.imageList.map(item=>{
                        return item.data
                    });
                    this.$api.labourSystem.submitNoticeBtn(params).then((res) => {
                        if(res.success) {
                            uni.$u.toast("提交成功!");
                            uni.redirectTo({
                                url: './noticeIndex'
                            });
                        } else {
                            uni.$u.toast(res.statusMsg);
                        }
                    })
                }else{
                    uni.$u.toast('请输入所有项');
                    return false
                }
            }, 3000),
            //获取信息详情
            getDetailsInfo(val){
                this.$api.reboSystem.detailsCheckSafe({secureInspectId:val}).then(res=>{
                    if(res.statusMsg === 'ok'){
                        this.noticeDetails = res.data
                        this.overArrNotice = res.data.tsecureInspectPaths.filter(item=>item.isType ===2)
                        this.ArrNotice = res.data.tsecureInspectPaths.filter(item=>item.isType ===1)
                    }else{
                        uni.$u.toast(res.statusMsg);
                    }
                })
            },
            // 读取图片后
            afterRead(event) {
                this.imageList.push({
                    status: 'loading',
                    message: '上传中',
                })
                uni.uploadFile({
                    url: `${basrUrl}/file/file/upload`,
                    fileType: 'image',
                    filePath: event.file.url,
                    name: 'file',
                    success: (res) => {
                        const data = JSON.parse(res.data);
                        this.$set(this.imageList, this.imageList.length - 1, {
                            id: this.imageList.length + 1,
                            status: 'success',
                            message: '',
                            data: data.data,
                            url: `https://szpipe.thhy-tj.com/${data.data}`
                        })
                    },
                    fail: (error) => {
                        uni.$u.toast('上传失败!');
                    }
                })
            },
            // 删除图片
            deleteImage(event) {
                this.$nextTick(() => {
                    this.imageList.splice(event.index, 1);
                })
            },
        }
    }
</script>
 
<style scoped lang="scss">
    .home_index{
        background-color: #F6F6F6;
        width: 100%;
        height: 100vh;
        overflow: hidden;
        position: relative;
        .home_content{
            // position: relative;
            height: 100%;
            .home_top_bg{
                background: url('https://s1.ax1x.com/2022/09/14/vvBuYq.png') no-repeat;
                background-size: 100% 100%;
                height: 40vh;
                position: absolute;
                left: 0;
                top: 0;
                right: 0;
            }
            .notice_header{
                height: 148px;
                margin: 0px 15px;
                position: absolute;
                top: 50px;
                right: 0;
                left: 0;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
                
                .notice_header_icon{
                    width: 100%;
                    height: 100%;
                }
                .notice_header_time{
                    margin-top: 15px;
                    font-size: 16px;
                    color: #FFFFFF;
                }
            }
            .notice_details{
                height:100%;
                // overflow: auto;
                position: absolute;
                top: 110px;
                left: 0px;
                right: 0px;
                margin: 0 15px;
                border-radius: 6px;
                padding:15px ;
                background-color: #FFFFFF;
                
                .notice_main_headers{
                    color:#1977FF;
                    font-size: 17px;
                }
                .notice_main_matter{
                    height: 95%;
                    margin-top: 15px;
                    display: flex;
                    flex-direction:  column;
                    .notice_matter_items{
                        display: flex;
                        flex-direction:row;
                        
                        .notice_matter_titles{
                            flex: none;
                            color: #333333;
                            font-size: 17px;
                            margin-left: 10px;
                            position: relative;
                            &::before{
                                content: "";
                                width: 3px;
                                height: 18px;
                                background-color: #1977FF;
                                position: absolute;
                                top: 3px;
                                left: -10px;
                            }
                        }
                        .notice_matter_datas{
                            color: #AEAEAE;
                            font-size: 17px;
                        }
                    }
                    .notice_matter_phone{
                        margin-top: 10px;
                        margin-bottom: 10px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                    }
                }
            }
            .notice_main{
                height:calc(100% - 174px);
                position: absolute;
                top: 110px;
                left: 0px;
                right: 0px;
                margin: 0 15px;
                border-radius: 6px;
                padding:15px ;
                // overflow: auto;
                background-color: #FFFFFF;
                
                .notice_main_headers{
                    color:#1977FF;
                    font-size: 17px;
                }
                .notice_main_matter{
                    height: calc(100% - 30px);
                    // overflow: auto;
                    margin-top: 15px;
                    display: flex;
                    flex-direction:  column;
                    .notice_matter_items{
                        display: flex;
                        flex-direction:row;
                        
                        .notice_matter_titles{
                            color: #333333;
                            font-size: 17px;
                            margin-left: 10px;
                            position: relative;
                            &::before{
                                content: "";
                                width: 3px;
                                height: 18px;
                                background-color: #1977FF;
                                position: absolute;
                                top: 3px;
                                left: -10px;
                            }
                        }
                        .notice_matter_datas{
                            color: #AEAEAE;
                            font-size: 17px;
                        }
                    }
                    .notice_matter_phone{
                        margin-top: 10px;
                        margin-bottom: 10px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                    }
                    .notice_matter_uoplod{
                        margin-top: 15px;
                        // height: 18vh;
                        padding: 15px 0px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border: 1px dashed #D8D8D8;
                    }
                }
            }
            .notice_footer_btn{
                display: flex;
                align-items: center;
                height: 40px;
                position: absolute;
                bottom: -5px;
                left: 0px;
                right: 0px;
                margin: 0 15px;
            }
        }
    }
    
    ::v-deep .u-upload{
        flex: none !important;;
    }
    ::v-deep image{
        width: 320px!important;
        height: 240px!important;
    }
</style>
<style scoped>
    .items_tyle /deep/.u-form-item__body{
        flex-direction: column !important;
    }
    .notice_matter_uoplod /deep/ image{
        width: 64px!important;
        height: 64px!important;
    }
</style>