wupengfei
6 天以前 b9eb4d112d8e5f252c4d3d7e067290569b749cfb
src/views/EnterpriseManage/components/ConfigureDialog.vue
@@ -1,6 +1,6 @@
<template>
  <ProDialog title="配置" v-model="visible" @close="onDialogClose" destroy-on-close draggable>
    <ProForm :model="form" ref="dialogForm" label-width="100px">
    <ProForm :model="form" ref="dialogForm" label-width="120px">
      <ProFormItemV2 label="" prop="enterpriseConfigureType" label-width="0">
        <ProFormRadio
          v-model="form.enterpriseConfigureType"
@@ -35,65 +35,60 @@
        </ProFormItemV2>
        <ProFormItemV2 label="银行账户:" prop="verifyStatus">
          {{ VerifyStatusText[form.verifyStatus] }}
          <el-button style="margin-left: 40px" type="primary" link @click="handleCheckBankAccount"
          <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount"
            >校验</el-button
          >
        </ProFormItemV2>
      </template> -->
      <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.AliPay">
        <ProFormItemV2
          label="支付宝账号:"
          prop="alipayAccount"
          :checkRules="[{ message: '请输入支付宝账号' }]"
        >
          <div style="display: flex; width: 100%">
            <ProFormText v-model.trim="form.alipayAccount" placeholder="请输入支付宝账号">
            </ProFormText>
            <el-button style="margin-left: 10px" type="primary" link @click="openEnterpriseWallet"
              >获取签约链接</el-button
            >
          </div>
        </ProFormItemV2>
        <ProFormItemV2
          label="商户ID:"
          prop="alipayMerchantId"
          :checkRules="[{ message: '请输入商户ID' }]"
        >
          <ProFormText v-model.trim="form.alipayMerchantId" placeholder="请输入商户ID" />
        </ProFormItemV2>
        <ProFormItemV2 label="签约状态:" prop="alipayAccount" required>
          <span>已签约</span>
          <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount"
            >校验</el-button
          >
        </ProFormItemV2>
        <ProFormItemV2 label="进件状态:" prop="alipayAccount" required>
          <span>已进件</span>
          <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount"
            >校验</el-button
          >
        </ProFormItemV2>
      </template>
      <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.Electronic">
        <div class="configure-dialog-form-title">通道配置</div>
        <ProFormItemV2
          label="名称:"
          prop="realAccess"
          :checkRules="[{ message: '请选择电子签通道' }]"
          v-for="(item, index) in enabledElectronSignSettings"
          :label="item.accessName"
          :key="item.access"
          prop="electronSignAccesses"
          required
        >
          <ProFormSelect
            v-model="form.realAccess"
            :valueEnum="EnumRealAccessText"
            placeholder="请选择电子签通道"
          >
          </ProFormSelect>
          <ProFormSwitch
            v-model="form.electronSignAccesses[index]"
            :active-value="Number(item.access)"
            :inactive-value="null"
          ></ProFormSwitch>
        </ProFormItemV2>
        <div class="configure-dialog-form-title">费用配置</div>
        <ProFormItemV2
          label="计费方式:"
          prop="chargeType"
          :checkRules="[{ message: '请选择计费方式' }]"
        >
          <ProFormRadio
            :button-style="false"
            v-model="form.chargeType"
            :value-enum="ChargeTypeEnumText"
          />
        </ProFormItemV2>
        <template v-if="form.chargeType === ChargeTypeEnum.Group">
          <ProFormItemV2 label="实名费用:" prop="realVerifyCost">
            <ProFormInputNumber
              :controls="false"
              v-model="form.realVerifyCost"
              placeholder="请输入"
              unit="元/条"
            />
          </ProFormItemV2>
          <ProFormItemV2 label="签约费用:" prop="signCost">
            <ProFormInputNumber
              :controls="false"
              v-model="form.signCost"
              placeholder="请输入"
              unit="元/份"
            />
          </ProFormItemV2>
        </template>
        <template v-if="form.chargeType === ChargeTypeEnum.Merge">
          <ProFormItemV2 label="统一电子签:" prop="mergeSignCost">
            <ProFormInputNumber
              :controls="false"
              v-model="form.mergeSignCost"
              placeholder="请输入"
              unit="元/份"
            />
          </ProFormItemV2>
        </template>
      </template>
      <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage">
        <div class="configure-dialog-form-title">通道配置</div>
@@ -123,6 +118,7 @@
      </span>
    </template>
  </ProDialog>
  <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen>
</template>
<script setup lang="ts">
@@ -135,17 +131,20 @@
  ProFormRadio,
  ProFormInputNumber,
  ProFormSelect,
  ProFormSwitch,
  useFormDialog,
} from '@bole-core/components';
import { BoleRegExp } from '@bole-core/core';
import {
  EnterpriseConfigureType,
  EnterpriseConfigureTypeText,
  ChargeTypeEnum,
  ChargeTypeEnumText,
  EnumRealAccessText,
  EnumElectronSignAccessText,
  EnumSmsAccessText,
  EnumRealAccess,
  EnumElectronSignAccess,
} from '@/constants';
import * as enterpriseWalletServices from '@/services/api/enterpriseWallet';
import AlipayWalletOpen from './AlipayWalletOpen.vue';
defineOptions({
  name: 'ConfigureDialog',
@@ -157,13 +156,12 @@
  // openBranchBank: string;
  // bankAccount: string;
  // verifyStatus: VerifyStatus;
  chargeType: ChargeTypeEnum;
  realAccess: EnumRealAccess;
  realVerifyCost: number;
  signCost: number;
  mergeSignCost: number;
  electronSignAccesses: EnumElectronSignAccess[];
  smsAccess: EnumSmsAccess;
  smsCost: number;
  alipayAccount: string;
  alipayMerchantId: string;
  id: string;
};
const form = defineModel<Form>('form');
@@ -175,6 +173,8 @@
}>();
const dialogForm = ref<FormInstance>();
const { enabledElectronSignSettings } = useEnabledElectronSignSettings();
function handleCheckBankAccount() {}
@@ -193,6 +193,27 @@
    }
  });
}
const { dialogProps: dialogQrcodeProps, handleAdd } = useFormDialog({
  defaultFormParams: {
    alipayUrl: '',
  },
});
async function openEnterpriseWallet() {
  try {
    let params: API.OpenEnterpriseWalletCommand = {
      access: EnumEnterpriseWalletAccess.Alipay,
      enterpriseId: form.value.id,
    };
    let res = await enterpriseWalletServices.openEnterpriseWallet(params);
    if (res) {
      handleAdd({
        alipayUrl: res.signUrl,
      });
    }
  } catch (error) {}
}
</script>
<style lang="scss" scoped>
@use '@/style/common.scss' as *;