tengxi 1 year ago
parent 7c77ddcfa6
commit 54b7c20332

@ -2,30 +2,30 @@ import { defHttp } from '@/utils/http/axios'
// 查询企业信息列表
export function getEnterprisePage(params) {
return defHttp.get({ url: '/xxjj/enterprise/page', params })
return defHttp.get({ url: '/system/enterprise/page', params })
}
// 查询企业信息详情
export function getEnterprise(id: number) {
return defHttp.get({ url: '/xxjj/enterprise/get?id=' + id })
return defHttp.get({ url: '/system/enterprise/get?id=' + id })
}
// 新增企业信息
export function createEnterprise(data) {
return defHttp.post({ url: '/xxjj/enterprise/create', data })
return defHttp.post({ url: '/system/enterprise/create', data })
}
// 修改企业信息
export function updateEnterprise(data) {
return defHttp.put({ url: '/xxjj/enterprise/update', data })
return defHttp.put({ url: '/system/enterprise/update', data })
}
// 删除企业信息
export function deleteEnterprise(id: number) {
return defHttp.delete({ url: '/xxjj/enterprise/delete?id=' + id })
return defHttp.delete({ url: '/system/enterprise/delete?id=' + id })
}
// 导出企业信息 Excel
export function exportEnterprise(params) {
return defHttp.download({ url: '/xxjj/enterprise/export-excel', params }, '企业信息.xls')
return defHttp.download({ url: '/system/enterprise/export-excel', params }, '企业信息.xls')
}

@ -0,0 +1,57 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? t('action.edit') : t('action.create')" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, unref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { createFormSchema, updateFormSchema } from './enterprise.data'
// import { createEnterprise, getEnterprise, updateEnterprise } from '@/api/system/enterprise'
import { createEnterprise, getEnterprise, updateEnterprise } from '@/api/xxjj/enterprise'
defineOptions({ name: 'EnterpriseModal' })
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({
labelWidth: 120,
baseColProps: { span: 24 },
schemas: createFormSchema,
showActionButtonGroup: false,
actionColOptions: { span: 23 }
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
resetSchema(updateFormSchema)
const res = await getEnterprise(data.record.id)
setFieldsValue({ ...res })
}
})
async function handleSubmit() {
try {
const values = await validate()
setModalProps({ confirmLoading: true })
if (unref(isUpdate)) {
await updateEnterprise(values)
} else {
await createEnterprise(values)
}
closeModal()
emit('success')
createMessage.success(t('common.saveSuccessText'))
} finally {
setModalProps({ confirmLoading: false })
}
}
</script>

