Commit 6157b097 authored by pengyunqian's avatar pengyunqian

Merge branch 'dev' of https://git.yidian-inc.com:8021/bp/op-web-service into pyq

parents a74d8a48 60b71f6c
...@@ -70,19 +70,19 @@ ...@@ -70,19 +70,19 @@
> >
<template #reference> <template #reference>
<el-image <el-image
v-if="scope.row.sensitiveWord && scope.row.entterprise_image" v-if="scope.row.sensitiveWord && scope.row.entterprise_image_url"
fit="fill" fit="fill"
:src="scope.row.entterprise_image" :src="scope.row.entterprise_image_url"
></el-image> ></el-image>
<span v-else-if=" <span v-else-if="
scope.row.sensitiveWord && !scope.row.entterprise_image scope.row.sensitiveWord && !scope.row.entterprise_image_url
"></span> "></span>
<span v-else>无权限</span> <span v-else>无权限</span>
</template> </template>
<el-image <el-image
fit="fill" fit="fill"
style="width:100%;height:100%" style="width:100%;height:100%"
:src="scope.row.entterprise_image" :src="scope.row.entterprise_image_url"
></el-image> ></el-image>
</el-popover> </el-popover>
</template> </template>
...@@ -119,19 +119,19 @@ ...@@ -119,19 +119,19 @@
> >
<template #reference> <template #reference>
<el-image <el-image
v-if="scope.row.sensitiveWord && 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" :src="scope.row.legal_front_id_card_url"
fit="fill" fit="fill"
></el-image> ></el-image>
<span v-else-if=" <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>
<span v-else>无权限</span> <span v-else>无权限</span>
</template> </template>
<el-image <el-image
fit="fill" fit="fill"
style="width:100%;height:100%" style="width:100%;height:100%"
:src="scope.row.legal_front_id_card" :src="scope.row.legal_front_id_card_url"
></el-image> ></el-image>
</el-popover> </el-popover>
</template> </template>
...@@ -148,19 +148,19 @@ ...@@ -148,19 +148,19 @@
> >
<template #reference> <template #reference>
<el-image <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" fit="fill"
:src="scope.row.legal_back_id_card" :src="scope.row.legal_back_id_card_url"
></el-image> ></el-image>
<span v-else-if=" <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>
<span v-else>无权限</span> <span v-else>无权限</span>
</template> </template>
<el-image <el-image
fit="fill" fit="fill"
style="width:100%;height:100%" style="width:100%;height:100%"
:src="scope.row.legal_back_id_card" :src="scope.row.legal_back_id_card_url"
></el-image> ></el-image>
</el-popover> </el-popover>
......
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
prop="businessLicense" prop="businessLicense"
> >
<el-image <el-image
v-if="establishForm.entterpriseImage" v-if="establishForm.entterprise_image_url"
style="width:200px;height:200px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.entterpriseImage" :src="establishForm.entterprise_image_url"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:data="{scenario:`business_license`}"
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:accept="'image/*'" :accept="'image/*'"
...@@ -84,12 +85,13 @@ ...@@ -84,12 +85,13 @@
prop="front_img" prop="front_img"
> >
<el-image <el-image
v-if="establishForm.frontImg" v-if="establishForm.legal_front_id_card_url"
style="width:200px;height:200px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.frontImg" :src="establishForm.legal_front_id_card_url"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:data="{scenario:`id_card`}"
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:accept="'image/*'" :accept="'image/*'"
...@@ -109,12 +111,13 @@ ...@@ -109,12 +111,13 @@
prop="bak_img" prop="bak_img"
> >
<el-image <el-image
v-if="establishForm.bakImg" v-if="establishForm.legal_back_id_card_url"
style="width:200px;height:200px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.bakImg" :src="establishForm.legal_back_id_card_url"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:data="{scenario:`id_card`}"
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:accept="'image/*'" :accept="'image/*'"
...@@ -188,7 +191,7 @@ export default { ...@@ -188,7 +191,7 @@ export default {
data () { data () {
// 营业执照校验规则 // 营业执照校验规则
const businessRules = (rule, value, callback) => { const businessRules = (rule, value, callback) => {
if (!this.establishForm.entterprise_image) { if (this.establishForm.entterprise_image.length === 0) {
callback(new Error("请上传营业执照")); callback(new Error("请上传营业执照"));
} else { } else {
callback(); callback();
...@@ -197,7 +200,7 @@ export default { ...@@ -197,7 +200,7 @@ export default {
}; };
// 身份证照片正面校验规则 // 身份证照片正面校验规则
const idPhotoFontRules = (rule, value, callback) => { const idPhotoFontRules = (rule, value, callback) => {
if (!this.establishForm.front_img) { if (this.establishForm.legal_front_id_card.length === 0) {
callback(new Error("请上传身份正面证照片")); callback(new Error("请上传身份正面证照片"));
} else { } else {
callback(); callback();
...@@ -206,7 +209,7 @@ export default { ...@@ -206,7 +209,7 @@ export default {
}; };
// 身份证照片反面校验规则 // 身份证照片反面校验规则
const idPhotoBackRules = (rule, value, callback) => { const idPhotoBackRules = (rule, value, callback) => {
if (!this.establishForm.bak_img) { if (this.establishForm.legal_back_id_card.length === 0) {
callback(new Error("请上传身份反面证照片")); callback(new Error("请上传身份反面证照片"));
} else { } else {
callback(); callback();
...@@ -254,7 +257,7 @@ export default { ...@@ -254,7 +257,7 @@ export default {
establishForm: { establishForm: {
code: null, // 企业代码(!) code: null, // 企业代码(!)
name: null, // 企业名称(!) name: null, // 企业名称(!)
entterprise_image: null, // 金山云key(!) entterprise_image_url: null, // 金山云图片地址(!)
/* *********身份认证信息********* */ /* *********身份认证信息********* */
record_id: null, // 企业认证id record_id: null, // 企业认证id
front_img: "", // 身份证正面照的金山云objectid(!) front_img: "", // 身份证正面照的金山云objectid(!)
...@@ -263,7 +266,8 @@ export default { ...@@ -263,7 +266,8 @@ export default {
userName: "", // 用户姓名(!) userName: "", // 用户姓名(!)
legal_mobile: "", // 法人手机号 legal_mobile: "", // 法人手机号
data_type: null, // 企业类型(!) data_type: null, // 企业类型(!)
mobile: "" // 用户手机号 mobile: "", // 用户手机号
enterprise_id: "" // 返回的企业id
}, },
// 表单校验规则 // 表单校验规则
...@@ -324,9 +328,12 @@ export default { ...@@ -324,9 +328,12 @@ export default {
this.establishForm.data_type = val.record.data_type; this.establishForm.data_type = val.record.data_type;
this.establishForm.name = val.record.name; this.establishForm.name = val.record.name;
this.establishForm.code = val.record.code; 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.entterprise_image = val.record.entterprise_image;
this.establishForm.front_img = val.record.legal_front_id_card; this.establishForm.legal_front_id_card_url = val.record.legal_front_id_card_url;
this.establishForm.bak_img = val.record.legal_back_id_card; 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.idcard_number = val.record.legal_id_card;
this.establishForm.userName = val.record.legal_person; this.establishForm.userName = val.record.legal_person;
this.establishForm.legal_mobile = val.record.legal_mobile; this.establishForm.legal_mobile = val.record.legal_mobile;
...@@ -334,9 +341,6 @@ export default { ...@@ -334,9 +341,6 @@ export default {
this.establishForm.legal_mobile = val.record.mobile; this.establishForm.legal_mobile = val.record.mobile;
this.establishForm.user_id = val.record.user_id; this.establishForm.user_id = val.record.user_id;
this.establishForm.sensitiveWord = val.record.sensitiveWord; 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 +349,24 @@ export default { ...@@ -345,24 +349,24 @@ export default {
handleEnterpriseSuccess (res) { handleEnterpriseSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("entterpriseImageRef"); this.clearValidate("entterpriseImageRef");
this.establishForm.entterpriseImage = `http://${res.result.file_url}`; this.establishForm.entterprise_image_url = res.result.file_url;
this.establishForm.entterprise_image = res.result.object_id; this.establishForm.entterprise_image = `${res.result.bucket}/${res.result.object_id}`;
}, },
// 上传身份证前面 // 上传身份证前面
handleFontSuccess (res) { handleFontSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("frontImgRef"); this.clearValidate("frontImgRef");
this.establishForm.frontImg = `http://${res.result.file_url}`; this.establishForm.legal_front_id_card_url = res.result.file_url;
this.establishForm.front_img = res.result.object_id; this.establishForm.legal_front_id_card = `${res.result.bucket}/${res.result.object_id}`;
}, },
// 上传身份证后面 // 上传身份证后面
handleBackSuccess (res) { handleBackSuccess (res) {
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.clearValidate("bakImgRef"); this.clearValidate("bakImgRef");
this.establishForm.bakImg = `http://${res.result.file_url}`; this.establishForm.legal_back_id_card_url = res.result.file_url;
this.establishForm.bak_img = res.result.object_id; this.establishForm.legal_back_id_card = `${res.result.bucket}/${res.result.object_id}`;
}, },
// 取消创建表单 // 取消创建表单
...@@ -394,7 +398,7 @@ export default { ...@@ -394,7 +398,7 @@ export default {
const enterpriseQuery = { const enterpriseQuery = {
code, code,
name, name,
entterprise_image, entterprise_image_url: entterprise_image,
data_from: 3, data_from: 3,
data_type, data_type,
mobile, mobile,
...@@ -417,12 +421,11 @@ export default { ...@@ -417,12 +421,11 @@ export default {
data_type, data_type,
mobile mobile
} = this.establishForm; } = this.establishForm;
entterprise_image = this.transformObjectId(entterprise_image);
const editQuery = { const editQuery = {
record_id: this.enterpriseId, enterprise_auth_record_id: this.enterpriseId,
code, code,
name, name,
entterprise_image, entterprise_image_url: entterprise_image,
data_type, data_type,
data_from: 3, data_from: 3,
mobile mobile
...@@ -445,24 +448,22 @@ export default { ...@@ -445,24 +448,22 @@ export default {
let { let {
data_type, data_type,
user_id, user_id,
front_img, legal_front_id_card,
bak_img, legal_back_id_card,
idcard_number, idcard_number,
userName, userName,
legal_mobile legal_mobile
} = this.establishForm; } = this.establishForm;
front_img = this.transformObjectId(front_img);
bak_img = this.transformObjectId(bak_img);
// 提交法人信息 // 提交法人信息
let legalQuery = { let legalQuery = {
record_id: this.enterpriseId enterprise_auth_record_id: this.enterpriseId
? this.enterpriseId ? this.enterpriseId
: this.establishForm.enterprise_id, : this.establishForm.enterprise_id,
front_completeness: 0, front_completeness: 0,
bak_completeness: 0, bak_completeness: 0,
user_id: user_id ? parseInt(user_id) : "", user_id: user_id ? parseInt(user_id) : "",
front_img, posit_image_url: legal_front_id_card,
bak_img, back_image_url: legal_back_id_card,
idcard_number, idcard_number,
name: userName, name: userName,
legal_mobile, legal_mobile,
...@@ -477,18 +478,6 @@ export default { ...@@ -477,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) { clearValidate (formName) {
this.$refs[formName].clearValidate(); this.$refs[formName].clearValidate();
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-if="scope.row.audit_status == 2 || scope.row.online_status == 1 || scope.row.online_status == 2" v-if="scope.row.audit_status == 2 || scope.row.online_status == 2 || scope.row.online_status == 1"
type="text" type="text"
@click="goDetail(`EDIT`, scope.row.goods_spu_id)" @click="goDetail(`EDIT`, scope.row.goods_spu_id)"
>编辑</el-button> >编辑</el-button>
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
>审核</el-button> >审核</el-button>
<el-popconfirm <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="您确定要上架该商品吗?" title="您确定要上架该商品吗?"
cancelButtonType="default" cancelButtonType="default"
@confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)" @confirm="changeGoodsState('GROUNDING', scope.row.goods_spu_id)"
......
...@@ -14,7 +14,7 @@ import goodsRouter from "./Goods/index"; ...@@ -14,7 +14,7 @@ import goodsRouter from "./Goods/index";
const routes = [ const routes = [
{ {
path: "/op/enterprise", path: "/op/enterprise",
redirect: "/enterprise/certification" redirect: "/op/enterprise/certification"
}, },
{ {
path: "/op/404", path: "/op/404",
......
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