瀏覽代碼

修改中融文通实名已签约并且信息不为空的情况下 不允许修改

Handy_Cao 1 年之前
父節點
當前提交
c921c33d54
共有 2 個文件被更改,包括 44 次插入32 次删除
  1. 22 10
      src/packages/zrwyt/views/account/certification/Index.vue
  2. 22 22
      src/packages/zrwyt/views/mine/Index.vue

+ 22 - 10
src/packages/zrwyt/views/account/certification/Index.vue

@@ -6,37 +6,37 @@
         <Form ref="formRef" class="g-form__container" @submit="onCheckCardNum" :loading="loading">
             <!-- 个人 -->
             <CellGroup v-if="getUserInfoType() === 1" inset>
-                <Field v-model="person.realName" name="realName" label="姓名" placeholder="请输入用户姓名" :rules="PFormRules.realName" />
+                <Field v-model="person.realName" :readonly="isReadonly && person.realName != ''" name="realName" label="姓名" placeholder="请输入用户姓名" :rules="PFormRules.realName" />
                 <Field v-model="person.mobile" name="mobile" readonly label="手机号码" :rules="PFormRules.mobile"/>
-                <Field v-model="person.bankCard" name="bankCard" label="银行卡号" placeholder="请输入银行卡号" :rules="PFormRules.bankCard" />
-                <Field v-model="person.idCardNo" name="idCardNo" label="证件号码" placeholder="请输入证件号码" :rules="PFormRules.idCardNo" />
+                <Field v-model="person.bankCard" :readonly="isReadonly && person.bankCard != ''" name="bankCard" label="银行卡号" placeholder="请输入银行卡号" :rules="PFormRules.bankCard" />
+                <Field v-model="person.idCardNo" :readonly="isReadonly && person.idCardNo != ''" 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" />
+                            v-if="isReadonly && person.idCardPhoto != ''" />
                         <app-uploader @success="f_afterRead" v-else />
                     </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" />
+                            v-if="isReadonly && person.idCardPhotoBackURL != ''" />
                         <app-uploader @success="b_afterRead" v-else />
                     </template>
                 </Field>
             </CellGroup>
             <!-- 企业 -->
             <CellGroup inset v-else>
-                <Field v-model="company.realName" name="realName" label="法人姓名" placeholder="请输入法人姓名" :rules="CFormRules.realName" />
+                <Field v-model="company.realName" :readonly="isReadonly && company.realName != ''" 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" name="bankCard" label="法人银行卡号" placeholder="请输入法人银行卡号" :rules="CFormRules.bankCard" />
-                <Field v-model="company.idCardNo" name="idCardNo" label="法人身份证号" placeholder="请输入法人身份证号" :rules="CFormRules.idCardNo" />
+                <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 name="idCardPhoto" label="营业执照" :rules="CFormRules.idCardPhoto">
                     <template #input>
                         <Image fit="contain" :src="getFileUrl(company.idCardPhoto)" width="100" height="100"
-                            v-if="isReadonly" />
+                            v-if="isReadonly && company.idCardPhoto != ''" />
                         <app-uploader @success="f_afterRead" v-else />
                     </template>
                 </Field>
@@ -68,6 +68,7 @@ import { useNavigation } from '@mobile/router/navigation'
 import { getUserId, getMemberUserId, getUserInfoType } from '@/services/methods/user'
 import AppUploader from '@mobile/components/base/uploader/index.vue'
 import { decryptAES } from '@/services/websocket/package/crypto';
+import { queryBankAccountSign } from '@/services/api/bank'
 
 const componentMap = new Map<string, unknown>([
     ['captcha', defineAsyncComponent(() => import('./components/captcha/Index.vue'))],
@@ -89,7 +90,18 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 /// 流水号
 const serialNo = ref<string>('')
 /// 是否只读
-const isReadonly = false
+const isReadonly = ref(false)
+
+/// 查询托管银行信息
+useRequest(queryBankAccountSign, {
+    onSuccess: (res) => {
+        /// 签约状态
+        if (res.data.length != 0) {
+            /// 如果已经签约了 不允许修改信息
+            isReadonly.value = res.data.some(e => [2, 3, 4].includes(e.signstatus))
+        }
+    }
+})
 
 /// 查询记录
 const { loading: buttonLoading } = useRequest(queryTencentUsereSignRecords, {

+ 22 - 22
src/packages/zrwyt/views/mine/Index.vue

@@ -96,7 +96,7 @@
                         <Iconfont icon="g-icon-certification">实名认证</Iconfont>
                     </template>
                 </Cell>
-                <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified && canBankSign">
+                <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified && hasSignContract">
                     <template #title>
                         <Iconfont icon="g-icon-sign">签约账户</Iconfont>
                     </template>
@@ -165,7 +165,7 @@ const positionStore = usePositionStore()
 const accountStore = useAccountStore()
 const { currentAccount } = accountStore.$toRefs()
 /// 判断是否能签约
-const canBankSign = shallowRef(false) 
+const hasSignContract = shallowRef(false) 
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
 
@@ -177,33 +177,33 @@ const onReady = (el: HTMLDivElement) => {
 /// 进行出入金操作判断
 const doInOutMoney = (tab: string) => {
     if (authStatus.value === AuthStatus.Certified) {
-        // /// 当前未签署合同
-        // if (!canBankSign.value) {
-        //     dialog({
-        //         message: '请先去签署合同条例!',
-        //         showCancelButton: true,
-        //         confirmButtonText: '去签署合同'
-        //     }).then(() => {
-        //         router.push({ name: 'account-protocol', query: { memberUserId: getMemberUserId()} })
-        //     })
-        //     return
-        // }
         // 判断是否已签约
         fullloading((hideLoading) => {
             queryBankAccountSign().then((res) => {
                 hideLoading()
                 const { signstatus } = res.data[0] ?? {}
-                /// 只有已签约的情况下才可以进行出入金
-                if (signstatus && signstatus === 4) {
-                    router.push({ name: 'bank-wallet', query: { tab } })
-                } else {
+                /// 已实名未签合同
+                if (!hasSignContract.value) {
                     dialog({
-                        message: '请先添加签约账户信息!',
+                        message: '请先去签署合同条例!',
                         showCancelButton: true,
-                        confirmButtonText: '去签'
+                        confirmButtonText: '去签署合同'
                     }).then(() => {
-                        router.push({ name: 'bank-sign' })
+                        router.push({ name: 'account-protocol', query: { memberUserId: getMemberUserId()} })
                     })
+                } else {
+                    /// 只有已签约的情况下才可以进行出入金
+                    if (signstatus && signstatus === 4) {
+                        router.push({ name: 'bank-wallet', query: { tab } })
+                    } else {
+                        dialog({
+                            message: '请先添加签约账户信息!',
+                            showCancelButton: true,
+                            confirmButtonText: '去签约'
+                        }).then(() => {
+                            router.push({ name: 'bank-sign' })
+                        })
+                    }
                 }
             }).catch(() => {
                 hideLoading('加载失败', 'fail')
@@ -238,7 +238,7 @@ onActivated(() => {
 
     /// 机构不需要签合同
     if (userStore.userInfo.usertype === 2) {
-        canBankSign.value = true
+        hasSignContract.value = true
         return 
     }
     
@@ -251,7 +251,7 @@ onActivated(() => {
         }
     }).then((res) => {
         /// 判断是否能签约
-        canBankSign.value = res.data.some(e => e.recordstatus === 3 )
+        hasSignContract.value = res.data.some(e => e.recordstatus === 3 )
     })
 })