Xiao_123 10 mēneši atpakaļ
vecāks
revīzija
441884c4e4

+ 102 - 0
src/views/recruit/enterprise/elite/components/public.vue

@@ -0,0 +1,102 @@
+<template>
+  <CtForm ref="CtFormRef" :items="formItems" style="height: 420px;">
+    <template #time="{ item }">
+      <VueDatePicker 
+        v-model="item.value"
+        placeholder="面试时间 *"
+        class="mb-4"
+        model-type="timestamp"
+        :text-input="{ format: 'MM.dd.yyyy HH:mm' }" />
+    </template>
+  </CtForm>
+</template>
+
+<script setup>
+defineOptions({ name: 'invite-public'})
+import { ref } from 'vue'
+
+const props = defineProps({
+  itemData: {
+    type: Object,
+    default: () => {}
+  }
+})
+
+const CtFormRef = ref()
+const formItems = ref({
+  options: [
+    {
+      slotName: 'time',
+      key: 'time',
+      value: null,
+      rules: [v => !!v || '请选择面试时间'],
+    },
+    {
+      type: 'text',
+      key: 'position',
+      value: '',
+      noParam: true,
+      disabled: true,
+      label: '面试岗位'
+    },
+    {
+      type: 'text',
+      key: 'address',
+      value: '',
+      label: '面试地点 *',
+      rules: [v => !!v || '请输入面试地点'],
+    },
+    {
+      type: 'text',
+      key: 'invitePhone',
+      value: null,
+      label: '联系电话 *',
+      outlined: true,
+      rules: [v => !!v || '请填写联系电话']
+    },
+    {
+      type: 'textarea',
+      key: 'remark',
+      value: '',
+      label: '备注事项',
+      counter: 140,
+      rules: [
+        value => {
+          if (value?.length <= 140) return true
+          return '请输入备注事项,最多140字'
+        }
+      ]
+    }
+  ]
+})
+
+if (Object.keys(props.itemData).length) {
+  const obj = formItems.value.options.find(e => e.key === 'position')
+  obj.value = `${props.itemData?.job?.name}${props.itemData?.job?.areaName ? '_' + props.itemData?.job?.areaName : ''} ${props.itemData?.job?.payFrom}-${props.itemData?.job?.payTo}/${props.itemData?.job?.payName}`
+  formItems.value.options.find(e => e.key === 'address').value = props.itemData.job?.address
+}
+
+const getQuery = () => {
+  const obj = {
+    type: 1,
+    jobId: props.itemData.job.id,
+    userId: props.itemData.userId,
+    latitude: props.itemData.job?.latitude,
+    longitude: props.itemData.job?.longitude
+  }
+  formItems.value.options.forEach(item => {
+    if (item.noParam) return
+    obj[item.key] = item.value
+  })
+  return obj
+}
+
+defineExpose({
+  CtFormRef,
+  getQuery
+})
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 7 - 4
src/views/recruit/enterprise/elite/components/screen.vue

@@ -19,7 +19,10 @@
         <v-radio v-model="selected" label="新投递" value="0" color="primary" hide-details density="compact" class="mr-3"></v-radio>
         <v-radio v-model="selected" label="已查看" value="1" color="primary" hide-details density="compact"></v-radio>
       </v-radio-group>
-      <v-checkbox class="ml-3" v-model="bounty" label="赏金职位" color="primary" hide-details density="compact" @update:model-value="handleChangeBounty"></v-checkbox>
+      <v-radio-group class="ml-5" v-model="bounty" inline style="height: 28px;" @update:modelValue="handleChangeBounty">
+        <v-radio v-model="bounty" label="普通职位" :value="false" color="primary" hide-details density="compact" class="mr-3"></v-radio>
+        <v-radio v-model="bounty" label="赏金职位" :value="true" color="primary" hide-details density="compact"></v-radio>
+      </v-radio-group>
     </div>
     <span class="reset-text cursor-pointer ml-3" @click="handleReset">重置</span>
   </div>
@@ -39,7 +42,7 @@ const props = defineProps({
 })
 
 const selected = ref()
