li.shaoyi 2 months ago
parent
commit
b715ef7287

+ 3 - 4
src/packages/pc/views/account/sign/components/sign/index.vue

@@ -11,15 +11,14 @@
                 </el-select>
             </el-form-item>
             <el-form-item :label="t('banksign.OpenBankAccId')" prop="OpenBankAccId">
-                <el-select effect="dark" v-model="formData.OpenBankAccId" :readonly="bankaccount != ''">
+                <el-select effect="dark" v-model="formData.OpenBankAccId">
                     <el-option :label="item.bankname" :value="item.bankid" v-for="(item, index) in banklist"
                         :key="index" />
                 </el-select>
             </el-form-item>
             <el-form-item :label="t('banksign.bankaccountno')" prop="BankAccountNo">
-                <el-input type="number" name="BankAccountNo" :readonly="bankaccount != ''"
-                    :placeholder="t('banksign.bankaccountno')" :maxlength="30" v-model="formData.BankAccountNo"
-                    :rules="formRules.BankAccountNo" />
+                <el-input type="number" name="BankAccountNo" :placeholder="t('banksign.bankaccountno')" :maxlength="30"
+                    v-model="formData.BankAccountNo" :rules="formRules.BankAccountNo" />
             </el-form-item>
             <el-form-item :label="t('banksign.accountname')" prop="AccountName">
                 <el-input name="AccountName" readonly :placeholder="t('banksign.accountname1')"

+ 11 - 26
src/packages/pc/views/account/sign/index.vue

@@ -4,7 +4,7 @@
         :expand-row-keys="expandKeys" @row-click="rowClick">
         <template #headerLeft>
             <template v-if="authStatus === AuthStatus.Certified">
-                <template v-if="hasSignContract">
+                <template v-if="records.length === 0 || records.some(e => e.recordstatus === 3)">
                     <el-button type="primary" size="small" @click="showComponent('sign')"
                         v-if="![SignStatus.Audit, SignStatus.Signing, SignStatus.Signed].includes(signStatus)">
                         {{ t('banksign.addbanksign') }}
@@ -50,14 +50,14 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, onMounted, computed } from 'vue'
+import { shallowRef, defineAsyncComponent, computed } from 'vue'
 import { useComponent } from '@/hooks/component'
 import { useComposeTable } from '@pc/components/base/table'
 import { useRequest } from '@/hooks/request'
 import { queryBankAccountSign, queryCusBankSignBank } from '@/services/api/bank'
 import { getSignStatusName, SignStatus } from '@/constants/bank'
 import { getCertificateTypeCodeName } from '@/constants/account'
-import { queryUserAccount, queryTencentUsereSignRecords } from '@/services/api/account'
+import { queryTencentUsereSignRecords } from '@/services/api/account'
 import { AuthStatus } from '@/constants/account'
 import { useUserStore, i18n } from '@/stores'
 import { ElMessage } from 'element-plus'
@@ -72,13 +72,18 @@ const componentMap = new Map<string, unknown>([
     ['protocol', defineAsyncComponent(() => import('./components/protocol/index.vue'))], // 合同签署
 ])
 
-const useStore = useUserStore()
-const authStatus = shallowRef(AuthStatus.Certified) // 实名认证状态
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+    run()
+})
+
+const { t } = i18n.global
+const userStore = useUserStore()
 const signStatus = shallowRef(SignStatus.Unsigned)
 const cusBank = shallowRef<Model.CusBankSignBankRsp>()
-const { t } = i18n.global
 const dataList = shallowRef<Model.BankAccountSignRsp[]>()
 
+const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
+
 const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.BankAccountSignRsp>({ rowKey: 'applyexchticket' })
 // 需求 #5692: 交易系统通用问题2024
 const { loading, run } = useRequest(queryBankAccountSign, {
@@ -96,14 +101,6 @@ const { loading, run } = useRequest(queryBankAccountSign, {
 /// 查询爱签签约协议信息
 const { dataList: records } = useRequest(queryTencentUsereSignRecords)
 
-/// 判断是否能签约
-const hasSignContract = computed(() => {
-    if (records.value.length) {
-        return records.value.some(e => e.recordstatus === 3)
-    }
-    return true
-})
-
 /// 查询托管银行信息
 useRequest(queryCusBankSignBank, {
     onSuccess: (res) => {
@@ -114,10 +111,6 @@ useRequest(queryCusBankSignBank, {
     }
 })
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
-    run()
-})
-
 const showComponent = ((componentName: string) => {
     /// 认证请求中 不能操作
     if (authStatus.value === AuthStatus.Submitted) {
@@ -140,12 +133,4 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'remark', label: 'banksign.remark' },
     { field: 'updatetime', label: 'banksign.remark' },
 ])
-
-onMounted(() => {
-    useStore.getUserData()
-    // 获取用户账号信息----------------待处理,直接用useStore
-    queryUserAccount().then((res) => {
-        authStatus.value = res.data.hasauth
-    })
-})
 </script>