Commit 8dcf481f authored by mengwenhao's avatar mengwenhao

feature:增加金山云服务

parents 2027ccc3 f8d5f331
const API_INTERNAL_URI = require("../config.js").API_INTERNAL_URI; const API_INTERNAL_URI = require("../config.js").API_INTERNAL_URI;
const req = require("../utils/request").httpReq; const req = require("../utils/request").httpReq;
exports.entCheck = async (ctx) => { // 获取企业信息验证
exports.entCheck = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/ent_check`; const url = `${API_INTERNAL_URI}/merchant/inner/ent_check`;
// const url = `http://bp-test.ini.yidian-inc.com/merchant/inner/ent_check`;
const { user_id } = ctx.request.query;
const opts = { const opts = {
url: url, url: url,
method: "GET", method: "GET",
qs: {
user_id
}
};
ctx.body = await req(ctx, opts);
};
// 企业信息提交
exports.entCommit = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/inner/ent_commit`;
const opts = {
url,
method: "POST",
json: true, json: true,
timeout: 8000, timeout: 8000,
body: ctx.request.body body: ctx.request.body
}; };
console.log("参数传递", ctx.request);
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
exports.entCommit = async (ctx, next) => { // 生活号检查
const url = `${API_INTERNAL_URI}/merchant/inner/ent_commit`; exports.checkLife = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/enterprise/check_life`;
const opts = {
url,
method: "POST",
json: true,
timeout: 8000,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 创建生活号
exports.createLife = async ctx => {
const url = `${API_INTERNAL_URI}/merchant/enterprise/create_life`;
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
...@@ -23,6 +52,5 @@ exports.entCommit = async (ctx, next) => { ...@@ -23,6 +52,5 @@ exports.entCommit = async (ctx, next) => {
timeout: 8000, timeout: 8000,
body: ctx.request.body body: ctx.request.body
}; };
console.log(next);
ctx.body = await req(ctx, opts); ctx.body = await req(ctx, opts);
}; };
const API_INTERNAL_URI = require('../config.js').API_INTERNAL_URI const { API_INTERNAL_URI } = require("../config.js");
const req = require('../utils/request').httpReq const req = require("../utils/request").httpReq;
var query = { var query = {
async get_permissions(ctx, next) { async get_permissions (ctx) {
// http://bp-test.ini.yidian-inc.com/merchant/authority/get_role_list?user_email=jianghaiming@126.com // http://bp-test.ini.yidian-inc.com/merchant/authority/get_role_list?user_email=jianghaiming@126.com
const url = `${API_INTERNAL_URI}/merchant/authority/get_role_list`; const url = `${API_INTERNAL_URI}/merchant/authority/get_role_list`;
console.log(44444, ctx.request.query.email); console.log(44444, ctx.request.query.email);
const { email } = ctx.request.query; const { email } = ctx.request.query;
const opts = { const opts = {
url, url,
method: 'GET', method: "GET",
qs: { qs: {
user_email: 'jianghaiming@126.com' user_email: "jianghaiming@126.com"
// user_email: email // user_email: email
} }
};
ctx.body = await req(ctx, opts);
} }
ctx.body = await req(ctx, opts) };
}
}
exports.query = async (ctx, next) => { exports.query = async (ctx, next) => {
var type = ctx.params.type var type = ctx.params.type;
console.log("koa user::::::", type) console.log("koa user::::::", type);
if (query[type]) { if (query[type]) {
try { try {
ctx.set('Content-Type', 'application/json; charset=utf-8') ctx.set("Content-Type", "application/json; charset=utf-8");
await query[type](ctx, next) await query[type](ctx, next);
} catch (e) { } catch (e) {
console.error('/api/v1 error', e, ctx.url, ctx.headers['cookie']) console.error("/api/v1 error", e, ctx.url, ctx.headers["cookie"]);
ctx.body = { status: 'failed', reason: 'Internal Server Error' } ctx.body = { status: "failed", reason: "Internal Server Error" };
} }
} else { } else {
ctx.body = { ctx.body = {
status: 'failed', status: "failed",
reason: 'Invalid type param', reason: "Invalid type param"
} };
} }
} };
...@@ -11,6 +11,8 @@ router.get(`${API_VERSION}/fetch_user`, system.fetch_user); ...@@ -11,6 +11,8 @@ 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.get(`${API_VERSION}/certification`, enterprise.entCheck); router.get(`${API_VERSION}/certification`, enterprise.entCheck);
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}/create_life`, enterprise.createLife);
module.exports = router; module.exports = router;
...@@ -3,7 +3,7 @@ const request = require('request') ...@@ -3,7 +3,7 @@ const request = require('request')
exports.httpReq = (ctx, opts) => { exports.httpReq = (ctx, opts) => {
opts.timeout = opts.timeout || 1000 opts.timeout = opts.timeout || 1000
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var time_start = +new Date() // var time_start = +new Date()
request(opts, (err, res, body) => { request(opts, (err, res, body) => {
//console.info(`[Api] httpReq (${opts.url},${opts.headers && opts.headers.cookie}) spent: ${+new Date() - time_start}ms`) //console.info(`[Api] httpReq (${opts.url},${opts.headers && opts.headers.cookie}) spent: ${+new Date() - time_start}ms`)
if (!err) { if (!err) {
......
import request from "@/utils/request";
export default class CommonServer {
static getKsOssSign (params) {
return request({
url: '',
method: 'get',
params
})
}
};
...@@ -18,10 +18,6 @@ const headerConfig = { ...@@ -18,10 +18,6 @@ const headerConfig = {
path: '/life-no/life', path: '/life-no/life',
name: '生活号管理' name: '生活号管理'
}, },
{
path: '/certification',
name: '企业认证管理'
},
{ {
path: '/role', path: '/role',
name: '角色管理' name: '角色管理'
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<h4 style="margin-bottom:20px;">企业信息</h4> <h4 style="margin-bottom:20px;">企业信息</h4>
<!-- 审核/查看详情页 --> <!-- 审核/查看详情页 -->
<el-table <el-table
v-if="pageStatus !=='EDIT' " v-if="pageStatus !== 'EDIT'"
border border
:data="messageList" :data="messageList"
> >
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
<!-- 修改详情页 --> <!-- 修改详情页 -->
<el-form <el-form
:rules="detailRules" v-if="pageStatus === 'EDIT'"
:rules="messageLishRules"
label-width="240px" label-width="240px"
ref="establish_form" ref="establish_form"
:model="messageList[0]" :model="messageList[0]"
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
show-file-list show-file-list
:limit="4" :limit="4"
:auto-upload="false" :auto-upload="false"
:file-list="messageList.licenseList" :file-list="messageList[0].licenseList"
:on-change="onLicenseChange" :on-change="onLicenseChange"
:on-remove="onLicenseRemove" :on-remove="onLicenseRemove"
> >
...@@ -105,14 +106,14 @@ ...@@ -105,14 +106,14 @@
label="企业注册名称:" label="企业注册名称:"
prop="registeredName" prop="registeredName"
> >
<el-input v-model.trim="establishForm.registeredName"></el-input> <el-input v-model.trim="messageList[0].registeredName"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="统一社会信用代码(注册码):" label="统一社会信用代码(注册码):"
prop="registrationCode" prop="registrationCode"
> >
<el-input v-model.trim="establishForm.registrationCode"></el-input> <el-input v-model.trim="messageList[0].registrationCode"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="经营者(法人)身份证照片:" label="经营者(法人)身份证照片:"
...@@ -124,7 +125,7 @@ ...@@ -124,7 +125,7 @@
multiple multiple
show-file-list show-file-list
:auto-upload="false" :auto-upload="false"
:file-list="establishForm.idcardPhoto" :file-list="messageList[0].idcardPhoto"
:on-change="onIdPhoneChange" :on-change="onIdPhoneChange"
:on-remove="onIdPhoneRemove" :on-remove="onIdPhoneRemove"
> >
...@@ -139,21 +140,14 @@ ...@@ -139,21 +140,14 @@
label="经营者(法人)姓名:" label="经营者(法人)姓名:"
prop="legalName" prop="legalName"
> >
<el-input v-model.trim="establishForm.legalName"></el-input> <el-input v-model.trim="messageList[0].legalName"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="经营者(法人)身份证号:" label="经营者(法人)身份证号:"
prop="idcardNumber" prop="idcardNumber"
> >
<el-input v-model.trim="establishForm.idcardNumber"></el-input> <el-input v-model.trim="messageList[0].idcardNumber"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="handelCancel('establish_form')">取消</el-button>
<el-button
@click="handelSubmit('establish_form')"
type="primary"
>提交审核</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
...@@ -294,7 +288,6 @@ ...@@ -294,7 +288,6 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<!-- 查看详情__创建生活号表单 --> <!-- 查看详情__创建生活号表单 -->
<el-dialog <el-dialog
title="创建生活号" title="创建生活号"
...@@ -308,7 +301,10 @@ ...@@ -308,7 +301,10 @@
<el-input v-model="lifeForm.adminPhone"></el-input> <el-input v-model="lifeForm.adminPhone"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="生活号名称:"> <el-form-item label="生活号名称:">
<el-input v-model="lifeForm.lifeName"></el-input> <el-input
@blur="onCheckLife"
v-model="lifeForm.lifeName"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="生活号管理员:"> <el-form-item label="生活号管理员:">
<el-input v-model="lifeForm.lifeAdmin"></el-input> <el-input v-model="lifeForm.lifeAdmin"></el-input>
...@@ -319,7 +315,7 @@ ...@@ -319,7 +315,7 @@
<el-button @click="isDialogShow = false">取 消</el-button> <el-button @click="isDialogShow = false">取 消</el-button>
<el-button <el-button
type="primary" type="primary"
@click="isDialogShow = false" @click="onMakeCreateLife"
>确认创建</el-button> >确认创建</el-button>
</span> </span>
</template> </template>
...@@ -330,8 +326,14 @@ ...@@ -330,8 +326,14 @@
class="edit_button_area" class="edit_button_area"
v-if="pageStatus === 'EDIT'" v-if="pageStatus === 'EDIT'"
> >
<el-button type="danger">取消</el-button> <el-button
<el-button type="primary">提交审核</el-button> @click="handelCancel('establish_form')"
type="danger"
>取消</el-button>
<el-button
@click="handelSubmit('establish_form')"
type="primary"
>提交审核</el-button>
</div> </div>
</div> </div>
</layout> </layout>
...@@ -340,9 +342,10 @@ ...@@ -340,9 +342,10 @@
<style lang="less" src="./index.less" scope></style> <style lang="less" src="./index.less" scope></style>
<script> <script>
import Layout from '@/layouts' import Layout from "@/layouts";
import { checkLife, createLife } from "../../../service/enterprise";
export default { export default {
name: 'Audit', name: "Audit",
components: { Layout }, components: { Layout },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
to.params.pageStatus && to.params.auditId to.params.pageStatus && to.params.auditId
...@@ -358,26 +361,53 @@ export default { ...@@ -358,26 +361,53 @@ export default {
}, },
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
// 审核-企业信息 // 审核/修改详情/查看详情-企业信息
messageList: [ messageList: [
{ {
status: 1, status: 1,
id: 1221, id: 1221,
name: "一点资讯", code: 112211,
code: 1221, registeredName: "一点资讯", // 企业名称
picture: registrationCode: 1221, // 注册码
"https://gimg2.baidu.com/image_search/src=http%3A%2F%2F1812.img.pp.sohu.com.cn%2Fimages%2Fblog%2F2009%2F11%2F18%2F18%2F8%2F125b6560a6ag214.jpg&refer=http%3A%2F%2F1812.img.pp.sohu.com.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1624586640&t=b27aa012d8ca07eb9ab800ea43c5b218", licenseList: [], // 营业执照
userName: "蒙文昊", legalName: "蒙文昊", // 法人姓名
idNumber: 1232131, idcardNumber: 150402199704132713, // 法人身份证号
idPicture: idcardPhoto: [] // 身份证照片
"https://gimg2.baidu.com/image_search/src=http%3A%2F%2F2c.zol-img.com.cn%2Fproduct%2F124_500x2000%2F748%2FceZOdKgDAFsq2.jpg&refer=http%3A%2F%2F2c.zol-img.com.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1624586640&t=a1036d947c1c60f17b178a52d1f8c3f7"
} }
], ],
// 审核-提交信息 // 审核-提交信息
submitList: [ submitList: [
{ {
...@@ -386,7 +416,6 @@ export default { ...@@ -386,7 +416,6 @@ export default {
account: 492148618 account: 492148618
} }
], ],
// 审核-提交历史 // 审核-提交历史
historyList: [ historyList: [
{ {
...@@ -398,63 +427,175 @@ export default { ...@@ -398,63 +427,175 @@ export default {
address: "请求通过,可以提交审核" address: "请求通过,可以提交审核"
} }
], ],
// 审核-审核意见 // 审核-审核意见
opinionArea: "", opinionArea: "",
// 创建生活号表单是否弹出 // 创建生活号表单是否弹出
isDialogShow: false, isDialogShow: false,
// 生活号-生活号信息 // 生活号-生活号信息
lifeList: [ lifeList: [
{ {
lifeId: 1, lifeId: 1,
lifeName: '生活残忍', lifeName: "生活残忍",
adminName: '蒙文昊', adminName: "蒙文昊",
adminNumber: 492148618, adminNumber: 492148618,
adminId: 1111111111 adminId: 1111111111
} }
], ],
// 生活号-提交表单
// 生活号提交表单
lifeForm: { lifeForm: {
adminName: '蒙文昊', adminName: "蒙文昊",
adminPhone: 18147683288, adminPhone: 18147683288,
lifeName: '', lifeName: "",
lifeAdmin: '' lifeAdmin: ""
},
// 修改详情-表单校验规则
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"
}
]
},
// 生活号状态
lifeStatus: false,
// 生活号错误信息
lifeErrorMessage: ""
}; };
}, },
computed: { computed: {
titleContent () { titleContent () {
if (this.pageStatus === 'AUDIT') { if (this.pageStatus === "AUDIT") {
return '审核详情页' return "审核详情页";
} else if (this.pageStatus === 'EDIT') { } else if (this.pageStatus === "EDIT") {
return '修改详情页' return "修改详情页";
} else { } else {
return '查看详情页' return "查看详情页";
}
} }
},
}, },
methods: { methods: {
opinionChange () { },
// 审核-拒绝审核 // 审核-拒绝审核
auditRefuse () { auditRefuse () {
if (this.opinionArea.length === 0) return this.$message.error("请填写拒绝原因"); if (this.opinionArea.length === 0)
return this.$message.error("请填写拒绝原因");
}, },
// 返回上一页 // 返回上一页
goBack () { goBack () {
this.$router.replace({ name: 'Certification' }); this.$router.replace({ name: "Certification" });
}, },
// 生活号-创建生活号弹框显示 // 生活号-创建生活号弹框显示
onCreateLife (params) { onCreateLife (params) {
console.log(params); console.log(params);
this.isDialogShow = true; this.isDialogShow = true;
this.lifeStatus = true;
},
// 修改详情-提交审核
handelSubmit (formName) {
this.$refs[formName].validate(valid => {
console.log(valid);
});
},
// 修改详情-取消修改表单
handelCancel () {
this.$router.replace({ name: "Certification" });
},
// 修改详情-执照列表更改时
onLicenseChange (file, fileList) {
this.messageList[0].licenseList = fileList;
this.$refs["licenseChange"].clearValidate();
console.log("licenseList", this.messageList[0].licenseList);
},
// 修改详情-身份证照片更改时
onIdPhoneChange (file, fileList) {
this.messageList[0].idcardPhoto = fileList;
this.$refs["idcardPhotoChange"].clearValidate();
console.log("idcardPhoto:", this.messageList[0].idcardPhoto);
},
// 修改详情-删除上传的营业执照
onLicenseRemove (file, fileList) {
console.log("file", file);
console.log("fileList", fileList);
this.messageList[0].licenseList = fileList;
console.log("licenseList", this.messageList[0].licenseList);
},
// 修改详情-删除上传的身份证照片
onIdPhoneRemove (file, fileList) {
this.messageList[0].idcardPhoto = fileList;
console.log("idCarPhoto:", this.messageList[0].idcardPhoto);
},
// 查看详情-生活号名称检查
async onCheckLife () {
const res = await checkLife(this.lifeForm.lifeName);
if (res.code !== 0) {
this.lifeErrorMessage = res.reason;
this.lifeStatus = false;
} else {
this.lifeStatus = true;
}
},
// 创建生活号
async onMakeCreateLife () {
if (!this.lifeStatus) {
return this.$message.error(this.lifeErrorMessage);
} else {
const params = {
life_account_name: this.lifeForm.lifeName,
code: this.messageList[0].code,
user_id: ""
};
const res = await createLife(params);
if (res.code !== 0) {
return this.$message.error(res.reason)
} else {
this.$message({ type: 'success', message: '创建生活号成功!' });
this.isDialogShow = false;
}
console.log(res);
}
} }
} }
}; };
......
<template> <template>
<layout> <layout>
<div>
<!-- 企业信息提交 --> <!-- 企业信息提交 -->
<el-button <el-button
type="primary" type="primary"
class="setUp" class="setUp"
@click="goEstablish" @click="goEstablish"
>企业信息提交</el-button> >企业信息提交</el-button>
<div>
<el-card class="enterprise_card"> <el-card class="enterprise_card">
<!-- 企业认证筛选 --> <!-- 企业认证筛选 -->
<el-form <el-form
...@@ -148,17 +147,17 @@ ...@@ -148,17 +147,17 @@
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@click="goAuditPage('AUDIT',scope.row.id)" @click="goAuditPage('AUDIT', scope.row.id)"
>审核</el-button> >审核</el-button>
<el-button <el-button
size="mini" size="mini"
type="success" type="success"
@click="goAuditPage('EDIT',scope.row.id)" @click="goAuditPage('EDIT', scope.row.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.id)"
>查看详情</el-button> >查看详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -172,9 +171,9 @@ ...@@ -172,9 +171,9 @@
<script> <script>
import Layout from '@/layouts' import Layout from '@/layouts'
import { entCheck as entChecked } from '../../../service/enterprise' import { entCheck } from '../../../service/enterprise'
export default { export default {
name: 'Certification', name: "Certification",
components: { Layout }, components: { Layout },
data () { data () {
return { return {
...@@ -215,14 +214,16 @@ export default { ...@@ -215,14 +214,16 @@ export default {
}; };
}, },
created () { }, created () {
this.onEntCheck();
},
methods: { methods: {
// 获取商户认证检查信息 // 获取商户认证检查信息
async entCheck () { async onEntCheck () {
try { try {
const res = await entChecked(510232747179); const res = await entCheck(510232747179);
console.log('res:', res); console.log('res:----', res);
} }
catch (error) { catch (error) {
console.log('error:', error); console.log('error:', error);
...@@ -236,20 +237,18 @@ export default { ...@@ -236,20 +237,18 @@ export default {
// 跳转到审核页面 // 跳转到审核页面
goAuditPage (pageStatus, auditId) { goAuditPage (pageStatus, auditId) {
this.$router.push( this.$router.push({
{
name: "Audit", name: "Audit",
params: { params: {
pageStatus, pageStatus,
auditId auditId
} }
} });
);
}, },
// 跳转到企业信息提交 // 跳转到企业信息提交
goEstablish () { goEstablish () {
this.$router.push({ name: 'Establish' }) this.$router.push({ name: "Establish" });
} }
} }
}; };
......
...@@ -11,9 +11,24 @@ ...@@ -11,9 +11,24 @@
<el-form <el-form
:rules="establishRules" :rules="establishRules"
label-width="240px" label-width="240px"
ref="establish_form" ref="establishFormRef"
:model="establishForm" :model="establishForm"
> >
<el-form-item
label="商户类型"
prop="merchantsType"
>
<el-select v-model="establishForm.merchantsType">
<el-option
label="个体工商户"
value="1"
></el-option>
<el-option
label="普通企业"
value="2"
></el-option>
</el-select>
</el-form-item>
<el-form-item <el-form-item
label="营业执照:" label="营业执照:"
ref="licenseChange" ref="licenseChange"
...@@ -83,9 +98,9 @@ ...@@ -83,9 +98,9 @@
<el-input v-model.trim="establishForm.idcardNumber"></el-input> <el-input v-model.trim="establishForm.idcardNumber"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handelCancel('establish_form')">取消</el-button> <el-button @click="handelCancel('establishFormRef')">取消</el-button>
<el-button <el-button
@click="handelSubmit('establish_form')" @click="handelSubmit('establishFormRef')"
type="primary" type="primary"
>提交审核</el-button> >提交审核</el-button>
</el-form-item> </el-form-item>
...@@ -135,6 +150,7 @@ export default { ...@@ -135,6 +150,7 @@ export default {
return { return {
// 表单输入项 // 表单输入项
establishForm: { establishForm: {
merchantsType: null, // 商户类型
licenseList: [], // 营业执照 licenseList: [], // 营业执照
registeredName: "", // 注册名称 registeredName: "", // 注册名称
registrationCode: "", // 注册码 registrationCode: "", // 注册码
...@@ -180,7 +196,9 @@ export default { ...@@ -180,7 +196,9 @@ export default {
validator: idcardNumberRules, validator: idcardNumberRules,
trigger: "blur" trigger: "blur"
} }
] ],
// 商户类型
merchantsType: [{ required: true, message: "请选择商户类型", trigger: "change" }]
} }
}; };
}, },
...@@ -195,28 +213,22 @@ export default { ...@@ -195,28 +213,22 @@ export default {
onLicenseChange (file, fileList) { onLicenseChange (file, fileList) {
this.establishForm.licenseList = fileList; this.establishForm.licenseList = fileList;
this.$refs["licenseChange"].clearValidate(); this.$refs["licenseChange"].clearValidate();
console.log("licenseList", this.establishForm.licenseList);
}, },
// 身份证照片更改时 // 身份证照片更改时
onIdPhoneChange (file, fileList) { onIdPhoneChange (file, fileList) {
this.establishForm.idcardPhoto = fileList; this.establishForm.idcardPhoto = fileList;
this.$refs["idcardPhotoChange"].clearValidate(); this.$refs["idcardPhotoChange"].clearValidate();
console.log("idcardPhoto:", this.establishForm.idcardPhoto);
}, },
// 删除上传的营业执照 // 删除上传的营业执照
onLicenseRemove (file, fileList) { onLicenseRemove (file, fileList) {
console.log("file", file);
console.log("fileList", fileList);
this.establishForm.licenseList = fileList; this.establishForm.licenseList = fileList;
console.log("licenseList", this.establishForm.licenseList);
}, },
// 删除上传的身份证照片 // 删除上传的身份证照片
onIdPhoneRemove (file, fileList) { onIdPhoneRemove (file, fileList) {
this.establishForm.idcardPhoto = fileList; this.establishForm.idcardPhoto = fileList;
console.log("idCarPhoto:", this.establishForm.idcardPhoto);
}, },
// 取消创建表单 // 取消创建表单
...@@ -229,33 +241,46 @@ export default { ...@@ -229,33 +241,46 @@ export default {
this.$refs[formName].validate(async valid => { this.$refs[formName].validate(async valid => {
console.log(valid); console.log(valid);
const query = { const query = {
user_id: 510232747179, user_id: 510232747179, // 用户id
code: parseInt(this.establishForm.registrationCode), code: parseInt(this.establishForm.registrationCode), // 企业代码
name: this.establishForm.registeredName, name: this.establishForm.registeredName, // 企业名称
type: '', type: "", // 企业类型
addr: '', addr: "", // 企业注册地址
pers: '', pers: "", // 法人
scope: '', scope: "", // 经营范围
time: '', time: "", // 有效期
regi: '', regi: "", // 注册资本
organizer: '', organizer: "", // 主管单位(!)
date: '', date: "", // 成立时间(!)
comp: '', comp: "", // 登记机关(!)
num: '', num: "", // 登记号(!)
form: '', form: "", // 组成形式(!)
funding: '', funding: "", // 经费来源(!)
issue_date: '', issue_date: "", // 发证日期(!)
entterprise_image: '', entterprise_image: "", // 金山云key
data_from: '', data_from: "", // 数据来源,1C端,2B端,3 OP后台代提交
proxy_user_name: '' proxy_user_name: "" // OP后台代提交 代提交人名(!)
} };
if (valid) { if (valid) {
const res = await entCommit(query); const res = await entCommit(query);
if (res.code !== 0) {
return this.$message.error(res.reason);
} else {
this.$message({ type: "success", message: "信息提交成功!" });
}
console.log(res); console.log(res);
} else { } else {
this.$message.error('验证不通过') this.$message.error("表单未填写完整!");
} }
}); });
},
// 选择商户
chooseType () {
if (this.establishForm.merchantsType) {
this.$refs["merchantsTypeRef"].clearValidate();
}
console.log(this.establishForm.merchantsType);
} }
} }
}; };
......
.role_management {
padding: 50px;
}
.role_management .el-button {
margin: 0 2px;
}
.role_management{
padding: 50px;
.el-button{
margin: 0 2px;
}
}
\ No newline at end of file
<template>
<layout>
<el-card class="role_management">
<!-- 角色检索区域 -->
<el-form
inline
:model="searchForm"
>
<el-form-item label="角色名称">
<el-input v-model="searchForm.roleName"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select
v-model="searchForm.roleStatus"
placeholder="请选择角色状态"
>
<el-option
label="正常"
:value="1"
></el-option>
<el-option
label="禁用"
:value="2"
></el-option>
<el-option
label="删除"
:value="3"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
</el-form-item>
</el-form>
<!-- 角色搜索列表 -->
<el-table
border
:data="managementList"
>
<el-table-column
label="ID"
prop="id"
align="center"
></el-table-column>
<el-table-column
label="角色名称"
prop="name"
align="center"
></el-table-column>
<el-table-column
label="状态"
prop="status"
align="center"
></el-table-column>
<el-table-column
label="最后修改日期"
prop="lastDate"
align="center"
></el-table-column>
<el-table-column
label="最后修改人账号"
prop="updateNumber"
align="center"
></el-table-column>
<el-table-column
label="操作"
align="center"
>
<template #default="scope">
<el-button
size="mini"
@click="handelClick(scope.row)"
type="primary"
>修改</el-button>
<el-button
size="mini"
@click="handelClick(scope.row)"
type="warning"
>删除</el-button>
<el-button
size="mini"
@click="handelClick(scope.row)"
type="danger"
>禁用</el-button>
<el-button
size="mini"
@click="handelClick(scope.row)"
type="success"
>启用</el-button>
<el-button
style="margin-top:10px"
size="mini"
@click="handelClick(scope.row)"
>查看详情</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</layout>
</template>
<style lang="less" scope src="./index.less"></style>
<script>
import Layout from "@/layouts";
export default {
name: 'RoleManagement',
components: {
Layout
},
data () {
return {
searchForm: {
roleName: '',
roleStatus: 1
},
managementList: [
{
id: 1,
name: '超级管理员',
status: 1,
lastDate: '2021-05-31',
updateNumber: 492148618,
}
]
}
},
};
</script>
...@@ -18,6 +18,8 @@ const routes = [ ...@@ -18,6 +18,8 @@ const routes = [
name: 'NotFound', name: 'NotFound',
component: () => import(/* webpackChunkName: "enterprise" */ '@/pages/Catch/notFound'), component: () => import(/* webpackChunkName: "enterprise" */ '@/pages/Catch/notFound'),
}, },
// 企业认证管理
{ {
path: '/403', path: '/403',
name: 'Forbidden', name: 'Forbidden',
...@@ -57,9 +59,9 @@ const routes = [ ...@@ -57,9 +59,9 @@ const routes = [
} }
}, },
{ {
path: '/life-no/lifeNoDetail', path: "/life-no/lifeNoDetail",
name: 'LifeNoDetail', name: "LifeNoDetail",
component: LifeNoDetail, component: LifeNoDetail
}, },
//用户管理 //用户管理
{ {
...@@ -77,15 +79,20 @@ const routes = [ ...@@ -77,15 +79,20 @@ const routes = [
}, },
//角色管理 //角色管理
{ {
path: '/role/addRole', path: "/role/addRole",
name: 'AddRole', name: "AddRole",
component: AddRole, component: AddRole
}, },
{
path: "/role",
name: "Role",
component: import(/* webpackChunkName: "role" */ "@/pages/Role/RoleManagement")
}
]; ];
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
routes, routes
}); });
export default router; export default router;
/**
* 企业认证
*/
import axios from "../utils/request"; import axios from "../utils/request";
// 获取审核列表
// export async function auditList (params) {
// const res = await axios.post(``)
// }
// 企业信息检查 // 企业信息检查
export async function entCheck (user_id) { export async function entCheck (user_id) {
const res = await axios.get(`/api/v1/certification`, { params: { user_id } }); const res = await axios.get(`/api/v1/certification`, { params: { user_id } });
return res.result; 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 });
return res.result; return res;
}
// 检查生活号信息唯一性
export async function checkLife (life_account_name) {
const res = await axios.post(`/api/v1/check_life`, { life_account_name });
return res;
}
// 创建生活号
export async function createLife (params) {
const res = await axios.post(`/api/v1/create_life`, { params });
return res;
} }
import moment from "moment";
import CommonServer from "@/api/common";
import axios from "axios";
import { ElMessage } from "element-plus";
// 文件扩展名提取
export const fileType = fileName => {
fileName.substring(fileName.lastIndexOf(".") + 1);
};
/**
* oss 路径定义
* @param file 文件
* @param customFileType 自定义扩展名
*/
export const ossPath = (file, customFileType) => {
const folder = moment().format("YYYY-MM-DD");
const name = moment().format("YYYY-MM-DD-HH-mm-ss-SSS");
if (file.name) {
const type = fileType(file.name);
return `项目名称(金山云上创建的对应项目文件名/upload/${folder}/${type}/${name}.${type})`;
} else if (customFileType) {
return `项目名称(金山云上创建的对应项目文件名/upload/${folder}/${customFileType}/${name}.${customFileType})`;
}
};
/**
* 金山云上传
* @returns {Promise<any>}
*/
export const ksOssUpload = (file, customFileType) => {
return new Promise((resolve, reject) => {
const key = ossPath(file, customFileType);
const params = { fileName: key };
CommonServer.getKsOssSign(params)
.then(res => {
const { accessid, policy, signature, host } = res;
const formData = new FormData();
formData.append("acl", "public-read");
formData.append("key", key);
formData.append("signature", signature);
formData.append("KSSAccessKeyId", accessid);
formData.append("policy", policy);
formData.append("file", file);
axios
.post(`https://${host}`, formData)
.then(res => {
const { status } = res;
if (status === 200) {
const data = {
url: `https://${host}/${key}`,
type: file.name ? fileType(file.name) : customFileType
};
resolve(data);
} else {
reject(res);
}
})
.catch(err => {
reject(err);
});
})
.catch(err => {
console.log(err);
});
});
};
/**
* 上传文件大小限制
* @param file
* @param fileMaxSize
* @returns {boolean}
*/
export const isMaxFileSize = (file, fileMaxSize = 1) => {
if (!file) return false;
const isMaxSize = file.size / 1024 / 1024 < fileMaxSize;
if (!isMaxSize) {
ElMessage.error(`上传文件大小不能超过${fileMaxSize}MB!`);
return false;
}
return true;
};
/**
* 文件最大数量限制
* @param fileList
* @param maxLength
* @returns {boolean}
*/
export const isMaxFileLength = (fileList = [], maxLength = 3) => {
if (fileList.length > maxLength) {
ElMessage.error(`最多上传${maxLength}个文件`);
return false;
}
return true;
};
/**
* 判断上传是否为图片
* @param file
* @returns {boolean}
*/
export const isImageFile = file => {
if (!file) return false;
const types = [
"image/png",
"image/gif",
"image/jpeg",
"image/jpg",
"image/bmp",
"image/x-icon"
];
const isImage = types.includes(file.type);
if (!isImage) {
ElMessage.error(`上传文件非图片格式`);
return false;
}
return true;
};
/**
* 判断图片是否损坏
* @param file
*/
export const isNormalImage = file => {
return new Promise((resolve, reject) => {
if (!file) return;
const image = new Image();
image.src = file;
image.onload = () => {
resolve({ status: 1, message: "加载成功" });
};
image.onerror = () => {
reject({ status: 0, errMsg: "图片损坏,请重新上传" });
};
});
};
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