-const bounty = ref(false)
+const bounty = ref(null)
 
 const list = ref([
   {
@@ -85,7 +88,7 @@ list.value.forEach(k => {
     })
   }
   if (k.api) {
-    k.api({ hire: false }).then(data => {
+    k.api({}).then(data => {
       if (data.length) {
         const list = dealDictArrayData([], data)
         k.items = list.map(e => {
@@ -112,7 +115,7 @@ const handleReset = () => {
     return e
   })
   selected.value = ''
-  bounty.value = false
+  bounty.value = null
   emit('reset')
 }
 

+ 23 - 8
src/views/recruit/enterprise/elite/components/table.vue

@@ -27,21 +27,18 @@
         <span v-else>{{ item.status ? props.statusList.find(i => i.value === item.status).label : '' }}</span>
       </template>
       <template v-slot:item.actions="{ item }">
-        <div v-if="tab === 0">
-          <v-btn color="primary" variant="text" @click="handlePreviewResume(item)">查看附件</v-btn>
-          <v-btn color="primary" variant="text" @click="handleInterviewInvite(item)">邀请面试</v-btn>
-        </div>
+        <v-btn v-if="tab === 0" color="primary" variant="text" @click="handlePreviewResume(item)">查看附件</v-btn>
+        <v-btn v-if="tab === 0" color="primary" variant="text" @click="handleInterviewInvite(item)">邀请面试</v-btn>
         <v-btn v-if="tab === 0 || tab === 1" color="primary" variant="text" @click="handleEliminate(item)">不合适</v-btn>
-        <div v-if="tab === 1">
-          <v-btn color="primary" variant="text" @click="handleEnterByEnterprise(item)">入职</v-btn>
-        </div>
+        <v-btn v-if="tab === 1 && (item.status === '3' || item.status === '4')" color="primary" variant="text" @click="handleEnterByEnterprise(item)">入职</v-btn>
         <v-btn v-if="tab === 4" color="primary" variant="text" @click="handleCancelEliminate(item)">取消不合适</v-btn>
+        <v-btn v-if="tab === 2 && item?.job?.hire" color="primary" variant="text" @click="handleSettlement(item)">结算</v-btn>
       </template>
     </v-data-table>
 
     <!-- 邀请面试 -->
     <CtDialog :visible="showInvite" :widthType="2" titleClass="text-h6" title="面试信息" @close="handleEditClose" @submit="handleEditSubmit">
-      <InvitePage v-if="showInvite" ref="inviteRef" :itemData="itemData"></InvitePage>
+      <InvitePage v-if="showInvite && !inviteType" ref="inviteRef" :itemData="itemData"></InvitePage>
     </CtDialog>
   </div>
 </template>
@@ -52,7 +49,9 @@ import { ref, computed, watch } from 'vue'
 import { previewFile } from '@/utils'
 import { personJobCvLook, joinEliminate, personEntryByEnterprise, personCvUnfitCancel } from '@/api/recruit/enterprise/personnel'
 import { saveInterviewInvite } from '@/api/recruit/enterprise/interview'
+import { hireJobCvRelSettlement } from '@/api/recruit/public/delivery'
 import { useI18n } from '@/hooks/web/useI18n'
+import { useUserStore } from '@/store/user'
 import Snackbar from '@/plugins/snackbar'
 import InvitePage from './invite.vue'
 
@@ -71,6 +70,7 @@ const badgeIcon = computed(() => (item) => {
   return (item.person && item.person.sex) ? (item.person.sex === '1' ? 'mdi-gender-male' : 'mdi-gender-female') : 'mdi-gender-female'
 })
 
+const userStore = useUserStore()
 const inviteRef = ref()
 const showInvite = ref(false)
 const headers = ref([
@@ -151,13 +151,16 @@ const handlePreviewResume = async ({ url, id }) => {
 
 // 邀请面试
 const itemData = ref({})
+const inviteType = ref(false)
 const handleInterviewInvite = (item) => {
+  if (item?.job?.hire) inviteType.value = true
   itemData.value = item
   showInvite.value = true
 }
 
 const handleEditClose = () => {
   showInvite.value = false
+  inviteType.value = false
   itemData.value = {}
 }
 
@@ -171,6 +174,18 @@ const handleEditSubmit = async () => {
   handleEditClose()
   emit('refresh')
 }
+
+// 结算
+const handleSettlement = async (item) => {
+  if (!item.id) return
+  await hireJobCvRelSettlement(item.id)
+  Snackbar.success(t('common.operationSuccessful'))
+  emit('refresh')
+  // 更新账户信息
+  setTimeout(async () => {
+    await userStore.getEnterpriseUserAccountInfo()
+  }, 2000)
+}
 </script>
 
 <style scoped lang="scss">

+ 2 - 2
src/views/recruit/enterprise/elite/index.vue

@@ -40,7 +40,7 @@ const query = ref({
   pageNo: 1,
   pageSize: 10,
   status: null,
-  type: 0
+  type: null
 })
 const tab = ref(0)
 const tabList = ref([
@@ -121,7 +121,7 @@ const handleScreenReset = () => {
   }
   if (tab.value === 0) {
     query.value.status = null
-    query.value.type = 0
+    query.value.type = null
   }
   if (textItems.value.value) query.value.name = textItems.value.value
   getList()