Commit da10c3ba authored by mengwenhao's avatar mengwenhao

feature:企业认证列表接口对接完成

parent 6e4cbdc7
...@@ -5,7 +5,7 @@ const req = require("../utils/request").httpReq; ...@@ -5,7 +5,7 @@ const req = require("../utils/request").httpReq;
exports.auditList = async ctx => { exports.auditList = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/audit_list`; const url = `${API_INTERNAL_URI}/merchant/inner/audit_list`;
const opts = { const opts = {
url: url, url,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
...@@ -13,9 +13,9 @@ exports.auditList = async ctx => { ...@@ -13,9 +13,9 @@ exports.auditList = async ctx => {
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 企业信息提交 // 企业认证获取验证码
exports.entCommit = async ctx => { exports.sendCode = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/ent_commit`; const url = `${API_INTERNAL_URI}/merchant/lifeinner/send_code`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
...@@ -25,21 +25,21 @@ exports.entCommit = async ctx => { ...@@ -25,21 +25,21 @@ exports.entCommit = async ctx => {
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 生活号检查 // 企业认证校验验证码
exports.checkLife = async ctx => { exports.checkCode = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/enterprise/check_life`; const url = `${API_INTERNAL_URI}/merchant/lifeinner/check_code`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
json: true, json: true,
body: ctx.request.body body: ctx.request.body
}; };
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts)
}; };
// 创建生活号 // 企业信息提交
exports.createLife = async ctx => { exports.entCommit = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/enterprise/create_life`; const url = `${API_INTERNAL_URI}/merchant/inner/ent_commit`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
......
...@@ -10,16 +10,18 @@ const API_VERSION = "/api/v1"; ...@@ -10,16 +10,18 @@ const API_VERSION = "/api/v1";
// router.post(`${API_VERSION}/login`, system.login); // router.post(`${API_VERSION}/login`, system.login);
router.get(`${API_VERSION}/fetch_user`, system.fetch_user); router.get(`${API_VERSION}/fetch_user`, system.fetch_user);
router.get(`${API_VERSION}/user/:type`, user.query) router.get(`${API_VERSION}/user/:type`, user.query);
router.post(`${API_VERSION}/merchant/authority/role_list`, role.getRole_list);
router.post(`${API_VERSION}/merchant/authority/add_role`, role.getAdd_role);
router.post(`${API_VERSION}/merchant/authority/update_role`, role.getUpdate_role);
router.post(`${API_VERSION}/merchant/authority/get_role_list`, role.getAll_role_list);
router.post(`${API_VERSION}/merchant/authority/get_role_info`, role.get_role_info);
/* 企业认证 */
router.post(`${API_VERSION}/certification`, enterprise.auditList); router.post(`${API_VERSION}/certification`, enterprise.auditList);
router.post(`${API_VERSION}/emterprise_commit`, enterprise.entCommit); router.post(`${API_VERSION}/emterprise_commit`, enterprise.entCommit);
router.post(`${API_VERSION}/check_life`, enterprise.checkLife); router.post(`${API_VERSION}/send_code`, enterprise.sendCode);
router.post(`${API_VERSION}/create_life`, enterprise.createLife); router.post(`${API_VERSION}/check_code`, enterprise.checkCode);
router.post(`${API_VERSION}/merchant/authority/role_list`, role.getRole_list)
router.post(`${API_VERSION}/merchant/authority/add_role`, role.getAdd_role)
router.post(`${API_VERSION}/merchant/authority/update_role`, role.getUpdate_role)
router.post(`${API_VERSION}/merchant/authority/get_role_list`, role.getAll_role_list)
router.post(`${API_VERSION}/merchant/authority/get_role_info`, role.get_role_info)
//生活号 //生活号
router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info) router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list) router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
label="法人或经营者姓名:" label="法人或经营者姓名:"
prop="userName" prop="userName"
> >
<el-input v-model="enterpriseForm.legalPerson"></el-input> <el-input v-model="enterpriseForm.legal_person"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="审核状态:"> <el-form-item label="审核状态:">
<el-select <el-select
...@@ -56,10 +56,7 @@ ...@@ -56,10 +56,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="提交人账号:"> <el-form-item label="提交人账号:">
<el-input <el-input v-model="enterpriseForm.proxy_user_name"></el-input>
type="text"
v-model="enterpriseForm.proxy_user_name"
></el-input>
</el-form-item> </el-form-item>
</div> </div>
<!-- 按钮区域 --> <!-- 按钮区域 -->
...@@ -68,6 +65,7 @@ ...@@ -68,6 +65,7 @@
<el-button <el-button
type="primary" type="primary"
class="inquire" class="inquire"
@click="queryMessage"
>查询</el-button> >查询</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -85,13 +83,20 @@ ...@@ -85,13 +83,20 @@
> >
<el-table-column <el-table-column
label="ID" label="ID"
prop="id" prop="enterprise_auth_record_id"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="审核状态" label="审核状态"
align="center" align="center"
></el-table-column> >
<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>
</template>
</el-table-column>
<el-table-column <el-table-column
label="企业注册名称" label="企业注册名称"
prop="name" prop="name"
...@@ -104,22 +109,28 @@ ...@@ -104,22 +109,28 @@
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="法人或经营者姓名" label="法人或经营者姓名"
prop="userName" prop="legal_person"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="提交日期" label="提交日期"
prop="date" prop="audit_time"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="提交类型" label="提交类型"
prop="type"
align="center" align="center"
></el-table-column> >
<template #default="scope">
<span v-if="scope.row.data_from === 1">生活圈c端</span>
<span v-if="scope.row.data_from === 2">销售端b端</span>
<span v-if="scope.row.data_from === 3">内部代提交</span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="提交人账号" label="提交人账号"
align="center" align="center"
prop="proxy_user_name"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
...@@ -130,18 +141,19 @@ ...@@ -130,18 +141,19 @@
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@click="goAuditPage('AUDIT', scope.row.id)" @click="goAuditPage('AUDIT', scope.row.enterprise_auth_record_id)"
>审核</el-button> >审核</el-button>
<el-button <el-button
disabled
size="mini" size="mini"
type="success" type="success"
@click="goAuditPage('EDIT', scope.row.id)" @click="goAuditPage('EDIT', scope.row.enterprise_auth_record_id)"
>修改提交</el-button> >修改提交</el-button>
<el-button <el-button
size="mini" size="mini"
type="warning" type="warning"
@click="goAuditPage('DETAIL', scope.row.id)" @click="
goAuditPage('DETAIL', scope.row.enterprise_auth_record_id)
"
>查看详情</el-button> >查看详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -152,7 +164,7 @@ ...@@ -152,7 +164,7 @@
v-model:currentPage="currentPage" v-model:currentPage="currentPage"
layout="total,prev,pager,next" layout="total,prev,pager,next"
:page-size="pageSize" :page-size="pageSize"
:total="100" :total="totalCount"
></el-pagination> ></el-pagination>
</el-card> </el-card>
<!-- 修改提交验证码弹框 --> <!-- 修改提交验证码弹框 -->
...@@ -163,6 +175,7 @@ ...@@ -163,6 +175,7 @@
<el-input <el-input
style="width:50%" style="width:50%"
placeholder="请输入您收到的验证码" placeholder="请输入您收到的验证码"
v-model="checkIsCode"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
...@@ -181,7 +194,7 @@ ...@@ -181,7 +194,7 @@
<script> <script>
import Layout from "@/layouts"; import Layout from "@/layouts";
import { auditList } from "@/service/enterprise"; import { auditList, sendCode, checkCode } from "@/service/enterprise";
export default { export default {
name: "Certification", name: "Certification",
components: { Layout }, components: { Layout },
...@@ -192,7 +205,6 @@ export default { ...@@ -192,7 +205,6 @@ export default {
name: "", name: "",
code: "", code: "",
legal_person: "", legal_person: "",
type: "",
audit_status: null, audit_status: null,
data_form: null, data_form: null,
proxy_user_name: null, proxy_user_name: null,
...@@ -210,16 +222,16 @@ export default { ...@@ -210,16 +222,16 @@ export default {
}, },
// 企业认证管理列表 // 企业认证管理列表
enterpriseList: [ enterpriseList: [],
{
id: 1
}
],
detailDialogVisible: false,// 跳转详情页弹窗 detailDialogVisible: false, // 跳转详情页弹窗
currentPage: 1,// 当前页 currentPage: 1, // 当前页
pageSize: 20, // 每页条数 pageSize: 20, // 每页条数
totalCount: 0 // 总条数 totalCount: 0, // 总条数
auditId: 0, // 要操作的企业信息id
checkIsCode: "" // 用户修改操作的验证码
}; };
}, },
...@@ -230,6 +242,7 @@ export default { ...@@ -230,6 +242,7 @@ export default {
methods: { methods: {
// 获取商户认证检查信息 // 获取商户认证检查信息
async getEnterpriseList () { async getEnterpriseList () {
this.enterpriseList = []; // 重置表格
const { const {
name, name,
code, code,
...@@ -248,12 +261,16 @@ export default { ...@@ -248,12 +261,16 @@ export default {
data_form, // 提交类型 data_form, // 提交类型
proxy_user_name // 提交人账号 proxy_user_name // 提交人账号
}; };
console.log(params); try {
const res = await auditList(params); const res = await auditList(params);
console.log(res); if (res.code !== 0) return this.$message.error(res.result);
if (res.code !== 0) return this.$message.error(res.result); this.enterpriseList = res.result.data;
this.enterpriseList = res.result.data; this.totalCount = res.result.count;
this.total console.log(res);
} catch (err) {
this.$message.error("发生未知错误");
console.log(err);
}
}, },
// 重置表单 // 重置表单
...@@ -269,6 +286,8 @@ export default { ...@@ -269,6 +286,8 @@ export default {
// 跳转到审核页面 // 跳转到审核页面
goAuditPage (pageStatus, auditId) { goAuditPage (pageStatus, auditId) {
if (pageStatus === "EDIT") { if (pageStatus === "EDIT") {
console.log(auditId);
this.auditId = auditId;
return (this.detailDialogVisible = true); return (this.detailDialogVisible = true);
} else { } else {
this.$router.push({ name: "Audit", params: { pageStatus, auditId } }); this.$router.push({ name: "Audit", params: { pageStatus, auditId } });
...@@ -276,19 +295,46 @@ export default { ...@@ -276,19 +295,46 @@ export default {
}, },
// 获取验证码 // 获取验证码
getAuthCode () { }, async getAuthCode () {
console.log(this.auditId);
try {
const res = await sendCode(this.auditId);
console.log(res);
} catch (err) {
console.log(err);
}
},
// 校验验证码 // 校验验证码
checkAuthCode () { async checkAuthCode () {
this.$router.push({ if (this.checkIsCode.length === 0) {
name: "Audit", return this.$message.error("验证码不可为空");
params: { pageStatus: "EDIT", auditId: 1 } } else {
}); try {
const parasm = {
enterprise_auth_record_id: this.auditId,
code: parseInt(this.checkIsCode)
};
const res = await checkCode(parasm);
console.log(res);
} catch (error) {
console.log(error);
}
this.$router.push({
name: "Audit",
params: { pageStatus: "EDIT", auditId: this.auditId }
});
}
}, },
// 换页操作 // 换页操作
handleCurrentChange (e) { handleCurrentChange (e) {
this.currentPage = e; // 更换页码 this.currentPage = e; // 更换页码
this.getEnterpriseList(); // 加载数据 this.getEnterpriseList(); // 加载数据
},
// 查询列表
queryMessage () {
this.getEnterpriseList(); // 加载数据
} }
} }
}; };
......
...@@ -12,20 +12,27 @@ export async function auditList (params) { ...@@ -12,20 +12,27 @@ export async function auditList (params) {
return res; return res;
} }
// 发送企业信息认证 /**
export async function entCommit (query) { * 企业认证审核获取验证码
const res = await axios.post(`/api/v1/emterprise_commit`, { query }); * @param enterprise_auth_record_id 企业认证审核id
*/
export async function sendCode (enterprise_auth_record_id) {
const res = await axios.post(`/api/v1/send_code`, enterprise_auth_record_id);
return res; return res;
} }
// 检查生活号信息唯一性 /**
export async function checkLife (life_account_name) { * 企业认证检测验证码
const res = await axios.post(`/api/v1/check_life`, { life_account_name }); * @param enterprise_auth_record_id 企业认证审核id
* @param code 验证码
*/
export async function checkCode (params) {
const res = await axios.post(`/api/v1/check_code`, params);
return res; return res;
} }
// 创建生活号 // 发送企业信息认证
export async function createLife (params) { export async function entCommit (query) {
const res = await axios.post(`/api/v1/create_life`, { params }); const res = await axios.post(`/api/v1/emterprise_commit`, query);
return res; 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