Commit 7d3b8f10 authored by zhangtong5@yidian-inc.com's avatar zhangtong5@yidian-inc.com

update:合并

parents 8443b3d0 6327f134
...@@ -20,7 +20,6 @@ app.use(router.routes(), router.allowedMethods()); ...@@ -20,7 +20,6 @@ app.use(router.routes(), router.allowedMethods());
app.use(serve(path.join(__dirname, './public'))); app.use(serve(path.join(__dirname, './public')));
app.listen(config.port, () => { app.listen(config.port, () => {
console.info( console.info(
'Listening on port %s in %s mode, Open up http://127.0.0.1:%s/ in your browser.', 'Listening on port %s in %s mode, Open up http://127.0.0.1:%s/ in your browser.',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,7 +11,7 @@ exports.auditList = async ctx => { ...@@ -11,7 +11,7 @@ exports.auditList = async ctx => {
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
// 企业认证获取验证码 // 企业认证获取验证码
...@@ -67,7 +67,7 @@ exports.getRecordInfo = async ctx => { ...@@ -67,7 +67,7 @@ exports.getRecordInfo = async ctx => {
} else { } else {
request.result.record.sensitiveWord = true; // 是否有查看敏感词权限 request.result.record.sensitiveWord = true; // 是否有查看敏感词权限
} }
ctx.body = request; ctx.body = JSON.stringify(request);
}; };
// 历史提交审核日志详情页 // 历史提交审核日志详情页
...@@ -93,6 +93,17 @@ exports.postAudit = async ctx => { ...@@ -93,6 +93,17 @@ exports.postAudit = async ctx => {
}; };
ctx.body = await req(ctx, opts); 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 => { exports.postBusiness = async ctx => {
......
...@@ -11,7 +11,7 @@ exports.get_life_list = async (ctx, next) => { ...@@ -11,7 +11,7 @@ exports.get_life_list = async (ctx, next) => {
qs: ctx.request.query qs: ctx.request.query
} }
ctx.body = await req(ctx, opts) ctx.body = JSON.stringify(await req(ctx, opts))
} }
//生活号详情 //生活号详情
exports.get_life_info = async (ctx, next) => { exports.get_life_info = async (ctx, next) => {
...@@ -23,5 +23,5 @@ exports.get_life_info = async (ctx, next) => { ...@@ -23,5 +23,5 @@ exports.get_life_info = async (ctx, next) => {
timeout: 8000, timeout: 8000,
body: ctx.request.body body: ctx.request.body
} }
ctx.body = await req(ctx, opts) ctx.body = JSON.stringify(await req(ctx, opts))
} }
...@@ -15,7 +15,7 @@ exports.getRole_list = async (ctx, next) => { ...@@ -15,7 +15,7 @@ exports.getRole_list = async (ctx, next) => {
json: true, json: true,
body: ctx.request.body body: ctx.request.body
} }
ctx.body = await req(ctx, opts) ctx.body = JSON.stringify(await req(ctx, opts))
} }
exports.getAdd_role = async (ctx, next) => { exports.getAdd_role = async (ctx, next) => {
var url = `${API_INTERNAL_URI}/merchant/authority/add_role`; var url = `${API_INTERNAL_URI}/merchant/authority/add_role`;
......
...@@ -46,7 +46,7 @@ exports.user_list = async (ctx, next) => { ...@@ -46,7 +46,7 @@ exports.user_list = async (ctx, next) => {
method: "GET", method: "GET",
qs: ctx.request.query, qs: ctx.request.query,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
exports.user_detail = async (ctx, next) => { exports.user_detail = async (ctx, next) => {
...@@ -56,7 +56,7 @@ exports.user_detail = async (ctx, next) => { ...@@ -56,7 +56,7 @@ exports.user_detail = async (ctx, next) => {
method: "GET", method: "GET",
qs: ctx.request.query, qs: ctx.request.query,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
exports.user_edit = async (ctx, next) => { exports.user_edit = async (ctx, next) => {
...@@ -67,7 +67,7 @@ exports.user_edit = async (ctx, next) => { ...@@ -67,7 +67,7 @@ exports.user_edit = async (ctx, next) => {
json: true, json: true,
body: ctx.request.body, body: ctx.request.body,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
exports.user_new = async (ctx, next) => { exports.user_new = async (ctx, next) => {
...@@ -78,6 +78,6 @@ exports.user_new = async (ctx, next) => { ...@@ -78,6 +78,6 @@ exports.user_new = async (ctx, next) => {
json: true, json: true,
body: ctx.request.body, body: ctx.request.body,
}; };
ctx.body = await req(ctx, opts); ctx.body = JSON.stringify(await req(ctx, opts));
}; };
...@@ -34,6 +34,7 @@ router.post(`${API_VERSION}/get_log`, enterprise.getLog); ...@@ -34,6 +34,7 @@ router.post(`${API_VERSION}/get_log`, enterprise.getLog);
router.post(`${API_VERSION}/audit`, enterprise.postAudit); router.post(`${API_VERSION}/audit`, enterprise.postAudit);
router.post(`${API_VERSION}/business`, enterprise.postBusiness) router.post(`${API_VERSION}/business`, enterprise.postBusiness)
router.post(`${API_VERSION}/op_commit`, enterprise.opCommit); 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) router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<!-- 审核/查看详情页 --> <!-- 审核/查看详情页 -->
<el-table <el-table
v-if="pageStatus !== 'EDIT'" v-if="pageStatus !== 'EDIT' && pageStatus !== 'COMPILE'"
border border
:data="messageList" :data="messageList"
> >
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
label="审核状态" label="审核状态"
> >
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.audit_status === 5">编辑中</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 == 10">审核</span>
<span v-if="scope.row.audit_status === 20">审核成功</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 == 30">审核失败</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- 企业ID --> <!-- 企业ID -->
...@@ -41,6 +41,16 @@ ...@@ -41,6 +41,16 @@
label="企业注册名称" label="企业注册名称"
prop="name" prop="name"
></el-table-column> ></el-table-column>
<!-- 商户类型 -->
<el-table-column
align="center"
label="商户类型"
>
<template #default="scope">
<span v-if="scope.row.data_type === 1">个体工商户</span>
<span v-if="scope.row.data_type === 2">普通企业</span>
</template>
</el-table-column>
<!-- 注册码 --> <!-- 注册码 -->
<el-table-column <el-table-column
align="center" align="center"
...@@ -53,13 +63,28 @@ ...@@ -53,13 +63,28 @@
label="企业营业执照照片" label="企业营业执照照片"
> >
<template #default="scope"> <template #default="scope">
<el-image <el-popover
v-if="scope.row.sensitiveWord && scope.row.entterprise_image" placement="bottom"
fit="fill" :width="600"
:src="scope.row.entterprise_image" trigger="click"
></el-image> >
<span v-else-if="scope.row.sensitiveWord && !scope.row.entterprise_image"></span> <template #reference>
<span v-else>无权限</span> <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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -72,18 +97,43 @@ ...@@ -72,18 +97,43 @@
label="法人或经营者身份证号" label="法人或经营者身份证号"
prop="legal_id_card" prop="legal_id_card"
></el-table-column> ></el-table-column>
<el-table-column
align="center"
label="法人手机号"
prop="mobile"
>
<template #default="scope">
<span v-if="scope.row.mobile">{{ scope.row.mobile }}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="身份证正面照片" label="身份证正面照片"
> >
<template #default="scope"> <template #default="scope">
<el-image <el-popover
v-if="scope.row.sensitiveWord && scope.row.legal_front_id_card" placement="bottom"
:src="scope.row.legal_front_id_card" :width="600"
fit="fill" trigger="click"
></el-image> >
<span v-else-if="scope.row.sensitiveWord && !scope.row.legal_front_id_card"></span> <template #reference>
<span v-else>无权限</span> <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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -91,13 +141,29 @@ ...@@ -91,13 +141,29 @@
label="身份证反面照片" label="身份证反面照片"
> >
<template #default="scope"> <template #default="scope">
<el-image <el-popover
v-if="scope.row.sensitiveWord && scope.row.legal_back_id_card" placement="bottom"
fit="fill" :width="600"
:src="scope.row.legal_back_id_card" trigger="click"
></el-image> >
<span v-else-if="scope.row.sensitiveWord && !scope.row.legal_back_id_card"></span> <template #reference>
<span v-else>无权限</span> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -106,7 +172,7 @@ ...@@ -106,7 +172,7 @@
<enterprise-form <enterprise-form
:dataForm="messageForm" :dataForm="messageForm"
:enterpriseId="auditId" :enterpriseId="auditId"
v-if="pageStatus === 'EDIT'" v-if="pageStatus === 'EDIT' || pageStatus === 'COMPILE'"
></enterprise-form> ></enterprise-form>
</el-card> </el-card>
...@@ -130,7 +196,7 @@ ...@@ -130,7 +196,7 @@
<el-table-column <el-table-column
align="center" align="center"
label="提交时间" label="提交时间"
prop="audit_time" prop="submit_time"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -172,15 +238,21 @@ ...@@ -172,15 +238,21 @@
label="审核状态" label="审核状态"
> >
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.audit_status === 20">通过</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 == 30">审核不通过</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="审核意见" 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-table>
</el-card> </el-card>
...@@ -327,12 +399,9 @@ export default { ...@@ -327,12 +399,9 @@ export default {
try { try {
const res = await getRecordInfo(params); const res = await getRecordInfo(params);
if (res.code !== 0) return this.$message.error(res.reason); 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.messageList.push(res.result.record);
this.lifeList.push(res.result.life); 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); console.log(res);
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
...@@ -370,7 +439,7 @@ export default { ...@@ -370,7 +439,7 @@ export default {
return this.$message.error("请填写审核意见"); return this.$message.error("请填写审核意见");
const res = await postAudit(params); const res = await postAudit(params);
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.$message.warning("拒绝审核通过成功!"); this.$message.warning("审核拒绝成功!");
this.$router.replace({ name: "Certification" }); this.$router.replace({ name: "Certification" });
} }
}, },
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
v-model="enterpriseForm.audit_status" v-model="enterpriseForm.audit_status"
> >
<el-option <el-option
v-for="item in enterpriseForm.statusOptions" v-for="item in statusOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
placeholder="请选择提交类型" placeholder="请选择提交类型"
> >
<el-option <el-option
v-for="item in enterpriseForm.typeOptions" v-for="item in typeOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="提交日期" label="提交日期"
prop="audit_time" prop="submit_time"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-if=" scope.row.audit_status === 10" v-if="scope.row.audit_status === 10"
size="mini" size="mini"
type="primary" type="primary"
:disabled="!permission.get('audit')" :disabled="!permission.get('audit')"
...@@ -163,14 +163,32 @@ ...@@ -163,14 +163,32 @@
>审核</el-button> >审核</el-button>
<el-button <el-button
v-if=" scope.row.audit_status === 30" v-if="
:disabled="!permission.get('edit') || scope.row.audit_status !== 30 ? true : false" 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" size="mini"
type="success" type="success"
@click="goAuditPage('EDIT', scope.row.enterprise_auth_record_id)" @click="
>修改提交</el-button> goAuditPage(
scope.row.audit_status === 5 ? 'COMPILE' : 'EDIT',
scope.row.enterprise_auth_record_id
)
"
>{{
scope.row.audit_status === 5 ? "编辑" : "修改"
}}提交</el-button>
<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" size="mini"
type="warning" type="warning"
@click=" @click="
...@@ -195,7 +213,7 @@ ...@@ -195,7 +213,7 @@
v-model="detailDialogVisible" v-model="detailDialogVisible"
> >
<el-input <el-input
style="width:50%" style="width:40%"
placeholder="请输入您收到的验证码" placeholder="请输入您收到的验证码"
v-model="checkIsCode" v-model="checkIsCode"
></el-input> ></el-input>
...@@ -230,18 +248,19 @@ export default { ...@@ -230,18 +248,19 @@ export default {
audit_status: 10, audit_status: 10,
data_from: null, data_from: null,
proxy_user_name: null, proxy_user_name: null,
statusOptions: [
{ 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: [], enterpriseList: [],
...@@ -258,6 +277,8 @@ export default { ...@@ -258,6 +277,8 @@ export default {
}, },
created () { created () {
const queryForm = window.localStorage.getItem("queryForm");
this.enterpriseForm = queryForm ? JSON.parse(queryForm) : this.enterpriseForm;
this.getEnterpriseList(); this.getEnterpriseList();
console.log(this.$store); console.log(this.$store);
}, },
...@@ -265,9 +286,10 @@ export default { ...@@ -265,9 +286,10 @@ export default {
computed: { computed: {
// 使用示例: permission.get("audit") 获取是否有审核权限 // 使用示例: permission.get("audit") 获取是否有审核权限
permission () { permission () {
const modulePermissions = this.$store.getters.moduleSubPermissions('enterprise') || []; const modulePermissions =
console.log('Current page func-permissions:', modulePermissions); this.$store.getters.moduleSubPermissions("enterprise") || [];
return new Map(modulePermissions.map(ele => [ele.name, true])) console.log("Current page func-permissions:", modulePermissions);
return new Map(modulePermissions.map(ele => [ele.name, true]));
} }
}, },
...@@ -308,6 +330,14 @@ export default { ...@@ -308,6 +330,14 @@ export default {
// 重置表单 // 重置表单
resetForm (formName) { resetForm (formName) {
this.$refs[formName].resetFields(); 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(); this.getEnterpriseList();
}, },
...@@ -319,9 +349,10 @@ export default { ...@@ -319,9 +349,10 @@ export default {
// 跳转到审核页面 // 跳转到审核页面
goAuditPage (pageStatus, auditId) { goAuditPage (pageStatus, auditId) {
if (pageStatus === "EDIT") { if (pageStatus === "EDIT") {
console.log(auditId);
this.auditId = auditId; this.auditId = auditId;
return (this.detailDialogVisible = true); return (this.detailDialogVisible = true);
} else if (pageStatus === "COMPILE") {
this.$router.push({ name: "Audit", params: { pageStatus, auditId } });
} else { } else {
this.$router.push({ name: "Audit", params: { pageStatus, auditId } }); this.$router.push({ name: "Audit", params: { pageStatus, auditId } });
} }
...@@ -365,6 +396,8 @@ export default { ...@@ -365,6 +396,8 @@ export default {
// 查询列表 // 查询列表
queryMessage () { queryMessage () {
const queryString = JSON.stringify(this.enterpriseForm);
window.localStorage.setItem("queryForm", queryString);
this.getEnterpriseList(); // 加载数据 this.getEnterpriseList(); // 加载数据
} }
} }
......
...@@ -29,23 +29,21 @@ ...@@ -29,23 +29,21 @@
<!-- 营业执照金山云key --> <!-- 营业执照金山云key -->
<el-form-item <el-form-item
label="营业执照:" label="营业执照:"
ref="licenseChange" ref="entterpriseImageRef"
prop="businessLicense" prop="businessLicense"
> >
<el-image <el-image
v-if="establishForm.entterpriseImage" v-if="establishForm.entterpriseImage"
style="width:100px;height:100px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.entterpriseImage" :src="establishForm.entterpriseImage"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:limit="1"
:accept="'image/*'" :accept="'image/*'"
auto-upload auto-upload
:on-success="handleEnterpriseSuccess" :on-success="handleEnterpriseSuccess"
:on-change="handleEnterpriseChange"
> >
<el-button <el-button
size="small" size="small"
...@@ -70,27 +68,27 @@ ...@@ -70,27 +68,27 @@
<!-- 企业代码 --> <!-- 企业代码 -->
<el-form-item <el-form-item
label="用户手机号:" label="用户手机号:"
prop="userMobile" prop="mobile"
> >
<el-input v-model.trim="establishForm.userMobile"></el-input> <el-input v-model.trim="establishForm.mobile"></el-input>
</el-form-item> </el-form-item>
<!-- =================普通企业法人/个体工商户身份认证信息========== --> <!-- =================普通企业法人/个体工商户身份认证信息========== -->
<h3>身份信息</h3> <h3>身份信息</h3>
<!-- 身份证正面照片 --> <!-- 身份证正面照片 -->
<el-form-item <el-form-item
label="经营者(法人)身份证正面照" label="经营者(法人)身份证正面照"
ref="frontImgRef"
prop="front_img" prop="front_img"
> >
<el-image <el-image
v-if="establishForm.frontImg" v-if="establishForm.frontImg"
style="width:100px;height:100px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.frontImg" :src="establishForm.frontImg"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:limit="1"
:accept="'image/*'" :accept="'image/*'"
auto-upload auto-upload
:on-success="handleFontSuccess" :on-success="handleFontSuccess"
...@@ -104,18 +102,18 @@ ...@@ -104,18 +102,18 @@
<!-- 身份证反面照片 --> <!-- 身份证反面照片 -->
<el-form-item <el-form-item
label="经营者(法人)身份证反面照" label="经营者(法人)身份证反面照"
ref="bakImgRef"
prop="bak_img" prop="bak_img"
> >
<el-image <el-image
v-if="establishForm.bakImg" v-if="establishForm.bakImg"
style="width:100px;height:100px;border-radius:10px" style="width:200px;height:200px;border-radius:10px"
:src="establishForm.bakImg" :src="establishForm.bakImg"
fit="cover" fit="cover"
></el-image> ></el-image>
<el-upload <el-upload
:show-file-list="false" :show-file-list="false"
:action="domainName" :action="domainName"
:limit="1"
:accept="'image/*'" :accept="'image/*'"
auto-upload auto-upload
:on-success="handleBackSuccess" :on-success="handleBackSuccess"
...@@ -136,16 +134,16 @@ ...@@ -136,16 +134,16 @@
<!-- 经营者(法人)手机号 --> <!-- 经营者(法人)手机号 -->
<el-form-item <el-form-item
label="经营者(法人)手机号:" label="经营者(法人)手机号:"
prop="mobile" prop="legal_mobile"
v-if="isMobbileRequired" v-if="isMobbileRequired"
> >
<el-input v-model.trim="establishForm.mobile"></el-input> <el-input v-model.trim="establishForm.legal_mobile"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="经营者(法人)手机号:" label="经营者(法人)手机号:"
v-else v-else
> >
<el-input v-model.trim="establishForm.mobile"></el-input> <el-input v-model.trim="establishForm.legal_mobile"></el-input>
</el-form-item> </el-form-item>
<!-- 经营者(法人)身份证号 --> <!-- 经营者(法人)身份证号 -->
<el-form-item <el-form-item
...@@ -154,14 +152,7 @@ ...@@ -154,14 +152,7 @@
> >
<el-input v-model.trim="establishForm.idcard_number"></el-input> <el-input v-model.trim="establishForm.idcard_number"></el-input>
</el-form-item> </el-form-item>
<!-- 用户手机号 --> <!-- 信息提交 -->
<!-- <el-form-item
label="用户手机号:"
prop="mobile"
>
<el-input v-model.number="establishForm.mobile"></el-input>
</el-form-item> -->
<el-form-item> <el-form-item>
<el-button @click="handelCancel('establishFormRef')">取消</el-button> <el-button @click="handelCancel('establishFormRef')">取消</el-button>
<el-button <el-button
...@@ -183,7 +174,7 @@ ...@@ -183,7 +174,7 @@
</style> </style>
<script> <script>
import { postBusiness, opCommit } from "@/service/enterprise"; import { postBusiness, opCommit, opBusinessUpdate } from "@/service/enterprise";
import { API_INTERNAL_URI } from "../../../../server/config"; import { API_INTERNAL_URI } from "../../../../server/config";
export default { export default {
props: { props: {
...@@ -203,7 +194,7 @@ export default { ...@@ -203,7 +194,7 @@ export default {
}; };
// 身份证照片正面校验规则 // 身份证照片正面校验规则
const idPhotoFontRules = (rule, value, callback) => { const idPhotoFontRules = (rule, value, callback) => {
if (this.establishForm.idcardFontPhoto.length === 0) { if (!this.establishForm.front_img) {
callback(new Error("请上传身份正面证照片")); callback(new Error("请上传身份正面证照片"));
} else { } else {
callback(); callback();
...@@ -212,7 +203,7 @@ export default { ...@@ -212,7 +203,7 @@ export default {
}; };
// 身份证照片反面校验规则 // 身份证照片反面校验规则
const idPhotoBackRules = (rule, value, callback) => { const idPhotoBackRules = (rule, value, callback) => {
if (this.establishForm.idcardBackPhoto.length === 0) { if (!this.establishForm.bak_img) {
callback(new Error("请上传身份反面证照片")); callback(new Error("请上传身份反面证照片"));
} else { } else {
callback(); callback();
...@@ -234,23 +225,23 @@ export default { ...@@ -234,23 +225,23 @@ export default {
callback(); callback();
}; };
// 法人手机号校验规则 // 法人手机号校验规则
const mobileRules = (rule, value, callback) => { const legal_mobileRules = (rule, value, callback) => {
const phoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; const phoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
const { mobile } = this.establishForm; const { legal_mobile } = this.establishForm;
if (mobile.length === 0) { if (legal_mobile.length === 0) {
callback(new Error("法人手机号不可为空!")); callback(new Error("法人手机号不可为空!"));
} else if (!phoneReg.test(mobile)) { } else if (!phoneReg.test(legal_mobile)) {
callback(new Error("法人手机号格式不正确!")); callback(new Error("法人手机号格式不正确!"));
} }
callback(); callback();
}; };
// 用户手机号 // 用户手机号
const userMobileRules = (rule, value, callback) => { const mobileRules = (rule, value, callback) => {
const phoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; const phoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
const { userMobile } = this.establishForm; const { mobile } = this.establishForm;
if (userMobile.length === 0) { if (mobile.length === 0) {
callback(new Error("用户手机号不可为空!")); callback(new Error("用户手机号不可为空!"));
} else if (!phoneReg.test(userMobile)) { } else if (!phoneReg.test(mobile)) {
callback(new Error("用户手机号格式不正确!")); callback(new Error("用户手机号格式不正确!"));
} }
callback(); callback();
...@@ -267,9 +258,9 @@ export default { ...@@ -267,9 +258,9 @@ export default {
bak_img: "", // 身份证反面照的尖山云objeid(!) bak_img: "", // 身份证反面照的尖山云objeid(!)
idcard_number: "", // 身份证号(!) idcard_number: "", // 身份证号(!)
userName: "", // 用户姓名(!) userName: "", // 用户姓名(!)
mobile: "", // 法人手机号 legal_mobile: "", // 法人手机号
data_type: null, // 企业类型(!) data_type: null, // 企业类型(!)
userMobile: "" // 用户手机号 mobile: "" // 用户手机号
}, },
// 表单校验规则 // 表单校验规则
...@@ -306,11 +297,11 @@ export default { ...@@ -306,11 +297,11 @@ export default {
{ required: true, message: "请填写经营者(法人姓名)", trigger: "blur" } { required: true, message: "请填写经营者(法人姓名)", trigger: "blur" }
], ],
// 法人手机号 // 法人手机号
mobile: [{ required: true, validator: mobileRules, trigger: "blur" }], legal_mobile: [
{ required: true, validator: legal_mobileRules, trigger: "blur" }
],
// 用户手机号 // 用户手机号
userMobile: [ mobile: [{ required: true, validator: mobileRules, trigger: "blur" }]
{ required: true, validator: userMobileRules, trigger: "blur" }
]
}, },
// 域名选择 // 域名选择
...@@ -327,17 +318,22 @@ export default { ...@@ -327,17 +318,22 @@ export default {
watch: { watch: {
// 监听异步传过来的表单值做修改 // 监听异步传过来的表单值做修改
dataForm (val) { dataForm (val) {
this.establishForm.data_type = val.data_type; this.establishForm.data_type = val.record.data_type;
this.establishForm.name = val.name; this.establishForm.name = val.record.name;
this.establishForm.code = val.code; this.establishForm.code = val.record.code;
this.establishForm.entterprise_image = val.entterprise_image; this.establishForm.entterprise_image = val.record.entterprise_image;
this.establishForm.front_img = val.legal_front_id_card; this.establishForm.front_img = val.record.legal_front_id_card;
this.establishForm.bak_img = val.legal_back_id_card; this.establishForm.bak_img = val.record.legal_back_id_card;
this.establishForm.idcard_number = val.legal_id_card; this.establishForm.idcard_number = val.record.legal_id_card;
this.establishForm.userName = val.legal_person; this.establishForm.userName = val.record.legal_person;
this.establishForm.mobile = val.mobile; this.establishForm.legal_mobile = val.record.legal_mobile;
this.establishForm.user_id = val.user_id; this.establishForm.mobile = val.life.mobile;
this.establishForm.sensitiveWord = val.sensitiveWord; 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,19 +341,15 @@ export default { ...@@ -345,19 +341,15 @@ 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.establishForm.entterpriseImage = `http://${res.result.file_url}`; this.establishForm.entterpriseImage = `http://${res.result.file_url}`;
this.establishForm.entterprise_image = res.result.object_id; this.establishForm.entterprise_image = res.result.object_id;
}, },
// 更改营业执照时
handleEnterpriseChange (file, fileList) {
console.log(fileList);
// fileList = [];
fileList.push(file);
},
// 上传身份证前面 // 上传身份证前面
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.establishForm.frontImg = `http://${res.result.file_url}`; this.establishForm.frontImg = `http://${res.result.file_url}`;
this.establishForm.front_img = res.result.object_id; this.establishForm.front_img = res.result.object_id;
}, },
...@@ -365,6 +357,7 @@ export default { ...@@ -365,6 +357,7 @@ export default {
// 上传身份证后面 // 上传身份证后面
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.establishForm.bakImg = `http://${res.result.file_url}`; this.establishForm.bakImg = `http://${res.result.file_url}`;
this.establishForm.bak_img = res.result.object_id; this.establishForm.bak_img = res.result.object_id;
}, },
...@@ -375,67 +368,127 @@ export default { ...@@ -375,67 +368,127 @@ export default {
}, },
// 提交表单 // 提交表单
async handelSubmit () { handelSubmit (formName) {
if (this.enterpriseId && !this.establishForm.sensitiveWord) this.$refs[formName].validate(valid => {
return this.$message.error("您无权限修改信息!!!"); if (this.enterpriseId && !this.establishForm.sensitiveWord)
return this.$message.error("您无敏感词权限修改信息!!!");
if (valid) {
// 企业信息提交参数
/**
* 第一步 企业信息提交(修改)
* @param enterpriseQuery
*/
// 提交
if (!this.enterpriseId) {
let {
code,
name,
entterprise_image,
data_type,
mobile
} = this.establishForm;
const enterpriseQuery = {
code,
name,
entterprise_image,
data_from: 3,
data_type,
mobile,
proxy_user_name: this.$store.state.userInfo.email
};
postBusiness(enterpriseQuery).then(res => {
if (res.code !== 0) return this.$message.error(res.reason);
this.establishForm.enterprise_id =
res.result.enterprise_auth_record_id;
// 提交法人信息
this.uploadLegal();
});
}
// 修改
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
};
opBusinessUpdate(editQuery).then(res => {
if (res.code !== 0) return this.$message.error(res.reason);
// 提交法人信息
this.uploadLegal();
});
};
} else {
this.$message.error("请按提示正确填写内容");
return false;
}
});
},
// 企业信息提交参数 // 提交法人信息
const { uploadLegal () {
code, let {
name,
entterprise_image,
data_type, data_type,
user_id,
front_img, front_img,
bak_img, bak_img,
idcard_number, idcard_number,
userName, userName,
mobile, legal_mobile
userMobile,
user_id
} = this.establishForm; } = this.establishForm;
/** front_img = this.transformObjectId(front_img);
* 第一步 企业信息提交 bak_img = this.transformObjectId(bak_img);
* @param enterpriseQuery // 提交法人信息
*/ let legalQuery = {
// 1.设置提交参数
const enterpriseQuery = {
code,
name,
entterprise_image,
data_from: 3,
data_type,
mobile: parseInt(userMobile)
};
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;
/**
* 第二步 法人(经营者信息提交)
*/
// 法人信息提交参数
const legalQuery = {
record_id: this.enterpriseId record_id: this.enterpriseId
? this.enterpriseId ? this.enterpriseId
: this.establishForm.enterprise_id, : this.establishForm.enterprise_id,
front_img,
bak_img,
front_completeness: 0, front_completeness: 0,
bak_completeness: 0, bak_completeness: 0,
user_id: user_id ? parseInt(user_id) : "",
front_img,
bak_img,
idcard_number, idcard_number,
name: userName, name: userName,
mobile, legal_mobile,
data_type, data_type
user_id: parseInt(user_id)
}; };
const result = await opCommit(legalQuery); opCommit(legalQuery).then(result => {
if (result.code !== 0) return this.$message.error(result.reason); if (result.code !== 0) return this.$message.error(result.reason);
if (!this.enterpriseId) { this.$message.success(
this.$message.success("企业信息代提交成功!"); `企业信息${this.enterpriseId ? "修改" : "代提交"}成功!`
this.$router.replace({ name: "Certification" }); );
} else {
this.$message.success("企业信息修改成功!");
this.$router.replace({ name: "Certification" }); 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;
} }
},
// 清除校验
clearValidate (formName) {
this.$refs[formName].clearValidate();
} }
} }
}; };
......
...@@ -74,4 +74,11 @@ export async function opCommit (params) { ...@@ -74,4 +74,11 @@ export async function opCommit (params) {
const res = await axios.post(`/api/v1/op_commit`, params); const res = await axios.post(`/api/v1/op_commit`, params);
return res; 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;
}
import axios from "axios"; import axios from "axios";
import store from "@/store" import store from "@/store"
import { v1 as uuidv1 } from 'uuid'; import { v1 as uuidv1 } from 'uuid';
import jsonBig from 'json-bigint'
// import { ElMessage } from "element-plus"; // import { ElMessage } from "element-plus";
// import { APP_URI } from "../config/app.config"; // import { APP_URI } from "../config/app.config";
...@@ -98,7 +99,12 @@ instance.interceptors.response.use( ...@@ -98,7 +99,12 @@ instance.interceptors.response.use(
// showClose: true // showClose: true
// }); // });
// } // }
return data; try {
return jsonBig.parse(data);
} catch (err) {
console.log('转换失败', err)
return data;
}
}, },
// function (error) { // function (error) {
// if (!(error.code && error.code === -1)) error.message = "接口请求错误"; // if (!(error.code && error.code === -1)) error.message = "接口请求错误";
......
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