ClientManagerment.vue 16.6 KB
Newer Older
feifei's avatar
feifei committed
1 2
<template>
  <div>
caimeng's avatar
caimeng committed
3
    <block-header title="搜索"/>
feifei's avatar
feifei committed
4
    <div class="page-search">
caimeng's avatar
caimeng committed
5
      <el-form label-suffix=":" size="small" :inline="true" :model="searchInfo" class="demo-form-inline">
feifei's avatar
feifei committed
6
        <el-form-item label="手机号">
caimeng's avatar
caimeng committed
7
          <el-input v-model="searchInfo.clientCell" placeholder="请输入手机号"></el-input>
feifei's avatar
feifei committed
8 9 10
        </el-form-item>

        <el-form-item label="产品名称">
caimeng's avatar
caimeng committed
11
          <app-select v-model="searchInfo.appName" @handleSetting="(e)=>{ searchInfo.appName = e}"/>
feifei's avatar
feifei committed
12 13 14
        </el-form-item>

        <el-form-item>
caimeng's avatar
caimeng committed
15
          <el-button size="small" type="primary" @click="onSubmit">查询</el-button>
feifei's avatar
feifei committed
16 17 18 19
        </el-form-item>
      </el-form>
    </div>

caimeng's avatar
caimeng committed
20

feifei's avatar
feifei committed
21
    <div v-show="isShow">
caimeng's avatar
caimeng committed
22
      <!--用户信息-->
caimeng's avatar
caimeng committed
23
      <block-header title="客户信息"/>
feifei's avatar
feifei committed
24 25 26 27 28 29 30
      <el-collapse v-model="activeNames">

        <el-collapse-item title="用户基本信息" name="1">
          <br/>
          <div v-if="this.clientInfo.ucUserDO !=null">
            <el-row :gutter="24" :data="clientInfo.ucUserDO" style="margin-left:50px">
              <el-col :span="16">
caimeng's avatar
caimeng committed
31
                <div class="grid-content bg-purple">客户编号:{{ clientInfo.ucUserDO.clientNo }}</div>
feifei's avatar
feifei committed
32 33 34
              </el-col>
              <br/>
              <el-col :span="16">
caimeng's avatar
caimeng committed
35
                <div class="grid-content bg-purple">姓名:{{ clientInfo.ucUserDO.realName }}</div>
feifei's avatar
feifei committed
36 37 38
              </el-col>
              <br/>
              <el-col :span="16">
caimeng's avatar
caimeng committed
39
                <div class="grid-content bg-purple">注册时间:{{ clientInfo.ucUserDO.gmtFirstLogin | dateFilter }}</div>
feifei's avatar
feifei committed
40 41 42
              </el-col>
              <br/>
              <el-col :span="16">
caimeng's avatar
caimeng committed
43
                <div class="grid-content bg-purple">末次登陆:{{ clientInfo.ucUserDO.gmtLastLogin | dateFilter }}</div>
feifei's avatar
feifei committed
44 45 46 47
              </el-col>
              <br/>
              <el-col :span="16">
                <div class="grid-content bg-purple">
caimeng's avatar
caimeng committed
48 49
                  用户状态:{{ clientFormat(clientInfo.ucUserDO.state) }}
                  <el-button style="margin-left: 30px" type="danger" size="small"
caimeng's avatar
caimeng committed
50
                             v-if="this.clientInfo.ucUserDO.state != 4" @click="handleShow">销户
caimeng's avatar
caimeng committed
51
                  </el-button>
feifei's avatar
feifei committed
52 53 54 55 56 57 58 59 60 61 62 63 64
                </div>
              </el-col>
              <br/>
            </el-row>
          </div>
        </el-collapse-item>


        <el-collapse-item title="实名认证" name="2">
          <div v-if="this.clientInfo.clientRealAuthDO !=null">
            <el-row :gutter="20" :data="clientInfo.clientRealAuthDO" style="margin-left:50px">
              <el-col :span="8">
                <div class="grid-content bg-purple">
caimeng's avatar
caimeng committed
65 66 67 68 69
                  实名认证状态:{{ realAuthFormat(clientInfo.clientRealAuthDO.state) }}
                  <el-button type="primary" size="small"
                             v-if="this.clientInfo.userFaceRecognitionDO == null || this.clientInfo.userFaceRecognitionDO.state != 1"
                             @click="resetRealAuth(clientInfo.clientRealAuthDO.clientNo)">重置实名
                  </el-button>
