Handy_Cao 2 năm trước cách đây
mục cha
commit
e30f99f53a

+ 22 - 1
src/business/user/account.ts

@@ -1,6 +1,6 @@
 import { shallowRef, reactive, computed } from 'vue'
 import { useLoginStore, useAccountStore } from '@/stores'
-import { investorDel, modifyPassword, requestAddAuth, requestAddUser, requestCreateContractAndAddSigner } from '@/services/api/account'
+import { investorDel, modifyPassword, requestAddAuth, requestAddUser, requestCreateContractAndAddSigner, requestSignCompleted } from '@/services/api/account'
 import cryptojs from 'crypto-js'
 
 const loginStore = useLoginStore()
@@ -146,4 +146,25 @@ export function  useRequestCreateContractAndAddSigner() {
         createSigner,
         templateNoFormData
     }
+}
+
+/**
+ * 提交实名认证
+ */
+export function  useRequestSignCompleted() {
+    const loading = shallowRef(false)
+
+    const signCompleted = async () => {
+        try {
+            loading.value = true
+            return await requestSignCompleted({})
+        } finally {
+            loading.value = false
+        }
+    }
+
+    return {
+        loading,
+        signCompleted
+    }
 }

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

@@ -123,16 +123,16 @@ const formRules: { [key in keyof Model.AddUserReq]?: FieldRule[] } = {
 }
 
 const onSubmit = () => {
-    fullloading((hideLoading) => {
-        formSubmit().then(() => {
-            hideLoading()
-            dialog('实名认证提交请求成功').then(() => {
+    // fullloading((hideLoading) => {
+    //     formSubmit().then(() => {
+    //         hideLoading()
+    //         dialog('实名认证提交请求成功').then(() => {
                 /// 进行下一步
                 openComponent('certification-next')
-            })
-        }).catch((err) => {
-            showFailToast(err)
-        })
-    })
+    //         })
+    //     }).catch((err) => {
+    //         showFailToast(err)
+    //     })
+    // })
 }
 </script>

+ 17 - 15
src/packages/qxst/views/account/certification/components/certification-next/Index.vue

@@ -30,7 +30,7 @@
             </CellGroup>
             <template #footer>
                 <div class="g-form__footer inset">
-                    <Button type="danger" :disable="!canAdd" @click="formRef?.submit" round block>提交认证</Button>
+                    <Button type="danger" :disable="!canAdd" @click="completed()" round block>提交认证</Button>
                 </div>
             </template>
         </app-view>
@@ -39,24 +39,24 @@
 
 <script lang="ts" setup>
 import { shallowRef, computed, PropType} from 'vue'
-import { CellGroup, Button, Cell, Field, Icon, FormInstance, showFailToast } from 'vant'
+import { CellGroup, Button, Cell, Field, Icon, showFailToast } from 'vant'
 import { fullloading, dialog } from '@/utils/vant';
 import { getAQCertificateTypeListName } from "@/constants/account";
 import { useRequest } from '@/hooks/request'
 import { queryUserESignRecord } from '@/services/api/account';
-import { useRequestCreateContractAndAddSigner } from '@/business/user/account';
+import { useRequestCreateContractAndAddSigner, useRequestSignCompleted } from '@/business/user/account';
 import AppModal from '@/components/base/modal/index.vue'
 import plus from '@/utils/h5plus'
 import { onMounted } from 'vue';
 import { getFileUrl } from '@/filters';
 
-const formRef = shallowRef<FormInstance>()
 const error = shallowRef(false)
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)
 const dataList = shallowRef<Model.UserESignRecordRsq[]>([])
 const { createSigner, templateNoFormData} = useRequestCreateContractAndAddSigner()
+const { signCompleted} = useRequestSignCompleted()
 /// 可以认证
 const canAdd = shallowRef(false)
 
@@ -96,16 +96,16 @@ const props = defineProps({
     }
 })
 
-const onSubmit = () => {
+const completed = () => {
     fullloading((hideLoading) => {
-        // formSubmit().then(() => {
-        //     hideLoading()
-        //     dialog('实名认证提交请求成功').then(() => {
-        //         // router.back()
-        //     })
-        // }).catch((err) => {
-        //     showFailToast(err)
-        // })
+        signCompleted().then(() => {
+            hideLoading()
+            dialog('实名认证提交请求成功').then(() => {
+                // router.back()
+            })
+        }).catch((err) => {
+            showFailToast(err)
+        })
     })
 }
 
@@ -136,10 +136,12 @@ onMounted(() => {
     useRequest(queryUserESignRecord, {
         onSuccess: (res) => {
             if (res.data.length != 0) {
-                dataList.value = res.data
+                dataList.value = res.data.filter(obj => {
+                    return obj.templatetype === 2
+                })
             }
             /// 只有全部签署才可以进行下一步
-            canAdd.value = res.data.some(obj => { [1, 2, 4].includes(obj.recordstatus) })
+            canAdd.value = dataList.value.some(obj => { [1, 2, 4].includes(obj.recordstatus) })
         },
         onError: () => {
             error.value = true

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

@@ -173,4 +173,15 @@ export function requestCreateContractAndAddSigner(config: RequestConfig<Model.Co
         url: '/Account/CreateContractAndAddSigner',
         data: config.data,
     })
+}
+
+/**
+ * 提交实名认证
+ */
+export function requestSignCompleted(config: RequestConfig<Model.ContractAndAddSignerReq> = {}) {
+    return http.goRequest<Model.ContractAndAddSignerRsq>({
+        method: 'post',
+        url: '/Account/SignCompleted',
+        data: config.data,
+    })
 }