Browse Source

refactor: 重构企业审核管理

master
wangxiang 2 years ago
parent
commit
c5b8379183
  1. 23
      src/views/common/push/pushEnterpriseAudit/EnterpriseAuditModal.vue
  2. 91
      src/views/common/push/pushEnterpriseAudit/enterpriseAudit.data.ts
  3. 34
      src/views/common/push/pushEnterpriseAudit/index.vue
  4. 11
      src/views/system/user/account/setting/entCertification/Step1.vue
  5. 8
      src/views/system/user/account/setting/entCertification/Step2.vue
  6. 4
      src/views/system/user/account/setting/entCertification/Step3.vue
  7. 75
      src/views/system/user/account/setting/entCertification/data.ts
  8. 1
      src/views/system/user/account/setting/entCertification/data.tsx
  9. 6
      src/views/system/user/account/setting/entCertification/index.vue

23
src/views/common/push/pushEnterpriseAudit/ThirdPartyModal.vue → src/views/common/push/pushEnterpriseAudit/EnterpriseAuditModal.vue

@ -14,18 +14,12 @@ @@ -14,18 +14,12 @@
</BasicModal>
</template>
<script lang="ts" setup>
/**
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致
* 采用vben-动态表格表单封装组件编写,采用 setup 写法
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-王翔
*/
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './thirdParty.data';
import { editPushThirdParty, getPushThirdParty, delPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty';
import { formSchema } from './enterpriseAudit.data';
import { getPushEnterprise, editPushEnterprise, delPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
import { ref } from 'vue';
import {useMessage} from '/@/hooks/web/useMessage';
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage } = useMessage();
const id = ref<string>('');
@ -44,15 +38,17 @@ @@ -44,15 +38,17 @@
id.value = data.record?.id;
const props: Partial<ModalProps> = { confirmLoading: false };
// tag
props.title = '审批企业申请';
await setFieldsValue(await getPushThirdParty(id.value));
props.title = '企业审核';
let enterprise = await getPushEnterprise(id.value);
enterprise.license = String(enterprise.license).split(',');
await setFieldsValue(enterprise);
await setProps({ disabled: true });
// :
setModalProps(props);
});
async function handleReject() {
await delPushThirdParty(id.value);
await delPushEnterprise(id.value);
closeModal();
createMessage.info('审核驳回!');
emit('success');
@ -61,9 +57,10 @@ @@ -61,9 +57,10 @@
async function handleSubmit() {
try {
const formData = await validate();
formData.license = Array(formData.license).join(',');
formData.status = '1';
setModalProps({ confirmLoading: true });
await editPushThirdParty(formData);
await editPushEnterprise(formData);
closeModal();
createMessage.success('审核通过!');
emit('success');

91
src/views/common/push/pushEnterpriseAudit/thirdParty.data.ts → src/views/common/push/pushEnterpriseAudit/enterpriseAudit.data.ts

@ -1,15 +1,17 @@ @@ -1,15 +1,17 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import {listUser} from "/@/api/platform/system/controller/user";
import {commonUpload} from "/@/api/platform/core/controller/upload";
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '法定代表人',
dataIndex: 'statutoryRepName',
title: '企业名称',
dataIndex: 'name'
},
{
title: '企业名称',
dataIndex: 'entName'
title: '法定代表人',
dataIndex: 'repName',
},
{
title: '手机号',
@ -32,7 +34,7 @@ export const columns: BasicColumn[] = [ @@ -32,7 +34,7 @@ export const columns: BasicColumn[] = [
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'entName',
field: 'name',
label: '企业名称',
component: 'Input',
componentProps: {
@ -48,37 +50,94 @@ export const formSchema: FormSchema[] = [ @@ -48,37 +50,94 @@ export const formSchema: FormSchema[] = [
field: 'id',
label: 'ID',
component: 'Input',
show: false
show: false,
},
{
field: 'statutoryRepName',
label: '法定代表人',
component: 'Input',
required: true
},
{
field: 'idCard',
label: '身份证',
field: 'name',
label: '企业名称',
component: 'Input',
required: true,
colProps: {
span: 12
},
},
{
field: 'entName',
label: '企业名称',
field: 'repName',
label: '法定代表人',
component: 'Input',
required: true,
colProps: {
span: 12
},
},
{
field: 'phone',
label: '手机号',
component: 'Input',
required: true,
colProps: {
span: 12
},
rules: [
{
required: true,
message: '请输入手机号!',
},
{
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'),
message: '请输入正确的手机号码!',
validateTrigger: 'blur'
}
]
},
{
field: 'userId',
label: '关联用户',
component: 'ApiSelect',
required: true,
componentProps: {
api: listUser,
params: {
size: 99
},
labelField: 'nickName',
valueField: 'id',
resultField: 'data'
},
},
{
field: 'license',
label: '营业执照',
component: 'Upload',
required: true,
componentProps: {
multiple: true,
maxSize: 20,
maxNumber: 10,
showUploadSaveBtn: true,
showPreviewNumber: true,
emptyHidePreview: true,
api: commonUpload,
accept: ['image/*']
}
},
{
field: 'creditCode',
label: '信用代码',
component: 'Input',
required: true,
colProps: {
span: 12
},
},
{
field: 'idCard',
label: '身份证',
component: 'Input',
required: true,
colProps: {
span: 12
},
},
{
field: 'detailedAddress',

34
src/views/common/push/pushEnterpriseAudit/index.vue

@ -11,41 +11,36 @@ @@ -11,41 +11,36 @@
@click="handleDel()"
>驳回申请</a-button>
</template>
<template #action="{ record }">
<TableAction
:actions="[
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction :actions="[
{
label: '审',
label: '审',
icon: 'fa6-regular:pen-to-square',
onClick: handleEdit.bind(null, record)
},
{
label: '删除',
label: '驳回',
icon: 'ant-design:delete-outlined',
color: 'error',
onClick: handleDel.bind(null, record)
}]"
/>
/>
</template>
</template>
</BasicTable>
<!--弹出窗体区域-->
<ThirdPartyModal @register="registerModal" @success="handleRefreshTable"/>
<EnterpriseAuditModal @register="registerModal" @success="handleRefreshTable"/>
</div>
</template>
<script lang="ts" setup>
/**
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致
* 采用vben-动态表格表单封装组件编写,采用 setup 写法
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-王翔
*/
import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listPushThirdParty, delPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty';
import { listPushEnterprise, delPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise';
import { useModal } from '/@/components/Modal';
import ThirdPartyModal from './ThirdPartyModal.vue';
import { columns, searchFormSchema } from './thirdParty.data';
import EnterpriseAuditModal from './EnterpriseAuditModal.vue';
import { columns, searchFormSchema } from './enterpriseAudit.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
@ -64,8 +59,8 @@ @@ -64,8 +59,8 @@
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '企业申请列表',
api: listPushThirdParty,
title: '企业审核列表',
api: listPushEnterprise,
rowKey: 'id',
columns,
formConfig: {
@ -90,7 +85,6 @@ @@ -90,7 +85,6 @@
width: 220,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: false
},
searchInfo: {
@ -125,7 +119,7 @@ @@ -125,7 +119,7 @@
title: '警告',
content: `是否确认驳回编号为${ids}的数据?`,
onOk: async () => {
await delPushThirdParty(ids);
await delPushEnterprise(ids);
createMessage.success('驳回成功!');
handleRefreshTable();
}

11
src/views/system/user/account/setting/entCertification/Step1.vue

@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
<script lang="ts">
import { defineComponent, ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form';
import { formSchema } from '/@/views/common/push/pushEnterprise/thirdParty.data';
import { addPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty';
import { formSchema } from './data';
import { addPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise';
import { useMessage } from '/@/hooks/web/useMessage';
export default defineComponent({
@ -36,9 +36,10 @@ @@ -36,9 +36,10 @@
async function handleSubmit() {
try {
const formData = await validate();
formData.license = Array(formData.license).join(',');
submitBtnLoading.value = true;
await addPushThirdParty(formData);
createMessage.success('保存成功!');
await addPushEnterprise(formData);
createMessage.success('提交成功!');
emit('next');
} finally {
submitBtnLoading.value = false;
@ -51,7 +52,7 @@ @@ -51,7 +52,7 @@
</script>
<style lang="less" scoped>
.step1 {
width: 450px;
width: 550px;
margin: 0 auto;
}
</style>

8
src/views/system/user/account/setting/entCertification/Step2.vue

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<template>
<div class="step2">
<AResult title="等待审核" sub-title="预计在一个小时内完成">
<AResult title="等待审核" sub-title="预计客服在一个小时内完成">
<template #icon>
<SmileOutlined/>
</template>
@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
</template>
<script lang="ts" setup>
import { Result } from 'ant-design-vue';
import { delRevokeAuth } from '/@/api/platform/common/controller/pushThirdParty';
import { revokeAuthPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise';
import { useMessage } from '/@/hooks/web/useMessage';
import { SmileOutlined } from '@ant-design/icons-vue';
@ -27,9 +27,9 @@ @@ -27,9 +27,9 @@
createConfirm({
iconType: 'warning',
title: '温馨提醒',
content: '是否确认撤回申请?',
content: '是否确认撤回审核申请?',
onOk: async () => {
await delRevokeAuth();
await revokeAuthPushEnterprise();
emit('previous');
}
});

4
src/views/system/user/account/setting/entCertification/Step3.vue

@ -5,14 +5,14 @@ @@ -5,14 +5,14 @@
<a-button @click="handleViewInfo">查看企业信息</a-button>
</template>
</AResult>
<ThirdPartyModal @register="registerModal"/>
<EnterpriseModal @register="registerModal"/>
</div>
</template>
<script lang="ts" setup>
import { Result } from 'ant-design-vue';
const AResult = Result;
import { useModal } from '/@/components/Modal';
import ThirdPartyModal from '/@/views/common/push/pushEnterprise/ThirdPartyModal.vue';
import EnterpriseModal from '/@/views/common/push/pushEnterprise/EnterpriseModal.vue';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();

75
src/views/system/user/account/setting/entCertification/data.ts

@ -0,0 +1,75 @@ @@ -0,0 +1,75 @@
import { FormSchema } from '/@/components/Form';
import { commonUpload } from '/@/api/platform/core/controller/upload';
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false,
},
{
field: 'name',
label: '企业名称',
component: 'Input',
required: true,
},
{
field: 'repName',
label: '法定代表人',
component: 'Input',
required: true,
},
{
field: 'phone',
label: '手机号',
component: 'Input',
required: true,
rules: [
{
required: true,
message: '请输入手机号!',
},
{
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'),
message: '请输入正确的手机号码!',
validateTrigger: 'blur'
}
]
},
{
field: 'license',
label: '营业执照',
component: 'Upload',
required: true,
componentProps: {
multiple: true,
maxSize: 20,
maxNumber: 10,
showUploadSaveBtn: true,
showPreviewNumber: true,
emptyHidePreview: true,
api: commonUpload,
accept: ['image/*']
}
},
{
field: 'creditCode',
label: '信用代码',
component: 'Input',
required: true,
},
{
field: 'idCard',
label: '身份证',
component: 'Input',
required: true,
},
{
field: 'detailedAddress',
label: '详细地址',
component: 'Input',
required: true,
}
];

1
src/views/system/user/account/setting/entCertification/data.tsx

@ -1 +0,0 @@ @@ -1 +0,0 @@
import { FormSchema } from '/@/components/Form';

6
src/views/system/user/account/setting/entCertification/index.vue

@ -25,8 +25,8 @@ @@ -25,8 +25,8 @@
import Step3 from './Step3.vue';
import { Steps } from 'ant-design-vue';
import { useContentHeight } from '/@/hooks/web/useContentHeight';
import { getPushThirdPartyByUserId } from '/@/api/platform/common/controller/pushThirdParty';
import type { PushEnterprise } from '/@/api/platform/common/entity/pushThirdParty';
import { getPushEnterpriseByUserId } from '/@/api/platform/common/controller/pushEnterprise';
import type { PushEnterprise } from '/@/api/platform/common/entity/pushEnterprise';
import { useUserStore } from '/@/store/modules/user';
const ASteps = Steps;
@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
});
async function refreshPushThirdParty() {
const result = await getPushThirdPartyByUserId(userInfoStore.id);
const result = await getPushEnterpriseByUserId(userInfoStore.id);
pushThirdParty.value = result;
switch (result?.status) {
case '0':

Loading…
Cancel
Save