| | |
| | | <template #query> |
| | | <QueryFilterItem tip-content="配置状态"> |
| | | <FieldRadio |
| | | v-model="extraParamState.flexEnterpriseSettingStatus" |
| | | :value-enum="FlexEnterpriseSettingStatusText" |
| | | v-model="extraParamState.isConfigured" |
| | | :value-enum="[ |
| | | { |
| | | value: true, |
| | | label: '已配置', |
| | | }, |
| | | { |
| | | value: false, |
| | | label: '未配置', |
| | | }, |
| | | ]" |
| | | buttonStyle |
| | | showAllBtn |
| | | @change="getList()" |
| | |
| | | </QueryFilterItem> |
| | | <QueryFilterItem> |
| | | <SearchInput |
| | | v-model="extraParamState.searchWord" |
| | | v-model="extraParamState.keywords" |
| | | style="width: 200px" |
| | | placeholder="企业名称/法人/联系人" |
| | | @on-click-search="getList" |
| | |
| | | <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> |
| | | </ProTableV2> |
| | | </AppContainer> |
| | | <ConfigureDialog v-bind="dialogProps" /> |
| | | <!-- <ConfigureDialog v-bind="dialogProps" /> --> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | |
| | | FieldRadio, |
| | | } from '@bole-core/components'; |
| | | import { useAccess, useGlobalEventContext } from '@/hooks'; |
| | | import { |
| | | SearchType, |
| | | FlexEnterpriseSettingStatusText, |
| | | FlexEnterpriseSettingStatus, |
| | | FlexEnterpriseCertificationStatusText, |
| | | EnterpriseConfigureType, |
| | | MessageChannelEnum, |
| | | VerifyStatus, |
| | | SignChannelEnum, |
| | | ChargeTypeEnum, |
| | | FlexEnterpriseStatus, |
| | | } from '@/constants'; |
| | | import { EnterpriseConfigureType } from '@/constants'; |
| | | import ConfigureDialog from './components/ConfigureDialog.vue'; |
| | | import { OrderInputType, Message } from '@bole-core/core'; |
| | | import { useQueryClient } from '@tanstack/vue-query'; |
| | | import { Message } from '@bole-core/core'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | | |
| | | defineOptions({ |
| | | name: 'EnterpriseManageList', |
| | |
| | | editBtn: { emits: { onClick: (role) => addOrEditEnterprise(role) } }, |
| | | detailBtn: { emits: { onClick: (role) => handleDetail(role) } }, |
| | | configBtn: { emits: { onClick: (role) => openDialog(role) } }, |
| | | freezeBtn: { emits: { onClick: (role) => handleSetStatus(role) } }, |
| | | }; |
| | | |
| | | const { checkSubModuleItemShow, column, operationBtns } = useAccess({ |
| | |
| | | const BaseState = { |
| | | loading: true, |
| | | }; |
| | | const queryClient = useQueryClient(); |
| | | const typeList = ref([]); |
| | | |
| | | const state = reactive({ ...BaseState }); |
| | | |
| | |
| | | } = useTable( |
| | | async ({ pageIndex, pageSize }, extraParamState) => { |
| | | try { |
| | | let params: API.GetFlexEnterpriseInput = { |
| | | let params: API.GetEnterprisesQuery = { |
| | | pageModel: { |
| | | rows: pageSize, |
| | | page: pageIndex, |
| | | orderInput: extraParamState.orderInput, |
| | | }, |
| | | flexEnterpriseSettingStatus: extraParamState.flexEnterpriseSettingStatus, |
| | | searchWord: extraParamState.searchWord, |
| | | isConfigured: extraParamState.isConfigured, |
| | | keywords: extraParamState.keywords, |
| | | }; |
| | | |
| | | let res = await flexEnterpriseServices.getFlexEnterpriseList(params, { |
| | | let res = await enterpriseServices.getEnterprises(params, { |
| | | showLoading: !state.loading, |
| | | }); |
| | | return res; |
| | |
| | | }, |
| | | { |
| | | defaultExtraParams: { |
| | | searchWord: '', |
| | | orderInput: [{ property: 'id', order: OrderInputType.Desc }], |
| | | flexEnterpriseSettingStatus: '' as any as FlexEnterpriseSettingStatus, |
| | | keywords: '', |
| | | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], |
| | | isConfigured: '' as any as boolean, |
| | | }, |
| | | queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'], |
| | | columnsRenderProps: { |
| | | settingStatus: { type: 'enum', valueEnum: FlexEnterpriseSettingStatusText }, |
| | | certificationStatus: { type: 'enum', valueEnum: FlexEnterpriseCertificationStatusText }, |
| | | }, |
| | | columnsRenderProps: {}, |
| | | } |
| | | ); |
| | | |
| | | function openDialog(row?: API.FlexEnterpriseDto) { |
| | | function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | if (row) { |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | flexEnterpirseId: row.id, |
| | | openBank: row.flexEnterpriseBankDto?.openBank, |
| | | openBranchBank: row.flexEnterpriseBankDto?.openBranchBank, |
| | | bankAccount: row.flexEnterpriseBankDto?.bankAccount, |
| | | verifyStatus: row.flexEnterpriseBankDto?.verifyStatus, |
| | | signChannel: row.enterpriseSignSettingDto?.signChannel, |
| | | chargeType: row.enterpriseSignSettingDto?.chargeType, |
| | | realVerifyCost: row.enterpriseSignSettingDto?.realVerifyCost ?? 0, |
| | | signCost: row.enterpriseSignSettingDto?.signCost ?? 0, |
| | | mergeSignCost: row.enterpriseSignSettingDto?.mergeSignCost ?? 0, |
| | | messageCost: row.flexEnterpriseMessageSettingDto?.messageCost ?? 0, |
| | | messageChannel: row.flexEnterpriseMessageSettingDto?.messageChannel, |
| | | }); |
| | | } else { |
| | | handleAdd({ |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }); |
| | | handleAdd(); |
| | | } |
| | | } |
| | | |
| | |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | flexEnterpirseId: '', |
| | | enterpriseConfigureType: '' as any as EnterpriseConfigureType, |
| | | openBank: '', |
| | | openBranchBank: '', |
| | | bankAccount: '', |
| | | verifyStatus: '' as any as VerifyStatus, |
| | | signChannel: '' as any as SignChannelEnum, |
| | | chargeType: '' as any as ChargeTypeEnum, |
| | | realVerifyCost: 0, |
| | | signCost: 0, |
| | | mergeSignCost: 0, |
| | | messageCost: 0, |
| | | messageChannel: '' as any as MessageChannelEnum, |
| | | }, |
| | | }); |
| | | |
| | | async function handleAddOrEdit(type: EnterpriseConfigureType) { |
| | | try { |
| | | let res; |
| | | if (type === EnterpriseConfigureType.Bank) { |
| | | res = await createOrEditFlexEnterpriseBankSetting(); |
| | | } |
| | | // if (type === EnterpriseConfigureType.Bank) { |
| | | // res = await createOrEditFlexEnterpriseBankSetting(); |
| | | // } |
| | | if (type === EnterpriseConfigureType.Electronic) { |
| | | res = await createOrEditFlexEnterpriseSignSetting(); |
| | | } |
| | |
| | | } 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 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.CreateOrEditFlexEnterpriseSignSettingInput = { |
| | | let params: API.SetEnterpriseElectronSignSettingCommand = { |
| | | id: editForm.id, |
| | | flexEnterpirseId: editForm.flexEnterpirseId, |
| | | signChannel: editForm.signChannel, |
| | | chargeType: editForm.chargeType, |
| | | realVerifyCost: editForm.realVerifyCost, |
| | | signCost: editForm.signCost, |
| | | mergeSignCost: editForm.mergeSignCost, |
| | | }; |
| | | return await flexEnterpriseServices.createOrEditFlexEnterpriseSignSetting(params); |
| | | return await enterpriseServices.setEnterpriseElectronSignSetting(params); |
| | | } catch (error) {} |
| | | } |
| | | async function createOrEditFlexEnterpriseMessageSetting() { |
| | | try { |
| | | let params: API.CreateOrEditFlexEnterpriseMessageSettingInput = { |
| | | let params: API.SetEnterpriseSmsSettingCommand = { |
| | | id: editForm.id, |
| | | flexEnterpirseId: editForm.flexEnterpirseId, |
| | | messageChannel: editForm.messageChannel, |
| | | messageCost: editForm.messageCost, |
| | | }; |
| | | return await flexEnterpriseServices.createOrEditFlexEnterpriseMessageSetting(params); |
| | | return await enterpriseServices.setEnterpriseSmsSetting(params); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function handleSetStatus(row: API.FlexEnterpriseDto) { |
| | | try { |
| | | let params: API.SetFlexEnterpriseStatusInput = { |
| | | id: row.id, |
| | | status: |
| | | row.status === FlexEnterpriseStatus.Frozen |
| | | ? FlexEnterpriseStatus.Normal |
| | | : FlexEnterpriseStatus.Frozen, |
| | | }; |
| | | let res = await flexEnterpriseServices.setFlexEnterpriseStatus(params); |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | function addOrEditEnterprise(row?: API.FlexEnterpriseDto) { |
| | | function addOrEditEnterprise(row?: API.GetEnterprisesQueryResultItem) { |
| | | router.push({ name: 'AddOrEditEnterprise', params: { id: row?.id ?? '' } }); |
| | | } |
| | | function handleDetail(row: API.FlexEnterpriseDto) { |
| | | function handleDetail(row: API.GetEnterprisesQueryResultItem) { |
| | | router.push({ name: 'EnterpriseDetail', params: { id: row?.id ?? '' } }); |
| | | } |
| | | </script> |