|
|
@@ -21,11 +21,11 @@
|
|
|
</Field>
|
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
|
- <Cell v-for="(item, index) in dataList" :key="index" :title="item.templatename" :icon="iconName(item.recordstatus)" :disable="[2, 4].includes(item.recordstatus)" @click="signer(item)" />
|
|
|
+ <Cell v-for="(item, index) in dataList.filter(obj => obj.templatetype === 2)" :key="index" :title="item.templatename" :icon="iconName(item.recordstatus)" :disable="[2, 4].includes(item.recordstatus)" @click="signer(item)" />
|
|
|
</CellGroup>
|
|
|
<template #footer>
|
|
|
<div class="g-form__footer inset">
|
|
|
- <Button type="danger" :disable="!canAdd" @click="completed()" round block>提交认证</Button>
|
|
|
+ <Button type="danger" :disable="!canAdd" @click="onSubmit()" round block>提交认证</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-view>
|
|
|
@@ -39,7 +39,7 @@ import { fullloading, dialog } from '@/utils/vant';
|
|
|
import { getAQCertificateTypeListName } from "@/constants/account";
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryUserESignRecord } from '@/services/api/account';
|
|
|
-import { useRequestCreateContractAndAddSigner, useRequestSignCompleted } from '@/business/user/account';
|
|
|
+import { useRequestCreateContractAndAddSigner, useRequestSignCompleted, useRequestWillFace } from '@/business/user/account';
|
|
|
import plus from '@/utils/h5plus'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import { getFileUrl } from '@/filters';
|
|
|
@@ -50,6 +50,8 @@ const showModal = shallowRef(true)
|
|
|
const refresh = shallowRef(false)
|
|
|
const dataList = shallowRef<Model.UserESignRecordRsq[]>([])
|
|
|
const { createSigner, templateNoFormData} = useRequestCreateContractAndAddSigner()
|
|
|
+/// 意愿视频认证
|
|
|
+const { willFace, willFaceFormData} = useRequestWillFace()
|
|
|
const { signCompleted} = useRequestSignCompleted()
|
|
|
/// 可以认证
|
|
|
const canAdd = shallowRef(false)
|
|
|
@@ -57,24 +59,18 @@ const canAdd = shallowRef(false)
|
|
|
/// 查询
|
|
|
const { run } = useRequest(queryUserESignRecord, {
|
|
|
onSuccess: (res) => {
|
|
|
- if (res.data.length != 0) {
|
|
|
- dataList.value = res.data.filter(obj => obj.templatetype === 2)
|
|
|
- }
|
|
|
+ if (res.data.length != 0) { dataList.value = res.data }
|
|
|
/// 只有全部签署才可以进行下一步
|
|
|
- canAdd.value = dataList.value.some(obj => [1, 4].includes(obj.recordstatus) )
|
|
|
+ canAdd.value = dataList.value.some(obj => obj.templatetype === 2 && [2, 3].includes(obj.recordstatus) )
|
|
|
}
|
|
|
})
|
|
|
|
|
|
const iconName = (type: number) => {
|
|
|
switch (type) {
|
|
|
- case 2:
|
|
|
- return 'info-o'
|
|
|
- case 4:
|
|
|
- return 'close'
|
|
|
- case 3:
|
|
|
- return 'passed'
|
|
|
- default:
|
|
|
- return 'circle'
|
|
|
+ case 2: return 'info-o'
|
|
|
+ case 4: return 'close'
|
|
|
+ case 3: return 'passed'
|
|
|
+ default: return 'circle'
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -119,17 +115,9 @@ const completed = () => {
|
|
|
const signer = (item: Model.UserESignRecordRsq) => {
|
|
|
/// 如果是已签署
|
|
|
if (item.recordstatus === 2) {
|
|
|
- if (item.signurl != '') {
|
|
|
- openURL(item.signurl)
|
|
|
- } else {
|
|
|
- showFailToast('合同地址错误')
|
|
|
- }
|
|
|
+ item.signurl != '' ? openURL(item.signurl) : showFailToast('合同地址错误')
|
|
|
} else if (item.recordstatus === 3) {
|
|
|
- if (item.contractfileaddr != '') {
|
|
|
- openURL(item.contractfileaddr)
|
|
|
- } else {
|
|
|
- showFailToast('已签署文件地址错误')
|
|
|
- }
|
|
|
+ item.contractfileaddr != '' ? openURL(item.contractfileaddr) : showFailToast('合同地址错误')
|
|
|
} else {
|
|
|
fullloading((hideLoading) => {
|
|
|
templateNoFormData.templateNo = item.templateno
|
|
|
@@ -144,6 +132,32 @@ const signer = (item: Model.UserESignRecordRsq) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/// 最终提交
|
|
|
+const onSubmit = () => {
|
|
|
+ /// 如果类型为3 状态为3的 已经进行视频认证成功
|
|
|
+ if (dataList.value.some(obj => obj.templatetype === 3 && obj.recordstatus === 3)) {
|
|
|
+ completed()
|
|
|
+ } else {
|
|
|
+ willface()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/// 进行视频认证
|
|
|
+const willface = () => {
|
|
|
+ /// 参数信息
|
|
|
+ willFaceFormData.idCardNo = props.formData.idCard
|
|
|
+ willFaceFormData.realName = props.formData.name
|
|
|
+ /// loading
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ willFace().then((res) => {
|
|
|
+ hideLoading()
|
|
|
+ openURL(res.data.faceUrl)
|
|
|
+ }).catch((err) => {
|
|
|
+ showFailToast(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 接收窗口页面状态通知
|
|
|
const documentVisibilityStateNotify = eventBus.$on('DocumentVisibilityStateNotify', (state) => {
|
|
|
if (state === 'visible') {
|