|
@@ -1,10 +1,11 @@
|
|
<template>
|
|
<template>
|
|
<div class="create-container">
|
|
<div class="create-container">
|
|
- <div class="create-body" v-loading="loading">
|
|
|
|
|
|
+ <div class="create-body" v-loading="loading" style="width: 100%">
|
|
<div class="title">测评机构认证</div>
|
|
<div class="title">测评机构认证</div>
|
|
<el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
|
|
<el-form :model="authentication" :rules="rules" ref="authentication" label-width="12%" class="demo-report">
|
|
<el-form-item prop="file" label="机构logo">
|
|
<el-form-item prop="file" label="机构logo">
|
|
<el-upload
|
|
<el-upload
|
|
|
|
+ v-if="isModifyMode"
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
action=""
|
|
action=""
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
@@ -13,15 +14,16 @@
|
|
<img v-if="authentication.photoUrl" :src="authentication.photoUrl" class="avatar">
|
|
<img v-if="authentication.photoUrl" :src="authentication.photoUrl" class="avatar">
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</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>-->
|
|
|
|
|
|
+ <span v-if="!isModifyMode">
|
|
|
|
+ <el-image
|
|
|
|
+ style="width: 100px;"
|
|
|
|
+ :src="authentication.photoUrl"
|
|
|
|
+ fit="scale-down"></el-image>
|
|
|
|
+ </span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="机构名称" prop="name">
|
|
<el-form-item label="机构名称" prop="name">
|
|
<el-input v-if="isModifyMode" v-model="authentication.name"></el-input>
|
|
<el-input v-if="isModifyMode" v-model="authentication.name"></el-input>
|
|
- <!--<span v-if="!isModifyMode">{{authentication.name}}</span>-->
|
|
|
|
|
|
+ <span v-if="!isModifyMode">{{authentication.name}}</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!--<el-form-item label="机构电话" prop="name">-->
|
|
<!--<el-form-item label="机构电话" prop="name">-->
|
|
<!--<el-input v-if="isModifyMode" v-model="authentication.mobile"></el-input>-->
|
|
<!--<el-input v-if="isModifyMode" v-model="authentication.mobile"></el-input>-->
|
|
@@ -29,11 +31,11 @@
|
|
<!--</el-form-item>-->
|
|
<!--</el-form-item>-->
|
|
<el-form-item label="对公账户" prop="name">
|
|
<el-form-item label="对公账户" prop="name">
|
|
<el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
|
|
<el-input v-if="isModifyMode" v-model="authentication.bankAccount"></el-input>
|
|
- <!--<span v-if="!isModifyMode">{{authentication.bankAccount}}</span>-->
|
|
|
|
|
|
+ <span v-if="!isModifyMode">{{authentication.bankAccount}}</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="地址" prop="name">
|
|
<el-form-item label="地址" prop="name">
|
|
<el-input v-if="isModifyMode" v-model="authentication.address"></el-input>
|
|
<el-input v-if="isModifyMode" v-model="authentication.address"></el-input>
|
|
- <!--<span v-if="!isModifyMode">{{authentication.address}}</span>-->
|
|
|
|
|
|
+ <span v-if="!isModifyMode">{{authentication.address}}</span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="测评机构能力" prop="name">
|
|
<el-form-item label="测评机构能力" prop="name">
|
|
<el-checkbox-group v-if="isModifyMode" v-model="authentication.ability">
|
|
<el-checkbox-group v-if="isModifyMode" v-model="authentication.ability">
|
|
@@ -41,11 +43,11 @@
|
|
<el-checkbox :label="item" name="type">{{item}} </el-checkbox>
|
|
<el-checkbox :label="item" name="type">{{item}} </el-checkbox>
|
|
</span>
|
|
</span>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
- <!--<span v-if="!isModifyMode">{{authentication.ability}}</span>-->
|
|
|
|
|
|
+ <span v-if="!isModifyMode" v-for="(item,index) in authentication.ability" :key="index"><span class="badge">{{item}}</span></span>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="测评机构资源" prop="name">
|
|
<el-form-item label="测评机构资源" prop="name">
|
|
- <span v-for="item in authentication.resource" :key="item.id">
|
|
|
|
- 资源类型: <el-select v-model="item.type" placeholder="请选择" style="width: 150px;margin-bottom: 10px"
|
|
|
|
|
|
+ <span v-if="isModifyMode" v-for="item in authentication.resource" :key="item.id" style="width: 2000px">
|
|
|
|
+ 资源类型: <el-select v-model="item.type" placeholder="请选择" style="width: 15%;margin-bottom: 10px"
|
|
:value="item.type">
|
|
:value="item.type">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in resourceTypes"
|
|
v-for="item in resourceTypes"
|
|
@@ -54,24 +56,27 @@
|
|
:value="item">
|
|
:value="item">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- 资源名称: <el-input v-model="item.name" style="width: 150px"></el-input>
|
|
|
|
- 总量: <el-input-number :min="0" v-model="item.totalNum"></el-input-number>
|
|
|
|
- 可用数量: <el-input-number :min="0" :max="item.totalNum" v-model="item.availableNum"></el-input-number>
|
|
|
|
|
|
+ 资源名称: <el-input v-model="item.name" style="width: 15%"></el-input>
|
|
|
|
+ 总量: <el-input-number :min="0" v-model="item.totalNum" style="width: 15%"></el-input-number>
|
|
|
|
+ 可用数量: <el-input-number :min="0" :max="item.totalNum" style="width: 15%"
|
|
|
|
+ v-model="item.availableNum"></el-input-number>
|
|
<el-button type="danger" icon="el-icon-delete" @click="removeAgencyResource(item.id)"></el-button>
|
|
<el-button type="danger" icon="el-icon-delete" @click="removeAgencyResource(item.id)"></el-button>
|
|
<br/>
|
|
<br/>
|
|
</span>
|
|
</span>
|
|
- <el-button type="primary" icon="el-icon-circle-plus" plain size="small" @click="addAgencyResource">添加资源
|
|
|
|
|
|
+ <el-button v-if="isModifyMode" type="primary" icon="el-icon-circle-plus" plain size="small"
|
|
|
|
+ @click="addAgencyResource">添加资源
|
|
</el-button>
|
|
</el-button>
|
|
- <!--<span v-if="!isModifyMode">{{authentication.resource}}</span>-->
|
|
|
|
|
|
+ <span v-if="!isModifyMode" v-for="item in authentication.resource" :key="item">
|
|
|
|
+ 资源类型:{{item.type}}; 资源名称:{{item.name}}; 资源总量:{{item.totalNum}}; 可用资源:{{item.availableNum}}<br/>
|
|
|
|
+ </span>
|
|
</el-form-item>
|
|
</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-medium btn-info" @click="modifyInfo()">修改</div>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item v-if="isModifyMode">
|
|
<el-form-item v-if="isModifyMode">
|
|
- <div class="btn btn-primary btn-info" @click="submitInfo()">提交</div>
|
|
|
|
- <!--<div class="btn btn-primary" @click="cancelModify()">取消</div>-->
|
|
|
|
|
|
+ <div class="btn btn-primary btn-info" @click="updateAuthInfo()">提交</div>
|
|
|
|
+ <div class="btn btn-primary" @click="cancelModify()">取消</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -82,7 +87,14 @@
|
|
import Http from '@/js/http'
|
|
import Http from '@/js/http'
|
|
import Apis from '@/js/api'
|
|
import Apis from '@/js/api'
|
|
import {notify} from '@/constants/index'
|
|
import {notify} from '@/constants/index'
|
|
-import {getAllAgencyResourceTypes, getAllServiceTypes, storageGet} from '@/js/index'
|
|
|
|
|
|
+import {
|
|
|
|
+ defaultValue,
|
|
|
|
+ getAllAgencyResourceTypes,
|
|
|
|
+ getAllServiceTypes,
|
|
|
|
+ getCurrentAuthenInfo,
|
|
|
|
+ storageGet,
|
|
|
|
+ updateAgencyAuthInfo
|
|
|
|
+} from '@/js/index'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'AgencyAuthentication',
|
|
name: 'AgencyAuthentication',
|
|
@@ -91,7 +103,7 @@ export default {
|
|
userId: 0,
|
|
userId: 0,
|
|
user: {},
|
|
user: {},
|
|
loading: false,
|
|
loading: false,
|
|
- isModifyMode: true,
|
|
|
|
|
|
+ isModifyMode: false,
|
|
resourceTypes: [],
|
|
resourceTypes: [],
|
|
serviceTypes: [],
|
|
serviceTypes: [],
|
|
authentication: {
|
|
authentication: {
|
|
@@ -102,7 +114,7 @@ export default {
|
|
ability: [],
|
|
ability: [],
|
|
resource: [],
|
|
resource: [],
|
|
photo: [],
|
|
photo: [],
|
|
- photoUrl: '',
|
|
|
|
|
|
+ photoUrl: defaultValue.image,
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
// name: [
|
|
// name: [
|
|
@@ -136,16 +148,32 @@ export default {
|
|
this.setServiceTypes()
|
|
this.setServiceTypes()
|
|
this.setResourceTypes()
|
|
this.setResourceTypes()
|
|
this.setUserInfo()
|
|
this.setUserInfo()
|
|
|
|
+ this.getAuthInfo()
|
|
},
|
|
},
|
|
//加载数据
|
|
//加载数据
|
|
- loadData: function () {
|
|
|
|
|
|
+ getAuthInfo () {
|
|
|
|
+ this.showLoading()
|
|
|
|
+ getCurrentAuthenInfo().then((res) => {
|
|
|
|
+ this.authentication.photo = []
|
|
|
|
+ this.authentication.photoUrl = res.agencyPhoto == null ? defaultValue.image : res.agencyPhoto
|
|
|
|
+ this.authentication.name = res.evaluationAgencyName == null ? '暂未填写' : res.evaluationAgencyName
|
|
|
|
+ this.authentication.ability = res.evaluationAgencyAbilityList == null ? [] : res.evaluationAgencyAbilityList
|
|
|
|
+ this.authentication.resource = res.evaluationAgencyResourceList == null ? [] : res.evaluationAgencyResourceList
|
|
|
|
+ this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
|
|
|
|
+ this.authentication.address = res.address == null ? '暂未填写' : res.address
|
|
|
|
+ this.hideLoading()
|
|
|
|
+ console.log(this.authentication)
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ this.hideLoading()
|
|
|
|
+ notify('error', '加载认证信息失败:' + error.data)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//表单进入可编辑状态,可修改表单,不再使用
|
|
//表单进入可编辑状态,可修改表单,不再使用
|
|
modifyInfo () {
|
|
modifyInfo () {
|
|
this.isModifyMode = true
|
|
this.isModifyMode = true
|
|
},
|
|
},
|
|
//提交认证信息
|
|
//提交认证信息
|
|
- submitInfo () {
|
|
|
|
|
|
+ updateAuthInfo () {
|
|
//this.isModifyMode = false
|
|
//this.isModifyMode = false
|
|
this.showLoading()
|
|
this.showLoading()
|
|
const newAuthentication = {
|
|
const newAuthentication = {
|
|
@@ -157,12 +185,14 @@ export default {
|
|
evaluationAgencyResourceList: this.authentication.resource,
|
|
evaluationAgencyResourceList: this.authentication.resource,
|
|
agencyPhoto: this.authentication.photoUrl,
|
|
agencyPhoto: this.authentication.photoUrl,
|
|
}
|
|
}
|
|
- console.log(newAuthentication)
|
|
|
|
- Http.post(Apis.USER.SUBMIT_AGENCY_AUTHENTICATION_INFO.replace('{userId}', this.user.userVO.id), newAuthentication).then((res) => {
|
|
|
|
|
|
+ //console.log(newAuthentication)
|
|
|
|
+ updateAgencyAuthInfo(this.user.userVO.id, newAuthentication).then((res) => {
|
|
console.log(res)
|
|
console.log(res)
|
|
this.hideLoading()
|
|
this.hideLoading()
|
|
- notify('success', '认证信息上传成功')
|
|
|
|
|
|
+ this.cancelModify()
|
|
|
|
+ notify('success', '认证信息修改成功')
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
|
|
+ this.hideLoading()
|
|
notify('error', error.data)
|
|
notify('error', error.data)
|
|
})
|
|
})
|
|
},
|
|
},
|