Handy_Cao 1 rok temu
rodzic
commit
ea6c3d1d42

+ 17 - 20
src/packages/zrwyt/views/account/certification/Index.vue

@@ -6,44 +6,40 @@
         <Form ref="formRef" class="g-form__container" @submit="onCheckCardNum" :loading="loading">
             <!-- 个人 -->
             <CellGroup v-if="getUserInfoType() === 1" inset>
-                <Field v-model="person.realName" :readonly="isReadonly && person.realName != ''" name="realName" label="姓名" placeholder="请输入用户姓名" :rules="PFormRules.realName" />
+                <Field v-model="person.realName" :readonly="isReadonly && customername != ''" name="realName" label="姓名" placeholder="请输入用户姓名" :rules="PFormRules.realName" />
                 <Field v-model="person.mobile" name="mobile" readonly label="预留手机号" :rules="PFormRules.mobile"/>
                 <Field name="bankId" label="开户银行" :rules="PFormRules.bankId" is-link>
                     <template #input>
-                        <app-select v-model="person.bankId" placeholder="请选择开户银行" :options="banklist"
+                        <app-select v-model="person.bankId" placeholder="请选择开户银行" :readonly="isReadonly && bankaccount != ''" :options="banklist"
                             :optionProps="{ label: 'bankname', value: 'bankid' }" />
                     </template>
                 </Field>
-                <Field label="银行卡号" v-model="person.bankCard" :readonly="isReadonly && person.bankCard != ''" name="bankCard" placeholder="请输入银行卡号" :rules="PFormRules.bankCard" />
+                <Field label="银行卡号" v-model="person.bankCard" :readonly="isReadonly && bankaccount != ''" name="bankCard" placeholder="请输入银行卡号" :rules="PFormRules.bankCard" />
                 <span style="font-size: 12px; padding-left: 15px; color: #FF162F;">此银行卡作为后续签约银行卡,请谨慎填写</span>
-                <Field v-model="person.idCardNo" :readonly="isReadonly && person.idCardNo != ''" name="idCardNo" label="证件号码" placeholder="请输入证件号码" :rules="PFormRules.idCardNo" />
+                <Field v-model="person.idCardNo" :readonly="isReadonly && cardnum != ''" name="idCardNo" label="证件号码" placeholder="请输入证件号码" :rules="PFormRules.idCardNo" />
                 <Field name="idCardPhoto" label="证件正面照片" :rules="PFormRules.idCardPhoto">
                     <template #input>
-                        <Image fit="contain" :src="getFileUrl(person.idCardPhoto)" width="100" height="100"
-                            v-if="isReadonly && person.idCardPhoto != ''" />
-                        <app-uploader @success="f_afterRead" v-else />
+                        <app-uploader @success="f_afterRead" />
                     </template>
                 </Field>
                 <Field name="cardbackphotourl" label="证件反面照片" :rules="PFormRules.idCardPhotoBackURL">
                     <template #input>
-                        <Image fit="contain" :src="getFileUrl(person.idCardPhotoBackURL)" width="100" height="100"
-                            v-if="isReadonly && person.idCardPhotoBackURL != ''" />
-                        <app-uploader @success="b_afterRead" v-else />
+                        <app-uploader @success="b_afterRead" />
                     </template>
                 </Field>
             </CellGroup>
             <!-- 企业 -->
             <CellGroup inset v-else>
-                <Field v-model="company.realName" :readonly="isReadonly && company.realName != ''" name="realName" label="法人姓名" placeholder="请输入法人姓名" :rules="CFormRules.realName" />
+                <Field v-model="company.realName" :readonly="isReadonly && customername != ''" name="realName" label="法人姓名" placeholder="请输入法人姓名" :rules="CFormRules.realName" />
                 <Field v-model="company.mobile" name="mobile" readonly label="法人手机号" />
                 <Field v-model="company.companyName" name="companyName" label="企业名称" placeholder="请输入企业名称" :rules="CFormRules.companyName" />
                 <Field v-model="company.creditCode" name="creditCode" label="信用代码" placeholder="请输入社会统一信用代码" :rules="CFormRules.creditCode" />
-                <Field v-model="company.bankCard" :readonly="isReadonly && company.bankCard != ''" name="bankCard" label="法人银行卡号" placeholder="请输入法人银行卡号" :rules="CFormRules.bankCard" />
-                <Field v-model="company.idCardNo" :readonly="isReadonly && company.idCardNo != ''" name="idCardNo" label="法人身份证号" placeholder="请输入法人身份证号" :rules="CFormRules.idCardNo" />
+                <Field v-model="company.bankCard" :readonly="isReadonly && bankaccount != ''" name="bankCard" label="法人银行卡号" placeholder="请输入法人银行卡号" :rules="CFormRules.bankCard" />
+                <Field v-model="company.idCardNo" :readonly="isReadonly && cardnum != ''" name="idCardNo" label="法人身份证号" placeholder="请输入法人身份证号" :rules="CFormRules.idCardNo" />
                     <Field name="idCardPhoto" label="营业执照" :rules="CFormRules.idCardPhoto">
                     <template #input>
                         <Image fit="contain" :src="getFileUrl(company.idCardPhoto)" width="100" height="100"
-                            v-if="isReadonly && company.idCardPhoto != ''" />
+                            v-if="company.idCardPhoto != ''" />
                         <app-uploader @success="f_afterRead" v-else />
                     </template>
                 </Field>
@@ -92,7 +88,7 @@ const person = ref<Model.PersonBankCard4>({})
 const company = ref<Model.CompanyBankCard4>({})
 /// 四要素校验
 const { formData, onBankCard4, loading } = useRequestBankCard4()
-
+const { customername, mobile2, cardnum } = userStore.userInfo
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     router.back()
 })
@@ -100,6 +96,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const serialNo = ref<string>('')
 /// 是否只读
 const isReadonly = ref(false)
+const bankaccount = ref('')
 
 /// 查询托管银行信息
 useRequest(queryBankAccountSign, {
@@ -108,6 +105,9 @@ useRequest(queryBankAccountSign, {
         if (res.data.length != 0) {
             /// 如果已经签约了 不允许修改信息
             isReadonly.value = res.data.some(e => [2, 3, 4].includes(e.signstatus))
+            person.value.bankCard = decryptAES(res.data[0].bankaccountno2)
+            person.value.bankId = res.data[0].bankid
+            bankaccount.value = res.data[0].bankaccountno2
         }
     }
 })
@@ -284,20 +284,17 @@ const onCheckCardNum = () => {
 }
 
 onMounted(() => {
-    const { customername, mobile2, cardnum, bankaccount, bankid } = userStore.userInfo
     // 个人
     if (getUserInfoType() === 1) {
         person.value.idCardNo = decryptAES(cardnum)
         person.value.mobile = mobile2
         person.value.realName = customername
-        person.value.bankCard = decryptAES(bankaccount)
-        person.value.bankId = bankid
     } else {
         // 企业
         company.value.mobile = mobile2
         company.value.realName = customername
         company.value.idCardNo = decryptAES(cardnum)
-        company.value.bankCard = decryptAES(bankaccount)
+        company.value.bankCard = decryptAES(bankaccount.value)
     }
 })
-</script>
+</script>