Commit ef50b54a authored by lvweichao's avatar lvweichao
parents 61d9d6a2 a52a6666
......@@ -93,6 +93,17 @@ exports.postAudit = async ctx => {
};
ctx.body = await req(ctx, opts);
};
// 企业资料修改
exports.opBusinessUpdate = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/op_business_update`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
}
// 商户上传营业执照信息
exports.postBusiness = async ctx => {
......
......@@ -34,6 +34,7 @@ router.post(`${API_VERSION}/get_log`, enterprise.getLog);
router.post(`${API_VERSION}/audit`, enterprise.postAudit);
router.post(`${API_VERSION}/business`, enterprise.postBusiness)
router.post(`${API_VERSION}/op_commit`, enterprise.opCommit);
router.post(`${API_VERSION}/op_business_update`, enterprise.opBusinessUpdate);
//生活号
router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
......
......@@ -13,7 +13,7 @@
<!-- 审核/查看详情页 -->
<el-table
v-if="pageStatus !== 'EDIT'"
v-if="pageStatus !== 'EDIT' && pageStatus !== 'COMPILE'"
border
:data="messageList"
>
......@@ -23,10 +23,10 @@
label="审核状态"
>
<template #default="scope">
<span v-if="scope.row.audit_status === 5">编辑中</span>
<span v-if="scope.row.audit_status === 10">待审核</span>
<span v-if="scope.row.audit_status === 20">审核成功</span>
<span v-if="scope.row.audit_status === 30">审核失败</span>
<span v-if="scope.row.audit_status == 5">编辑中</span>
<span v-if="scope.row.audit_status == 10">待审核</span>
<span v-if="scope.row.audit_status == 20">审核成功</span>
<span v-if="scope.row.audit_status == 30">审核失败</span>
</template>
</el-table-column>
<!-- 企业ID -->
......@@ -63,13 +63,28 @@
label="企业营业执照照片"
>
<template #default="scope">
<el-image
v-if="scope.row.sensitiveWord && scope.row.entterprise_image"
fit="fill"
:src="scope.row.entterprise_image"
></el-image>
<span v-else-if="scope.row.sensitiveWord && !scope.row.entterprise_image"></span>
<span v-else>无权限</span>
<el-popover
placement="bottom"
:width="600"
trigger="click"
>
<template #reference>
<el-image
v-if="scope.row.sensitiveWord && scope.row.entterprise_image"
fit="fill"
:src="scope.row.entterprise_image"
></el-image>
<span v-else-if="
scope.row.sensitiveWord && !scope.row.entterprise_image
"></span>
<span v-else>无权限</span>
</template>
<el-image
fit="fill"
style="width:100%;height:100%"
:src="scope.row.entterprise_image"
></el-image>
</el-popover>
</template>
</el-table-column>
<el-table-column
......@@ -88,7 +103,7 @@
prop="mobile"
>
<template #default="scope">
<span v-if="scope.row.mobile">{{scope.row.mobile}}</span>
<span v-if="scope.row.mobile">{{ scope.row.mobile }}</span>
<span v-else></span>
</template>
</el-table-column>
......@@ -97,13 +112,28 @@
label="身份证正面照片"
>
<template #default="scope">
<el-image
v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card"
:src="scope.row.legal_front_id_card"
fit="fill"
></el-image>
<span v-else-if="scope.row.sensitiveWord && !scope.row.legal_front_id_card"></span>
<span v-else>无权限</span>
<el-popover
placement="bottom"
:width="600"
trigger="click"
>
<template #reference>
<el-image
v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card"
:src="scope.row.legal_front_id_card"
fit="fill"
></el-image>
<span v-else-if="
scope.row.sensitiveWord && !scope.row.legal_front_id_card
"></span>
<span v-else>无权限</span>
</template>
<el-image
fit="fill"
style="width:100%;height:100%"
:src="scope.row.legal_front_id_card"
></el-image>
</el-popover>
</template>
</el-table-column>
<el-table-column
......@@ -111,13 +141,29 @@
label="身份证反面照片"
>
<template #default="scope">
<el-image
v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card"
fit="fill"
:src="scope.row.legal_back_id_card"
></el-image>
<span v-else-if="scope.row.sensitiveWord && !scope.row.legal_back_id_card"></span>
<span v-else>无权限</span>
<el-popover
placement="bottom"
:width="600"
trigger="click"
>
<template #reference>
<el-image
v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card"
fit="fill"
:src="scope.row.legal_back_id_card"
></el-image>
<span v-else-if="
scope.row.sensitiveWord && !scope.row.legal_back_id_card
"></span>
<span v-else>无权限</span>
</template>
<el-image
fit="fill"
style="width:100%;height:100%"
:src="scope.row.legal_back_id_card"
></el-image>
</el-popover>
</template>
</el-table-column>
</el-table>
......@@ -126,7 +172,7 @@
<enterprise-form
:dataForm="messageForm"
:enterpriseId="auditId"
v-if="pageStatus === 'EDIT'"
v-if="pageStatus === 'EDIT' || pageStatus === 'COMPILE'"
></enterprise-form>
</el-card>
......@@ -150,7 +196,7 @@
<el-table-column
align="center"
label="提交时间"
prop="audit_time"
prop="submit_time"
></el-table-column>
<el-table-column
align="center"
......@@ -192,15 +238,21 @@
label="审核状态"
>
<template #default="scope">
<span v-if="scope.row.audit_status === 20">通过</span>
<span v-if="scope.row.audit_status === 30">审核不通过</span>
<span v-if="scope.row.audit_status == 20">通过</span>
<span v-if="scope.row.audit_status == 30">审核不通过</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="审核意见"
prop="audit_opinion"
></el-table-column>
>
<template #default="scope">
<span v-if="scope.row.audit_opinion.length !== 0">{{
scope.row.audit_opinion
}}</span>
<span v-else></span>
</template>
</el-table-column>
</el-table>
</el-card>
......@@ -347,12 +399,9 @@ export default {
try {
const res = await getRecordInfo(params);
if (res.code !== 0) return this.$message.error(res.reason);
this.messageForm = res.result.record;
this.messageForm = res.result;
this.messageList.push(res.result.record);
this.lifeList.push(res.result.life);
console.log("messageForm=1-2=310=-203", this.messageForm);
console.log("lifeLIST======", this.lifeList);
console.log("messageList", this.messageList);
console.log(res);
} catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~");
......
......@@ -45,7 +45,7 @@
v-model="enterpriseForm.audit_status"
>
<el-option
v-for="item in enterpriseForm.statusOptions"
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -61,7 +61,7 @@
placeholder="请选择提交类型"
>
<el-option
v-for="item in enterpriseForm.typeOptions"
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -130,7 +130,7 @@
></el-table-column>
<el-table-column
label="提交日期"
prop="audit_time"
prop="submit_time"
align="center"
></el-table-column>
<el-table-column
......@@ -155,7 +155,7 @@
>
<template #default="scope">
<el-button
v-if=" scope.row.audit_status === 10"
v-if="scope.row.audit_status === 10"
size="mini"
type="primary"
:disabled="!permission.get('audit')"
......@@ -163,14 +163,32 @@
>审核</el-button>
<el-button
v-if=" scope.row.audit_status === 30"
:disabled="!permission.get('edit') || scope.row.audit_status !== 30 ? true : false"
v-if="
scope.row.audit_status === 30 || scope.row.audit_status === 5
"
:disabled="
!permission.get('edit') &&
scope.row.audit_status !== 30 &&
scope.row.audit_status !== 5
"
size="mini"
type="success"
@click="goAuditPage('EDIT', scope.row.enterprise_auth_record_id)"
>修改提交</el-button>
@click="
goAuditPage(
scope.row.audit_status === 5 ? 'COMPILE' : 'EDIT',
scope.row.enterprise_auth_record_id
)
"
>{{
scope.row.audit_status === 5 ? "编辑" : "修改"
}}提交</el-button>
<el-button
v-if=" scope.row.audit_status === 10 || scope.row.audit_status === 20 || scope.row.audit_status === 30 || scope.row.audit_status === 5"
v-if="
scope.row.audit_status === 10 ||
scope.row.audit_status === 20 ||
scope.row.audit_status === 30 ||
scope.row.audit_status === 5
"
size="mini"
type="warning"
@click="
......@@ -195,7 +213,7 @@
v-model="detailDialogVisible"
>
<el-input
style="width:50%"
style="width:40%"
placeholder="请输入您收到的验证码"
v-model="checkIsCode"
></el-input>
......@@ -230,19 +248,19 @@ export default {
audit_status: 10,
data_from: null,
proxy_user_name: null,
statusOptions: [
{ value: "", label: "全部" },
{ value: 5, label: "编辑中" },
{ value: 10, label: "待审核" },
{ value: 20, label: "审核成功" },
{ value: 30, label: "审核失败" }
],
typeOptions: [
{ value: 1, label: "生活圈c端" },
{ value: 2, label: "销售端b端" },
{ value: 3, label: "内部代提交" }
]
},
statusOptions: [
{ value: "", label: "全部" },
{ value: 5, label: "编辑中" },
{ value: 10, label: "待审核" },
{ value: 20, label: "审核成功" },
{ value: 30, label: "审核失败" }
],
typeOptions: [
{ value: 1, label: "生活圈c端" },
{ value: 2, label: "销售端b端" },
{ value: 3, label: "内部代提交" }
],
// 企业认证管理列表
enterpriseList: [],
......@@ -259,6 +277,8 @@ export default {
},
created () {
const queryForm = window.localStorage.getItem("queryForm");
this.enterpriseForm = queryForm ? JSON.parse(queryForm) : this.enterpriseForm;
this.getEnterpriseList();
console.log(this.$store);
},
......@@ -266,9 +286,10 @@ export default {
computed: {
// 使用示例: permission.get("audit") 获取是否有审核权限
permission () {
const modulePermissions = this.$store.getters.moduleSubPermissions('enterprise') || [];
console.log('Current page func-permissions:', modulePermissions);
return new Map(modulePermissions.map(ele => [ele.name, true]))
const modulePermissions =
this.$store.getters.moduleSubPermissions("enterprise") || [];
console.log("Current page func-permissions:", modulePermissions);
return new Map(modulePermissions.map(ele => [ele.name, true]));
}
},
......@@ -310,6 +331,13 @@ export default {
resetForm (formName) {
this.$refs[formName].resetFields();
this.enterpriseForm.audit_status = "";
this.enterpriseForm.name = "";
this.enterpriseForm.code = "";
this.enterpriseForm.legal_person = "";
this.enterpriseForm.audit_status = "";
this.enterpriseForm.data_from = null;
this.enterpriseForm.proxy_user_name = null;
window.localStorage.removeItem("queryForm");
this.getEnterpriseList();
},
......@@ -321,9 +349,10 @@ export default {
// 跳转到审核页面
goAuditPage (pageStatus, auditId) {
if (pageStatus === "EDIT") {
console.log(auditId);
this.auditId = auditId;
return (this.detailDialogVisible = true);
} else if (pageStatus === "COMPILE") {
this.$router.push({ name: "Audit", params: { pageStatus, auditId } });
} else {
this.$router.push({ name: "Audit", params: { pageStatus, auditId } });
}
......@@ -367,6 +396,8 @@ export default {
// 查询列表
queryMessage () {
const queryString = JSON.stringify(this.enterpriseForm);
window.localStorage.setItem("queryForm", queryString);
this.getEnterpriseList(); // 加载数据
}
}
......
......@@ -34,7 +34,7 @@
>
<el-image
v-if="establishForm.entterpriseImage"
style="width:100px;height:100px;border-radius:10px"
style="width:200px;height:200px;border-radius:10px"
:src="establishForm.entterpriseImage"
fit="cover"
></el-image>
......@@ -81,7 +81,7 @@
>
<el-image
v-if="establishForm.frontImg"
style="width:100px;height:100px;border-radius:10px"
style="width:200px;height:200px;border-radius:10px"
:src="establishForm.frontImg"
fit="cover"
></el-image>
......@@ -105,7 +105,7 @@
>
<el-image
v-if="establishForm.bakImg"
style="width:100px;height:100px;border-radius:10px"
style="width:200px;height:200px;border-radius:10px"
:src="establishForm.bakImg"
fit="cover"
></el-image>
......@@ -172,7 +172,7 @@
</style>
<script>
import { postBusiness, opCommit } from "@/service/enterprise";
import { postBusiness, opCommit, opBusinessUpdate } from "@/service/enterprise";
import { API_INTERNAL_URI } from "../../../../server/config";
export default {
props: {
......@@ -316,18 +316,22 @@ export default {
watch: {
// 监听异步传过来的表单值做修改
dataForm (val) {
this.establishForm.data_type = val.data_type;
this.establishForm.name = val.name;
this.establishForm.code = val.code;
this.establishForm.entterprise_image = val.entterprise_image;
this.establishForm.front_img = val.legal_front_id_card;
this.establishForm.bak_img = val.legal_back_id_card;
this.establishForm.idcard_number = val.legal_id_card;
this.establishForm.userName = val.legal_person;
this.establishForm.legal_mobile = val.legal_mobile;
this.establishForm.mobile = val.mobile;
this.establishForm.user_id = val.user_id;
this.establishForm.sensitiveWord = val.sensitiveWord;
this.establishForm.data_type = val.record.data_type;
this.establishForm.name = val.record.name;
this.establishForm.code = val.record.code;
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.idcard_number = val.record.legal_id_card;
this.establishForm.userName = val.record.legal_person;
this.establishForm.legal_mobile = val.record.legal_mobile;
this.establishForm.mobile = val.life.mobile;
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;
}
},
......@@ -361,65 +365,101 @@ export default {
// 提交表单
async handelSubmit () {
if (this.enterpriseId && !this.establishForm.sensitiveWord)
return this.$message.error("您无权限修改信息!!!");
return this.$message.error("您无敏感词权限修改信息!!!");
// 企业信息提交参数
const {
let {
code,
name,
entterprise_image,
data_type,
mobile,
user_id,
front_img,
bak_img,
idcard_number,
userName,
name: userName,
legal_mobile,
mobile,
user_id
} = this.establishForm;
/**
* 第一步 企业信息提交
* 第一步 企业信息提交(修改)
* @param enterpriseQuery
*/
// 1.设置提交参数
const enterpriseQuery = {
code,
name,
entterprise_image,
data_from: 3,
data_type,
mobile
};
const res = await postBusiness(enterpriseQuery);
if (res.code !== 0) return this.$message.error(res.reason);
this.establishForm.enterprise_id = res.result.enterprise_auth_record_id;
console.log("是否为修改的ID", this.enterpriseId);
// 提交
if (!this.enterpriseId) {
const enterpriseQuery = {
code,
name,
entterprise_image,
data_from: 3,
data_type,
mobile,
proxy_user_name: this.$store.state.userInfo.email
};
const res = await postBusiness(enterpriseQuery);
if (res.code !== 0) return this.$message.error(res.reason);
this.establishForm.enterprise_id = res.result.enterprise_auth_record_id;
}
// 修改
else {
let {
code,
name,
entterprise_image,
data_type,
mobile
} = this.establishForm;
entterprise_image = this.transformObjectId(entterprise_image);
const editQuery = {
record_id: this.enterpriseId,
code,
name,
entterprise_image,
data_type,
data_from: 3,
mobile
};
console.log("参数修改", editQuery);
const res = await opBusinessUpdate(editQuery);
console.log(res);
if (res.code !== 0) return this.$message.error(res.reason);
}
/**
* 第二步 法人(经营者信息提交)
*/
// 法人信息提交参数
const legalQuery = {
front_img = this.transformObjectId(front_img);
bak_img = this.transformObjectId(bak_img);
// 提交法人信息
let legalQuery = {
record_id: this.enterpriseId
? this.enterpriseId
: this.establishForm.enterprise_id,
front_img,
bak_img,
front_completeness: 0,
bak_completeness: 0,
user_id: user_id ? parseInt(user_id) : "",
front_img,
bak_img,
idcard_number,
name: userName,
legal_mobile,
mobile,
data_type,
user_id: user_id ? parseInt(user_id) : ""
data_type
};
const result = await opCommit(legalQuery);
if (result.code !== 0) return this.$message.error(result.reason);
if (!this.enterpriseId) {
this.$message.success("企业信息代提交成功!");
this.$router.replace({ name: "Certification" });
} else {
this.$message.success("企业信息修改成功!");
this.$router.replace({ name: "Certification" });
this.$message.success(`企业信息${this.enterpriseId ? "修改" : "代提交"}成功!`);
this.$router.replace({ name: "Certification" });
},
// 转换图片地址为ObjectId
transformObjectId (urls) {
try {
const url = new URL(urls);
let pathName = url.pathname;
let objectId = pathName.slice(1);
return objectId;
} catch (error) {
return urls;
}
}
}
......
......@@ -74,4 +74,11 @@ export async function opCommit (params) {
const res = await axios.post(`/api/v1/op_commit`, params);
return res;
}
/**
* 414-3商户后台营业执照更新(op后台)
* @param params 修改企业信息
*/
export async function opBusinessUpdate (params) {
const res = await axios.post(`/api/v1/op_business_update`, params);
return res;
}
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