|
@@ -5,7 +5,8 @@
|
|
|
:widthType="2"
|
|
|
titleClass="text-h6"
|
|
|
title="补充基本信息"
|
|
|
- @close="openDialog = false"
|
|
|
+ :closeable="props.closeable"
|
|
|
+ @close="openDialog = props.closeable ? false : true"
|
|
|
@submit="simpleInfoSubmit"
|
|
|
>
|
|
|
<simpleInfoForm ref="formRef"></simpleInfoForm>
|
|
@@ -13,6 +14,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
import simpleInfoForm from '../form/simpleInfo.vue'
|
|
|
import { savePersonSimpleInfo } from '@/api/recruit/personal/shareJob'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
@@ -20,6 +22,12 @@ import Snackbar from '@/plugins/snackbar'
|
|
|
import { ref } from 'vue'
|
|
|
defineOptions({name: 'shareJob-sendResume-simple'})
|
|
|
const emit = defineEmits(['simpleInfoReady'])
|
|
|
+const props = defineProps({
|
|
|
+ closeable: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
const openDialog = ref(false) // 默认不打开弹窗,先检验simpleInfoReady
|
|
|
const info = ref(null)
|
|
@@ -32,14 +40,20 @@ setTimeout(() => { if (!info.value) getUserInfoFail() }, 10000);
|
|
|
|
|
|
// 查询用户基本信息
|
|
|
const getUserInfoVerify = () => {
|
|
|
+ if (!getToken()) {
|
|
|
+ clearInterval(timer.value); timer.value = null
|
|
|
+ return
|
|
|
+ }
|
|
|
if (info.value) {
|
|
|
if (timer.value) clearInterval(timer.value); timer.value = null
|
|
|
const keyArr = ['name', 'phone', 'jobStatus', 'expType', 'eduType'] // 必填人才信息
|
|
|
const simpleInfoReady = Object.keys(info.value).length && keyArr.every(e => info.value[e] && info.value[e] !== 0) // 校验必填人才信息
|
|
|
- if (simpleInfoReady) emit('simpleInfoReady') // 存在
|
|
|
- else {
|
|
|
+ if (simpleInfoReady) {
|
|
|
+ emit('simpleInfoReady') // 存在
|
|
|
+ } else {
|
|
|
openDialog.value = true // 不存在
|
|
|
Snackbar.warning('请先完善个人基本信息')
|
|
|
+ localStorage.setItem('simpleCompleteDialogHaveBeenShow', true)
|
|
|
}
|
|
|
}
|
|
|
info.value = JSON.parse(localStorage.getItem('baseInfo'))
|