feifei's avatar
feifei committed
70 71 72 73 74 75 76 77
                </div>
              </el-col>
            </el-row>
          </div>
          <br/>
          <div v-if="this.clientInfo.clientRealAuthDO !=null">
            <el-row :gutter="24" :data="clientInfo.clientRealAuthDO" style="margin-left:50px">
              <el-col :span="12">
caimeng's avatar
caimeng committed
78
                <img :src="clientInfo.clientRealAuthDO.idPhotoFrontUrl" alt="" style="width: 60%;height: 60%"/>
feifei's avatar
feifei committed
79 80
              </el-col>
              <el-col :span="12">
caimeng's avatar
caimeng committed
81
                <img :src="clientInfo.clientRealAuthDO.idPhotoConUrl" alt="" style="width: 60%;height: 60%"/>
feifei's avatar
feifei committed
82 83 84 85 86 87 88 89 90 91 92 93
              </el-col>
              <br/>
            </el-row>
          </div>
        </el-collapse-item>


        <el-collapse-item title="活体认证" name="3">
          <div v-if="this.clientInfo.userFaceRecognitionDO !=null">
            <el-row :gutter="24" :data="clientInfo.userFaceRecognitionDO" style="margin-left:50px">
              <el-col :span="24">
                <div class="grid-content bg-purple">
caimeng's avatar
caimeng committed
94 95 96 97 98
                  活体认证状态:{{ faceFormat(clientInfo.userFaceRecognitionDO.state) }}
                  <el-button style="margin-left: 30px" type="primary" size="small"
                             v-if="clientInfo.userFaceRecognitionDO.state != 1"
                             @click="manuallyCheck(clientInfo.userFaceRecognitionDO.userId)">人工通过
                  </el-button>
feifei's avatar
feifei committed
99 100 101 102
                </div>
              </el-col>
              <el-col :span="24">
                <div class="grid-content bg-purple">
caimeng's avatar
caimeng committed
103 104 105 106 107
                  认证次数:{{ clientInfo.userFaceRecognitionDO.verifyTimes }}
                  <el-button style="margin-left: 30px" type="primary" size="small"
                             v-if="clientInfo.userFaceRecognitionDO.state != 1"
                             @click="resetNumber(clientInfo.userFaceRecognitionDO.userId)">重置次数
                  </el-button>
feifei's avatar
feifei committed
108 109 110
                </div>
              </el-col>
              <el-col :span="24">
caimeng's avatar
caimeng committed
111
                <div class="grid-content bg-purple">认证结果:{{ clientInfo.userFaceRecognitionDO.faceResult }}</div>
feifei's avatar
feifei committed
112 113 114 115 116 117
              </el-col>
            </el-row>

            <el-row :gutter="24" :data="clientInfo.userFaceRecognitionDO" style="margin-left:50px;margin-top: 20px">
              <el-col :span="12">
                <div class="grid-content bg-purple-light">
caimeng's avatar
caimeng committed
118 119
                  人脸照片<br/><img :src="clientInfo.userFaceRecognitionDO.faceBestImgPath" alt=""
                                style="width: 50%;height: 50%"/>
feifei's avatar
feifei committed
120 121 122 123 124 125 126 127 128 129 130 131
                </div>
              </el-col>
            </el-row>
          </div>
        </el-collapse-item>


        <el-collapse-item title="基本信息" name="4">
          <br/>
          <div v-if="this.clientInfo.clientRiskFileDO !=null">
            <el-row :gutter="24" :data="clientInfo.clientRiskFileDO" style="margin-left:50px">
              <el-col :span="16">
caimeng's avatar
caimeng committed
132 133
                <div class="grid-content bg-purple">通讯录权限:{{ fileTypeFormat(clientInfo.clientRiskFileDO.fileType) }}
                </div>
feifei's avatar
feifei committed
134 135 136 137
              </el-col>
              <br/>
            </el-row>
          </div>
