Commit ddc3e995 authored by mengwenhao's avatar mengwenhao

fix:随服务端字段更改

parent 631489f0
......@@ -70,19 +70,19 @@
>
<template #reference>
<el-image
v-if="scope.row.sensitiveWord && scope.row.entterprise_image"
v-if="scope.row.sensitiveWord && scope.row.entterprise_image_url"
fit="fill"
:src="scope.row.entterprise_image"
:src="scope.row.entterprise_image_url"
></el-image>
<span v-else-if="
scope.row.sensitiveWord && !scope.row.entterprise_image
scope.row.sensitiveWord && !scope.row.entterprise_image_url
"></span>
<span v-else>无权限</span>
</template>
<el-image
fit="fill"
style="width:100%;height:100%"
:src="scope.row.entterprise_image"
:src="scope.row.entterprise_image_url"
></el-image>
</el-popover>
</template>
......@@ -119,19 +119,19 @@
>
<template #reference>
<el-image
v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card"
:src="scope.row.legal_front_id_card"
v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card_url"
:src="scope.row.legal_front_id_card_url"
fit="fill"
></el-image>
<span v-else-if="
scope.row.sensitiveWord && !scope.row.legal_front_id_card
scope.row.sensitiveWord && !scope.row.legal_front_id_card_url
"></span>
<span v-else>无权限</span>
</template>
<el-image
fit="fill"
style="width:100%;height:100%"
:src="scope.row.legal_front_id_card"
:src="scope.row.legal_front_id_card_url"
></el-image>
</el-popover>
</template>
......@@ -148,19 +148,19 @@
>
<template #reference>
<el-image
v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card"
v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card_url"
fit="fill"
:src="scope.row.legal_back_id_card"
:src="scope.row.legal_back_id_card_url"
></el-image>
<span v-else-if="
scope.row.sensitiveWord && !scope.row.legal_back_id_card
scope.row.sensitiveWord && !scope.row.legal_back_id_card_url
"></span>
<span v-else>无权限</span>
</template>
<el-image
fit="fill"
style="width:100%;height:100%"
:src="scope.row.legal_back_id_card"
:src="scope.row.legal_back_id_card_url"
></el-image>
</el-popover>
......
......@@ -33,12 +33,13 @@
prop="businessLicense"
>
<el-image
v-if="establishForm.entterpriseImage"
v-if="establishForm.entterprise_image_url"
style="width:200px;height:200px;border-radius:10px"
:src="establishForm.entterpriseImage"
:src="establishForm.entterprise_image_url"
fit="cover"
></el-image>
<el-upload
:data="{scenario:`business_license`}"
:show-file-list="false"
:action="domainName"
:accept="'image/*'"
......@@ -84,12 +85,13 @@
prop="front_img"
>
<el-image
v-if="establishForm.frontImg"
v-if="establishForm.legal_front_id_card_url"
style="width:200px;height:200px;border-radius:10px"
:src="establishForm.frontImg"
:src="establishForm.legal_front_id_card_url"
fit="cover"
></el-image>
<el-upload
:data="{scenario:`id_card`}"
:show-file-list="false"
:action="domainName"
:accept="'image/*'"
......@@ -109,12 +111,13 @@
prop="bak_img"
>
<el-image
v-if="establishForm.bakImg"
v-if="establishForm.legal_back_id_card_url"
style="width:200px;height:200px;border-radius:10px"
:src="establishForm.bakImg"
:src="establishForm.legal_back_id_card_url"
fit="cover"
></el-image>
<el-upload
:data="{scenario:`id_card`}"
:show-file-list="false"
:action="domainName"
:accept="'image/*'"
......@@ -197,7 +200,7 @@ export default {
};
// 身份证照片正面校验规则
const idPhotoFontRules = (rule, value, callback) => {
if (!this.establishForm.front_img) {
if (!this.establishForm.legal_front_id_card) {
callback(new Error("请上传身份正面证照片"));
} else {
callback();
......@@ -206,7 +209,7 @@ export default {
};
// 身份证照片反面校验规则
const idPhotoBackRules = (rule, value, callback) => {
if (!this.establishForm.bak_img) {
if (!this.establishForm.legal_back_id_card) {
callback(new Error("请上传身份反面证照片"));
} else {
callback();
......@@ -256,7 +259,7 @@ export default {
name: null, // 企业名称(!)
entterprise_image: null, // 金山云key(!)
/* *********身份认证信息********* */
record_id: null, // 企业认证id
enterprise_auth_record_id: null, // 企业认证id
front_img: "", // 身份证正面照的金山云objectid(!)
bak_img: "", // 身份证反面照的尖山云objeid(!)
idcard_number: "", // 身份证号(!)
......@@ -324,9 +327,12 @@ export default {
this.establishForm.data_type = val.record.data_type;
this.establishForm.name = val.record.name;
this.establishForm.code = val.record.code;
this.establishForm.entterprise_image_url = val.record.entterprise_image_url;
this.establishForm.entterprise_image = val.record.entterprise_image;
this.establishForm.front_img = val.record.legal_front_id_card;
this.establishForm.bak_img = val.record.legal_back_id_card;
this.establishForm.legal_front_id_card_url = val.record.legal_front_id_card_url;
this.establishForm.legal_front_id_card = val.record.legal_front_id_card;
this.establishForm.legal_back_id_card_url = val.record.legal_back_id_card_url;
this.establishForm.legal_back_id_card = val.record.legal_back_id_card;
this.establishForm.idcard_number = val.record.legal_id_card;
this.establishForm.userName = val.record.legal_person;
this.establishForm.legal_mobile = val.record.legal_mobile;
......@@ -334,9 +340,6 @@ export default {
this.establishForm.legal_mobile = val.record.mobile;
this.establishForm.user_id = val.record.user_id;
this.establishForm.sensitiveWord = val.record.sensitiveWord;
this.establishForm.entterpriseImage = val.record.entterprise_image;
this.establishForm.frontImg = val.record.legal_front_id_card;
this.establishForm.bakImg = val.record.legal_back_id_card;
}
},
......@@ -345,24 +348,24 @@ export default {
handleEnterpriseSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("entterpriseImageRef");
this.establishForm.entterpriseImage = `http://${res.result.file_url}`;
this.establishForm.entterprise_image = res.result.object_id;
this.establishForm.entterprise_image_url = `http://${res.result.file_url}`;
this.establishForm.entterprise_image = `${res.result.bucket}/${res.result.object_id}`;
},
// 上传身份证前面
handleFontSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("frontImgRef");
this.establishForm.frontImg = `http://${res.result.file_url}`;
this.establishForm.front_img = res.result.object_id;
this.establishForm.legal_front_id_card_url = `http://${res.result.file_url}`;
this.establishForm.legal_front_id_card = `${res.result.bucket}/${res.result.object_id}`;
},
// 上传身份证后面
handleBackSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("bakImgRef");
this.establishForm.bakImg = `http://${res.result.file_url}`;
this.establishForm.bak_img = res.result.object_id;
this.establishForm.legal_back_id_card_url = `http://${res.result.file_url}`;
this.establishForm.legal_back_id_card = `${res.result.bucket}/${res.result.object_id}`;
},
// 取消创建表单
......@@ -394,7 +397,7 @@ export default {
const enterpriseQuery = {
code,
name,
entterprise_image,
entterprise_image_url: entterprise_image,
data_from: 3,
data_type,
mobile,
......@@ -402,7 +405,7 @@ export default {
};
postBusiness(enterpriseQuery).then(res => {
if (res.code !== 0) return this.$message.error(res.reason);
this.establishForm.enterprise_id =
this.establishForm.enterprise_auth_record_id =
res.result.enterprise_auth_record_id;
// 提交法人信息
this.uploadLegal();
......@@ -417,12 +420,11 @@ export default {
data_type,
mobile
} = this.establishForm;
entterprise_image = this.transformObjectId(entterprise_image);
const editQuery = {
record_id: this.enterpriseId,
enterprise_auth_record_id: this.enterpriseId,
code,
name,
entterprise_image,
entterprise_image_url: entterprise_image,
data_type,
data_from: 3,
mobile
......@@ -445,24 +447,20 @@ export default {
let {
data_type,
user_id,
front_img,
bak_img,
legal_front_id_card,
legal_back_id_card,
idcard_number,
userName,
legal_mobile
} = this.establishForm;
front_img = this.transformObjectId(front_img);
bak_img = this.transformObjectId(bak_img);
// 提交法人信息
let legalQuery = {
record_id: this.enterpriseId
? this.enterpriseId
: this.establishForm.enterprise_id,
enterprise_auth_record_id: this.enterpriseId ? parseInt(this.enterpriseId) : parseInt(this.establishForm.enterprise_auth_record_id),
front_completeness: 0,
bak_completeness: 0,
user_id: user_id ? parseInt(user_id) : "",
front_img,
bak_img,
posit_image_url: legal_front_id_card,
back_image_url: legal_back_id_card,
idcard_number,
name: userName,
legal_mobile,
......@@ -477,18 +475,6 @@ export default {
});
},
// 转换图片地址为ObjectId
transformObjectId (urls) {
try {
const url = new URL(urls);
let pathName = url.pathname;
let objectId = pathName.slice(1);
return objectId;
} catch (error) {
return urls;
}
},
// 清除校验
clearValidate (formName) {
this.$refs[formName].clearValidate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment