Commit 097602b1 authored by mengwenhao's avatar mengwenhao

feature:审核通过或拒绝接口调通

parent 50223ae0
...@@ -61,6 +61,18 @@ exports.getLog = async ctx => { ...@@ -61,6 +61,18 @@ exports.getLog = async ctx => {
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
// 企业资料审核
exports.postAudit = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/audit`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
}
// 企业信息提交 // 企业信息提交
exports.entCommit = async ctx => { exports.entCommit = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/ent_commit`; const url = `${API_INTERNAL_URI}/merchant/inner/ent_commit`;
......
...@@ -25,6 +25,7 @@ router.post(`${API_VERSION}/send_code`, enterprise.sendCode); ...@@ -25,6 +25,7 @@ router.post(`${API_VERSION}/send_code`, enterprise.sendCode);
router.post(`${API_VERSION}/check_code`, enterprise.checkCode); router.post(`${API_VERSION}/check_code`, enterprise.checkCode);
router.post(`${API_VERSION}/get_record_info`, enterprise.getRecordInfo); router.post(`${API_VERSION}/get_record_info`, enterprise.getRecordInfo);
router.post(`${API_VERSION}/get_log`, enterprise.getLog); router.post(`${API_VERSION}/get_log`, enterprise.getLog);
router.post(`${API_VERSION}/audit`, enterprise.postAudit);
//生活号 //生活号
router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info) router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
background-color: lightblue; background-color: lightblue;
color: #000; color: #000;
} }
.audit .history_area {
margin-bottom: 20px;
}
.mgtb20 { .mgtb20 {
margin: 20px 0; margin: 20px 0;
} }
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
color: #000; color: #000;
} }
} }
.history_area{
margin-bottom: 20px;
}
} }
.mgtb20{ .mgtb20{
margin: 20px 0; margin: 20px 0;
......
...@@ -182,10 +182,13 @@ ...@@ -182,10 +182,13 @@
></textarea> ></textarea>
<h5 class="mgtb20">审核结果</h5> <h5 class="mgtb20">审核结果</h5>
<div class="button_area"> <div class="button_area">
<el-button type="primary">通过</el-button> <el-button
type="primary"
@click="auditResult(20)"
>通过</el-button>
<el-button <el-button
type="danger" type="danger"
@click="auditRefuse" @click="auditResult(30)"
>拒绝</el-button> >拒绝</el-button>
</div> </div>
</el-card> </el-card>
...@@ -235,7 +238,7 @@ ...@@ -235,7 +238,7 @@
<script> <script>
import Layout from "@/layouts"; import Layout from "@/layouts";
import { getRecordInfo, getLog } from "@/service/enterprise"; import { getRecordInfo, getLog, postAudit } from "@/service/enterprise";
import EnterpriseForm from "../components/enterpriseForm.vue"; import EnterpriseForm from "../components/enterpriseForm.vue";
export default { export default {
name: "Audit", name: "Audit",
...@@ -249,42 +252,13 @@ export default { ...@@ -249,42 +252,13 @@ export default {
created () { created () {
const { pageStatus, auditId } = this.$route.params; const { pageStatus, auditId } = this.$route.params;
this.auditId = parseInt(auditId); this.auditId = parseInt(auditId);
console.log("企业信息ID!!!!!!!!!!", this.auditId);
this.pageStatus = pageStatus; this.pageStatus = pageStatus;
this.getInfo(); this.getInfo();
this.getHistory(); this.getHistory();
console.log(this.$store);
}, },
data () { data () {
// 营业执照校验规则
let businessRules = (rule, value, callback) => {
if (this.messageList[0].licenseList.length === 0) {
callback(new Error("请上传营业执照"));
} else {
callback();
}
};
// 身份证照片校验规则
let idPhotoRules = (rule, value, callback) => {
if (this.messageList[0].idcardPhoto.length === 0) {
callback(new Error("请上传身份证照片"));
} else {
callback();
}
};
// 身份证号校验规则
let idcardNumberRules = (rule, value, callback) => {
let IDRe18 = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
let IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
let idNumber = this.messageList[0].idcardNumber;
if (idNumber.length === 0) {
callback(new Error("身份证号不可为空"));
} else if (!(IDRe18.test(idNumber) || IDre15.test(idNumber))) {
callback(new Error("身份证号格式不正确"));
} else {
callback();
}
};
return { return {
pageStatus: null, // 哪个按钮进入 pageStatus: null, // 哪个按钮进入
auditId: null, // 传入的企业id auditId: null, // 传入的企业id
...@@ -305,70 +279,10 @@ export default { ...@@ -305,70 +279,10 @@ export default {
], ],
// 审核-提交历史 // 审核-提交历史
historyList: [ historyList: [],
{
subDate: null,
author: null,
auditDate: null,
auditer: null,
status: null,
address: null
}
],
// 审核-审核意见 // 审核-审核意见
opinionArea: "", opinionArea: ""
// 生活号-生活号信息
lifeList: [],
// 修改详情-表单校验规则
messageLishRules: {
// 营业执照
businessLicense: [
{ required: true, validator: businessRules, trigger: "change" }
],
// 企业注册名称
registeredName: [
{ required: true, message: "请输入企业注册名称", trigger: "blur" }
],
// 注册码
registrationCode: [
{
required: true,
message: "请输入统一社会信用代码(注册码)",
trigger: "blur"
}
],
// 法人照片
legalPhoto: [
{ required: true, validator: idPhotoRules, trigger: "change" }
],
// 法人姓名
legalName: [
{
required: true,
message: "请输入经营者(法人)姓名",
trigger: "blur"
}
],
// 法人身份证号
idcardNumber: [
{
required: true,
validator: idcardNumberRules,
trigger: "blur"
}
],
// 商户类型
merchantsType: [
{
required: true,
message: "请选择商户类型",
trigger: "change"
}
]
},
}; };
}, },
...@@ -392,7 +306,7 @@ export default { ...@@ -392,7 +306,7 @@ export default {
const params = { enterprise_auth_record_id: this.auditId }; const params = { enterprise_auth_record_id: this.auditId };
try { try {
const res = await getRecordInfo(params); const res = await getRecordInfo(params);
if (res.code !== 0) return this.$message.error(res.result); if (res.code !== 0) return this.$message.error(res.reason);
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(this.lifeList); console.log(this.lifeList);
...@@ -411,15 +325,37 @@ export default { ...@@ -411,15 +325,37 @@ export default {
}, },
// 审核-拒绝审核 // 审核-拒绝审核
auditRefuse () { async auditResult (status) {
if (this.opinionArea.length === 0) console.log(this.$store.state.userInfo.userid);
return this.$message.error("请填写拒绝原因"); const params = {
audit_status: status,
audit_user_name: this.$store.state.userInfo.name,
audit_user_id: this.$store.state.userInfo.userid,
enterprise_auth_record_id: this.auditId,
audit_opinion: this.opinionArea
};
// 审核通过
if (status === 20) {
const res = await postAudit(params);
if (res.code !== 0) return this.$message.error(res.reason);
this.$message.success("审核通过成功!");
this.$router.replace({ name: "Certification" });
}
// 拒绝审核通过
else {
if (this.opinionArea.length === 0) return this.$message.error("请填写拒绝原因");
const res = await postAudit(params);
if (res.code !== 0) return this.$message.error(res.reason);
this.$message.warning("拒绝审核通过成功!");
this.$router.replace({ name: "Certification" });
}
}, },
// 返回上一页 // 返回上一页
goBack () { goBack () {
this.$router.replace({ name: "Certification" }); this.$router.replace({ name: "Certification" });
}, }
} }
}; };
</script> </script>
...@@ -238,6 +238,7 @@ export default { ...@@ -238,6 +238,7 @@ export default {
created () { created () {
this.getEnterpriseList(); this.getEnterpriseList();
console.log(this.$store);
}, },
methods: { methods: {
......
...@@ -155,16 +155,16 @@ ...@@ -155,16 +155,16 @@
>点击上传</el-button> >点击上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<!-- orc照片正面完整度 --> <!-- ocr照片正面完整度 -->
<el-form-item <el-form-item
label="orc正面完整度" label="ocr正面完整度"
prop="front_completeness" prop="front_completeness"
> >
<el-input v-model="establishForm.front_completeness"></el-input> <el-input v-model="establishForm.front_completeness"></el-input>
</el-form-item> </el-form-item>
<!-- orc照片反面完整度 --> <!-- ocr照片反面完整度 -->
<el-form-item <el-form-item
label="orc反面完整度" label="ocr反面完整度"
prop="bak_completeness" prop="bak_completeness"
> >
<el-input v-model="establishForm.bak_completeness"></el-input> <el-input v-model="establishForm.bak_completeness"></el-input>
...@@ -328,11 +328,11 @@ export default { ...@@ -328,11 +328,11 @@ export default {
], ],
// 正面完整度 // 正面完整度
front_completeness: [ front_completeness: [
{ required: true, message: "请填写orc正面完整度", trigger: "blur" } { required: true, message: "请填写ocr正面完整度", trigger: "blur" }
], ],
// 反面完整度 // 反面完整度
bak_completeness: [ bak_completeness: [
{ required: true, message: "请填写orc反面完整度", trigger: "blur" } { required: true, message: "请填写ocr反面完整度", trigger: "blur" }
], ],
// 身份证号 // 身份证号
idcard_number: [ idcard_number: [
......
...@@ -48,6 +48,15 @@ export async function getLog (params) { ...@@ -48,6 +48,15 @@ export async function getLog (params) {
return res; return res;
} }
/**
* 企业资料审核
* @param param 企业资料审核参数
*/
export async function postAudit (params) {
const res = axios.post(`/api/v1/audit`, params);
return res;
}
// 发送企业信息认证 // 发送企业信息认证
export async function entCommit (query) { export async function entCommit (query) {
const res = await axios.post(`/api/v1/emterprise_commit`, query); const res = await axios.post(`/api/v1/emterprise_commit`, query);
......
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