Handy_Cao 1 年間 前
コミット
bc7c4da0c1

+ 1 - 1
src/business/bank/index.ts

@@ -499,7 +499,7 @@ export function useDoYJFGetWithholdSignInSMSVCode() {
         UserID: useStore.userInfo.userid,
         LoginID: loginStore.loginId,
         ClientSerialNo: v4(),
-        Yckfxe: '0.00',
+        Yckfxe: '500000.00',
         Kkzqnkfxe: '0.00', 
         Kkzqnxzbs: '0',
         Kksjbc: '99'

+ 28 - 0
src/constants/order.ts

@@ -62,6 +62,13 @@ export enum TradeStatus {
     LoginOut = 7
 }
 
+/// 代扣处理结果
+export enum BillResult {
+    Success = 0,
+    Failure = 1,
+    InProcess = 2
+}
+
 /**
  * 获取买卖方向列表
  * @returns 
@@ -553,4 +560,25 @@ export function getTransferApplyStatusList() {
 export function getTransferApplyStatusName(value: number) {
     const enums = getTransferApplyStatusList()
     return getEnumTypeName(enums, value)
+}
+
+/**
+ * 获取代扣扣费列表
+ * @returns 
+ */
+export function getBillResultList() {
+    return [
+        { label: '扣费成功', value: BillResult.Success },
+        { label: '扣费失败', value: BillResult.Failure },
+        { label: '处理中', value: BillResult.InProcess },
+    ]
+}
+
+/**
+ * 获取代扣扣费名称
+ * @returns 
+ */
+export function getBillResultName(value: number) {
+    const enums = getBillResultList()
+    return getEnumTypeName(enums, value)
 }

+ 2 - 1
src/packages/gstj/views/holdbank/holddeposit/Index.vue

@@ -19,7 +19,7 @@
                             <h5>{{ formatDecimal(item.billamount) }}</h5>
                         </div>
                         <div class="right">
-                            <span>{{ item.billresult === '0' ? '扣费成功' : '扣费失败' }}</span>
+                            <span>{{ getBillResultName(Number(item.billresult)) }}</span>
                         </div>
                     </div>
                     <div class="g-order-list__content">
@@ -55,6 +55,7 @@ import { useRequest } from '@/hooks/request'
 import { SignStatus } from '@/constants/bank'
 import { Calendar, Cell } from 'vant'
 import { queryGtwithholddepositapply, queryGetGtwithholdsigninfo } from '@/services/api/bank'
+import { getBillResultName } from '@/constants/order'
 import moment from 'moment'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 

+ 2 - 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'
@@ -70,7 +70,7 @@ const formRules: { [key: string]: FieldRule[] } = {
         message: '请输入代扣金额',
         validator: (val) => {
             if (val > 500000) {
-                return '代扣金额不能超过50 万'
+                return '代扣金额不能超过50万'
             }
             return true
         }

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

@@ -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')

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

@@ -44,11 +44,13 @@ import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@mobile/router/navigation'
 import { queryQuoteGoodsList, queryMdUserSwapProtocol } from '@/services/api/swap'
 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 { getUserId, getMemberUserId } from '@/services/methods/user'
+import { requestInitMdUserSwapProtocol } from '@/services/api/account'
 import { shallowRef } from 'vue'
+import service from '@/services'
+import quoteSocket from '@/services/websocket/quote'
+import AppList from '@mobile/components/base/list/index.vue'
 
 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/pc/views/account/holddeposit/components/deposit/index.vue

@@ -44,7 +44,7 @@ const formRules: FormRules = {
         message: '请输入代扣金额',
             validator: (rule, value, callback) => {
                 if (value > 500000) {
-                    callback(new Error('代扣金额不能超过 50 万'))
+                    callback(new Error('代扣金额不能超过50万'))
                 } else {
                     callback()
                 }

+ 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>
 

+ 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

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