| | |
| | | <template> |
| | | <LoadingLayout :loading="state.loading"> |
| | | <LoadingLayout :loading="isInitialLoading"> |
| | | <AppContainer> |
| | | <ProTableQueryFilterBar @on-reset="reset"> |
| | | <template #query> |
| | |
| | | :value-enum="IsConfiguredText" |
| | | buttonStyle |
| | | showAllBtn |
| | | @change="getList()" |
| | | /> |
| | | </QueryFilterItem> |
| | | <QueryFilterItem> |
| | |
| | | style="width: 300px" |
| | | placeholder="企业名称/法人/联系人" |
| | | @on-click-search="getList" |
| | | @keyup.enter="getList()" |
| | | > |
| | | </SearchInput> |
| | | </QueryFilterItem> |
| | |
| | | LoadingLayout, |
| | | AppContainer, |
| | | QueryFilterItem, |
| | | useTable, |
| | | useFormDialog, |
| | | FieldRadio, |
| | | useTableV2, |
| | | } from '@bole-core/components'; |
| | | import { useAccess, useGlobalEventContext } from '@/hooks'; |
| | | import { EnterpriseConfigureType, IsConfiguredText } from '@/constants'; |
| | |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const BaseState = { |
| | | loading: true, |
| | | }; |
| | | |
| | | const state = reactive({ ...BaseState }); |
| | | |
| | | onMounted(async () => { |
| | | await getList(); |
| | | state.loading = false; |
| | | }); |
| | | |
| | | const { |
| | | getDataSource: getList, |
| | | proTableProps, |
| | | paginationState, |
| | | extraParamState, |
| | | reset, |
| | | } = useTable( |
| | | async ({ pageIndex, pageSize }, extraParamState) => { |
| | | isInitialLoading, |
| | | } = useTableV2( |
| | | async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => { |
| | | try { |
| | | let params: API.GetEnterprisesQuery = { |
| | | pageModel: { |
| | |
| | | }; |
| | | |
| | | let res = await enterpriseServices.getEnterprises(params, { |
| | | showLoading: !state.loading, |
| | | showLoading: !isInitialLoading, |
| | | }); |
| | | return res; |
| | | } catch (error) { |
| | |
| | | } |
| | | ); |
| | | |
| | | async function getEnterpriseElectronSignSetting(id: string) { |
| | | try { |
| | | return await enterpriseServices.getEnterpriseElectronSignSetting({ id: id }); |
| | | } catch (error) {} |
| | | function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }); |
| | | } |
| | | |
| | | async function getEnterpriseSmsSetting(id: string) { |
| | | try { |
| | | return await enterpriseServices.getEnterpriseSmsSetting({ id: id }); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | if (row) { |
| | | let electronSignSetting = await getEnterpriseElectronSignSetting(row.id); |
| | | let smsSetting = await getEnterpriseSmsSetting(row.id); |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.Electronic, |
| | | electronSignAccesses: electronSignSetting.electronSignAccesses, |
| | | smsAccess: smsSetting.smsAccess, |
| | | smsCost: smsSetting.smsCost, |
| | | }); |
| | | } else { |
| | | handleAdd({ |
| | | enterpriseConfigureType: EnterpriseConfigureType.Electronic, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({ |
| | | const { dialogProps, handleEdit, dialogState } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | enterpriseConfigureType: EnterpriseConfigureType.Electronic, |
| | | electronSignAccesses: [] as EnumElectronSignAccess[], |
| | | smsAccess: '' as any as EnumSmsAccess, |
| | | smsCost: 0, |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }, |
| | | }); |
| | | |
| | | async function handleAddOrEdit() { |
| | | try { |
| | | let res; |
| | | // if (type === EnterpriseConfigureType.Bank) { |
| | | // res = await createOrEditFlexEnterpriseBankSetting(); |
| | | // } |
| | | if (editForm.enterpriseConfigureType === EnterpriseConfigureType.Electronic) { |
| | | res = await createOrEditFlexEnterpriseSignSetting(); |
| | | } |
| | | if (editForm.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage) { |
| | | res = await createOrEditFlexEnterpriseMessageSetting(); |
| | | } |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | // async function createOrEditFlexEnterpriseBankSetting() { |
| | | // try { |
| | | // let params: API.CreateOrEditFlexEnterpriseBankInput = { |
| | | // id: editForm.id, |
| | | // openBank: editForm.openBank, |
| | | // openBranchBank: editForm.openBranchBank, |
| | | // bankAccount: editForm.bankAccount, |
| | | // verifyStatus: editForm.verifyStatus, |
| | | // flexEnterpirseId: editForm.flexEnterpirseId, |
| | | // }; |
| | | // return await flexEnterpriseServices.createOrEditFlexEnterpriseBankSetting(params); |
| | | // } catch (error) {} |
| | | // } |
| | | async function createOrEditFlexEnterpriseSignSetting() { |
| | | try { |
| | | let params: API.SetEnterpriseElectronSignSettingCommand = { |
| | | id: editForm.id, |
| | | electronSignAccesses: editForm.electronSignAccesses, |
| | | }; |
| | | return await enterpriseServices.setEnterpriseElectronSignSetting(params); |
| | | } catch (error) {} |
| | | } |
| | | async function createOrEditFlexEnterpriseMessageSetting() { |
| | | try { |
| | | let params: API.SetEnterpriseSmsSettingCommand = { |
| | | id: editForm.id, |
| | | smsAccess: editForm.smsAccess, |
| | | smsCost: editForm.smsCost, |
| | | }; |
| | | return await enterpriseServices.setEnterpriseSmsSetting(params); |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } catch (error) {} |
| | | } |
| | | |