|
@@ -104,6 +104,7 @@
|
|
|
:key="tool.name"
|
|
|
size="small"
|
|
|
class="mr-3"
|
|
|
+ :disabled="tool.disabled"
|
|
|
:color="tool.color"
|
|
|
@click="tool.handle(tool)"
|
|
|
>
|
|
@@ -116,7 +117,7 @@
|
|
|
indeterminate
|
|
|
></v-progress-circular>
|
|
|
<v-icon v-else class="mr-2">{{ tool.icon }}</v-icon>
|
|
|
- {{ tool.name }}
|
|
|
+ {{ tool.disabled ? tool.disabledText : tool.name }}
|
|
|
</v-btn>
|
|
|
</template>
|
|
|
</Chatting>
|
|
@@ -160,29 +161,32 @@
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'personal-message-index'})
|
|
|
import InvitePage from '@/views/recruit/enterprise/interviewManagement/components/invite'
|
|
|
-import { timesTampChange } from '@/utils/date'
|
|
|
-import { ref, inject, watch,onMounted, nextTick } from 'vue'
|
|
|
+
|
|
|
+import { ref, inject, watch,onMounted, nextTick, computed } from 'vue'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
+
|
|
|
import Chatting from './components/chatting.vue'
|
|
|
import { initConnect, send, initChart, getMoreMessages, checkConversation } from '@/hooks/web/useIM'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
-import { getPositionDetails } from '@/api/position'
|
|
|
-import { getInterviewInviteListByInviteUserId } from '@/api/common'
|
|
|
+import { useI18n } from '@/hooks/web/useI18n'
|
|
|
+import { getPositionDetails, jobCvRelCheckSend, jobCvRelSend, jobCvRelHireSend } from '@/api/position'
|
|
|
+import { getInterviewInviteListByInviteUserId, getMessageType } from '@/api/common'
|
|
|
import { getUserInfo } from '@/api/personal/user'
|
|
|
-import { useIMStore } from '@/store/im'
|
|
|
-import { useUserStore } from '@/store/user'
|
|
|
-import Snackbar from '@/plugins/snackbar'
|
|
|
-import { getUserAvatar } from '@/utils/avatar'
|
|
|
-
|
|
|
import { getJobAdvertised } from '@/api/enterprise'
|
|
|
-import { dealDictArrayData } from '@/utils/position'
|
|
|
import { saveInterviewInvite } from '@/api/recruit/enterprise/interview'
|
|
|
import { savePersonResumeCv } from '@/api/recruit/personal/resume'
|
|
|
-import { useI18n } from '@/hooks/web/useI18n'
|
|
|
import { userInterviewInviteReject, userInterviewInviteConsent } from '@/api/recruit/personal/personalCenter'
|
|
|
import { getPersonResumeCv } from '@/api/recruit/personal/resume'
|
|
|
-import { previewFile } from '@/utils'
|
|
|
+
|
|
|
+import { useIMStore } from '@/store/im'
|
|
|
+import { useUserStore } from '@/store/user'
|
|
|
+import Snackbar from '@/plugins/snackbar'
|
|
|
import Confirm from '@/plugins/confirm'
|
|
|
|
|
|
+import { getUserAvatar } from '@/utils/avatar'
|
|
|
+import { dealDictArrayData } from '@/utils/position'
|
|
|
+import { previewFile } from '@/utils'
|
|
|
+import { timesTampChange } from '@/utils/date'
|
|
|
+
|
|
|
const { t } = useI18n()
|
|
|
const chatRef = ref()
|
|
|
|
|
@@ -212,6 +216,10 @@ const inviteRef = ref()
|
|
|
const showResume = ref(false)
|
|
|
const resumeList = ref([])
|
|
|
const selectResume = ref(null)
|
|
|
+
|
|
|
+// 众聘 介绍人个人id
|
|
|
+const isEmployment = ref('-1')
|
|
|
+
|
|
|
// 上传附件简历
|
|
|
const CtFormRef = ref()
|
|
|
const formItems = ref({
|
|
@@ -243,20 +251,37 @@ const showRightNoData = ref(false)
|
|
|
const info = ref({})
|
|
|
|
|
|
const enterpriseTools = ref([
|
|
|
- { name: '求简历', icon: 'mdi-email', color:"primary", loading: false, handle: handleRequest },
|
|
|
- { name: '面试邀约', icon: 'mdi-email', color:"primary", loading: false, handle: handleInvite }
|
|
|
+ { name: '求简历', icon: 'mdi-email', color:"primary", loading: false, handle: handleRequest, disabled: false, disabledText: '简历已接收' },
|
|
|
+ { name: '面试邀约', icon: 'mdi-email', color:"primary", loading: false, handle: handleInvite, disabled: false, disabledText: '面试邀约' }
|
|
|
])
|
|
|
|
|
|
const userTools = ref([
|
|
|
- { name: '发送简历', icon: 'mdi-email', color:"primary", loading: false, handle: handleSendResume }
|
|
|
+ {
|
|
|
+ name: '发送简历',
|
|
|
+ key: 'sendResume',
|
|
|
+ icon: 'mdi-email',
|
|
|
+ color:"primary",
|
|
|
+ loading: false,
|
|
|
+ handle: handleSendResume,
|
|
|
+ disabled: false,
|
|
|
+ disabledText: '简历已投递'
|
|
|
+ }
|
|
|
])
|
|
|
|
|
|
-const tools = isEnterprise ? enterpriseTools.value : userTools.value
|
|
|
+// const tools = isEnterprise ? enterpriseTools.value : userTools.value
|
|
|
+const tools = computed(() => {
|
|
|
+ return isEnterprise ? enterpriseTools.value : userTools.value
|
|
|
+})
|
|
|
+
|
|
|
+const positionInfo = ref({})
|
|
|
+// const isSendResume = ref(false)
|
|
|
+
|
|
|
|
|
|
if (!IM) {
|
|
|
console.log('IM is disconnected')
|
|
|
}
|
|
|
|
|
|
+// 职位进入
|
|
|
if (route.query.id) {
|
|
|
const api = route.query.enterprise ? getPositionDetails : getUserInfo
|
|
|
const res = await api({ id: route.query.id })
|
|
@@ -328,7 +353,37 @@ watch(
|
|
|
immediate: true
|
|
|
}
|
|
|
)
|
|
|
+// 获取职位信息
|
|
|
+async function getMessageTypeSync () {
|
|
|
+ const data = await getMessageType({
|
|
|
+ fromUid: IM.uid,
|
|
|
+ channelId: channelItem.value?.channelID,
|
|
|
+ type: 102,
|
|
|
+ page: {
|
|
|
+ current: 1,
|
|
|
+ size: 1,
|
|
|
+ orders: [
|
|
|
+ { column: 'message_seq', asc: false }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (!data.records || !data.records.length) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const _item = data.records.pop()
|
|
|
+ const _itemJSON = JSON.parse(_item.payload)
|
|
|
+ const _content = JSON.parse(_itemJSON.content)
|
|
|
+ positionInfo.value = _content.positionInfo
|
|
|
+ const check = await jobCvRelCheckSend({ jobId: _content.positionInfo.id })
|
|
|
+ handleChangeSendResumeStatus(check)
|
|
|
+}
|
|
|
|
|
|
+function handleChangeSendResumeStatus (status) {
|
|
|
+ if (!isEnterprise) {
|
|
|
+ const item = userTools.value.find(e => e.key === 'sendResume')
|
|
|
+ item.disabled = status
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
async function handleChange (items) {
|
|
|
// console.log([...items])
|
|
@@ -347,6 +402,8 @@ async function handleChange (items) {
|
|
|
const { channel, list, more } = await initChart(userId, enterpriseId)
|
|
|
// console.log('--------',list)
|
|
|
channelItem.value = channel.value
|
|
|
+ // 获取最近职位记录
|
|
|
+ getMessageTypeSync()
|
|
|
messageItems.value = list.value
|
|
|
hasMore.value = more
|
|
|
chatRef.value.scrollBottom()
|
|
@@ -432,7 +489,7 @@ const handleSubmitAttachment = async () => {
|
|
|
send (JSON.stringify(text), channelItem.value, 105)
|
|
|
}
|
|
|
|
|
|
-function handleSubmitResume () {
|
|
|
+async function handleSubmitResume () {
|
|
|
if (!selectResume.value) {
|
|
|
Snackbar.error(t('resume.selectResumeToSubmit'))
|
|
|
return
|
|
@@ -448,6 +505,23 @@ function handleSubmitResume () {
|
|
|
type: 1
|
|
|
}
|
|
|
send (JSON.stringify(text), channelItem.value, 105)
|
|
|
+
|
|
|
+ // 简历投递至简历库
|
|
|
+ if (isEmployment.value !== '-1') {
|
|
|
+ await jobCvRelHireSend({
|
|
|
+ jobId: positionInfo.value.id,
|
|
|
+ url: _info.url,
|
|
|
+ recommendUserId: isEmployment.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ await jobCvRelSend({
|
|
|
+ jobId: positionInfo.value.id,
|
|
|
+ title: _info.title,
|
|
|
+ url: _info.url,
|
|
|
+ type: positionInfo.value.hire ? 1 : 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleChangeSendResumeStatus(true)
|
|
|
showResume.value = false
|
|
|
}
|
|
|
// 求简历
|