瀏覽代碼

1 实名认证改为 18-60 岁;
2 铁合金签署逻辑修改;
3 其他 Bug 修改;

Handy_Cao 1 年之前
父節點
當前提交
f61e31bfb7

+ 2 - 2
src/packages/gcszt/views/account/certification/Index.vue

@@ -179,7 +179,7 @@ const PFormRules: { [key in keyof Model.PersonBankCard4]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true
@@ -236,7 +236,7 @@ const CFormRules: { [key in keyof Model.CompanyBankCard4]?: FieldRule[] } = {
         message: '请输入法人身份证号',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

+ 8 - 2
src/packages/gstj/views/holdbank/holddeposit/components/apply/Index.vue

@@ -36,7 +36,7 @@
 
 <script lang="ts" setup>
 import { shallowRef, ref } from 'vue'
-import { Form, Field, CellGroup, Button, FieldRule, FormInstance } from 'vant'
+import { Form, Field, CellGroup, Button, FieldRule, FormInstance, Stepper } from 'vant'
 import { useDoYJF_WithholdInApply } from '@/business/bank'
 import { formatDecimal } from '@/filters'
 import { fullloading, dialog } from '@/utils/vant'
@@ -67,7 +67,13 @@ defineExpose({
 const formRules: { [key: string]: FieldRule[] } = {
     BillAmount: [{
         required: true,
-        message: '请填写入金金额',
+        message: '请输入代扣金额',
+        validator: (val) => {
+            if (val >= 500000) {
+                return '代扣金额不能大于 50 万'
+            }
+            return true
+        }
     }]
 }
 

+ 2 - 2
src/packages/gstj/views/holdbank/holdsign/components/SMSCode/Index.vue

@@ -6,7 +6,7 @@
             </template>
             <Form ref="formRef" class="g-form__container" @submit="formSubmit">
                 <CellGroup inset>
-                    <Field type="number" name="VCode" label="验证码" maxlength=" 6" v-model.trim="formData.VCode"
+                    <Field type="number" name="VCode" label="验证码" maxlength="6" v-model.trim="formData.VCode"
                         placeholder="请输入短信验证码" :rules="formRules.VCode" />
                 </CellGroup>
             </Form>
@@ -47,8 +47,8 @@ const formSubmit = () => {
     formRef.value?.validate('VCode').then(() => {
         fullloading((hideLoading) => {
             onSubmit().then(() => {
+                hideLoading()
                 dialog('提交成功,请稍候查看').then(() => {
-                    hideLoading()
                     /// 返回上层
                     closed(true)
                 })

+ 0 - 38
src/packages/gstj/views/holdbank/holdsign/components/apply/Index.vue

@@ -13,21 +13,6 @@
                         placeholder="请选择协议到期日" :rules="formRules.Xydqrq" is-link @click="showCalendar = true" />
                     <Field type="number" name="Lxdh" label="手机号码" maxlength="30" v-model.trim="formData.Lxdh"
                         placeholder="请输入手机号码" :rules="formRules.Lxdh" />
-                    <!-- <Field name="Yckfxe" label="一次扣费限额" placeholder="请输入一次扣费限额" :rules="formRules.Yckfxe" >
-                        <template #input>
-                            <Stepper v-model="Yckfxe" theme="round" button-size="22" :min="0.0" :step="0.01" />
-                        </template>
-                    </Field>
-                    <Field name="Kkzqnkfxe" label="扣费周期内扣款限额" placeholder="请输入扣费周期内扣款限额" :rules="formRules.Kkzqnkfxe" >
-                        <template #input>
-                            <Stepper v-model="Kkzqnkfxe" theme="round" button-size="22" :min="0.0" :step="0.01" />
-                        </template>
-                    </Field>
-                    <Field name="Kkzqnxzbs" placeholder="请输入扣费周期内限制笔数"  :rules="formRules.Kkzqnxzbs" label="扣费周期内限制笔数">
-                        <template #input>
-                            <Stepper v-model="Kkzqnxzbs" theme="round" button-size="22" :min="0" :max="99" :step="1" integer />
-                        </template>
-                    </Field> -->
                     <Field name="Kksjdw" label="扣款单位" maxlength="30" :rules="formRules.Kksjdw" is-link>
                         <template #input>
                             <app-select v-model="Kksjdw" placeholder="请选择扣款单位" :options="getGt_kksjdwList()" />
@@ -71,9 +56,6 @@ const { formData, onSubmit, bankaccountno } = useDoYJFGetWithholdSignInSMSVCode(
 // 日期范围
 const dateRange = ref<string[]>([]) 
 const Kksjdw = ref('')
-// const Kkzqnkfxe = ref(0.00)
-// const Yckfxe = ref(0.00)
-// const Kkzqnxzbs = ref(0)
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     closed(true)
@@ -85,12 +67,6 @@ const componentMap = new Map<string, unknown>([
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.YJF_GetWithholdSignInSMSVCodeReq]?: FieldRule[] } = {
-    // Yckfxe: [{
-    //     message: '请输入一次扣费限额',
-    //     validator: () => {
-    //         return !!Yckfxe.value
-    //     }
-    // }],
     Xysxrq: [{
         message: '请选择协议生效期',
         validator: () => {
@@ -109,18 +85,6 @@ const formRules: { [key in keyof Proto.YJF_GetWithholdSignInSMSVCodeReq]?: Field
             return !!Kksjdw.value
         }
     }],
-    // Kkzqnkfxe: [{
-    //     message: '请输入扣费周期内扣款限额',
-    //     validator: () => {
-    //         return !!Kkzqnkfxe.value
-    //     }
-    // }],
-    // Kkzqnxzbs: [{
-    //     message: '请输入扣费周期内限制笔数',
-    //     validator: () => {
-    //         return !!Kkzqnxzbs.value
-    //     }
-    // }],
     Lxdh: [{
         required: true,
         message: '请输入手机号码',
@@ -150,10 +114,8 @@ const formSubmit = () => {
     }).then(() => {
         formRef.value?.validate('Lxdh').then(() => {
             fullloading((hideLoading) => {
-
                 /// 数据单独处理
                 formData.Kksjdw = Kksjdw.value.toString()
-
                 onSubmit().then(() => {
                     hideLoading()
                     openComponent('SMSCode')

+ 1 - 1
src/packages/mobile/views/account/certification/Index.vue

@@ -80,7 +80,7 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

+ 28 - 5
src/packages/mobile/views/swap/list/Index.vue

@@ -43,12 +43,14 @@ import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@mobile/router/navigation'
 import { queryQuoteGoodsList, queryMdUserSwapProtocol } from '@/services/api/swap'
+import { requestInitMdUserSwapProtocol } from '@/services/api/account'
 import { useFuturesStore, useUserStore } from '@/stores'
-import quoteSocket from '@/services/websocket/quote'
-import AppList from '@mobile/components/base/list/index.vue'
 import { showToast } from 'vant'
-import { getUserId } from '@/services/methods/user'
+import { getMemberUserId, getUserId } from '@/services/methods/user'
 import { shallowRef } from 'vue'
+import quoteSocket from '@/services/websocket/quote'
+import AppList from '@mobile/components/base/list/index.vue'
+import service from '@/services'
 
 const props = defineProps({
     showBackButton: {
@@ -65,7 +67,7 @@ const futuresStore = useFuturesStore()
 const userStore = useUserStore()
 const subscribe = quoteSocket.createSubscribe()
 const canBankSign = shallowRef(false)
-
+const oem = service.getConfig('oem')
 const title = getQueryString('title')
 const titleName = computed(() => title ? decodeURIComponent(title) : props.marketSection?.displayname ?? '掉期贸易')
 
@@ -135,6 +137,19 @@ const rowClick = (row: Model.QuoteGoodsListRsp) => {
     }
 }
 
+/// 创建电子签合同
+const { run: initMdUserSwapProtocol } = useRequest(requestInitMdUserSwapProtocol, {
+    manual: true,
+    params: {
+        userId: getUserId(),
+        memberUserId: getMemberUserId()
+    },
+    onSuccess: () => {
+        /// 重新请求
+        showToast('合同已提交签署请求,请耐心等待审核通过!')
+    }
+})
+
 onActivated(() => {
     const goodsCodes = dataList.value.map((e) => e.refgoodscode)
     if (goodsCodes.length) {
@@ -148,7 +163,15 @@ onActivated(() => {
             userId: getUserId()
         }
     }).then((res) => {
-        canBankSign.value = res.data.some(e => e.protocolstatus === 4)
+        if (oem === 'tjmd') { // 天津麦顿
+            canBankSign.value = res.data.some(e => e.protocolstatus === 4)
+        } else {
+            if (res.data.length === 0) {
+                initMdUserSwapProtocol()
+            } else {
+                canBankSign.value = res.data.some(e => e.protocolstatus === 4)
+            }
+        }
     })
 })
 

+ 1 - 1
src/packages/nhgj/views/account/certification/Index.vue

@@ -104,7 +104,7 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

+ 3 - 2
src/packages/pc/views/footer/capital/summary/index.vue

@@ -38,11 +38,12 @@ import { useComposeTable } from '@pc/components/base/table'
 import { getTradeStatusName } from '@/constants/order'
 import { AuthStatus } from '@/constants/account'
 import { queryBankAccountSign } from '@/services/api/bank'
-import AppTable from '@pc/components/base/table/index.vue'
 import { useRequest } from '@/hooks/request'
-import service from '@/services'
 import { queryMdUserSwapProtocol } from '@/services/api/swap'
 import { getUserId } from '@/services/methods/user'
+import AppTable from '@pc/components/base/table/index.vue'
+import service from '@/services'
+
 const oem = service.getConfig('oem')
 
 const componentMap = new Map<string, unknown>([

+ 1 - 1
src/packages/pc/views/footer/capital/summary/withdraw/index.vue

@@ -1,7 +1,7 @@
 <!-- 资金信息-资金汇总-出金申请 -->
 <template>
     <app-drawer title="出金申请" :width="500" v-model:show="show" :loading="loading">
-        <el-form ref="formRef" v-if="cusBank.canoutamount === 1" class="el-form--vertical" label-width="120px"
+        <el-form ref="formRef" v-if="cusBank.canoutamount === 1" class="el-form--vertical" label-width="140px"
             :model="formData" :rules="formRules">
             <el-form-item label="资金账号">
                 <span>{{ accountStore.currentAccountId }}</span>

+ 1 - 1
src/packages/qxst/views/account/certification/Index.vue

@@ -123,7 +123,7 @@ const formRules: { [key in keyof Model.AddUserReq]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

+ 1 - 1
src/packages/sbyj/views/account/certification/Index.vue

@@ -104,7 +104,7 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

+ 16 - 0
src/packages/thj/router/index.ts

@@ -98,6 +98,22 @@ const routes: Array<RouteRecordRaw> = [
     ],
   },
   {
+    path: '/account',
+    component: Page,
+    children: [
+      {
+        path: 'certification',
+        name: 'account-certification',
+        component: () => import('../views/account/certification/Index.vue'),
+      },
+      {
+        path: 'protocol',
+        name: 'account-protocol',
+        component: () => import('../views/account/protocol/Index.vue'),
+      }
+    ],
+  },
+  {
     path: '/report',
     component: Page,
     children: [

+ 149 - 0
src/packages/thj/views/account/certification/Index.vue

@@ -0,0 +1,149 @@
+<template>
+    <app-view class="g-form account-certification">
+        <template #header>
+            <app-navbar title="实名认证" />
+        </template>
+        <Form ref="formRef" class="g-form__container" @submit="onCheckCardNum" :loading="loading">
+            <CellGroup inset>
+                <Field v-model="formData.username" name="username" label="姓名" placeholder="请输入用户姓名" :rules="formRules.username"
+                    :readonly="isReadonly" />
+                <Field v-model="formData.mobile" name="mobile" readonly label="手机号码" />
+                <Field name="idCardType" label="证件类型" :rules="formRules.cardtype" is-link>
+                    <template #input>
+                        <app-select v-model="formData.cardtype" placeholder="请选择证件类型"
+                            :options="getCerTypePersonList()" :readonly="isReadonly" />
+                    </template>
+                </Field>
+                <Field v-model="formData.cardnum" name="cardnum" label="证件号码" placeholder="请输入证件号码" :rules="formRules.cardnum"
+                    :readonly="isReadonly" />
+                <Field name="cardfrontphotourl" label="证件正面照片" :rules="formRules.cardfrontphotourl">
+                    <template #input>
+                        <Image fit="contain" :src="getFileUrl(formData.cardfrontphotourl)" width="100" height="100"
+                            v-if="isReadonly" />
+                        <app-uploader @success="f_afterRead" v-else />
+                    </template>
+                </Field>
+                <Field name="cardbackphotourl" label="证件反面照片" :rules="formRules.cardbackphotourl">
+                    <template #input>
+                        <Image fit="contain" :src="getFileUrl(formData.cardbackphotourl)" width="100" height="100"
+                            v-if="isReadonly" />
+                        <app-uploader @success="b_afterRead" v-else />
+                    </template>
+                </Field>
+            </CellGroup>
+        </Form>
+        <img src="../../../assets/images/certification.png" />
+        <template #footer>
+            <div class="g-form__footer inset">
+                <Button type="danger" :loading="buttonLoading" @click="formRef?.submit" round block>提交实名认证</Button>
+            </div>
+        </template>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, onMounted } from 'vue'
+import { CellGroup, Button, Field, Form, FormInstance, showFailToast, FieldRule, Image } from 'vant'
+import { fullloading, dialog } from '@/utils/vant';
+import { getFileUrl, getIdCardAge } from '@/filters';
+import { getCerTypePersonList } from "@/constants/account";
+import { useRequest } from '@/hooks/request'
+import { queryTencentUsereSignRecords, requestCheckCardNum } from '@/services/api/account';
+import { addAuthReq } from '@/business/user/account';
+import { validateRules } from '@/constants/regex';
+import { useUserStore } from '@/stores'
+import AppSelect from '@mobile/components/base/select/index.vue'
+import AppUploader from '@mobile/components/base/uploader/index.vue'
+import { useNavigation } from '@mobile/router/navigation'
+import { getUserId, getMemberUserId } from '@/services/methods/user'
+
+const { router } = useNavigation()
+const userStore = useUserStore()
+const formRef = shallowRef<FormInstance>()
+const { formData, formSubmit, loading } = addAuthReq()
+
+const isReadonly = false//computed(() => userESignRecords.value.some((e) => e.recordstatus === 3))
+
+/// 查询记录
+const { loading: buttonLoading } = useRequest(queryTencentUsereSignRecords, {
+    params: {
+        userId: getUserId(),
+        memberUserId: getMemberUserId()
+    },
+    onError: (err) => {
+        showFailToast(err)
+    }
+})
+
+const b_afterRead = (filePath: string) => {
+    formData.cardbackphotourl = filePath
+}
+
+const f_afterRead = (filePath: string) => {
+    formData.cardfrontphotourl = filePath
+}
+
+// 表单验证规则
+const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
+    username: [{
+        required: true,
+        message: '请输入用户姓名',
+    }],
+    mobile: [{
+        required: true,
+        message: '请输入手机号码',
+        validator: (val) => {
+            if (validateRules.phone.validate(val)) {
+                return true
+            }
+            return validateRules.phone.message
+        }
+    }],
+    cardnum: [{
+        required: true,
+        message: '请输入证件号码',
+        validator: (val) => {
+            if (validateRules.cardno.validate(val)) {
+                if (getIdCardAge(val)) {
+                    return '开户失败,您的年龄不符合开户要求'
+                } 
+                return true
+            }
+            return validateRules.cardno.message
+        }
+    }],
+    cardbackphotourl: [{
+        required: true,
+        message: '请上传证件背面照片',
+    }],
+    cardfrontphotourl: [{
+        required: true,
+        message: '请上传证件正面照片',
+    }],
+}
+
+const onCheckCardNum = () => {
+    fullloading((hideLoading) => {
+        requestCheckCardNum({
+            data: {
+                cardnum: formData.cardnum
+            }
+        }).then(() => {
+            formSubmit().then(() => {
+                hideLoading()
+                dialog('提交请求成功,请耐心等待审核!').then(() => {
+                    router.back()
+                })
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        }).catch((err) => {
+            hideLoading(err, 'fail')
+        })
+    })
+}
+
+onMounted(() => {
+    formData.mobile = userStore.userInfo?.mobile2 ?? ''
+})
+</script>

+ 135 - 0
src/packages/thj/views/account/protocol/Index.vue

@@ -0,0 +1,135 @@
+<template>
+    <app-view class="g-form">
+        <template #header>
+            <app-navbar title="合同签署" />
+        </template>
+        <div class="g-form__container">
+            <CellGroup inset>
+                <Cell title="姓名" :value="customername" />
+                <Cell title="手机号码" :value="mobile2" />
+                <Cell title="证件号码" :value="decryptAES(cardnum)" />
+                <Cell title="签署机构" :value="memberUserId" />
+            </CellGroup>
+            <CellGroup inset>
+                <template v-for="(item, index) in dataList" :key="index">
+                    <Cell :title="item.templatename" :icon="iconName(item.recordstatus)" @click="signer(item)"
+                        is-link />
+                </template>
+            </CellGroup>
+        </div>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { CellGroup, Cell, showFailToast, showToast } from 'vant'
+import { fullloading } from '@/utils/vant';
+import { useNavigation } from '@mobile/router/navigation'
+import { useRequest } from '@/hooks/request'
+import { queryTencentUsereSignRecords, requestInitTencentESS } from '@/services/api/account';
+import { useRequestCreateFlowByTemplateDirectly } from '@/business/user/account';
+import plus from '@/utils/h5plus'
+import { getUserId } from '@/services/methods/user'
+import { useUserStore } from '@/stores'
+import { decryptAES } from '@/services/websocket/package/crypto'
+
+const { getQueryStringToNumber } = useNavigation()
+/// 所属机构
+const memberUserId = getQueryStringToNumber('memberUserId')
+/// userStore
+const userStore = useUserStore()
+/// 创建电子签合同
+const { createTemplate, templateFormData } = useRequestCreateFlowByTemplateDirectly()
+/// 电子签合同信息
+const dataList = shallowRef<Model.TencentUsereSignRecordsRsq[]>([])
+/// 用户信息
+const { customername, cardnum, mobile2 } =  userStore.userInfo
+/// 查询
+const { run } = useRequest(queryTencentUsereSignRecords, {
+    params: {
+        userId: getUserId(),
+        memberUserId: memberUserId
+    },
+    onSuccess: (res) => {
+        if (res.data != null && res.data.length != 0) {
+            dataList.value = res.data
+        }  else {
+            /// 创建电子签合同
+            initTencentESS()
+        }
+    }
+})
+
+/// 创建电子签合同
+const { run: initTencentESS } = useRequest(requestInitTencentESS, {
+    manual: true,
+    params: {
+        userId: getUserId(),
+        memberUserId: memberUserId
+    },
+    onSuccess: () => {
+        /// 重新请求
+        run()
+    }
+})
+
+const iconName = (type: number) => {
+    switch (type) {
+        case 2: return 'info-o'
+        case 4: return 'close'
+        case 3: return 'passed'
+        default: return 'circle'
+    }
+}
+
+const openWebview = (url: string) => {
+    const ua = window.navigator.userAgent.toLowerCase()
+    if (ua.indexOf('micromessenger') !== -1) {
+        showToast({
+            type: 'fail',
+            message: '请使用浏览器打开此页面'
+        })
+    } else {
+        plus.openWebview({
+            url,
+            titleText: '实名认证',
+            onClose: () => run()
+        })
+    }
+}
+
+const signer = (item: Model.TencentUsereSignRecordsRsq) => {
+    ///  如果是已签署
+    if (item.recordstatus === 2) {
+        item.signurl ? openWebview(item.signurl) : showFailToast('合同地址错误')
+    } else if (item.recordstatus === 3) {
+        showFailToast('合同已签署,请前往腾讯电子签小程序查看!')
+    } else {
+        fullloading((hideLoading) => {
+            const userinfotype = useUserStore().userInfo.userinfotype
+            templateFormData.userESignRecordID = item.recordid
+            templateFormData.userType = userinfotype
+            /// 个人信息
+            if (userinfotype === 1) {
+                templateFormData.personInfo = {
+                    idCardNumber: decryptAES(cardnum),
+                    mobile: mobile2,
+                    name: customername
+                }
+            } else {
+                templateFormData.organizationInfo = {
+                    name: customername
+                }
+            }
+            /// 创建合同
+            createTemplate().then((res) => {
+                hideLoading()
+                openWebview(res.data.signUrl)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    }
+}
+
+</script>

+ 40 - 2
src/packages/thj/views/mine/Index.vue

@@ -90,11 +90,17 @@
                         <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>
                 </Cell>
+                <Cell is-link :to="{ name: 'account-protocol', query: { memberUserId: getMemberUserId() } }"
+                    v-if="userStore.userType != 2 && authStatus === AuthStatus.Certified">
+                    <template #title>
+                        <Iconfont icon="g-icon-order--line">合同签署</Iconfont>
+                    </template>
+                </Cell>
                 <Cell is-link :to="{ name: 'mine-profile' }">
                     <template #title>
                         <Iconfont icon="g-icon-profile">公司信息</Iconfont>
@@ -144,13 +150,16 @@ import { queryBankAccountSign } from '@/services/api/bank'
 import { useLoginStore, useAccountStore, useUserStore } from '@/stores'
 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'
 
 const { router, routerTo } = useNavigation()
 const loginStore = useLoginStore()
 const userStore = useUserStore()
 const accountStore = useAccountStore()
 const { currentAccount } = accountStore.$toRefs()
-
+/// 判断是否能签约
+const canBankSign = shallowRef(false)
 const headerRef = shallowRef<HTMLDivElement>()
 const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
 
@@ -162,6 +171,19 @@ 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()
@@ -208,6 +230,22 @@ onActivated(() => {
         userStore.getUserData()
     }
     accountStore.getAccountList()
+
+    // 机构不需要签合同
+    if (userStore.userInfo.usertype === 2) {
+        canBankSign.value = true
+        return
+    }
+
+    /// 查询数据
+    queryMdUserSwapProtocol({
+        data: {
+            userId: loginStore.userId
+        }
+    }).then((res) => {
+        /// 判断是否能签约
+        canBankSign.value = res.data.some(e => e.protocolstatus === 4)
+    })
 })
 </script>
 

+ 1 - 1
src/packages/tjmd/views/account/certification/Index.vue

@@ -104,7 +104,7 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

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

@@ -179,7 +179,7 @@ const PFormRules: { [key in keyof Model.PersonBankCard4]?: FieldRule[] } = {
         message: '请输入证件号码',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true
@@ -236,7 +236,7 @@ const CFormRules: { [key in keyof Model.CompanyBankCard4]?: FieldRule[] } = {
         message: '请输入法人身份证号',
         validator: (val) => {
             if (validateRules.cardno.validate(val)) {
-                if ((getIdCardAge(val) < 18) || (getIdCardAge(val) > 65)) {
+                if((getIdCardAge(val) < 18) || (getIdCardAge(val) > 60)) {
                     return '开户失败,您的年龄不符合开户要求'
                 } 
                 return true

+ 11 - 0
src/services/api/account/index.ts

@@ -280,6 +280,17 @@ export function requestInitTencentESS(config: RequestConfig<Model.InitTencentESS
 }
 
 /**
+ * 按用户 ID 和机构 ID 创建机构交易协议申请信息
+ */
+export function requestInitMdUserSwapProtocol(config: RequestConfig<Model.InitMdUserSwapProtocolReq> = {}) {
+    return http.commonRequest<Model.InitMdUserSwapProtocolRsp>({
+        method: 'post',
+        url: '/Tencent/InitMdUserSwapProtocol',
+        data: config.data,
+    }, 'InitMdUserSwapProtocol')
+}
+
+/**
  * 银行卡四要素认证
  */
 export function requestBankCard4(config: RequestConfig<Model.BankCard4Req> = {}) {

+ 14 - 0
src/types/model/user.d.ts

@@ -342,6 +342,20 @@ declare namespace Model {
         signUrl: string
     }
 
+    /// 按用户 ID 和机构 ID 创建机构交易协议申请信息 - 请求
+    interface InitMdUserSwapProtocolReq {
+        /// 所属会员ID
+        memberUserId?: number
+        /// 用户ID
+        userId?: number
+    }
+
+    /// 按用户 ID 和机构 ID 创建机构交易协议申请信息 - 回应
+    interface InitMdUserSwapProtocolRsp {
+        /// code
+        code: string
+    }
+
     /// 按用户 ID 和机构 ID 创建腾讯电子签业务信息 - 请求
     interface InitTencentESSReq {
         /// 所属会员ID