| | |
| | | import ConfigureDialog from './components/ConfigureDialog.vue'; |
| | | import { Message } from '@bole-core/core'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | | import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; |
| | | |
| | | defineOptions({ |
| | | name: 'EnterpriseManageList', |
| | |
| | | ); |
| | | |
| | | async function getEnterpriseElectronSignSetting(id: string) { |
| | | try { |
| | | return await enterpriseServices.getEnterpriseElectronSignSetting({ id: id }); |
| | | } catch (error) {} |
| | | return await enterpriseServices.getEnterpriseElectronSignSetting({ id: id }); |
| | | } |
| | | |
| | | async function getEnterpriseSmsSetting(id: string) { |
| | | try { |
| | | return await enterpriseServices.getEnterpriseSmsSetting({ id: id }); |
| | | } catch (error) {} |
| | | return await enterpriseServices.getEnterpriseSmsSetting({ id: id }); |
| | | } |
| | | |
| | | const EnumElectronSignAccessList = computed(() => |
| | |
| | | ); |
| | | |
| | | 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: EnumElectronSignAccessList.value.map((value) => |
| | | electronSignSetting.electronSignAccesses.includes(value) ? value : null |
| | | ), |
| | | smsAccess: smsSetting.smsAccess, |
| | | smsCost: smsSetting.smsCost, |
| | | }); |
| | | } else { |
| | | handleAdd({ |
| | | enterpriseConfigureType: EnterpriseConfigureType.Electronic, |
| | | }); |
| | | } |
| | | try { |
| | | if (row) { |
| | | let electronSignSetting = await getEnterpriseElectronSignSetting(row.id); |
| | | let smsSetting = await getEnterpriseSmsSetting(row.id); |
| | | // let alipayWallet = await enterpriseWalletServices.getEnterpriseWallet({ |
| | | // enterpriseId: row.id, |
| | | // access: EnumEnterpriseWalletAccess.Alipay, |
| | | // }); |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.AliPay, |
| | | electronSignAccesses: EnumElectronSignAccessList.value.map((value) => |
| | | electronSignSetting.electronSignAccesses.includes(value) ? value : null |
| | | ), |
| | | smsAccess: smsSetting.smsAccess, |
| | | smsCost: smsSetting.smsCost, |
| | | alipayAccount: '', |
| | | alipayMerchantId: '', |
| | | }); |
| | | } else { |
| | | handleAdd({ |
| | | enterpriseConfigureType: EnterpriseConfigureType.AliPay, |
| | | }); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | enterpriseConfigureType: EnterpriseConfigureType.Electronic, |
| | | enterpriseConfigureType: EnterpriseConfigureType.AliPay, |
| | | electronSignAccesses: [] as EnumElectronSignAccess[], |
| | | smsAccess: '' as any as EnumSmsAccess, |
| | | smsCost: 0, |
| | | alipayAccount: '', |
| | | alipayMerchantId: '', |
| | | }, |
| | | }); |
| | | |