| | |
| | | <template> |
| | | <LoadingLayout :loading="state.loading"> |
| | | <LoadingLayout :loading="isInitialLoading"> |
| | | <AppContainer> |
| | | <ProTableQueryFilterBar @on-reset="reset"> |
| | | <template #query> |
| | | <QueryFilterItem tip-content="配置状态"> |
| | | <FieldRadio |
| | | v-model="extraParamState.isConfigured" |
| | | :value-enum="[ |
| | | { |
| | | value: true, |
| | | label: '已配置', |
| | | }, |
| | | { |
| | | value: false, |
| | | label: '未配置', |
| | | }, |
| | | ]" |
| | | :value-enum="IsConfiguredText" |
| | | buttonStyle |
| | | showAllBtn |
| | | @change="getList()" |
| | | /> |
| | | </QueryFilterItem> |
| | | <QueryFilterItem> |
| | | <SearchInput |
| | | v-model="extraParamState.keywords" |
| | | style="width: 200px" |
| | | style="width: 300px" |
| | | placeholder="企业名称/法人/联系人" |
| | | @on-click-search="getList" |
| | | @keyup.enter="getList()" |
| | | > |
| | | </SearchInput> |
| | | </QueryFilterItem> |
| | |
| | | <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> |
| | | </ProTableV2> |
| | | </AppContainer> |
| | | <!-- <ConfigureDialog v-bind="dialogProps" /> --> |
| | | <ConfigureDialog v-bind="dialogProps" /> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | |
| | | LoadingLayout, |
| | | AppContainer, |
| | | QueryFilterItem, |
| | | useTable, |
| | | useFormDialog, |
| | | FieldRadio, |
| | | useTableV2, |
| | | } from '@bole-core/components'; |
| | | import { useAccess, useGlobalEventContext } from '@/hooks'; |
| | | import { EnterpriseConfigureType } from '@/constants'; |
| | | import { EnterpriseConfigureType, IsConfiguredText } from '@/constants'; |
| | | import ConfigureDialog from './components/ConfigureDialog.vue'; |
| | | import { Message } from '@bole-core/core'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | |
| | | |
| | | 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) { |
| | |
| | | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], |
| | | isConfigured: '' as any as boolean, |
| | | }, |
| | | queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'], |
| | | columnsRenderProps: {}, |
| | | queryKey: ['enterpriseServices/getEnterprises'], |
| | | columnsRenderProps: { |
| | | isReal: { type: 'enum', valueEnum: IsRealText }, |
| | | isConfigured: { type: 'enum', valueEnum: IsConfiguredText }, |
| | | }, |
| | | } |
| | | ); |
| | | |
| | | function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row.id, |
| | | }); |
| | | } else { |
| | | handleAdd(); |
| | | } |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }); |
| | | } |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({ |
| | | const { dialogProps, handleEdit, dialogState } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }, |
| | | }); |
| | | |
| | | async function handleAddOrEdit(type: EnterpriseConfigureType) { |
| | | async function handleAddOrEdit() { |
| | | try { |
| | | let res; |
| | | // if (type === EnterpriseConfigureType.Bank) { |
| | | // res = await createOrEditFlexEnterpriseBankSetting(); |
| | | // } |
| | | if (type === EnterpriseConfigureType.Electronic) { |
| | | res = await createOrEditFlexEnterpriseSignSetting(); |
| | | } |
| | | if (type === 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, |
| | | }; |
| | | return await enterpriseServices.setEnterpriseElectronSignSetting(params); |
| | | } catch (error) {} |
| | | } |
| | | async function createOrEditFlexEnterpriseMessageSetting() { |
| | | try { |
| | | let params: API.SetEnterpriseSmsSettingCommand = { |
| | | id: editForm.id, |
| | | }; |
| | | return await enterpriseServices.setEnterpriseSmsSetting(params); |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } catch (error) {} |
| | | } |
| | | |