@ -0,0 +1,814 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
// {
// title: '编号',
// dataIndex: 'id',
// width: 160
// },
{
title: '企业名称',
dataIndex: 'name',
width: 160
},
{
title: '机构类型',
dataIndex: 'enterpriseType',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.ENTERPRISE_TYPE)
}
},
{
title: '关联子公司(没弄)',
dataIndex: '',
width: 160
},
{
title: '包含业务线(没弄)',
dataIndex: '',
width: 160
},
{
title: '关联员工(没弄)',
dataIndex: '',
width: 160
},
{
title: '首联系人',
dataIndex: 'firstConcat',
width: 160
},
{
title: '联系电话',
dataIndex: 'phone',
width: 160
},
{
title: '更新时间',
dataIndex: 'updateTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
},
// {
// title: '企业简称',
// dataIndex: 'shortName',
// width: 160
// },
// {
// title: '主体类型',
// dataIndex: 'mainType',
// width: 180,
// customRender: ({ text }) => {
// return useRender.renderDict(text, DICT_TYPE.MAIN_TYPE)
// }
// },
// {
// title: '企业代码',
// dataIndex: 'code',
// width: 160
// },
// {
// title: '社会统一信息代码',
// dataIndex: 'societyCode',
// width: 160
// },
// {
// title: '办理人(0法人 1代办人)',
// dataIndex: 'transactors',
// width: 160
// },
// {
// title: '实际操作人(0法人 1代办人)',
// dataIndex: 'operator',
// width: 160
// },
// {
// title: '法人证件有效期类型(0长期 1非长期)',
// dataIndex: 'legalOperator',
// width: 160
// },
// {
// title: '代办人证件类型(0身份证 1护照)',
// dataIndex: 'commissionCertificateType',
// width: 160
// },
// {
// title: '代办人证件有效期类型(0长期 1非长期)',
// dataIndex: 'commissionOperator',
// width: 160
// },
// {
// title: '创建时间',
// dataIndex: 'createTime',
// width: 180,
// customRender: ({ text }) => {
// return useRender.renderDate(text)
// }
// },
// {
// title: '企业id',
// dataIndex: 'parentId',
// width: 160
// },
]
export const searchFormSchema: FormSchema[] = [
{
label: '企业名称',
field: 'name',
component: 'Input',
colProps: { span: 8 }
},
// {
// label: '主体类型',
// field: 'mainType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.MAIN_TYPE)
// },
// colProps: { span: 8 }
// },
// {
// label: '企业代码',
// field: 'code',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '社会统一信息代码',
// field: 'societyCode',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '办理人(0法人 1代办人)',
// field: 'transactors',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '实际操作人(0法人 1代办人)',
// field: 'operator',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '法人证件有效期类型(0长期 1非长期)',
// field: 'legalOperator',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '代办人证件类型(0身份证 1护照)',
// field: 'commissionCertificateType',
// component: 'Select',
// componentProps: {
// options: []
// },
// colProps: { span: 8 }
// },
// {
// label: '代办人证件有效期类型(0长期 1非长期)',
// field: 'commissionOperator',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '创建时间',
// field: 'createTime',
// component: 'RangePicker',
// colProps: { span: 8 }
// },
// {
// label: '企业id',
// field: 'parentId',
// component: 'Input',
// colProps: { span: 8 }
// },
// {
// label: '总公司,子公司机构类型',
// field: 'enterpriseType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.ENTERPRISE_TYPE)
// },
// colProps: { span: 8 }
// },
]
export const createFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input'
},
{
label: '企业名称',
field: 'name',
required: true,
component: 'Input'
},
// {
// label: '企业简称',
// field: 'shortName',
// component: 'Input'
// },
// {
// label: '主体类型',
// field: 'mainType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.MAIN_TYPE, 'number')
// }
// },
// {
// label: '所在城市',
// field: 'city',
// component: 'Input'
// },
// {
// label: '行业类型',
// field: 'dutyType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.DUTY_TYPE, 'number')
// }
// },
{
label: '首联系人',
field: 'firstConcat',
component: 'Input'
},
// {
// label: '职位',
// field: 'position',
// component: 'Input'
// },
{
label: '手机号码',
field: 'phone',
component: 'Input'
},
// {
// label: 'logo图片',
// field: 'logo',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '地址',
// field: 'address',
// component: 'Input'
// },
// {
// label: '企业电话',
// field: 'enterprisePhone',
// component: 'Input'
// },
// {
// label: '企业传真',
// field: 'enterpriseFax',
// component: 'Input'
// },
// {
// label: '企业网址',
// field: 'enterpriseWebsite',
// component: 'Input'
// },
// {
// label: '企业简介',
// field: 'enterpriseRemark',
// component: 'InputTextArea'
// },
// {
// label: '税号',
// field: 'dutyParagraph',
// component: 'Input'
// },
// {
// label: '发票抬头',
// field: 'invoiceHeader',
// component: 'Input'
// },
// {
// label: '开户银行',
// field: 'openBank',
// component: 'Input'
// },
// {
// label: '银行卡号',
// field: 'bankAccount',
// component: 'Input'
// },
// {
// label: '银行电话',
// field: 'bankPhone',
// component: 'Input'
// },
// {
// label: '注册地址',
// field: 'registerAddress',
// component: 'Input'
// },
// {
// label: '经营开始时间',
// field: 'startDate',
// component: 'DatePicker'
// },
// {
// label: '经营结束时间',
// field: 'endDate',
// component: 'DatePicker'
// },
// {
// label: '证件照',
// field: 'photo',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '经营范围',
// field: 'businessScope',
// component: 'InputTextArea'
// },
// {
// label: '邮箱',
// field: 'email',
// component: 'Input'
// },
// {
// label: '法人证件照1',
// field: 'legalPersonPhoto1',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '法人证件照2',
// field: 'legalPersonPhoto2',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '法人证件照3',
// field: 'legalPersonPhoto3',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '法人证件类型(0身份证 1护照)',
// field: 'legalCertificateType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.CERTIFICATE_TYPE, 'number')
// }
// },
// {
// label: '法人姓名',
// field: 'legalPersonName',
// component: 'Input'
// },
// {
// label: '法人证件号',
// field: 'legalCardNo',
// component: 'Input'
// },
// {
// label: '法人生日',
// field: 'legalBirthday',
// component: 'Input'
// },
// {
// label: '法人证件有效开始时间',
// field: 'legalCardStart',
// component: 'DatePicker'
// },
// {
// label: '法人证件有效结束时间',
// field: 'legalCardEnd',
// component: 'DatePicker'
// },
// {
// label: '代办人证件照1',
// field: 'commissionPersonPhoto1',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '代办人证件照2',
// field: 'commissionPersonPhoto2',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '代办人证件照3',
// field: 'commissionPersonPhoto3',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '代办人证件照4',
// field: 'commissionPersonPhoto4',
// component: 'FileUpload',
// componentProps: {
// fileType: 'file',
// maxCount: 1
// }
// },
// {
// label: '代办人姓名',
// field: 'commissionPersonName',
// component: 'Input'
// },
// {
// label: '代办人证件号',
// field: 'commissionCardNo',
// component: 'Input'
// },
// {
// label: '代办人生日',
// field: 'commissionBirthday',
// component: 'Input'
// },
// {
// label: '代办人证件有效开始时间',
// field: 'commissionCardStart',
// component: 'DatePicker'
// },
// {
// label: '代办人证件有效结束时间',
// field: 'commissionCardEnd',
// component: 'DatePicker'
// },
{
label: '描述',
field: 'description',
component: 'InputTextArea'
},
// {
// label: '企业代码',
// field: 'code',
// component: 'Input'
// },
// {
// label: '社会统一信息代码',
// field: 'societyCode',
// component: 'Input'
// },
// {
// label: '办理人(0法人 1代办人)',
// field: 'transactors',
// component: 'Input'
// },
// {
// label: '实际操作人(0法人 1代办人)',
// field: 'operator',
// component: 'Input'
// },
// {
// label: '法人证件有效期类型(0长期 1非长期)',
// field: 'legalOperator',
// component: 'Input'
// },
// {
// label: '代办人证件类型(0身份证 1护照)',
// field: 'commissionCertificateType',
// component: 'Select',
// componentProps: {
// options:[]
// }
// },
// {
// label: '代办人证件有效期类型(0长期 1非长期)',
// field: 'commissionOperator',
// component: 'Input'
// },
{
label: '企业id',
field: 'parentId',
component: 'Input'
},
{
label: '上级机构',
field: 'enterpriseType',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.ENTERPRISE_TYPE, 'number')
}
},
]
export const updateFormSchema: FormSchema[] = [
// {
// label: '编号',
// field: 'id',
// show: false,
// component: 'Input'
// },
{
label: '企业名称',
field: 'name',
required: true,
component: 'Input'
},
{
label: '企业id',
field: 'parentId',
component: 'Input'
},
{
label: '首联系人',
field: 'firstConcat',
component: 'Input'
},
{
label: '手机号码',
field: 'phone',
component: 'Input'
},
{
label: '机构描述',
field: 'description',
component: 'InputTextArea'
},
// {
// label: '企业简称',
// field: 'shortName',
// component: 'Input'
// },
// {
// label: '主体类型',
// field: 'mainType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.MAIN_TYPE, 'number')
// }
// },
// {
// label: '所在城市',
// field: 'city',
// component: 'Input'
// },
// {
// label: '行业类型',
// field: 'dutyType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.DUTY_TYPE, 'number')
// }
// },
// {
// label: 'logo图片',
// field: 'logo',
// component: 'Upload'
// },
// {
// label: '地址',
// field: 'address',
// component: 'Input'
// },
// {
// label: '企业电话',
// field: 'enterprisePhone',
// component: 'Input'
// },
// {
// label: '企业传真',
// field: 'enterpriseFax',
// component: 'Input'
// },
// {
// label: '企业网址',
// field: 'enterpriseWebsite',
// component: 'Input'
// },
// {
// label: '企业简介',
// field: 'enterpriseRemark',
// component: 'InputTextArea'
// },
// {
// label: '税号',
// field: 'dutyParagraph',
// component: 'Input'
// },
// {
// label: '发票抬头',
// field: 'invoiceHeader',
// component: 'Input'
// },
// {
// label: '开户银行',
// field: 'openBank',
// component: 'Input'
// },
// {
// label: '银行卡号',
// field: 'bankAccount',
// component: 'Input'
// },
// {
// label: '银行电话',
// field: 'bankPhone',
// component: 'Input'
// },
// {
// label: '注册地址',
// field: 'registerAddress',
// component: 'Input'
// },
// {
// label: '经营开始时间',
// field: 'startDate',
// component: 'DatePicker'
// },
// {
// label: '经营结束时间',
// field: 'endDate',
// component: 'DatePicker'
// },
// {
// label: '证件照',
// field: 'photo',
// component: 'Upload'
// },
// {
// label: '经营范围',
// field: 'businessScope',
// component: 'InputTextArea'
// },
// {
// label: '邮箱',
// field: 'email',
// component: 'Input'
// },
// {
// label: '法人证件照1',
// field: 'legalPersonPhoto1',
// component: 'Upload'
// },
// {
// label: '法人证件照2',
// field: 'legalPersonPhoto2',
// component: 'Upload'
// },
// {
// label: '法人证件照3',
// field: 'legalPersonPhoto3',
// component: 'Upload'
// },
// {
// label: '法人证件类型(0身份证 1护照)',
// field: 'legalCertificateType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.CERTIFICATE_TYPE, 'number')
// }
// },
// {
// label: '法人姓名',
// field: 'legalPersonName',
// component: 'Input'
// },
// {
// label: '法人证件号',
// field: 'legalCardNo',
// component: 'Input'
// },
// {
// label: '法人生日',
// field: 'legalBirthday',
// component: 'Input'
// },
// {
// label: '法人证件有效开始时间',
// field: 'legalCardStart',
// component: 'DatePicker'
// },
// {
// label: '法人证件有效结束时间',
// field: 'legalCardEnd',
// component: 'DatePicker'
// },
// {
// label: '代办人证件照1',
// field: 'commissionPersonPhoto1',
// component: 'Upload'
// },
// {
// label: '代办人证件照2',
// field: 'commissionPersonPhoto2',
// component: 'Upload'
// },
// {
// label: '代办人证件照3',
// field: 'commissionPersonPhoto3',
// component: 'Upload'
// },
// {
// label: '代办人证件照4',
// field: 'commissionPersonPhoto4',
// component: 'Upload'
// },
// {
// label: '代办人姓名',
// field: 'commissionPersonName',
// component: 'Input'
// },
// {
// label: '代办人证件号',
// field: 'commissionCardNo',
// component: 'Input'
// },
// {
// label: '代办人生日',
// field: 'commissionBirthday',
// component: 'Input'
// },
// {
// label: '代办人证件有效开始时间',
// field: 'commissionCardStart',
// component: 'DatePicker'
// },
// {
// label: '代办人证件有效结束时间',
// field: 'commissionCardEnd',
// component: 'DatePicker'
// },
// {
// label: '企业代码',
// field: 'code',
// component: 'Input'
// },
// {
// label: '社会统一信息代码',
// field: 'societyCode',
// component: 'Input'
// },
// {
// label: '办理人(0法人 1代办人)',
// field: 'transactors',
// component: 'Input'
// },
// {
// label: '实际操作人(0法人 1代办人)',
// field: 'operator',
// component: 'Input'
// },
// {
// label: '法人证件有效期类型(0长期 1非长期)',
// field: 'legalOperator',
// component: 'Input'
// },
// {
// label: '代办人证件类型(0身份证 1护照)',
// field: 'commissionCertificateType',
// component: 'Select',
// componentProps: {
// options:[]
// }
// },
// {
// label: '代办人证件有效期类型(0长期 1非长期)',
// field: 'commissionOperator',
// component: 'Input'
// },
// {
// label: '总公司,子公司机构类型',
// field: 'enterpriseType',
// component: 'Select',
// componentProps: {
// options: getDictOptions(DICT_TYPE.ENTERPRISE_TYPE, 'number')
// }
// },
]

