MrShi
2024-11-13 b496da6315314d9bd048ac2214d8bc95d2f1df02
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
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :withFooter="false"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <div class="info">
            <div class="info_label">
                <span>企业详情</span>
                <div>
                    <el-button type="primary" @click="$refs.modification.open('修改保险方案', form)">更改保险方案</el-button>
                    <el-button type="primary" @click="$refs.operaCompanyWindow.open('编辑企业信息', form)">修改企业信息</el-button>
                </div>
            </div>
            <div class="info_list">
                <div class="info_list_item">
                    <div class="info_list_item_label">企业名称:</div>
                    <div class="info_list_item_val">{{form.name || '-'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">统一信用代码:</div>
                    <div class="info_list_item_val">{{form.code || '-'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">公司账号:</div>
                    <div class="info_list_item_val">{{form.username || '-'}}</div>
                </div>
              <div class="info_list_item">
                <div class="info_list_item_label">法人姓名:</div>
                <div class="info_list_item_val">{{form.legalName || '-'}}</div>
              </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">绑定手机号:</div>
                    <div class="info_list_item_val">
                        {{form.phone || '-'}}
                        <el-button type="primary" size="mini" style="margin-left: 10px;" @click="visiblePhone = true">更改绑定</el-button>
                    </div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">认证邮箱:</div>
                    <div class="info_list_item_val">{{form.email || '-'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">纳税人识别号:</div>
                    <div class="info_list_item_val">{{form.taxCode || '-'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">开户行:</div>
                    <div class="info_list_item_val">{{form.taxBank || '-'}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">银行账号:</div>
                    <div class="info_list_item_val">{{form.taxAccount || '-'}}</div>
                </div>
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">地址、电话:</div>
                    <div class="info_list_item_val">{{form.taxAddr || '-'}}</div>
                </div>
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">电子发票接收地址:</div>
                    <div class="info_list_item_val">{{form.invoiceEmail || '-'}}</div>
                </div>
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">纸质发票接收地址:</div>
                    <div class="info_list_item_val">{{form.invoiceAddr || '-'}}</div>
                </div>
            </div>
            <el-table
                :data="form.solutionListName"
                border
                style="width: 100%; margin-bottom: 20px;">
                <el-table-column
                    label="序号"
                    align="center"
                    width="80">
                    <template slot-scope="scope">
                        <span>{{scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="solutionName"
                    align="center"
                    label="保险方案">
                </el-table-column>
                <el-table-column
                    prop="shopName"
                    align="center"
                    label="委托商户">
                </el-table-column>
                <el-table-column
                    align="center"
                    label="加减保功能">
                    <template slot-scope="{row}">
                        <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canAdd">加保</el-checkbox>
                        <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canReduce">减保</el-checkbox>
                    </template>
                </el-table-column>
                <el-table-column
                    align="center"
                    label="签署状态">
                    <template slot-scope="{row}">
                        <template v-if="row.signStatus == 0">待签署</template>
                        <template v-else-if="row.signStatus == 1">已签署</template>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="signDate"
                    align="center"
                    label="签署时间">
                </el-table-column>
                <el-table-column
                    prop="signUserName"
                    align="center"
                    label="签署人">
                </el-table-column>
                <el-table-column
                    label="操作">
                    <template slot-scope="{row}">
                        <el-button type="text" v-if="row.signStatus === 1" @click="openFile(row.fileSignUrl)">查看签署方案书</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="info_list" v-if="JSON.stringify(form) !== '{}'">
                <div class="info_list_item">
                    <div class="info_list_item_label" style="width: 100px;">营业执照:</div>
                    <div class="info_list_item_val">
                        <div class="image" v-if="form.businessImg && form.businessImg.fileurlFull">
                          <el-image
                              v-if="form.businessImg!=null&&form.businessImg.fileurlFull!=null"
                              style="width: 90px; height: 90px"
                              :src="form.businessImg.fileurlFull"
                              :preview-src-list="[form.businessImg.fileurlFull]">
                          </el-image>
                        </div>
                    </div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label" style="width: 100px;">法人身份证:</div>
                    <div class="info_list_item_val">
                        <div class="image" v-if="form.idcardImgList && form.idcardImgList .length>0 && form.idcardImgList[0].fileurlFull">
                           <el-image
                              append-to-body
                              v-if="form.idcardImgList[0].fileurlFull"
                              style="width: 90px; height: 90px"
                              :src="form.idcardImgList[0].fileurlFull"
                              :preview-src-list="[form.idcardImgList[0].fileurlFull]">
                          </el-image>
                        </div>
                        <div class="image" v-if="form.idcardImgList && form.idcardImgList .length>1 && form.idcardImgList[1].fileurlFull">
                           <el-image
                              append-to-body
                              v-if="form.idcardImgList[1].fileurlFull"
                              style="width: 90px; height: 90px"
                              :src="form.idcardImgList[1].fileurlFull"
                              :preview-src-list="[form.idcardImgList[1].fileurlFull]">
                          </el-image>
                        </div>
                    </div>
                </div>
<!--                <div class="info_list_item">
                    <div class="info_list_item_label" style="width: 100px;">企业签章:</div>
                    <div class="info_list_item_val">
                        <div class="image" v-if="form.signImg && form.signImg.fileurlFull">
                          <el-image
                              v-if="form.signImg.fileurlFull!=null"
                              style="width: 90px; height: 90px"
                              :src="form.signImg.fileurlFull"
                              :preview-src-list="[form.signImg.fileurlFull]">
                          </el-image>
                        </div>
                    </div>
                </div>-->
            </div>
        </div>
        <!-- 新建/修改 -->
        <OperaCompanyWindow ref="operaCompanyWindow" @success="callback"/>
        <!-- 修改保险方案 -->
        <modification ref="modification" @success="callback"/>
        <!-- 修改手机号 -->
        <el-dialog
            title="更改绑定手机号"
            :visible.sync="visiblePhone"
            width="500px"
            :modal="false"
            :show-close="false"
            :close-on-click-modal="false"
            center>
            <div class="form">
                <div class="form_item">
                    <div class="form_item_label">绑定手机号:</div>
                    <div class="form_item_val">
                        <el-input v-model="phone" placeholder="请输入"></el-input>
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">验证码:</div>
                    <div class="form_item_val">
                        <el-input v-model="code" placeholder="请输入"></el-input>
                        <el-button type="primary" style="margin-left: 20px;" @click="send" v-if="num === 0">发送验证码</el-button>
                        <el-button type="primary" style="flex-shrink: 0; margin-left: 15px;" v-else>{{num}}s</el-button>
                    </div>
                </div>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="close">取 消</el-button>
                <el-button type="primary" @click="updatePhoneEvent">提 交</el-button>
            </span>
        </el-dialog>
    </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
import modification from '@/components/business/modification'
import { getById, updatePhone } from '@/api/business/company'
import { listForCompany } from '@/api/business/solutions'
import { sendSms } from '@/api/business/smsEmail'
export default {
  name: 'OperaCompanyDescWindow',
  extends: BaseOpera,
  components: { GlobalWindow, OperaCompanyWindow, modification },
  data () {
    return {
      ruleForm: {
        phone: '',
        code: ''
      },
      dataId: null,
      num: 0,
      timer: null,
      // 表单数据
      form: {},
      phone: '',
      code: '',
      visiblePhone: false,
      options: [],
      tableData: []
    }
  },
  created () {
    this.config({
      api: '/business/company',
      'field.id': 'id'
    })
  },
  methods: {
    openFile(url) {
      window.open(url)
    },
    close () {
      this.visiblePhone = false
      this.phone = ''
      this.code = ''
      clearInterval(this.timer)
      this.num = 0
    },
    updatePhoneEvent () {
      if (!this.phone) {
        this.$message.warning('请输入手机号')
        return
      }
      if (!this.code) {
        this.$message.warning('请输入验证码')
        return
      }
      updatePhone({
        id: this.form.id,
        captche: this.code,
        phone: this.phone
      }).then(res => {
        this.form.phone = JSON.parse(JSON.stringify(this.phone))
        this.$message.success('操作成功')
        this.visiblePhone = false
        this.phone = ''
        this.code = ''
        clearInterval(this.timer)
        this.num = 0
      }) .catch(e => {
        this.$tip.apiFailed(e)
      })
    },
    send () {
      if (!this.phone) {
        this.$message.warning('请输入手机号')
        return
      }
      sendSms({ phone: this.phone })
        .then(res => {
          this.num = 60
          this.setTime()
        }) .catch(e => {
        this.$tip.apiFailed(e)
         })
    },
    setTime () {
      this.timer = setInterval(() => {
        this.num -= 1
        if (this.num === 0) {
          clearInterval(this.timer)
          this.num = 0
        }
      }, 1000)
    },
    open (title, target) {
      const that = this
      this.title = title
      this.dataId = target.id
      this.phone = ''
      this.code = ''
      clearInterval(this.timer)
      this.num = 0
      this.getDetail()
    },
    getDetail () {
      var that = this
      getById(this.dataId)
        .then(res => {
          this.form = res
          this.form.type = 1
 
          this.form.file = {
            imgurl: '',
            imgurlfull: ''
          }
          this.form.file1 = {
            imgurl: '',
            imgurlfull: ''
          }
          this.form.file2 = {
            imgurl: '',
            imgurlfull: ''
          }
          this.form.file3 = {
            imgurl: '',
            imgurlfull: ''
          }
          if(res.businessImg){
            this.form.file.imgurl = res.businessImg.fileurl
            this.form.file.imgurlfull = res.businessImg.fileurlFull
          }
          if (res.idcardImgList&& res.idcardImgList.length>0) {
            this.form.file1.imgurl = res.idcardImgList[0].fileurl
            this.form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
          }
          if (res.idcardImgList && res.idcardImgList.length>1) {
            this.form.file2.imgurl = res.idcardImgList[1].fileurl
            this.form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
          }
          if (res.signImg) {
            this.form.file3.imgurl = res.signImg.fileurl
            this.form.file3.imgurlfull = res.signImg.fileurlFull
          }
 
          listForCompany({ companyId: this.dataId })
            .then(resa => {
              that.form.solutionList = resa.map(item => {
                return {
                  solutionBaseId: item.solutionBaseId,
                  shopId: item.shopId,
                  canAdd: item.canAdd,
                  canReduce: item.canReduce
                }
              })
              that.form.solutionListName = resa.map(item => {
                return {
                  solutionName: item.solutionName,
                  shopName: item.shopName,
                  canAdd: item.canAdd,
                  canReduce: item.canReduce,
                  ...item
                }
              })
              console.log(that.form)
              that.visible = true
            })
        })
    },
    callback () {
      this.getDetail()
      this.$emit('success')
      // this.visible = false
    }
  }
}
</script>
 
<style lang="scss" scoped>
    .form {
        width: 100%;
        display: flex;
        flex-direction: column;
        .form_item {
            width: 100%;
            display: flex;
            align-items: center;
            margin-bottom: 20px;
            &:last-child {
                margin-bottom: 0 !important;
            }
            .form_item_label {
                width: 100px;
                flex-shrink: 0;
                font-size: 14px;
                color: black;
            }
            .form_item_val {
                flex: 1;
                height: 35px;
                display: flex;
                align-items: center;
                input {
                    width: 100%;
                    height: 100%;
                    font-size: 14px;
                    color: black;
                    padding: 5px 10px;
                    outline: none;
                    box-sizing: border-box;
                    border: 1px solid #ececec;
                }
            }
        }
    }
    .info {
        width: 100%;
        .info_label {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            span {
                font-size: 18px;
                font-weight: 500;
                color: #000000;
            }
        }
        .info_list {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            .info_list_item {
                width: 33.3%;
                display: flex;
                align-items: start;
                margin-bottom: 20px;
                .info_list_item_label {
                    /*width: 150px;*/
                    flex-shrink: 0;
                }
                .info_list_item_val {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    .image {
                        width: 100px;
                        height: 100px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        overflow: hidden;
                        margin-right: 10px;
                        &:last-child {
                            margin: 0 !important;
                        }
                        img {
                            width: 100%;
                        }
                    }
                }
            }
        }
    }
</style>