Commit 1ccd7433 authored by mengwenhao's avatar mengwenhao

fix:企业信息提交更改字段

parent c455a0f2
......@@ -33,9 +33,9 @@
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
......@@ -85,9 +85,9 @@
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
......@@ -111,9 +111,9 @@
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
......@@ -191,7 +191,7 @@ export default {
data () {
// 营业执照校验规则
const businessRules = (rule, value, callback) => {
if (!this.establishForm.entterprise_image) {
if (this.establishForm.entterprise_image.length === 0) {
callback(new Error("请上传营业执照"));
} else {
callback();
......@@ -200,7 +200,7 @@ export default {
};
// 身份证照片正面校验规则
const idPhotoFontRules = (rule, value, callback) => {
if (!this.establishForm.front_img) {
if (this.establishForm.legal_front_id_card.length === 0) {
callback(new Error("请上传身份正面证照片"));
} else {
callback();
......@@ -209,7 +209,7 @@ export default {
};
// 身份证照片反面校验规则
const idPhotoBackRules = (rule, value, callback) => {
if (!this.establishForm.bak_img) {
if (this.establishForm.legal_back_id_card.length === 0) {
callback(new Error("请上传身份反面证照片"));
} else {
callback();
......@@ -257,7 +257,7 @@ export default {
establishForm: {
code: null, // 企业代码(!)
name: null, // 企业名称(!)
entterprise_image: null, // 金山云key(!)
entterprise_image_url: null, // 金山云图片地址(!)
/* *********身份认证信息********* */
record_id: null, // 企业认证id
front_img: "", // 身份证正面照的金山云objectid(!)
......@@ -266,7 +266,8 @@ export default {
userName: "", // 用户姓名(!)
legal_mobile: "", // 法人手机号
data_type: null, // 企业类型(!)
mobile: "" // 用户手机号
mobile: "", // 用户手机号
enterprise_id: "" // 返回的企业id
},
// 表单校验规则
......@@ -327,9 +328,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;
......@@ -337,9 +341,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;
}
},
......@@ -348,7 +349,7 @@ 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_url = `http://${res.result.file_url}`;
this.establishForm.entterprise_image = `${res.result.bucket}/${res.result.object_id}`;
},
......@@ -356,16 +357,16 @@ export default {
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.bucket}/${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.bucket}/${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}`;
},
// 取消创建表单
......@@ -397,7 +398,7 @@ export default {
const enterpriseQuery = {
code,
name,
entterprise_image,
entterprise_image_url: entterprise_image,
data_from: 3,
data_type,
mobile,
......@@ -420,12 +421,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
......@@ -448,24 +448,22 @@ 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
enterprise_auth_record_id: this.enterpriseId
? this.enterpriseId
: this.establishForm.enterprise_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,
......@@ -480,18 +478,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();
......
......@@ -166,7 +166,7 @@
>
<template #default="scope">
<el-button
v-if="scope.row.audit_status == 2 || scope.row.online_status == 2"
v-if="scope.row.audit_status == 2 || scope.row.online_status == 2 || scope.row.online_status == 1"
type="text"
@click="goDetail(`EDIT`, scope.row.goods_spu_id)"
>编辑</el-button>
......@@ -178,7 +178,7 @@
>审核</el-button>
<el-popconfirm
v-if="scope.row.online_status == 2 || scope.row.audit_status != 0 && scope.row.online_status == 0"
v-if="scope.row.audit_status != 2 && scope.row.audit_status != 0 && (scope.row.online_status == 2 || scope.row.online_status == 0)"
title="您确定要上架该商品吗?"
cancelButtonType="default"
@confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)"
......
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