|
@@ -11,19 +11,19 @@
|
|
|
:show-file-list="false"
|
|
|
:http-request="uploadFile"
|
|
|
:before-upload="beforeFileUpload">
|
|
|
- <img v-if="authentication.photoUrl" :src="authentication.photoUrl" class="avatar">
|
|
|
+ <img v-if="authentication.agencyPhoto" :src="authentication.agencyPhoto" class="avatar">
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
</el-upload>
|
|
|
<span v-if="!isModifyMode">
|
|
|
<el-image
|
|
|
style="width: 100px;"
|
|
|
- :src="authentication.photoUrl"
|
|
|
+ :src="authentication.agencyPhoto"
|
|
|
fit="scale-down"></el-image>
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
<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-input v-if="isModifyMode" v-model="authentication.evaluationAgencyName"></el-input>
|
|
|
+ <span v-if="!isModifyMode">{{authentication.evaluationAgencyName}}</span>
|
|
|
</el-form-item>
|
|
|
<!--<el-form-item label="机构电话" prop="name">-->
|
|
|
<!--<el-input v-if="isModifyMode" v-model="authentication.mobile"></el-input>-->
|
|
@@ -38,15 +38,17 @@
|
|
|
<span v-if="!isModifyMode">{{authentication.address}}</span>
|
|
|
</el-form-item>
|
|
|
<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.evaluationAgencyAbilityList">
|
|
|
<span v-for="(item,index) in serviceTypes" :key="index">
|
|
|
<el-checkbox :label="item" name="type">{{item}} </el-checkbox>
|
|
|
</span>
|
|
|
</el-checkbox-group>
|
|
|
- <span v-if="!isModifyMode" v-for="(item,index) in authentication.ability" :key="index"><span class="badge">{{item}}</span></span>
|
|
|
+ <span v-if="!isModifyMode" v-for="(item,index) in authentication.evaluationAgencyAbilityList"
|
|
|
+ :key="index"><span class="badge">{{item}}</span></span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="测评机构资源" prop="name">
|
|
|
- <span v-if="isModifyMode" v-for="item in authentication.resource" :key="item.id" style="width: 2000px">
|
|
|
+ <span v-if="isModifyMode" v-for="item in authentication.evaluationAgencyResourceList" :key="item.id"
|
|
|
+ style="width: 2000px">
|
|
|
资源类型: <el-select v-model="item.type" placeholder="请选择" style="width: 15%;margin-bottom: 10px"
|
|
|
:value="item.type">
|
|
|
<el-option
|
|
@@ -66,7 +68,7 @@
|
|
|
<el-button v-if="isModifyMode" type="primary" icon="el-icon-circle-plus" plain size="small"
|
|
|
@click="addAgencyResource">添加资源
|
|
|
</el-button>
|
|
|
- <span v-if="!isModifyMode" v-for="item in authentication.resource" :key="item.id">
|
|
|
+ <span v-if="!isModifyMode" v-for="item in authentication.evaluationAgencyResourceList" :key="item.id">
|
|
|
资源类型:{{item.type}}; 资源名称:{{item.name}}; 资源总量:{{item.totalNum}}; 可用资源:{{item.availableNum}}<br/>
|
|
|
</span>
|
|
|
</el-form-item>
|
|
@@ -91,6 +93,7 @@ import {
|
|
|
defaultValue,
|
|
|
getAllAgencyResourceTypes,
|
|
|
getAllServiceTypes,
|
|
|
+ getCurrentAgencyAuthInfo,
|
|
|
getCurrentAuthenInfo,
|
|
|
storageGet,
|
|
|
updateAgencyAuthInfo
|
|
@@ -108,13 +111,13 @@ export default {
|
|
|
serviceTypes: [],
|
|
|
authentication: {
|
|
|
mobile: '',
|
|
|
- name: '',
|
|
|
+ evaluationAgencyName: '',
|
|
|
bankAccount: '',
|
|
|
address: '',
|
|
|
- ability: [],
|
|
|
- resource: [],
|
|
|
+ evaluationAgencyAbilityList: [],
|
|
|
+ evaluationAgencyResourceList: [],
|
|
|
photo: [],
|
|
|
- photoUrl: defaultValue.image,
|
|
|
+ agencyPhoto: defaultValue.image,
|
|
|
},
|
|
|
rules: {
|
|
|
// name: [
|
|
@@ -153,20 +156,22 @@ export default {
|
|
|
//加载数据
|
|
|
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)
|
|
|
- })
|
|
|
+ getCurrentAgencyAuthInfo(this.user.userVO.id, this.getAuthInfoSuccess, this.getAuthInfoFail)
|
|
|
+ },
|
|
|
+ getAuthInfoSuccess (res) {
|
|
|
+ this.hideLoading()
|
|
|
+ this.authentication.agencyPhoto = res.agencyPhoto == null ? defaultValue.image : res.agencyPhoto
|
|
|
+ this.authentication.evaluationAgencyName = res.evaluationAgencyName == null ? '暂未填写' : res.evaluationAgencyName
|
|
|
+ this.authentication.evaluationAgencyAbilityList = res.evaluationAgencyAbilityList == null ? [] : res.evaluationAgencyAbilityList
|
|
|
+ this.authentication.evaluationAgencyResourceList = res.evaluationAgencyResourceList == null ? [] : res.evaluationAgencyResourceList
|
|
|
+ this.authentication.bankAccount = res.bankAccount == null ? '暂未填写' : res.bankAccount
|
|
|
+ this.authentication.address = res.address == null ? '暂未填写' : res.address
|
|
|
+
|
|
|
+ console.log(this.authentication)
|
|
|
+ },
|
|
|
+ getAuthInfoFail (error) {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', '加载认证信息失败:' + error.data)
|
|
|
},
|
|
|
//表单进入可编辑状态,可修改表单,不再使用
|
|
|
modifyInfo () {
|
|
@@ -177,24 +182,26 @@ export default {
|
|
|
//this.isModifyMode = false
|
|
|
this.showLoading()
|
|
|
const newAuthentication = {
|
|
|
- mobile: this.authentication.mobile,
|
|
|
- evaluationAgencyName: this.authentication.name,
|
|
|
+ userId: this.user.userVO.id,
|
|
|
+ evaluationAgencyName: this.authentication.evaluationAgencyName,
|
|
|
bankAccount: this.authentication.bankAccount,
|
|
|
address: this.authentication.address,
|
|
|
- evaluationAgencyAbilityList: this.authentication.ability,
|
|
|
- evaluationAgencyResourceList: this.authentication.resource,
|
|
|
- agencyPhoto: this.authentication.photoUrl,
|
|
|
+ evaluationAgencyAbilityList: this.authentication.evaluationAgencyAbilityList,
|
|
|
+ evaluationAgencyResourceList: this.authentication.evaluationAgencyResourceList,
|
|
|
+ agencyPhoto: this.authentication.agencyPhoto,
|
|
|
}
|
|
|
//console.log(newAuthentication)
|
|
|
- updateAgencyAuthInfo(this.user.userVO.id, newAuthentication).then((res) => {
|
|
|
- console.log(res)
|
|
|
- this.hideLoading()
|
|
|
- this.cancelModify()
|
|
|
- notify('success', '认证信息修改成功')
|
|
|
- }).catch(error => {
|
|
|
- this.hideLoading()
|
|
|
- notify('error', error.data)
|
|
|
- })
|
|
|
+ updateAgencyAuthInfo(this.user.userVO.id, newAuthentication, this.updateAuthInfoSuccess, this.updateAuthInfoFail)
|
|
|
+ },
|
|
|
+ updateAuthInfoSuccess (res) {
|
|
|
+ console.log(res)
|
|
|
+ this.hideLoading()
|
|
|
+ this.cancelModify()
|
|
|
+ notify('success', '认证信息修改成功')
|
|
|
+ },
|
|
|
+ updateAuthInfoFail (error) {
|
|
|
+ this.hideLoading()
|
|
|
+ notify('error', error.data)
|
|
|
},
|
|
|
//取消修改表单,表单进入不可编辑状态,不再使用
|
|
|
cancelModify () {
|
|
@@ -229,7 +236,7 @@ export default {
|
|
|
formData.append('file', param.file)
|
|
|
Http.upload(Apis.FILE.UPLOAD_IMAGE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
|
|
|
console.log('上传成功')
|
|
|
- this.authentication.photoUrl = res.data
|
|
|
+ this.authentication.agencyPhoto = res.data
|
|
|
console.log(res.data)
|
|
|
notify('success', '上传成功')
|
|
|
}).catch(error => {
|
|
@@ -251,28 +258,28 @@ export default {
|
|
|
//添加一项测评机构资源
|
|
|
addAgencyResource () {
|
|
|
const tmpResource = {
|
|
|
- id: this.authentication.resource.length,
|
|
|
+ id: this.authentication.evaluationAgencyResourceList.length,
|
|
|
type: this.resourceTypes[0],
|
|
|
name: '',
|
|
|
totalNum: 0,
|
|
|
availableNum: 0,
|
|
|
}
|
|
|
- this.authentication.resource.push(tmpResource)
|
|
|
+ this.authentication.evaluationAgencyResourceList.push(tmpResource)
|
|
|
},
|
|
|
//删除一项测评机构资源
|
|
|
removeAgencyResource (id) {
|
|
|
- this.authentication.resource.splice(id, 1)
|
|
|
- for (var i = 0; i < this.authentication.resource.length; i++) {
|
|
|
- this.authentication.resource[i].id = i
|
|
|
+ this.authentication.evaluationAgencyResourceList.splice(id, 1)
|
|
|
+ for (var i = 0; i < this.authentication.evaluationAgencyResourceList.length; i++) {
|
|
|
+ this.authentication.evaluationAgencyResourceList[i].id = i
|
|
|
}
|
|
|
},
|
|
|
//检测测评机构资源填写是否有效
|
|
|
checkAgencyResourceVaild () {
|
|
|
- if (this.authentication.resource.length === 0) {
|
|
|
+ if (this.authentication.evaluationAgencyResourceList.length === 0) {
|
|
|
return true
|
|
|
}
|
|
|
- for (var i = 0; i < this.authentication.resource.length; i++) {
|
|
|
- const item = this.authentication.resource[i]
|
|
|
+ for (var i = 0; i < this.authentication.evaluationAgencyResourceList.length; i++) {
|
|
|
+ const item = this.authentication.evaluationAgencyResourceList[i]
|
|
|
if (item.type === '') {
|
|
|
notify('error', '资源类型不能为空')
|
|
|
return false
|