| | |
| | | <template> |
| | | <LoadingLayout :loading="isInitialLoading"> |
| | | <LoadingLayout :loading="state.loading"> |
| | | <AppContainer> |
| | | <ProTableQueryFilterBar @on-reset="reset"> |
| | | <template #query> |
| | |
| | | import { Message } from '@bole-core/core'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | | import WechatWalletOpen from './components/WechatWalletOpen.vue'; |
| | | import { stat } from 'fs'; |
| | | |
| | | defineOptions({ |
| | | name: 'EnterpriseManageList', |
| | |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const { |
| | | getDataSource: getList, |
| | | proTableProps, |
| | | paginationState, |
| | | extraParamState, |
| | | reset, |
| | | isInitialLoading, |
| | | } = useTableV2( |
| | | async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => { |
| | | try { |
| | | let params: API.GetEnterprisesQuery = { |
| | | pageModel: { |
| | | rows: pageSize, |
| | | page: pageIndex, |
| | | orderInput: extraParamState.orderInput, |
| | | }, |
| | | isConfigured: extraParamState.isConfigured, |
| | | keywords: extraParamState.keywords, |
| | | }; |
| | | const BaseState = { |
| | | loading: true, |
| | | }; |
| | | |
| | | let res = await enterpriseServices.getEnterprises(params, { |
| | | showLoading: !isInitialLoading, |
| | | }); |
| | | return res; |
| | | } catch (error) { |
| | | console.log('error: ', error); |
| | | } |
| | | }, |
| | | { |
| | | defaultExtraParams: { |
| | | keywords: '', |
| | | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], |
| | | isConfigured: '' as any as boolean, |
| | | }, |
| | | queryKey: ['enterpriseServices/getEnterprises'], |
| | | columnsRenderProps: { |
| | | isReal: { type: 'enum', valueEnum: IsRealText }, |
| | | isConfigured: { type: 'enum', valueEnum: IsConfiguredText }, |
| | | type: { type: 'enum', valueEnum: EnumEnterpriseTypeText }, |
| | | }, |
| | | } |
| | | ); |
| | | const state = reactive({ ...BaseState }); |
| | | |
| | | const { getList, proTableProps, paginationState, extraParamState, reset } = useGetEnterprises({ |
| | | type: EnumEnterpriseType.Supplier, |
| | | }); |
| | | |
| | | function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | handleEdit({ |
| | |
| | | function handleDetail(row: API.GetEnterprisesQueryResultItem) { |
| | | router.push({ name: 'EnterpriseDetail', params: { id: row?.id ?? '' } }); |
| | | } |
| | | onMounted(() => { |
| | | state.loading = true; |
| | | getList(); |
| | | state.loading = false; |
| | | }); |
| | | </script> |