Commit 561a9ad9 authored by mengwenhao's avatar mengwenhao

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

parents 8fb38a18 2aa07df8
......@@ -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/*'"
......@@ -188,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();
......@@ -197,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();
......@@ -206,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();
......@@ -254,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(!)
......@@ -263,7 +266,8 @@ export default {
userName: "", // 用户姓名(!)
legal_mobile: "", // 法人手机号
data_type: null, // 企业类型(!)
mobile: "" // 用户手机号
mobile: "", // 用户手机号
enterprise_id: "" // 返回的企业id
},
// 表单校验规则
......@@ -324,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;
......@@ -334,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;
}
},
......@@ -345,24 +349,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 +398,7 @@ export default {
const enterpriseQuery = {
code,
name,
entterprise_image,
entterprise_image_url: entterprise_image,
data_from: 3,
data_type,
mobile,
......@@ -417,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
......@@ -445,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,
......@@ -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) {
this.$refs[formName].clearValidate();
......
......@@ -166,7 +166,7 @@
>
<template #default="scope">
<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"
@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)"
......
......@@ -14,7 +14,7 @@ import goodsRouter from "./Goods/index";
const routes = [
{
path: "/op/enterprise",
redirect: "/enterprise/certification"
redirect: "/op/enterprise/certification"
},
{
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