|
@@ -120,20 +120,20 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 通用弹窗 -->
|
|
<!-- 通用弹窗 -->
|
|
|
- <ModernDialog
|
|
|
|
|
|
|
+ <!-- <ModernDialog
|
|
|
v-model:show="showDialog"
|
|
v-model:show="showDialog"
|
|
|
title="申请成功"
|
|
title="申请成功"
|
|
|
message="您的开票信息已提交至税务部门审核,审核通过后通知您缴纳税款,请关注缴税信息。"
|
|
message="您的开票信息已提交至税务部门审核,审核通过后通知您缴纳税款,请关注缴税信息。"
|
|
|
confirmText="我知道了"
|
|
confirmText="我知道了"
|
|
|
@confirm="onConfirm"
|
|
@confirm="onConfirm"
|
|
|
- />
|
|
|
|
|
|
|
+ /> -->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useDebounceFn } from '@/utils/util'
|
|
import { useDebounceFn } from '@/utils/util'
|
|
|
-import ModernDialog from '@/components/ModernDialog.vue'
|
|
|
|
|
|
|
+// import ModernDialog from '@/components/ModernDialog.vue'
|
|
|
import {
|
|
import {
|
|
|
getConfirmInvoiceInfoApi,
|
|
getConfirmInvoiceInfoApi,
|
|
|
getStatusApi,
|
|
getStatusApi,
|
|
@@ -142,7 +142,7 @@ import {
|
|
|
import type { PushRecordIdRequest } from '@/services/modules/invoiceInformation/type.d.ts'
|
|
import type { PushRecordIdRequest } from '@/services/modules/invoiceInformation/type.d.ts'
|
|
|
import { reactive, onMounted, ref } from 'vue'
|
|
import { reactive, onMounted, ref } from 'vue'
|
|
|
import StepProgress from '@/components/StepProgress.vue'
|
|
import StepProgress from '@/components/StepProgress.vue'
|
|
|
-import { showToast } from 'vant'
|
|
|
|
|
|
|
+import { showToast, showSuccessToast } from 'vant'
|
|
|
import { useUserStore } from '@/stores/modules/user'
|
|
import { useUserStore } from '@/stores/modules/user'
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
@@ -155,7 +155,7 @@ const params = reactive<PushRecordIdRequest>({
|
|
|
pushRecordId: userStore.pushRecordId,
|
|
pushRecordId: userStore.pushRecordId,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const btnDisabled = ref(false)
|
|
|
|
|
|
|
+const btnDisabled = ref<boolean>(false)
|
|
|
const getConfirmInvoiceInfo = async () => {
|
|
const getConfirmInvoiceInfo = async () => {
|
|
|
try {
|
|
try {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
@@ -168,54 +168,78 @@ const getConfirmInvoiceInfo = async () => {
|
|
|
// 如果存在错误码,则显示错误信息,且按钮禁用点击
|
|
// 如果存在错误码,则显示错误信息,且按钮禁用点击
|
|
|
if (code === 1 && message) {
|
|
if (code === 1 && message) {
|
|
|
showToast(message)
|
|
showToast(message)
|
|
|
- // btnDisabled.value = true
|
|
|
|
|
|
|
+ btnDisabled.value = true
|
|
|
}
|
|
}
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleNext = useDebounceFn(async () => {
|
|
|
|
|
|
|
+interface ToStatus {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 待处理事件
|
|
|
|
|
+ */
|
|
|
|
|
+ eventStatus?: string
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 开票状态
|
|
|
|
|
+ */
|
|
|
|
|
+ invoiceStatus?: string
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 是否上传身份证图片
|
|
|
|
|
+ */
|
|
|
|
|
+ isIdImgReady?: boolean
|
|
|
|
|
+ [property: string]: any
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const statusMap = ref<ToStatus>({})
|
|
|
|
|
+// 已经提交状态
|
|
|
|
|
+const isSubmitStausMap = ['PENDING', 'FINISHED']
|
|
|
|
|
+const getStatus = async () => {
|
|
|
const res = await getStatusApi(params)
|
|
const res = await getStatusApi(params)
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
- // res.data.eventStatus === 'PROCESSED' 去人脸识别页面
|
|
|
|
|
- if (res.data.eventStatus === 'PROCESSED') {
|
|
|
|
|
- return router.push({
|
|
|
|
|
- path: '/face-recognition',
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ statusMap.value = res.data as ToStatus
|
|
|
|
|
+ const invoiceStatus = res.data.invoiceStatus
|
|
|
|
|
+ if (invoiceStatus && isSubmitStausMap.includes(invoiceStatus)) {
|
|
|
|
|
+ btnDisabled.value = true
|
|
|
}
|
|
}
|
|
|
- return submitInvoiceApply()
|
|
|
|
|
- // 当前账户没有身份照片,跳转上传证件页面
|
|
|
|
|
- // if (!res.data.isIdImgReady) {
|
|
|
|
|
- // router.push({
|
|
|
|
|
- // path: '/identity-upload',
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleNext = useDebounceFn(async () => {
|
|
|
|
|
+ // 当eventStatus === PROCESSED 需要人脸认证
|
|
|
|
|
+ if (statusMap.value.eventStatus === 'PROCESSED') {
|
|
|
|
|
+ return router.push({
|
|
|
|
|
+ path: '/face-recognition',
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ return submitInvoiceApply()
|
|
|
|
|
+ // 当前账户没有身份照片,跳转上传证件页面
|
|
|
|
|
+ // if (!res.data.isIdImgReady) {
|
|
|
|
|
+ // router.push({
|
|
|
|
|
+ // path: '/identity-upload',
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
|
|
|
|
|
-const showDialog = ref(false)
|
|
|
|
|
const submitInvoiceApply = async () => {
|
|
const submitInvoiceApply = async () => {
|
|
|
try {
|
|
try {
|
|
|
const res = await submitInvoiceApplyApi(params)
|
|
const res = await submitInvoiceApplyApi(params)
|
|
|
if (res.code === 0 && res.data) {
|
|
if (res.code === 0 && res.data) {
|
|
|
- showDialog.value = true
|
|
|
|
|
|
|
+ showSuccessToast('提交成功')
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ userStore.LogOut()
|
|
|
|
|
+ router.replace({
|
|
|
|
|
+ path: '/success',
|
|
|
|
|
+ })
|
|
|
|
|
+ }, 800)
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
console.log('err', err)
|
|
console.log('err', err)
|
|
|
-
|
|
|
|
|
showToast('提交失败,请稍后重试')
|
|
showToast('提交失败,请稍后重试')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const activeStep = ref(1)
|
|
const activeStep = ref(1)
|
|
|
-const onConfirm = () => {
|
|
|
|
|
- showDialog.value = false
|
|
|
|
|
- userStore.LogOut()
|
|
|
|
|
- router.replace({
|
|
|
|
|
- path: '/login',
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
const toDetail = () => {
|
|
const toDetail = () => {
|
|
|
router.push({
|
|
router.push({
|
|
@@ -223,6 +247,7 @@ const toDetail = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ getStatus()
|
|
|
getConfirmInvoiceInfo()
|
|
getConfirmInvoiceInfo()
|
|
|
const authFlag = sessionStorage.getItem('FACE_AUTH_DONE')
|
|
const authFlag = sessionStorage.getItem('FACE_AUTH_DONE')
|
|
|
if (authFlag === '1') {
|
|
if (authFlag === '1') {
|