zhengyiming
5 天以前 a6921e08035356d4d4e367a8731f729d0520f6b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
  <ProFormPaginationSelect
    v-model="bank_branch_id"
    :proTableProps="proTableProps"
    enum-label-key="bank_branch_name"
    enum-value-key="bank_branch_id"
  >
  </ProFormPaginationSelect>
</template>
 
<script setup lang="ts">
import { useTable } from '@bole-core/components';
import * as enterpriseWalletServices from '@/services/api/enterpriseWallet';
 
defineOptions({
  name: 'WeChatPayWalletBankBranchsSelect',
});
 
type Props = {
  bank_alias_code: string;
  city_code: number;
  need_bank_branch: boolean;
};
 
const props = withDefaults(defineProps<Props>(), {});
 
const bank_branch_id = defineModel<string>('bank_branch_id');
 
onMounted(() => {
  getList();
});
 
watch(
  [toRef(props, 'bank_alias_code'), toRef(props, 'city_code'), toRef(props, 'need_bank_branch')],
  ([bank_alias_code, city_code, need_bank_branch]) => {
    bank_branch_id.value = '';
    if (need_bank_branch) {
      getList();
    }
  }
);
 
const {
  getDataSource: getList,
  proTableProps,
  paginationState,
  extraParamState,
  reset,
} = useTable(
  async ({ pageIndex, pageSize }, extraParamState) => {
    try {
      let params: API.GetEnterpriseWeChatPayWalletBankBranchesQuery = {
        pageModel: {
          rows: pageSize,
          page: pageIndex,
        },
        bank_alias_code: props.bank_alias_code,
        city_code: props.city_code,
      };
 
      let res = await enterpriseWalletServices.getEnterpriseWeChatPayWalletBankBranches(params, {
        showLoading: true,
      });
      return res;
    } catch (error) {
      console.log('error: ', error);
    }
  },
  {
    defaultExtraParams: {
      keywords: '',
    },
    queryKey: ['enterpriseWalletServices/getEnterpriseWeChatPayWalletBankBranches'],
  }
);
</script>