|
@@ -0,0 +1,205 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="create-container">
|
|
|
|
+ <div class="create-body">
|
|
|
|
+ <div class="title">个人信息认证</div>
|
|
|
|
+ <el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
|
|
|
|
+ <el-form-item label="姓名" prop="name">
|
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.name"></el-input>
|
|
|
|
+ <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item prop="file" label="手持身份证照片">
|
|
|
|
+ <el-upload
|
|
|
|
+ v-if="isModifyMode"
|
|
|
|
+ drag
|
|
|
|
+ class="upload-demo"
|
|
|
|
+ action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
+ :before-remove="beforeRemove"
|
|
|
|
+ multiple
|
|
|
|
+ :limit="1"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ :on-exceed="handleExceed"
|
|
|
|
+ :before-upload="beforeFileUpload"
|
|
|
|
+ :http-request="uploadFile"
|
|
|
|
+ :file-list="authentication.photo"
|
|
|
|
+ >
|
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
|
+ <div class="el-upload__text">
|
|
|
|
+ 将文件拖到此处,或
|
|
|
|
+ <em>点击上传</em>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="el-upload__tip" slot="tip">请上传头像</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <!--<div v-if="!isModifyMode">-->
|
|
|
|
+ <!--<span v-if="authentication.photo==null">暂无文件</span>-->
|
|
|
|
+ <!--<a :href="authentication.photo" v-if="authentication.photo!=null"><i class="fa fa-file-text-o"></i>-->
|
|
|
|
+ <!--{{authentication.photo}}</a>-->
|
|
|
|
+ <!--</div>-->
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="身份证号" prop="name">
|
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.idNumber"></el-input>
|
|
|
|
+ <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="银行卡账户" prop="name">
|
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
|
|
|
|
+ <!--<span v-if="!isModifyMode">{{authentication.bankAccount}}</span>-->
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="地址" prop="name">
|
|
|
|
+ <el-input v-if="isModifyMode" v-model="authentication.address"></el-input>
|
|
|
|
+ <!--<span v-if="!isModifyMode">{{authentication.address}}</span>-->
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <!--<el-form-item v-if="!isModifyMode">-->
|
|
|
|
+ <!--<div class="btn btn-medium btn-info" @click="modifyInfo()">修改</div>-->
|
|
|
|
+ <!--<div class="btn btn-medium" @click="cancelModify()">返回</div>-->
|
|
|
|
+ <!--</el-form-item>-->
|
|
|
|
+ <el-form-item v-if="isModifyMode">
|
|
|
|
+ <div class="btn btn-primary btn-info" @click="submitInfo()">提交</div>
|
|
|
|
+ <!--<div class="btn btn-primary" @click="cancelModify()">取消</div>-->
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import Http from '@/js/http'
|
|
|
|
+import Apis from '@/js/api'
|
|
|
|
+import {notify} from '@/constants/index'
|
|
|
|
+import {getAllAgencyResourceTypes, getAllServiceTypes} from '@/js/index'
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: 'IndividualAuthentication',
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ userId: 0,
|
|
|
|
+ isModifyMode: true,
|
|
|
|
+ authentication: {
|
|
|
|
+ photo: [],
|
|
|
|
+ photoUrl: '',
|
|
|
|
+ name: '',
|
|
|
|
+ idNumber: '',
|
|
|
|
+ bankAccount: '',
|
|
|
|
+ address: '',
|
|
|
|
+ },
|
|
|
|
+ rules: {
|
|
|
|
+ // name: [
|
|
|
|
+ // {required: true, message: '请输入报告名称', trigger: 'blur'}
|
|
|
|
+ // // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
|
|
|
|
+ // ],
|
|
|
|
+ // abstract: [
|
|
|
|
+ // {
|
|
|
|
+ // required: true,
|
|
|
|
+ // message: '请输入摘要信息',
|
|
|
|
+ // trigger: 'change'
|
|
|
|
+ // }
|
|
|
|
+ // ],
|
|
|
|
+ // type: [
|
|
|
|
+ // {required: true, message: '请选择报告类型', trigger: 'change'}
|
|
|
|
+ // ],
|
|
|
|
+ // conclusion: [
|
|
|
|
+ // {required: true, message: '请输入报告结论', trigger: 'blur'}
|
|
|
|
+ // ]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted () {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.init()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ //初始化数据
|
|
|
|
+ init () {
|
|
|
|
+ },
|
|
|
|
+ //加载数据
|
|
|
|
+ loadData: function () {
|
|
|
|
+ },
|
|
|
|
+ //表单进入可编辑状态,可修改表单,不再使用
|
|
|
|
+ modifyInfo () {
|
|
|
|
+ this.isModifyMode = true
|
|
|
|
+ },
|
|
|
|
+ //提交认证信息
|
|
|
|
+ submitInfo () {
|
|
|
|
+ //this.isModifyMode = false
|
|
|
|
+ const newAuthentication = {
|
|
|
|
+ mobile: this.authentication.mobile,
|
|
|
|
+ evaluationAgencyName: this.authentication.name,
|
|
|
|
+ bankAccount: this.authentication.bankAccount,
|
|
|
|
+ address: this.authentication.address,
|
|
|
|
+ abilities: this.authentication.ability,
|
|
|
|
+ resources: this.authentication.resource,
|
|
|
|
+ agencyPhoto: this.authentication.photoUrl,
|
|
|
|
+ }
|
|
|
|
+ Http.post(Apis.USER.AGENCY_AUTHENTICATION.replace('{userId}', 3), newAuthentication).then((res) => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ notify('success', '认证信息上传成功')
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ notify('error', error.data.msg)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //取消修改表单,表单进入不可编辑状态,不再使用
|
|
|
|
+ cancelModify () {
|
|
|
|
+ this.isModifyMode = false
|
|
|
|
+ },
|
|
|
|
+ //上传文件时移除文件的响应函数
|
|
|
|
+ handleRemove (file, fileList) {
|
|
|
|
+ console.log(file, fileList)
|
|
|
|
+ },
|
|
|
|
+ //添加文件时的响应函数
|
|
|
|
+ handleExceed (files, fileList) {
|
|
|
|
+ this.$message.warning(
|
|
|
|
+ `当前限制选择 1 个文件,本次选择了 ${
|
|
|
|
+ files.length
|
|
|
|
+ } 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ //移除文件前的响应函数
|
|
|
|
+ beforeRemove (file, fileList) {
|
|
|
|
+ //return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
|
+ },
|
|
|
|
+ //文件上传前的响应函数
|
|
|
|
+ beforeFileUpload () {
|
|
|
|
+ },
|
|
|
|
+ //上传文件,此处为上传图片
|
|
|
|
+ uploadFile (param) {
|
|
|
|
+ const formData = new FormData()
|
|
|
|
+ let config = {
|
|
|
|
+ //添加请求头
|
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'},
|
|
|
|
+ }
|
|
|
|
+ formData.append('file', param.file)
|
|
|
|
+ Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', 3), formData, config).then((res) => {
|
|
|
|
+ console.log('上传成功')
|
|
|
|
+ this.authentication.photoUrl = res.data
|
|
|
|
+ console.log(res.data)
|
|
|
|
+ notify('success', '上传成功')
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ notify('error', error.data.msg)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created: function () {
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+ .el-radio {
|
|
|
|
+ margin: 10px 20px 10px 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-form-item /deep/ .el-tabs__content {
|
|
|
|
+ max-height: 120px !important;
|
|
|
|
+ overflow: auto;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-row {
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-input {
|
|
|
|
+ width: 400px;
|
|
|
|
+ }
|
|
|
|
+</style>
|