feifei's avatar
feifei committed
138 139 140 141 142 143 144 145
          <div v-else>
            <el-row :gutter="24" style="margin-left:50px">
              <el-col :span="16">
                <div class="grid-content bg-purple">通讯录权限:通讯录未获取</div>
              </el-col>
              <br/>
            </el-row>
          </div>
feifei's avatar
feifei committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
          <div>
            <el-row :gutter="24" :data="clientInfo.clientRiskFileDO" style="margin-left:50px;margin-top: 30px">
              <el-col :span="16">
                <div class="grid-content bg-purple">盈火老用户数据清理(谨慎操作):
                  <el-button style="margin-left: 10px" type="danger" size="small" @click="removeUserInfo">清除</el-button>
                </div>
              </el-col>
              <br/>
            </el-row>
          </div>
        </el-collapse-item>

      </el-collapse>
    </div>

caimeng's avatar
caimeng committed
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
    <!--销户弹框-->
    <el-dialog title="销户" :visible.sync="logVisible" width="30%" :before-close="handleClose">
      <div style="margin-bottom: 20px;padding-left: 5px">正在进行销户操作,该操作不可恢复,请确认是否继续?</div>
      <br/>

      <el-form label-suffix=":" ref="logOffForm" :rules="rules" size="small" label-width="65px" :model="form"
               class="demo-form-inline">
        <el-form-item prop="memo" label="备注">
          <el-input type="textarea" v-model="form.memo" :rows="2" placeholder="请输入内容"></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="logVisible = false" size="small">取 消</el-button>
        <el-button type="primary" size="small" @click="handleLogSubmit">确 定</el-button>
      </span>
    </el-dialog>

feifei's avatar
feifei committed
179 180 181 182 183

  </div>
</template>

<script>
caimeng's avatar
caimeng committed
184 185 186 187 188 189 190 191 192 193
import * as moment from "moment";

