瀏覽代碼

人才详情-邀请面试

Xiao_123 2 月之前
父節點
當前提交
dd19726671

+ 15 - 0
api/new/interview.js

@@ -0,0 +1,15 @@
+import request from "@/utils/request"
+
+// 面试-保存、重新邀约
+export const saveInterviewInvite = (data) => {
+	return request({
+		url: '/app-api/menduner/system/recruit/interview-invite/save',
+		method: "POST",
+		data,
+		custom: {
+			openEncryption: true,
+			auth: true,
+			showLoading: false
+		}
+	})
+}

+ 6 - 0
pages.json

@@ -201,6 +201,12 @@
 					"style": {
 						"navigationBarTitleText": "招聘会/职位"
 					}
+				},
+				{
+					"path": "InviteInterview/index",
+					"style": {
+						"navigationBarTitleText": "邀请面试"
+					}
 				}
 			]
 		}

+ 1 - 1
pages/index/components/talentItem.vue

@@ -55,7 +55,7 @@
 						<span class="ss-m-l-20">
 							<span>{{ k.startTimeStr }}</span>
 							<span v-if="k.endTimeStr"> - {{ k.endTimeStr }}</span>
-							<span v-if="k.year"> ({{ k.year }})</span>
+							<!-- <span v-if="k.year"> ({{ k.year }})</span> -->
 						</span>
 					</view>
 				</view>

+ 2 - 4
pages/index/search.vue

@@ -28,7 +28,6 @@ import { onShow } from '@dcloudio/uni-app'
 import { getAccessToken } from '@/utils/request'
 import { showAuthModal } from '@/hooks/useModal'
 import { getJobAdvertised } from '@/api/search'
-import { dealDictArrayData } from '@/utils/position'
 import { userStore } from '@/store/user'
 import { formatName } from '@/utils/getText'
 import RecommendPage from './components/recommend.vue'
@@ -43,9 +42,8 @@ const jobList = ref([])
 const getJobList = async () => {
   const { data } = await getJobAdvertised({ status: 0 })
   if (data.length) {
-    const list = dealDictArrayData([], data)
-    jobList.value = list.map(e => {
-      return { text: `${formatName(e.name)}_${e.areaName ? e.area?.str : '全国'}`, value: e.id, data: e }
+    jobList.value = data.map(e => {
+      return { text: `${formatName(e.name)}_${e.areaName ? e.area?.str : '全国'}`, value: e.id }
     })
   }
 }

+ 114 - 0
pagesB/InviteInterview/index.vue

@@ -0,0 +1,114 @@
+<template>
+	<view style="padding: 30rpx;">
+		<uni-forms ref="formRef" :modelValue="formData" :rules="formRules" validateTrigger="bind" label-width="80px" label-align="right" label-position="left">
+			<uni-forms-item name="time" label="面试时间" required>
+				<uni-datetime-picker v-model="formData.time" type="datetime" :border="true" returnType="timestamp" :hide-second="true" />
+			</uni-forms-item>
+			<uni-forms-item name="jobId" label="招聘职位" required>
+				<uni-data-select	v-model="formData.jobId" :localdata="jobList"	@change="handleChangeJob"	placeholder="请选择招聘职位"></uni-data-select>
+			</uni-forms-item>
+			<uni-forms-item name="address" label="面试地点" required>
+				<uni-easyinput v-model="formData.address" placeholder="请输入面试地点"></uni-easyinput>
+			</uni-forms-item>
+			<uni-forms-item name="invitePhone" label="联系电话" required>
+				<uni-easyinput v-model="formData.invitePhone" placeholder="请输入联系电话"></uni-easyinput>
+			</uni-forms-item>
+			<uni-forms-item name="remark" label="备注事项">
+				<uni-easyinput v-model="formData.remark" type="textarea" placeholder="请输入备注事项"></uni-easyinput>
+			</uni-forms-item>
+		</uni-forms>
+		<button class="send-button" @tap="handleSubmit">提 交</button>
+	</view>
+</template>
+
+<script setup>
+import { ref, unref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import { userStore } from '@/store/user'
+import { mobile } from '@/utils/validate'
+import { getJobAdvertisedList } from '@/api/new/position'
+import { formatName } from '@/utils/getText'
+import { getInterviewInviteDefaultTime } from '@/utils/date'
+import { saveInterviewInvite } from '@/api/new/interview'
+
+const formRef = ref(null)
+const useUserStore = userStore()
+const formData = ref({
+	userId: null,
+	address: null,
+	invitePhone: useUserStore?.userInfo?.phone || '',
+	time: getInterviewInviteDefaultTime().timeStamp,
+	jobId: null,
+	remark: null,
+	type: 1
+})
+const formRules = {
+	time: {
+		rules: [{ required: true, errorMessage: '请选择面试时间' }]
+	},
+  invitePhone: mobile,
+	address: {
+		rules: [{ required: true, errorMessage: '请输入面试地点' }]
+	},
+	jobId: {
+		rules: [{ required: true, errorMessage: '请选择邀请面试的职位' }]
+	}
+}
+
+// 职位列表
+const jobList = ref([])
+const getJobList = async () => {
+  const { data } = await getJobAdvertisedList({ pageNo: 1, pageSize: 10, hasExpiredData: false, status: 0 })
+  jobList.value = data?.list.map(e => {
+    return { text: formatName(e.name), value: e.id, ...e }
+  })
+}
+
+const handleChangeJob = (e) =>{
+	const job = jobList.value.find(item => item.value === e)
+	if (!job) return
+	formData.value.address = job.address
+}
+
+onLoad(async (options) => {
+	const { id } = options
+	if (!id) {
+		uni.showToast({
+			title: '缺少人员id',
+			icon: 'none'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+		return
+	}
+
+	formData.value.userId = id
+	await getJobList()
+})
+
+// 提交
+const handleSubmit = async () => {
+	const valid = await unref(formRef).validate()
+	if (!valid) return
+
+	uni.showLoading({ title: '提交中' })
+	try {
+		await saveInterviewInvite(formData.value)
+		uni.hideLoading()
+		uni.showToast({
+			title: '提交成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+	} catch {
+		uni.hideLoading()
+	}
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 3 - 0
pagesB/personnelDetails/index.vue

@@ -162,6 +162,9 @@ const handleInvite = async () => {
 		})
 		return
 	}
+	uni.navigateTo({
+	  url: `/pagesB/InviteInterview/index?id=${cvData.value.person.userId}`
+	})
 }
 
 // 立即沟通

+ 12 - 0
utils/date.js

@@ -89,4 +89,16 @@ export const getTimeDifferenceInChinese = (startTime, endTime) => {
     result += "个月";
   }
   return result
+}
+
+// 设置面试邀请默认时间
+export const getInterviewInviteDefaultTime = () => {
+  const today = new Date()
+  today.setDate(today.getDate() + 1)
+
+  const time = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 10, 0, 0)
+  return {
+    time,
+    timeStamp: time.getTime()
+  }
 }