|
@@ -49,8 +49,19 @@
|
|
|
<span class="defaultLink ml-3 mt-2">{{ item?.name }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #actions="{ item }">
|
|
|
+ <v-btn color="primary" variant="text" @click="handleInvite(item)">邀请面试</v-btn>
|
|
|
+ <v-btn color="primary" variant="text" @click="handleCommunicate(item)">立即沟通</v-btn>
|
|
|
+ </template>
|
|
|
</CtTable>
|
|
|
</div>
|
|
|
+
|
|
|
+ <CtDialog :visible="showInvite" :widthType="4" titleClass="text-h6" title="邀请面试" @close="showInvite = false" @submit="handleSubmit">
|
|
|
+ <InvitePage v-if="showInvite" ref="inviteRef" :item-data="itemData" :position="positionList"></InvitePage>
|
|
|
+ </CtDialog>
|
|
|
+ <TipDialog :visible="showTip" icon="mdi-check-circle-outline" message="面试邀请发送成功" @close="showTip = false">
|
|
|
+ <div class="color-primary text-decoration-underline cursor-pointer" @click="handleToInterviewManagement">点击到面试中查看。</div>
|
|
|
+ </TipDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -62,8 +73,13 @@ import Area from './components/area.vue'
|
|
|
import { getPersonSearchPage } from '@/api/enterprise.js'
|
|
|
import { dealDictArrayData } from '@/utils/position'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
+import { talkToUser, defaultTextEnt } from '@/hooks/web/useIM'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
+import { getJobAdvertisedList } from '@/api/position'
|
|
|
import Snackbar from '@/plugins/snackbar'
|
|
|
+import { saveInterviewInvite } from '@/api/recruit/enterprise/interview'
|
|
|
+import { useRouter } from 'vue-router'; const router = useRouter()
|
|
|
+import InvitePage from '@/views/recruit/enterprise/interviewManagement/components/invite'
|
|
|
|
|
|
const textItem = ref({
|
|
|
type: 'text',
|
|
@@ -96,7 +112,8 @@ const headers = ref([
|
|
|
{ title: '所在城市', key: 'areaName', sortable: false },
|
|
|
{ title: '户籍地', key: 'regName', sortable: false },
|
|
|
{ title: '婚姻状况', key: 'maritalStatusName', sortable: false },
|
|
|
- { title: '首次工作时间', key: 'firstWorkTime', sortable: false, value: item => timesTampChange(item.firstWorkTime, 'Y-M-D') }
|
|
|
+ { title: '首次工作时间', key: 'firstWorkTime', sortable: false, value: item => timesTampChange(item.firstWorkTime, 'Y-M-D') },
|
|
|
+ { title: '操作', key: 'actions', sortable: false }
|
|
|
])
|
|
|
|
|
|
const getData = async () => {
|
|
@@ -159,6 +176,69 @@ const handleClose = (item) => {
|
|
|
position.value = position.value.filter(k => k.id !== item.id)
|
|
|
}
|
|
|
|
|
|
+// 职位列表
|
|
|
+const jobNum = ref(0)
|
|
|
+const positionList = ref([])
|
|
|
+const getJobList = async () => {
|
|
|
+ const { total, list } = await getJobAdvertisedList({ pageNo: 1, pageSize: 10, hasExpiredData: false, status: 0 })
|
|
|
+ jobNum.value = total
|
|
|
+ if (!list.length) {
|
|
|
+ positionList.value = []
|
|
|
+ jobNum.value = 0
|
|
|
+ return
|
|
|
+ }
|
|
|
+ positionList.value = list.map(e => {
|
|
|
+ const salary = e.payFrom && e.payTo ? `${e.payFrom ? e.payFrom + '-' : ''}${e.payTo}${e.payName ? '/' + e.payName : ''}` : '面议'
|
|
|
+ return {
|
|
|
+ label: `${e.name}${e.areaName ? '_' + e.areaName : ''} ${salary}`,
|
|
|
+ value: e.id,
|
|
|
+ data: e
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+getJobList()
|
|
|
+
|
|
|
+// 立即沟通
|
|
|
+const handleCommunicate = async (item) => {
|
|
|
+ // // 企业必须有招聘中的职位才能发起沟通
|
|
|
+ if (jobNum.value === 0) return Snackbar.warning('请先发布职位')
|
|
|
+ const userId = item.userId
|
|
|
+ if (!userId) return
|
|
|
+ await talkToUser({userId, text: defaultTextEnt})
|
|
|
+ let url = `/recruit/enterprise/chatTools?id=${userId}`
|
|
|
+ router.push(url)
|
|
|
+}
|
|
|
+
|
|
|
+const showInvite = ref(false)
|
|
|
+const showTip = ref(false)
|
|
|
+const inviteRef = ref()
|
|
|
+const itemData = ref({})
|
|
|
+const handleInvite = (item) => {
|
|
|
+ if (jobNum.value === 0) return Snackbar.warning('请先发布职位')
|
|
|
+ itemData.value = item
|
|
|
+ showInvite.value = true
|
|
|
+}
|
|
|
+// 发送面试邀请
|
|
|
+const handleSubmit = async () => {
|
|
|
+ const { valid } = await inviteRef.value.CtFormRef.formRef.validate()
|
|
|
+ if (!valid) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const query = inviteRef.value.getQuery()
|
|
|
+ if (!query.time) {
|
|
|
+ Snackbar.warning('时间不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ delete query.id
|
|
|
+ await saveInterviewInvite(query)
|
|
|
+ showInvite.value = false
|
|
|
+ showTip.value = true
|
|
|
+}
|
|
|
+
|
|
|
+const handleToInterviewManagement = () => {
|
|
|
+ router.push('/recruit/enterprise/interviewManagement')
|
|
|
+}
|
|
|
+
|
|
|
// 人才详情
|
|
|
const handleToPersonDetail = ({ userId, id }) => {
|
|
|
if (!userId || !id) return
|