Pārlūkot izejas kodu

面试管理-取消、爽约、反馈

Xiao_123 1 mēnesi atpakaļ
vecāks
revīzija
45038e886b

+ 18 - 0
pages.json

@@ -71,6 +71,24 @@
 						"navigationBarTitleText": "面试管理"
 					}
 				},
+				{
+					"path": "interview/feedback",
+					"style": {
+						"navigationBarTitleText": "面试反馈"
+					}
+				},
+				{
+					"path": "interview/cancel",
+					"style": {
+						"navigationBarTitleText": "取消面试"
+					}
+				},
+				{
+					"path": "interview/attended",
+					"style": {
+						"navigationBarTitleText": "面试爽约"
+					}
+				},
 				{
 					"path": "chart/index",
 					"style": {

+ 2 - 2
pages/index/my.vue

@@ -79,8 +79,8 @@ const vip = computed(() => new Date().getTime() < useUserStore?.userInfo?.vipExp
 const popup = ref()
 
 const defaultList = [
-	{ title: '简历', path: '/pagesA/resume/index' },
-	{ title: '面试', path: '/pagesA/interview/index' },
+	{ title: '简历管理', path: '/pagesA/resume/index' },
+	{ title: '面试管理', path: '/pagesA/interview/index' },
 	{ title: '联系我们', path: '/pagesB/contactUs/index' },
 	{ title: '协议中心', path: '/pagesB/agreement/index', open: true },
 	{ title: '我要求职', appId: 'wx5dd538ccc752b03a' },

+ 68 - 0
pagesA/interview/attended.vue

@@ -0,0 +1,68 @@
+<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="reason" label="爽约原因" required>
+				<uni-easyinput v-model="formData.reason" 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 { noAttendInterviewInvite } from '@/api/interview'
+
+const formRef = ref(null)
+const formData = ref({
+	id: null,
+	reason: null
+})
+const formRules = {
+	reason: {
+		rules: [{ required: true, errorMessage: '请输入爽约原因' }]
+	}
+}
+
+onLoad(async (options) => {
+	const { id } = options
+	if (!id) {
+		uni.showToast({
+			title: 'ID缺失',
+			icon: 'none'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+		return
+	}
+
+	formData.value.id = id
+})
+
+// 提交
+const handleSubmit = async () => {
+	const valid = await unref(formRef).validate()
+	if (!valid) return
+
+	uni.showLoading({ title: '提交中' })
+	try {
+		await noAttendInterviewInvite(formData.value)
+		uni.hideLoading()
+		uni.showToast({
+			title: '提交成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+	} catch {
+		uni.hideLoading()
+	}
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 68 - 0
pagesA/interview/cancel.vue

@@ -0,0 +1,68 @@
+<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="reason" label="取消原因" required>
+				<uni-easyinput v-model="formData.reason" 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 { cancelInterviewInvite } from '@/api/interview'
+
+const formRef = ref(null)
+const formData = ref({
+	id: null,
+	reason: null
+})
+const formRules = {
+	reason: {
+		rules: [{ required: true, errorMessage: '请输入取消原因' }]
+	}
+}
+
+onLoad(async (options) => {
+	const { id } = options
+	if (!id) {
+		uni.showToast({
+			title: 'ID缺失',
+			icon: 'none'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+		return
+	}
+
+	formData.value.id = id
+})
+
+// 提交
+const handleSubmit = async () => {
+	const valid = await unref(formRef).validate()
+	if (!valid) return
+
+	uni.showLoading({ title: '提交中' })
+	try {
+		await cancelInterviewInvite(formData.value)
+		uni.hideLoading()
+		uni.showToast({
+			title: '提交成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+	} catch {
+		uni.hideLoading()
+	}
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 15 - 15
pagesA/interview/item.vue → pagesA/interview/components/item.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<uni-card v-for="(val, index) in items" :key="index" :is-shadow="true" @tap.stop="handleDetail(val)" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
+		<uni-card v-for="(val, index) in items" :key="index" :is-shadow="true" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
 			<!-- 基本信息 -->
 			<view class="d-flex align-center">
 				<view class="user-avatar">
@@ -37,7 +37,7 @@
 				<view 
 					class="sub-li-bottom-item d-flex align-center justify-center" 
 					@tap.stop="handleLoadMore(val)" 
-					:style="{'color': !actionItems(val)?.length ? '#ccc' : '#00B760'}"
+					:style="{'color': val?.job?.status === '1' || !actionItems(val)?.length ? '#ccc' : '#00B760'}"
 				>
 					<view>更多操作</view>
 					<uni-icons type="list" class="ss-m-l-10" size="20" :color="!actionItems(val)?.length ? '#ccc' : '#00B760'"></uni-icons>
@@ -53,7 +53,7 @@
 					class="action-item"
 					v-for="(val, index) in actionItems(itemData)" 
 					:key="index"
-					@tap.stop="handleActionClick(val.type, itemData)"
+					@tap.stop="handleActionClick(val.value, itemData)"
 				>{{ val.title }}</view>
 			</view>
       <button class="big-cancel-button" @tap.stop="handleClosePopup">取消</button>
@@ -103,6 +103,11 @@ const itemData = ref({})
 
 // 更多操作
 const handleLoadMore = (val) => {
+	if (val?.job?.status === '1') {
+		itemData.value = {}
+		uni.showToast({ title: '职位已关闭,暂无更多操作', icon: 'none' })
+		return
+	}
 	if (!actionItems(val).length) {
 		itemData.value = {}
 		uni.showToast({ title: '暂无更多操作', icon: 'none' })
@@ -136,18 +141,6 @@ const handleFinishConfirm = async () => {
   }
 }
 
-// 邀请面试
-// const handleInterviewInvite = (item) => {
-// 	if (item?.job?.status === '1') {
-// 		uni.showToast({ title: '职位已关闭', icon: 'none' })
-// 		return
-// 	}
-// 	uni.navigateTo({
-// 	  url: `/pagesB/InviteInterview/index?id=${item.userId}&jobId=${item.job.id}`
-// 	})
-// 	handleClosePopup()
-// }
-
 const handleActionClick = (type, val) => {
   if (val.job?.status === '1' && (type !== 'completed')) {
     uni.showToast({ title: '职位已关闭', icon: 'none' })
@@ -164,6 +157,13 @@ const handleActionClick = (type, val) => {
 			url: '/pagesB/InviteInterview/index?editData=' + encodeURIComponent(JSON.stringify(val))
 		})
 	}
+	// 取消面试、爽约、面试反馈
+	if (['cancel', 'attended', 'feedback'].includes(type)) {
+		uni.navigateTo({
+			url: `/pagesA/interview/${type}?id=${val.id}`
+		})
+	}
+	popup.value.close()
 }
 
 const obj = {

+ 68 - 0
pagesA/interview/feedback.vue

@@ -0,0 +1,68 @@
+<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="evaluate" label="反馈内容" required>
+				<uni-easyinput v-model="formData.evaluate" 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 { feedbackInterviewInvite } from '@/api/interview'
+
+const formRef = ref(null)
+const formData = ref({
+	id: null,
+	evaluate: null
+})
+const formRules = {
+	evaluate: {
+		rules: [{ required: true, errorMessage: '请输入反馈内容' }]
+	}
+}
+
+onLoad(async (options) => {
+	const { id } = options
+	if (!id) {
+		uni.showToast({
+			title: 'ID缺失',
+			icon: 'none'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+		return
+	}
+
+	formData.value.id = id
+})
+
+// 提交
+const handleSubmit = async () => {
+	const valid = await unref(formRef).validate()
+	if (!valid) return
+
+	uni.showLoading({ title: '提交中' })
+	try {
+		await feedbackInterviewInvite(formData.value)
+		uni.hideLoading()
+		uni.showToast({
+			title: '提交成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			uni.navigateBack({ delta: 1 })
+		}, 1000)
+	} catch {
+		uni.hideLoading()
+	}
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 1 - 1
pagesA/interview/index.vue

@@ -30,7 +30,7 @@
 
 <script setup>
 import { ref } from 'vue'
-import CardItem from './item.vue'
+import CardItem from './components/item.vue'
 import { getInterviewInvitePage } from '@/api/interview'
 import { getJobAdvertised } from '@/api/search'
 import { onShow, onLoad } from '@dcloudio/uni-app'