export default {
  name: "ClientManagerment",
  data() {
    return {
      isShow: false,
      activeNames: ['1', '2', '3', '4'],
      searchInfo: {
        clientCell: '',
caimeng's avatar
caimeng committed
194
        appName: ''
caimeng's avatar
caimeng committed
195 196 197 198 199 200 201
      },
      clientInfo: {
        ucUserDO: {},
        clientRealAuthDO: {},
        userFaceRecognitionDO: {},
        clientRiskFileDO: {},
      },
caimeng's avatar
caimeng committed
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217

      rules: {
        memo: [
          {required: true, message: "请输入备注信息", trigger: 'blur'}
        ]
      },
      user: {},
      form: {
        userId: '',
        creator: '',
        clientCell: '',
        appName: '',
        memo: '',
      },
      logVisible: false,

caimeng's avatar
caimeng committed
218 219 220 221
    }
  },
  filters: {
    dateFilter: function (row) {
caimeng's avatar
caimeng committed
222
      const exp = row;
caimeng's avatar
caimeng committed
223 224
      if (!exp || typeof (exp) === undefined || typeof (exp) === null) {
        return ''
feifei's avatar
feifei committed
225
      }
caimeng's avatar
caimeng committed
226
      return moment(exp).format("YYYY-MM-DD HH:mm:ss")
caimeng's avatar
caimeng committed
227
    }
caimeng's avatar
caimeng committed
228 229 230 231 232 233 234 235
  },

  created() {
    //Vue的方法给原生调用,则需要把方法挂在Window下面
    window.clientData = this.clientData;
  },

  methods: {
caimeng's avatar
caimeng committed
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
    // 显示销户弹框
    handleShow() {
      const {clientCell, appName} = this.searchInfo
      this.form.appName = appName
      this.form.clientCell = clientCell

      this.logVisible = true;
    },
    // 关闭销户弹框
    handleClose() {
      this.logVisible = false;
    },
    // 注销提交
    handleLogSubmit() {
      this.$refs['logOffForm'].validate(async (valid) => {
        if (valid) {

          const form = this.form;
          const user = this.user;
          form.userId = user.userId;
          form.creator = encodeURIComponent(localStorage.getItem("userName"));
          try {
            const res = await this.$$get('/client/accountCancellation', form);
            const result = res.data;
            if (result.success) {
              this.$message({message: '销户成功', type: 'success'});
              const {clientCell, appName} = this.searchInfo;
              this.clientData(clientCell, appName);
              this.handleClose()
            }
          } catch (err) {
            this.$message({
              type: 'info',
              message: '销户失败'
            });
          }
        }
      })
    },
caimeng's avatar
caimeng committed
275 276
    /*搜索条件*/
    onSubmit() {
caimeng's avatar
caimeng committed
277
      if (this.searchInfo.clientCell === '' || this.searchInfo.appName === '') {
caimeng's avatar
caimeng committed
278 279 280 281
        this.$message({message: '手机号或产品名称不能为空', type: 'error'});
        return;
      }
      this.clientData(this.searchInfo.clientCell, this.searchInfo.appName);
feifei's avatar
feifei committed
282 283
    },

caimeng's avatar
caimeng committed
284 285 286 287 288 289 290
    clientData(record, value) {
      //查询客户数据
      this.$$get('/client/getClientInfo?cell=' + record + '&appName=' + value).then(res => {
        if (res.data.code != 200) {
          this.isShow = false;
          this.$message.error(res.data.message);
          return
feifei's avatar
feifei committed
291
        }
caimeng's avatar
caimeng committed
292
        this.isShow = true;
caimeng's avatar
caimeng committed
293 294 295 296 297
        const result = res.data.result;
        this.clientInfo = result;
        if (result.ucUserDO) {
          this.user = result.ucUserDO
        }
caimeng's avatar
caimeng committed
298 299 300 301
      }).catch(error => {
        this.$Message.error(error || '系统异常');
      });
    },
feifei's avatar
feifei committed
302

caimeng's avatar
caimeng committed
303 304 305 306 307 308 309 310
    //客户注册状态
    clientFormat(value) {
      var userStatus = value;
      if (userStatus == null || userStatus == '' || userStatus == undefined) {
        return ''
      }
      return this.$enumUtils.toMsg('ClientStatusEnum', userStatus);
    },
feifei's avatar
feifei committed
311

caimeng's avatar
caimeng committed
312 313 314 315 316 317 318 319
    //实名状态
    realAuthFormat(value) {
      var realAuthStatus = value;
      if (realAuthStatus == null || realAuthStatus == '' || realAuthStatus == undefined) {
        return ''
      }
      return this.$enumUtils.toMsg('RealAuthStatusEnum', realAuthStatus);
    },
feifei's avatar
feifei committed
320

caimeng's avatar
caimeng committed
321 322 323 324 325 326 327 328
    //活体状态
    faceFormat(value) {
      var faceStatus = value;
      if (faceStatus == null || faceStatus == '' || faceStatus == undefined) {
        return ''
      }
      return this.$enumUtils.toMsg('FaceStatusEnum', faceStatus);
    },
feifei's avatar
feifei committed
329

caimeng's avatar
caimeng committed
330 331 332 333 334 335 336 337 338 339 340 341
    //通讯录上传状态
    fileTypeFormat(value) {
      var fileTypeStatus = value;
      if (fileTypeStatus == null || fileTypeStatus == '' || fileTypeStatus == undefined) {
        return ''
      }
      if (fileTypeStatus == 1) {
        return '已获取';
      } else {
        return '无法获取获取';
      }
    },
feifei's avatar
feifei committed
342

caimeng's avatar
caimeng committed
343 344 345 346 347 348 349 350 351 352
    //重置实名
    resetRealAuth(value) {
      var clientCell = this.searchInfo.clientCell;
      var appName = this.searchInfo.appName;
      this.$confirm('正在重置实名认证, 是否继续?', '重置实名', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
刘雅文's avatar
刘雅文 committed
353
            this.$$get(`/client/resetAuthen?clientNo=${value}&appName=${appName}`)
feifei's avatar
feifei committed
354 355 356 357 358 359 360
                .then(res => {
                  if (res.data.code != 200) {
                    this.$message.error(res.data.message);
                    return
                  }
                  this.$message({message: '实名重置成功', type: 'success'});
                  done();
caimeng's avatar
caimeng committed
361
                  this.clientData(clientCell, appName);
feifei's avatar
feifei committed
362
                }).catch(err => {
caimeng's avatar
caimeng committed
363 364 365 366
              this.$Message.error(error || '系统异常');
            });
          } else {
            done();
feifei's avatar
feifei committed
367
          }
caimeng's avatar
caimeng committed
368 369 370 371 372
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消重置'
feifei's avatar
feifei committed
373
        });
caimeng's avatar
caimeng committed
374 375
      });
    },
