Handy_Cao před 2 roky
rodič
revize
7e50af0ee5

+ 23 - 0
src/packages/pc/views/account/sign/components/protocol/index.vue

@@ -0,0 +1,23 @@
+<!-- 掉期市场 - 买卖大厅 - 合同签署 -->
+<template>
+    <app-drawer title="合同签署" v-model:show="show" :refresh="refresh">
+        <div class="g-text-message">请前往手机App进行合同签署操作!</div>
+        <template #footer>
+            <el-button type="info" @click="onCancel(false)">确认</el-button>
+        </template>
+    </app-drawer>
+</template>  
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+
+const show = ref(true)
+const refresh = ref(false)
+
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+</script>

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

@@ -32,19 +32,19 @@
                             </template>
                         </el-input>
                     </el-form-item>
-                    </template>
-                    <template v-else-if="(item.fieldcode === 'bank_branch_name')">
-                        <el-form-item :label="item.fieldname" prop="OpenBankName"
-                                v-if="showExtendInfo(item)">
-                            <el-input maxlength="50" :name="item.fieldcode" placeholder="请必须输入" v-model="item.value" />
-                        </el-form-item>
-                    </template>
-                    <template v-else-if="(item.fieldcode === '100')">
-                        <el-form-item :label="item.fieldname" prop="OpenBankNo"
-                                v-if="showExtendInfo(item)">
-                            <el-input maxlength="50" :name="item.fieldcode" placeholder="请必须输入" v-model="item.value" />
-                        </el-form-item>
-                    </template>
+                </template>
+                <template v-else-if="(item.fieldcode === 'bank_branch_name')">
+                    <el-form-item :label="item.fieldname" prop="OpenBankName"
+                            v-if="showExtendInfo(item)">
+                        <el-input maxlength="50" :name="item.fieldcode" placeholder="请必须输入" v-model="item.value" />
+                    </el-form-item>
+                </template>
+                <template v-else-if="(item.fieldcode === '100')">
+                    <el-form-item :label="item.fieldname" prop="OpenBankNo"
+                            v-if="showExtendInfo(item)">
+                        <el-input maxlength="50" :name="item.fieldcode" placeholder="请必须输入" v-model="item.value" />
+                    </el-form-item>
+                </template>
                 <template v-else>
                     <el-form-item :label="item.fieldname" :prop="item.fieldcode"
                             v-if="showExtendInfo(item)">

+ 34 - 5
src/packages/pc/views/account/sign/index.vue

@@ -3,11 +3,23 @@
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
         :expand-row-keys="expandKeys" @row-click="rowClick">
         <template #headerLeft>
-            <el-button type="primary" size="small"
+            <template v-if="oem === 'tjmd'">
+                <template v-if="cusBank">
+                    <el-button type="primary" size="small"
+                        v-if="[AuthStatus.Certified, AuthStatus.Submitted].includes(authStatus) && ![SignStatus.Audit, SignStatus.Signing, SignStatus.Signed].includes(signStatus)"
+                        @click="showComponent('sign')">添加签约账户</el-button>
+                </template>
+                <template v-else>
+                    <el-button type="primary" size="small"
+                        v-if="[AuthStatus.Certified, AuthStatus.Submitted].includes(authStatus)"
+                        @click="showComponent('protocol')">合同签署</el-button>
+                </template>
+            </template>
+            <template v-else>
+                <el-button type="primary" size="small"
                 v-if="[AuthStatus.Certified, AuthStatus.Submitted].includes(authStatus) && ![SignStatus.Audit, SignStatus.Signing, SignStatus.Signed].includes(signStatus)"
                 @click="showComponent('sign')">添加签约账户</el-button>
-            <!-- <el-button type="warning" size="small" v-if="authStatus === AuthStatus.Uncertified"
-                @click="openComponent('certification')">实名认证</el-button> -->
+            </template>
             <el-button type="warning" size="small" v-if="authStatus === AuthStatus.Uncertified"
                 @click="openComponent('certification-aq')">实名认证</el-button>
         </template>
@@ -25,7 +37,7 @@
                 <el-button v-if="row.signstatus === SignStatus.Signed && cusBank?.canrelease === 1" type="danger"
                     size="small" @click="openComponent('cancel')">解约</el-button>
                 <el-button