@ -0,0 +1,92 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" v-auth="['system:enterprise:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button type="warning" v-auth="['system:enterprise:export']" :preIcon="IconEnum.EXPORT" @click="handleExport">
{{ t('action.export') }}
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:enterprise:update', onClick: handleEdit.bind(null, record) },
{
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
auth: 'system:enterprise:delete',
popConfirm: {
title: t('common.delMessage'),
placement: 'left',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
<EnterpriseModal @register="registerModal" @success="reload()" />
</div>
</template>
<script lang="ts" setup>
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import EnterpriseModal from './EnterpriseModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteEnterprise, exportEnterprise, getEnterprisePage } from '@/api/xxjj/enterprise'
import { columns, searchFormSchema } from './enterprise.data'
defineOptions({ name: 'Enterprise' })
const { t } = useI18n()
const { createConfirm, createMessage } = useMessage()
const [registerModal, { openModal }] = useModal()
const [registerTable, { getForm, reload }] = useTable({
title: '分支机构',
api: getEnterprisePage,
columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema },
useSearchForm: true,
showTableSetting: true,
actionColumn: {
width: 140,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
})
function handleCreate() {
openModal(true, { isUpdate: false })
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true })
}
async function handleExport() {
createConfirm({
title: t('common.exportTitle'),
iconType: 'warning',
content: t('common.exportMessage'),
async onOk() {
await exportEnterprise(getForm().getFieldsValue())
createMessage.success(t('common.exportSuccessText'))
}
})
}
async function handleDelete(record: Recordable) {
await deleteEnterprise(record.id)
createMessage.success(t('common.delSuccessText'))
reload()
}
</script>
Loading…
Cancel
Save