li.shaoyi 11 mesi fa
parent
commit
c2fd16b155

+ 14 - 6
src/packages/pc/views/account/sign/components/sign/index.vue

@@ -3,8 +3,9 @@
     <app-drawer :title="bankInfo?.signstatus != undefined ? t('banksign.modifybanksign') : t('banksign.addbanksign')"
         :width="500" v-model:show="show" :loading="loading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--vertical" label-width="120px" :model="formData" :rules="formRules">
-            <el-form-item :label="t('banksign.bankchannel')" prop="CusBankID" >
-                <el-select :disabled="bankInfo?.signstatus != undefined" effect="dark" v-model="formData.CusBankID" @change="cusBankChange">
+            <el-form-item :label="t('banksign.bankchannel')" prop="CusBankID">
+                <el-select :disabled="bankInfo?.signstatus != undefined" effect="dark" v-model="formData.CusBankID"
+                    @change="cusBankChange">
                     <el-option :label="item.cusbankname" :value="item.cusbankid" v-for="(item, index) in cusBanks"
                         :key="index" />
                 </el-select>
@@ -29,8 +30,7 @@
                     :placeholder="t('banksign.Pleaseenteryourmobilephonenumber')" v-model="formData.MobilePhone" />
             </el-form-item>
         </el-form>
-        <el-form ref="extendRef" class="el-form--vertical" label-width="120px" :model="extendModel"
-            :rules="formRules">
+        <el-form ref="extendRef" class="el-form--vertical" label-width="120px" :model="extendModel" :rules="formRules">
             <template v-for="(item, index) in configs" :key="index">
                 <template v-if="(item.fieldcode === 'verify_code')">
                     <el-form-item :label="item.fieldname" :prop="item.fieldcode"
@@ -81,7 +81,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, computed } from 'vue'
+import { ref, computed, watch } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { validateRules } from '@/constants/regex'
 import { useRequest } from '@/hooks/request'
@@ -129,7 +129,7 @@ const cusBankChange = () => {
 
 // 银行列表
 const banklist = computed(() => {
-    return cusBanks.value?.find(e => e.cusbankid === formData.CusBankID)?.Banklst.filter(e => e.status == 0 ) ?? []
+    return cusBanks.value?.find(e => e.cusbankid === formData.CusBankID)?.Banklst.filter(e => e.status == 0) ?? []
 })
 
 const formRules = computed(() => {
@@ -294,4 +294,12 @@ const formSubmit = () => {
         }
     })
 }
+
+// 待优化
+watch(configs, (data) => {
+    if (data.some((e) => e.fieldcode === 'legal_name')) {
+        // 初始化默认值
+        extendInfo.value['legal_name'] = legalpersonname
+    }
+})
 </script>