MrShi
2024-11-22 ba5f8ce99b414a89d1e21a650321bf373773e7ae
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
<template>
    <GlobalWindow
        :title="title"
        width="50%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <!--    退回申请    -->
            <div v-if="visible1==true"  class="form">
                <div class="form_item">
                    <div class="form_item_label"><span>*</span>填写退回说明:</div>
                    <div class="form_item_val">
                        <textarea  v-model="form.backCheckInfo" placeholder="请输入"></textarea>
                    </div>
                </div>
            </div>
        <!--    上传批单    -->
            <div v-if="visible3==true" class="form">
                <div class="form_item">
                    <div class="form_item_label">客户期望批单生效起期:</div>
                    <div class="form_item_val">{{ model.applyStartTime }}</div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">批单生效起期是否一致:</div>
                    <div class="form_item_val">
                        <el-radio-group v-model="form.selectRadio" @change="selectChange">
                            <el-radio :label="0"  >与批单一致</el-radio>
                            <el-radio :label="1" >与批单不一致</el-radio>
                        </el-radio-group>
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label"><span>*</span>批单生效起期:</div>
                    <div class="form_item_val">
                        <el-date-picker
                            v-model="form.applyStartTime"
                            type="date"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            placeholder="选择日期">
                        </el-date-picker>
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">批单生效起期:</div>
                    <div class="form_item_val">{{ form.applyStartTime }}</div>
                </div>
                <div class="form_item">
                    <div class="form_item_label"><span>*</span>批单号:</div>
                    <div class="form_item_val" >
                        <el-input v-model="form.validCode" placeholder="请输入"></el-input>
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">上传批单:</div>
                    <div class="form_item_val">
                      <UploadFile :uploadData="{ folder: 'apply',fileType:'.pdf' }" :limit="99" :fileList="form.fileList1" @remove="removePIDAN" @uploadSuccess="baoxianFileUploaded" />
                    </div>
                </div>
            </div>
        <!--    修改保险单    -->
            <div v-if="visible4==true" class="form">
                <div class="form_item">
                  <div class="form_item_label">批单生效起期:</div>
                  <div class="form_item_val">{{ model.applyStartTime }}</div>
                </div>
                <div class="form_item">
                    <div class="form_item_label"><span>*</span>批单号:</div>
                    <div class="form_item_val">
                        <el-input v-model="form.editValidCode" placeholder="请输入"></el-input>
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label"><span>*</span>上传批单:</div>
                    <div class="form_item_val">
                      <UploadFile :uploadData="{ folder: 'apply',fileType:'.pdf' }" :fileList="form.fileList2" @uploadSuccess="editBaoxianFileUploaded" />
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label"><span>*</span>修改原因:</div>
                    <div class="form_item_val">
                        <el-input placeholder="请输入" v-model="form.editCheckInfo" ></el-input>
                    </div>
                </div>
            </div>
        <!--    驳回退回申请    -->
        <div v-if="visible5==true" class="form">
            <div class="form_item">
                <div class="form_item_label"><span>*</span>填写说明:</div>
                <div class="form_item_val">
                    <textarea v-model="form.dealBackInfo"  placeholder="请输入"></textarea>
                </div>
            </div>
        </div>
        <!--    同意退回申请    -->
        <div v-if="visible6==true" class="form">
            <div class="form_item">
                <div class="form_item_label"><span>*</span>同意退回说明:</div>
                <div class="form_item_val">
                    <textarea  v-model="form.dealBackInfo"  placeholder="请输入"></textarea>
                </div>
            </div>
        </div>
      <template v-slot:footer>
        <el-button type="primary" @click="doSubmit">确 定</el-button>
        <el-button @click="visible=false">取消</el-button>
      </template>
    </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import {
  backChagne,
  uploadChangePidan,
  editChangePidan,
  dealBackChangeApply
} from '@/api/business/insuranceApply'
import UploadFile from '@/components/common/UploadFile'
export default {
  name: 'OperaApplyChangeCheckWindow',
  extends: BaseOpera,
  components: {UploadFile, GlobalWindow },
  data () {
    return {
      // 表单数据
      model: {},
      falg :0,
      form: {
          id: null,
          backCheckInfo:'',
          dealBackInfo:'',
          editCheckInfo:'',
          editValidCode: '',
          applyStartTime:null,
         validCode:null,
          pidanFile:[],
         editPidanFile:null,
          fileList1: [],
          fileList2: [],
          selectRadio:0
      },
      visible1: false,
      visible3: false,
      visible4: false,
      visible5: false,
      visible6: false,
    }
  },
  created () {
      this.config({
          api: '/business/insuranceApply',
          'field.id': 'id'
      })
  },
  methods: {
     open(title,target,flag){
       this.visible=true
       this.model={}
       this.form= {
         id: null,
         backCheckInfo:'',
         dealBackInfo:'',
         editCheckInfo:'',
         editValidCode: '',
         applyStartTime:null,
         validCode:null,
         pidanFile:[],
         editPidanFile:null,
         fileList1: [],
         fileList2: [],
         selectRadio:0
       },
       this.model=target
       this.form.applyStartTime=this.model.applyStartTime
       this.form.editValidCode=this.model.validCode
       this.title=title
       this.flag = flag
       this.visible1 = false
       this.visible3 = false
       this.visible4 = false
       this.visible5 = false
       this.visible6 = false
       if(flag == 1){
         this.visible1 = true
       }
       if(flag == 3){
         this.visible3 = true
       }
       if(flag == 4){
         this.visible4 = true
       }
       if(flag == 5){
         this.visible5 = true
       }
       if(flag == 6){
         this.visible6 = true
       }
     },
    doSubmit(){
      if (this.flag == 1) {
        this.backDo()
      } else if (this.flag == 3) {
        this.uploadPidan()
      } else if (this.flag == 4) {
        this.editPidan()
      } else if (this.flag == 5) {
        this.dealBackApply(1)
      } else if (this.flag == 6) {
        this.dealBackApply(0)
      }
    },
    selectChange(){
       if(this.form.selectRadio == 0){
         this.form.applyStartTime = this.model.validTime
       }else{
 
       }
    },
    baoxianFileUploaded(data){
      this.form.pidanFile.push(data)
    },
      removePIDAN(e) {
          this.form.pidanFile.forEach((item, index) => {
              if (item.imgaddr === e) {
                  this.form.pidanFile.splice(index, 1)
              }
          })
      },
    editBaoxianFileUploaded(data){
      this.form.editPidanFile=data
    },
    backDo(){
      this.$dialog.messageConfirm('确认进行该操作吗?')
          .then(() => {
            this.isWorking = true
            backChagne({id:this.model.id,checkInfo:this.form.backCheckInfo})
                .then(response => {
                  this.visible = false
                  this.$emit('success')
                  }).catch(err => {
                this.$tip.apiFailed(err)
                 })
          })
    },
    dealBackApply(type){
      this.$dialog.messageConfirm('确认进行该操作吗?')
          .then(() => {
            this.isWorking = true
            dealBackChangeApply({ id: this.model.id, checkInfo: this.form.dealBackInfo, dealBackApply: type })
                .then(response => {
                  this.visible = false
                  this.$emit('success')
                }).catch(err => {
                  this.$tip.apiFailed(err)
                })
          })
    },
    uploadPidan(){
      this.$dialog.messageConfirm('确认进行该操作吗?')
          .then(() => {
            this.isWorking = true
            uploadChangePidan({id:this.model.id,applyStartTime:this.form.applyStartTime, validCode:this.form.validCode,pidanFile:this.form.pidanFile})
                .then(response => {
                  this.visible = false
                  this.$emit('success')
                }).catch(err => {
                  this.$tip.apiFailed(err)
                })
          })
 
    },
    editPidan(){
      this.$dialog.messageConfirm('确认进行该操作吗?')
          .then(() => {
            this.isWorking = true
            editChangePidan({id:this.model.id, checkInfo:this.form.editCheckInfo,validCode:this.form.editValidCode,pidanFile:this.form.editPidanFile})
                .then(response => {
                  this.visible = false
                  this.$emit('success')
                }).catch(err => {
                  this.$tip.apiFailed(err)
                })
          })
    },
      handleRemove(file, fileList) {
          console.log(file, fileList);
      },
      handlePreview(file) {
          console.log(file);
      },
      handleExceed(files, fileList) {
          this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
      },
      beforeRemove(file, fileList) {
          return this.$confirm(`确定移除 ${ file.name }?`);
      },
      successEvent() {
 
      },
      handleSizeChange(val) {
          console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
          console.log(`当前页: ${val}`);
      },
      handleClick(tab, event) {
          console.log(tab, event);
      },
      onSubmit() {
 
      }
  }
}
</script>
<style>
 