feifei's avatar
feifei committed
376 377


caimeng's avatar
caimeng committed
378 379
    //销户
    cancelUser(record) {
caimeng's avatar
caimeng committed
380 381 382 383
      const clientCell = this.searchInfo.clientCell;
      const appName = this.searchInfo.appName;


caimeng's avatar
caimeng committed
384 385 386 387 388 389 390
      this.$confirm('正在进行销户操作, 是否继续?', '销户', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            this.$$get('/client/accountCancellation?userId=' + record.userId + '&clientCell=' + record.cell + '&appName=' + this.searchInfo.appName + '&creator=' + localStorage.getItem("userName"))
feifei's avatar
feifei committed
391 392 393 394 395 396 397
                .then(res => {
                  if (res.data.code != 200) {
                    this.$message.error(res.data.message);
                    return
                  }
                  this.$message({message: '销户成功', type: 'success'});
                  done();
caimeng's avatar
caimeng committed
398
                  this.clientData(clientCell, appName);
feifei's avatar
feifei committed
399
                }).catch(err => {
caimeng's avatar
caimeng committed
400 401 402 403
              this.$Message.error(error || '系统异常');
            });
          } else {
            done();
feifei's avatar
feifei committed
404
          }
caimeng's avatar
caimeng committed
405 406 407 408 409
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消销户'
feifei's avatar
feifei committed
410
        });
caimeng's avatar
caimeng committed
411 412
      });
    },
feifei's avatar
feifei committed
413

caimeng's avatar
caimeng committed
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428
    //活体人工通过接口
    manuallyCheck(record) {
      var clientCell = this.searchInfo.clientCell;
      var appName = this.searchInfo.appName;
      this.$$get('/client/manuallyCheck?userId=' + record).then(res => {
        if (res.data.code != 200) {
          this.$message.error(res.data.message);
          return
        }
        this.$message({message: '人工通过成功', type: 'success'});
        this.clientData(clientCell, appName);
      }).catch(error => {
        this.$Message.error(error || '系统异常');
      });
    },
feifei's avatar
feifei committed
429

caimeng's avatar
caimeng committed
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
    //重置用户认证次数
    resetNumber(record) {
      var clientCell = this.searchInfo.clientCell;
      var appName = this.searchInfo.appName;
      this.$$get('/client/resetNumber?userId=' + record).then(res => {
        if (res.data.code != 200) {
          this.$message.error(res.data.message);
          return
        }
        this.$message({message: '重置用户认证次数成功', type: 'success'});
        this.clientData(clientCell, appName);
      }).catch(error => {
        this.$Message.error(error || '系统异常');
      });
    },
feifei's avatar
feifei committed
445

caimeng's avatar
caimeng committed
446 447 448 449 450 451 452 453 454 455 456 457
    //清除用户数据
    removeUserInfo() {

      var clientCell = this.searchInfo.clientCell;
      var appName = this.searchInfo.appName;
      this.$confirm('正在进行用户数据清除操作, 是否继续?', '清除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            this.$$get('/client/removeUserInfo?cell=' + clientCell + '&appName=' + appName)
feifei's avatar
feifei committed
458 459 460 461 462 463 464
                .then(res => {
                  if (res.data.code != 200) {
                    this.$message.error(res.data.message);
                    return
                  }
                  this.$message({message: '清除用户数据成功', type: 'success'});
                  done();
caimeng's avatar
caimeng committed
465
                  this.clientData(clientCell, appName);
feifei's avatar
feifei committed
466
                }).catch(err => {
caimeng's avatar
caimeng committed
467 468 469 470
              this.$Message.error(error || '系统异常');
            });
          } else {
            done();
feifei's avatar
feifei committed
471
          }
caimeng's avatar
caimeng committed
472 473 474 475 476
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消清除'
feifei's avatar
feifei committed
477
        });
caimeng's avatar
caimeng committed
478 479
      });
    },
feifei's avatar
feifei committed
480 481

  }
caimeng's avatar
caimeng committed
482
}
feifei's avatar
feifei committed
483 484 485 486 487
</script>

<style scoped>

</style>