-                    v-if="[SignStatus.Refuse, SignStatus.Rescinded].includes(row.signstatus) || (row.signstatus === SignStatus.Signed && cusBank?.canmodifysigninfo === 1)"
+                    v-if="[SignStatus.Unsigned, SignStatus.Refuse, SignStatus.Rescinded].includes(row.signstatus) || (row.signstatus === SignStatus.Signed && cusBank?.canmodifysigninfo === 1)"
                     type="primary" size="small" @click="beforeShowComponent(row)">修改</el-button>
             </div>
         </template>
@@ -35,7 +47,7 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, defineAsyncComponent, onMounted } from 'vue'
+import { shallowRef, defineAsyncComponent, onMounted, computed } from 'vue'
 import { ElMessageBox } from 'element-plus'
 import { useComponent } from '@/hooks/component'
 import { useComposeTable } from '@pc/components/base/table'
@@ -48,18 +60,23 @@ import { AuthStatus } from '@/constants/account'
 import { useUserStore } from '@/stores'
 import { ElMessage } from 'element-plus'
 import AppTable from '@pc/components/base/table/index.vue'
+import service from '@/services'
+import { queryMdUserSwapProtocol } from '@/services/api/swap'
+import { getUserId } from '@/services/methods/user'
 
 const componentMap = new Map<string, unknown>([
     ['cancel', defineAsyncComponent(() => import('./components/cancel/index.vue'))],
     ['sign', defineAsyncComponent(() => import('./components/sign/index.vue'))],
     ['certification', defineAsyncComponent(() => import('./components/certification/index.vue'))], // 实名认证,
     ['certification-aq', defineAsyncComponent(() => import('./components/certification-aq/index.vue'))], // 实名认证
+    ['protocol', defineAsyncComponent(() => import('./components/protocol/index.vue'))], // 合同签署
 ])
 
 const useStore = useUserStore()
 const authStatus = shallowRef(AuthStatus.Certified) // 实名认证状态
 const signStatus = shallowRef(SignStatus.Unsigned)
 const cusBank = shallowRef<Model.CusBankSignBankRsp>()
+const oem = service.getConfig('oem')
 
 const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.BankAccountSignRsp>({ rowKey: 'applyexchticket' })
 const { loading, dataList, run } = useRequest(queryBankAccountSign, {
@@ -71,6 +88,18 @@ const { loading, dataList, run } = useRequest(queryBankAccountSign, {
     }
 })
 
+/// 查询用户掉期协议签署表
+const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
+    params: {
+        userId: getUserId()
+    }
+})
+
+/// 判断是否能签约
+const canBankSign = computed(() => {
+    return protocolList.value.some(e => { return e.protocolstatus === 4 })
+})
+
 /// 查询托管银行信息
 useRequest(queryCusBankSignBank, {
     onSuccess: (res) => {

+ 25 - 1
src/packages/tjmd/views/mine/Index.vue

@@ -73,7 +73,7 @@
                         <Iconfont icon="g-icon-certification">实名认证</Iconfont>
                     </template>
                 </Cell>
-                <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified">
+                <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified && canBankSign">
                     <template #title>
                         <Iconfont icon="g-icon-sign">签约账户</Iconfont>
                     </template>
@@ -132,6 +132,9 @@ import { useLoginStore, useAccountStore, useUserStore, usePositionStore } from '
 import eventBus from '@/services/bus'
 import Iconfont from '@/components/base/iconfont/index.vue'
 import { getMemberUserId } from '@/services/methods/user'
+import { queryMdUserSwapProtocol } from '@/services/api/swap'
+import { getUserId } from '@/services/methods/user'
+import { useRequest } from '@/hooks/request'
 
 const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
@@ -143,6 +146,18 @@ const { currentAccount } = accountStore.$toRefs()
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
 
+/// 查询用户掉期协议签署表
+const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
+    params: {
+        userId: getUserId()
+    }
+})
+
+/// 判断是否能签约
+const canBankSign = computed(() => {
+    return protocolList.value.some(e => { return e.protocolstatus === 4 })
+})
+
 const onReady = (el: HTMLDivElement) => {
     // 设置背景图位置
     headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
@@ -182,6 +197,15 @@ const doInOutMoney = (tab: string) => {
     }
 }
 
+const checkProtocolSign = () => {
+    dialog({
+        message: '当前没有签署相关合同信息,请先签署相关合同条例后再进行账户签约!',
+        showCancelButton: true
+    }).then(() => {
+        router.push({ name: 'account-protocol'})
+    })
+}
+
 const userLogout = () => {
     dialog({
         message: '是否退出当前账号?',