</style>
<style lang="scss" scoped>
    .form {
        width: 100%;
        display: flex;
        align-items: center;
        flex-direction: column;
        .form_span {
            width: 100%;
            display: flex;
            align-items: start;
            flex-direction: column;
            margin-bottom: 20px;
            span {
                font-size: 14px;
                &:nth-child(1) {
                    color: black;
                    margin-bottom: 5px;
                }
                &:nth-child(2) {
                    color: #8c939d;
                }
            }
        }
        .form_item {
            width: 100%;
            display: flex;
            align-items: center;
            margin-bottom: 20px;
            &:last-child {
                margin: 0 !important;
            }
            .form_item_label {
                flex-shrink: 0;
                width: 170px;
                color: black;
                font-size: 14px;
                span {
                    color: red;
                    font-size: 14px;
                }
            }
            .form_item_val {
                flex: 1;
                /*height: 40px;*/
                margin-left: 20px;
                textarea {
                    width: 100%;
                    height: 70px;
                    border: 1px solid #cbcbcb;
                    padding: 10px;
                    outline: none;
                    box-sizing: border-box;
                }
                input {
                    width: 100%;
                    height: 40px;
                    outline: none;
                    border-radius: 5px;
                    border: 1px solid #cbcbcb;
                    padding: 0 20px;
                    box-sizing: border-box;
                }
            }
        }
    }
    .desc {
        width: 100%;
        .desc_item {
            width: 100%;
            display: flex;
            flex-direction: column;
            .desc_item_label {
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 10px;
                span {
                    font-size: 14px;
                    color: black;
                    margin-right: 30px;
                }
            }
            .desc_item_from {
                width: 100%;
                margin-bottom: 10px;
                .desc_item_from_page {
                    width: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: end;
                    margin-top: 10px;
                }
            }
            .desc_item_cate {
                width: 100%;
                margin-bottom: 10px;
            }
            .desc_item_search {
                width: 100%;
                margin-bottom: 20px;
            }
            .desc_item_review {
                width: 100%;
                .desc_item_review_label {
                    font-size: 20px;
                    color: black;
                    font-weight: bold;
                    margin-bottom: 15px;
                }
            }
        }
    }
</style>