|
@@ -117,10 +117,10 @@
|
|
|
<el-input :disabled="!canEdit" v-model="enterpriseForm.address"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="认证权限" prop="roleList">
|
|
|
- <el-checkbox-group v-model="enterpriseForm.roleList" :disabled="!canEdit" :min="1" :max="1">
|
|
|
- <el-checkbox :label="1">发包企业</el-checkbox>
|
|
|
- <el-checkbox :label="0">测评机构</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-radio-group v-model="enterpriseForm.roleList" :disabled="!canEdit">
|
|
|
+ <el-radio :label="1">发包企业</el-radio>
|
|
|
+ <el-radio :label="0">测评机构</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="uploader-wrapper">
|
|
@@ -216,7 +216,7 @@
|
|
|
businessLicensePhoto: "",//企业执照
|
|
|
},
|
|
|
enterpriseForm: {
|
|
|
- roleList: [],//0是发包 1是接包 如果两个都有那么权限都有。
|
|
|
+ roleList: 1,//0是发包 1是接包 如果两个都有那么权限都有。
|
|
|
legalPersonName: "", //法人姓名
|
|
|
idCardNum: "",//身份证号码
|
|
|
address: "",//地址
|
|
@@ -251,7 +251,7 @@
|
|
|
{required: false, message: '请选择性别', trigger: 'blur'}
|
|
|
],
|
|
|
roleList: [
|
|
|
- {type: 'array', required: true, message: '请选择认证权限', trigger: 'change'}
|
|
|
+ {required: true, message: '请选择认证权限', trigger: 'change'}
|
|
|
],
|
|
|
idCardDeadTime: [
|
|
|
{required: false, message: '请选择身份证过期时间', trigger: 'change'}
|
|
@@ -281,6 +281,36 @@
|
|
|
if (!valid) {
|
|
|
notify('error', '信息填写不规范');
|
|
|
return false
|
|
|
+ }else{
|
|
|
+ let firstSubmit = this.$route.query.type;
|
|
|
+ if (this.enterpriseForm.roleList === 0) {
|
|
|
+ this.enterpriseForm.roleList = ["0", "1"]
|
|
|
+ }else{
|
|
|
+ this.enterpriseForm.roleList = ["1"]
|
|
|
+ }
|
|
|
+ let data = {...this.enterpriseForm, ...this.enterpriseForm1};
|
|
|
+ this.showLoading();
|
|
|
+ if (firstSubmit == 1) {
|
|
|
+ Http.post(`/api/user/${this.user.id}/agency`, data).then(res => {
|
|
|
+ if (res) {
|
|
|
+ notify('success', '提交成功');
|
|
|
+ this.$router.push('/personal/authentication')
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.hideLoading();
|
|
|
+ notify('error', err.data)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Http.put(`/api/user/${this.user.id}/agency`, data).then(res => {
|
|
|
+ if (res) {
|
|
|
+ notify('success', '修改成功');
|
|
|
+ this.$router.push('/personal/authentication')
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.hideLoading();
|
|
|
+ notify('error', err.data)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
//if (!this.enterpriseForm.idCardPositivePhoto) {
|
|
@@ -291,33 +321,7 @@
|
|
|
//notify('error', '身份证反面照片上传不规范');
|
|
|
//return false;
|
|
|
//}
|
|
|
- let firstSubmit = this.$route.query.type;
|
|
|
- if (this.enterpriseForm.roleList[0]=="0") {
|
|
|
- this.enterpriseForm.roleList.push("1")
|
|
|
- }
|
|
|
- let data = {...this.enterpriseForm, ...this.enterpriseForm1};
|
|
|
- this.showLoading();
|
|
|
- if (firstSubmit == 1) {
|
|
|
- Http.post(`/api/user/${this.user.id}/agency`, data).then(res => {
|
|
|
- if (res) {
|
|
|
- notify('success', '提交成功');
|
|
|
- this.$router.push('/personal/authentication')
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- this.hideLoading();
|
|
|
- notify('error', err.data)
|
|
|
- })
|
|
|
- } else {
|
|
|
- Http.put(`/api/user/${this.user.id}/agency`, data).then(res => {
|
|
|
- if (res) {
|
|
|
- notify('success', '修改成功');
|
|
|
- this.$router.push('/personal/authentication')
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- this.hideLoading();
|
|
|
- notify('error', err.data)
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
//获取当前认证状态
|
|
|
getAuthStatus() {
|
|
@@ -338,7 +342,7 @@
|
|
|
setFormInfo(detail) {
|
|
|
//回显认证信息
|
|
|
console.log("回显认证信息rolelist", detail.roleList);
|
|
|
- this.enterpriseForm.roleList = detail.roleList.length>1? [0] :[1] ;
|
|
|
+ this.enterpriseForm.roleList = detail.roleList.length >1? 0 : 1 ;
|
|
|
console.log(this.enterpriseForm.roleList,"this.enterpriseForm.roleList");
|
|
|
this.enterpriseForm.legalPersonName = detail.legalPersonName,
|
|
|
this.enterpriseForm.gender = detail.gender,
|