zhengyiming
3 天以前 1e77f7e375d797f96e384a9b769df966ee0c52be
src/views/EnterpriseManage/components/WeChatPayWalletBanksSelect.vue
@@ -17,10 +17,11 @@
  name: 'WeChatPayWalletBanksSelect',
});
// type Props = {
// };
type Props = {
  bank_account_type?: EnumWeChatPayApplymentBankAccountType;
};
// const props = withDefaults(defineProps<Props>(), {});
const props = withDefaults(defineProps<Props>(), {});
const bank_alias = defineModel<string>('bank_alias');
const account_bank = defineModel<string>('account_bank');
@@ -29,8 +30,24 @@
const need_bank_branch = defineModel<boolean>('need_bank_branch');
onMounted(() => {
  getList();
  if (props.bank_account_type !== ('' as any)) {
    getList();
  }
});
watch(
  () => props.bank_account_type,
  (newVal) => {
    bank_alias.value = '';
    account_bank.value = '';
    account_bank_code.value = '' as any as number;
    bank_alias_code.value = '';
    need_bank_branch.value = false;
    if (newVal !== ('' as any)) {
      getList();
    }
  }
);
const {
  getDataSource: getList,
@@ -46,7 +63,7 @@
          rows: pageSize,
          page: pageIndex,
        },
        bank_account_type: 0,
        bank_account_type: props.bank_account_type,
      };
      let res = await enterpriseWalletServices.getEnterpriseWeChatPayWalletBanks(params, {
@@ -62,11 +79,11 @@
      keywords: '',
    },
    queryKey: ['enterpriseWalletServices/getEnterpriseWeChatPayWalletBanks'],
    initialPageSize: 200,
  }
);
function handleAccountBankChange(bank_alias: string) {
  console.log('bank_alias: ', bank_alias);
  const bank = proTableProps.value.tableData.find((item) => item.bank_alias === bank_alias);
  if (bank) {
    account_bank.value = bank.account_bank;