|
|
@@ -2,24 +2,14 @@
|
|
|
<app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
|
|
|
<app-view class="g-form">
|
|
|
<template #header>
|
|
|
- <app-navbar title="实名认证" @back="closed" />
|
|
|
+ <app-navbar title="合同签署" @back="closed" />
|
|
|
</template>
|
|
|
<div class="g-form__container">
|
|
|
<CellGroup inset>
|
|
|
- <Cell title="姓名" :value="formData.username" />
|
|
|
- <Cell title="手机号码" :value="formData.mobile" />
|
|
|
- <Cell title="证件类型" :value="getAQCertificateTypeListName(formData.cardtype ?? 1)" />
|
|
|
- <Cell title="证件号码" :value="formData.cardnum" />
|
|
|
- <Cell title="证件正面照片">
|
|
|
- <template #value>
|
|
|
- <Image fit="contain" :src="cardfrontphotourl" width="100" height="100" />
|
|
|
- </template>
|
|
|
- </Cell>
|
|
|
- <Cell title="证件反面照片">
|
|
|
- <template #value>
|
|
|
- <Image fit="contain" :src="cardbackphotourl" width="100" height="100" />
|
|
|
- </template>
|
|
|
- </Cell>
|
|
|
+ <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">
|
|
|
@@ -28,51 +18,71 @@
|
|
|
</template>
|
|
|
</CellGroup>
|
|
|
</div>
|
|
|
- <template #footer>
|
|
|
- <div class="g-form__footer inset">
|
|
|
- <Button type="danger" :disabled="dataList.some((e) => e.recordstatus !== 3)" @click="closed(true)" round
|
|
|
- block>提交认证</Button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
</app-view>
|
|
|
</app-modal>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, computed, PropType } from 'vue'
|
|
|
-import { CellGroup, Button, Cell, showFailToast, Image, showToast } from 'vant'
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { CellGroup, Cell, showFailToast, showToast } from 'vant'
|
|
|
import { fullloading } from '@/utils/vant';
|
|
|
-import { getAQCertificateTypeListName } from "@/constants/account";
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
-import { queryTencentUsereSignRecords } from '@/services/api/account';
|
|
|
+import { queryTencentUsereSignRecords, requestInitTencentESS } from '@/services/api/account';
|
|
|
import { useRequestCreateFlowByTemplateDirectly } from '@/business/user/account';
|
|
|
import plus from '@/utils/h5plus'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import { getFileUrl } from '@/filters';
|
|
|
-import AppModal from '@/components/base/modal/index.vue'
|
|
|
-import { getUserId, getMemberUserId } from '@/services/methods/user'
|
|
|
+import { getUserId } from '@/services/methods/user'
|
|
|
import { useUserStore } from '@/stores'
|
|
|
+import { decryptAES } from '@/services/websocket/package/crypto'
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ memberUserId: {
|
|
|
+ type: Number,
|
|
|
+ required: true,
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
const showModal = shallowRef(true)
|
|
|
// 是否刷新父组件数据
|
|
|
const refresh = shallowRef(false)
|
|
|
+/// 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: getMemberUserId()
|
|
|
+ memberUserId: props.memberUserId
|
|
|
},
|
|
|
onSuccess: (res) => {
|
|
|
if (res.data.length != 0) {
|
|
|
dataList.value = res.data
|
|
|
+ } else {
|
|
|
+ /// 创建电子签合同
|
|
|
+ initTencentESS()
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+/// 创建电子签合同
|
|
|
+const { run: initTencentESS } = useRequest(requestInitTencentESS, {
|
|
|
+ manual: true,
|
|
|
+ params: {
|
|
|
+ userId: getUserId(),
|
|
|
+ memberUserId: props.memberUserId
|
|
|
+ },
|
|
|
+ onSuccess: () => {
|
|
|
+ /// 重新请求
|
|
|
+ run()
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
const iconName = (type: number) => {
|
|
|
switch (type) {
|
|
|
case 2: return 'info-o'
|
|
|
@@ -82,20 +92,6 @@ const iconName = (type: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 正面照
|
|
|
-const cardfrontphotourl = computed(() => {
|
|
|
- const cardfrontphotourl = props.formData.cardfrontphotourl ?? ''
|
|
|
- const image = cardfrontphotourl.split(',')[0]
|
|
|
- return getFileUrl(image)
|
|
|
-})
|
|
|
-
|
|
|
-// 背面照
|
|
|
-const cardbackphotourl = computed(() => {
|
|
|
- const cardbackphotourl = props.formData.cardbackphotourl ?? ''
|
|
|
- const image = cardbackphotourl.split(',')[0]
|
|
|
- return getFileUrl(image)
|
|
|
-})
|
|
|
-
|
|
|
const openWebview = (url: string) => {
|
|
|
const ua = window.navigator.userAgent.toLowerCase()
|
|
|
if (ua.indexOf('micromessenger') !== -1) {
|
|
|
@@ -112,13 +108,6 @@ const openWebview = (url: string) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const props = defineProps({
|
|
|
- formData: {
|
|
|
- type: Object as PropType<Model.AddAuthReq>,
|
|
|
- required: true,
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
const signer = (item: Model.TencentUsereSignRecordsRsq) => {
|
|
|
/// 如果是已签署
|
|
|
if (item.recordstatus === 2) {
|
|
|
@@ -134,13 +123,13 @@ const signer = (item: Model.TencentUsereSignRecordsRsq) => {
|
|
|
/// 个人信息
|
|
|
if (userinfotype === 1) {
|
|
|
templateFormData.personInfo = {
|
|
|
- idCardNumber: props.formData.cardnum,
|
|
|
- mobile: props.formData.mobile,
|
|
|
- name: props.formData.username
|
|
|
+ idCardNumber: decryptAES(cardnum),
|
|
|
+ mobile: mobile2,
|
|
|
+ name: customername
|
|
|
}
|
|
|
} else {
|
|
|
templateFormData.organizationInfo = {
|
|
|
- name: props.formData.username
|
|
|
+ name: customername
|
|
|
}
|
|
|
}
|
|
|
/// 创建合同
|