Bläddra i källkod

实习生投递减低 填写到岗时间

lifanagju_citu 2 månader sedan
förälder
incheckning
08f7d8e5f8
3 ändrade filer med 112 tillägg och 5 borttagningar
  1. 79 0
      components/studentDeliveryForm/index.vue
  2. 19 3
      pagesA/chart/index.vue
  3. 14 2
      pagesB/positionDetail/index.vue

+ 79 - 0
components/studentDeliveryForm/index.vue

@@ -0,0 +1,79 @@
+<template>
+	<view class="f-straight">
+    <uni-forms ref="form" :modelValue="formData" :rules="rules" validateTrigger="bind" :label-width="formLabelWidth">
+      <uni-forms-item label="实习到岗开始时间" name="startTime" required>
+				<picker mode="date" :value="formData.startTime" fields="month" @change="e => formData.startTime = e.detail.value">
+					<view v-if="formData.startTime" class="pickerText">{{ formData.startTime }}</view>
+					<view v-else class="pickerText">请选择</view>
+				</picker>
+			</uni-forms-item>
+      <uni-forms-item label="实习到岗结束时间" name="endTime" required>
+				<picker mode="date" :value="formData.endTime" fields="month" @change="e => formData.endTime = e.detail.value">
+					<view v-if="formData.endTime" class="pickerText">{{ formData.endTime }}</view>
+					<view v-else class="pickerText">请选择</view>
+				</picker>
+			</uni-forms-item>
+    </uni-forms>
+	</view>
+</template>
+
+<script setup>
+import { ref, unref } from 'vue'
+import { convertYearMonthToTimestamp } from '@/utils/date.js'
+
+const props = defineProps({
+  formLabelWidth: { type: [String, Number], default: '136px' },
+})
+
+const form = ref()
+let formData = ref({
+  startTime: '',
+  endTime: ''
+})
+
+const rules = {
+	startTime:{
+		rules: [{required: true, errorMessage: '请选择实习到岗开始时间' }]
+	},
+	endTime:{
+		rules: [{required: true, errorMessage: '请选择实习到岗结束时间' }]
+	}
+}
+
+// 保存
+const getQueryParams = async () => {
+  const valid = await unref(form).validate()
+  if (!valid) return
+  const startTime = convertYearMonthToTimestamp(formData.value.startTime)
+  const endTime = convertYearMonthToTimestamp(formData.value.endTime)
+  if (rules?.startTime && !startTime) {
+    uni.showToast({ icon: 'none', title: '请选择实习到岗开始时间' })
+    return
+  }
+  if (rules?.endTime && !endTime) {
+    uni.showToast({ icon: 'none', title: '请选择实习到岗结束时间' })
+    return
+  }
+  if (startTime > endTime) {
+    uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间' })
+    return
+  }
+  return { practiceStartTime: startTime, practiceEndTime: endTime }
+}
+
+defineExpose({
+	getQueryParams
+})
+</script>
+
+<style scoped lang="scss">
+.f-straight{
+	display: flex;
+	justify-content: center;
+	flex-direction: column;
+}
+.pickerText {
+  height: 36px;
+  line-height: 36px;
+}
+</style>

+ 19 - 3
pagesA/chart/index.vue

@@ -176,6 +176,9 @@
         <text>发送简历选择</text>
         <uni-icons type="closeempty" size="20" @tap="handleClose"></uni-icons>
       </view>
+      <view v-if="isStudent" class="ss-p-x-50" style="width: 272px;">
+        <studentDeliveryForm ref="studentDeliveryFormRef" />
+      </view>
       <view v-for="resume in resumeList" :key="resume.id" class="popup-content" @tap="resumeCheck = resume">
         <view class="iconBox">
           <uni-icons
@@ -212,7 +215,7 @@
 </template>
 
 <script setup>
-import { ref, watch, onMounted } from 'vue'
+import { ref, watch, onMounted, computed } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { useIMStore } from '@/store/im'
 import { userStore } from '@/store/user'
@@ -231,6 +234,7 @@ import {
   jobCvRelCheckSend,
   jobCvRelHireSend
 } from '@/api/position'
+import studentDeliveryForm from '@/components/studentDeliveryForm'
 
 const useUserStore = userStore()
 const IM = useIMStore()
@@ -263,6 +267,8 @@ const isSendResume = ref(false)
 const positionInfo = ref({})
 const isEmployment = ref('-1')
 
+const isStudent = ref(false)  // 已测试,待开放上线 const isStudent = computed(() => useUserStore.baseInfo?.type && Boolean(Number(useUserStore.baseInfo.type) === 1))
+
 onMounted(() => {
   setTimeout(() => {
     scrollAnimation.value = true
@@ -415,12 +421,20 @@ function handleClose () {
   popup.value.close()
 }
 
+const studentDeliveryFormRef = ref()
+
 // 发送简历
 async function handleSendResume () {
   if (!Object.keys(resumeCheck.value).length) {
     uni.showToast({ title: '请选择要投递的简历', icon: 'none' })
     return
   }
+  let practice = null
+  if (isStudent.value) {
+    practice = await studentDeliveryFormRef.value.getQueryParams()
+    if (!practice) return
+  }
+
   const text = {
     remark: '发送简历',
     query: {
@@ -437,7 +451,8 @@ async function handleSendResume () {
         jobId: positionInfo.value.id,
         // ...(jobFairId && { jobFairId }),
         url: resumeCheck.value.url,
-        recommendUserId: isEmployment.value
+        recommendUserId: isEmployment.value,
+        ...(practice && { practice }),
       })
     } else {
       await jobCvRelSend({
@@ -445,7 +460,8 @@ async function handleSendResume () {
         // ...(jobFairId && { jobFairId }),
         title: resumeCheck.value.title,
         url: resumeCheck.value.url,
-        type: positionInfo.value.hire ? 1 : 0
+        type: positionInfo.value.hire ? 1 : 0,
+        ...(practice && { practice }),
       })
     }
     isSendResume.value = true

+ 14 - 2
pagesB/positionDetail/index.vue

@@ -133,6 +133,9 @@
         </view>
         <view style="height: 1px; margin: 0 20rpx; background-color: #dedede;"></view>
         <scroll-view class="dialog-content" scroll-y="true" style="max-height: 50vh; width: auto;">
+          <view v-if="isStudent" class="ss-p-x-50">
+            <studentDeliveryForm ref="studentDeliveryFormRef" />
+          </view>
           <uni-card
             v-for="(item, index) in resumeList"
             :key="index"
@@ -212,7 +215,7 @@ import { timesTampChange } from '@/utils/date'
 import { preview } from '@/utils/preview'
 import { uploadFile } from '@/api/file'
 import layoutPage from '@/layout'
-import { ref, watch } from 'vue';
+import { ref, watch, computed } from 'vue';
 import {
   jobCvRelSend,
   getPositionDetails,
@@ -232,6 +235,7 @@ import { prologue, defaultText } from '@/hooks/useIM'
 import { userStore } from '@/store/user'
 import { getSubscribeTemplateList } from '@/api/common'
 import { formatName } from '@/utils/getText'
+import studentDeliveryForm from '@/components/studentDeliveryForm'
 // import { getShareQueryById } from '@/api/jobFair.js'
 
 const useUserStore = userStore()
@@ -247,6 +251,7 @@ const imgSrc = ref('')
 const appInfo = ref({})
 const poster = ref()
 const beenLogin = ref(false)
+const isStudent = ref(false) // 已测试,待开放上线 const isStudent = computed(() => useUserStore.baseInfo?.type && Boolean(Number(useUserStore.baseInfo.type) === 1))
 const areaName = ref('')
 const canvasToTempFilePath = ref('')
 
@@ -531,6 +536,8 @@ const handleDelivery = async () => {
     }
   })
 }
+
+const studentDeliveryFormRef = ref()
 const deliverySubmit = async (uploadFile) => {
   const resume = uploadFile ? uploadFile : resumeList.value[selectIndex.value]
   if (!resume) {
@@ -539,11 +546,16 @@ const deliverySubmit = async (uploadFile) => {
     return
   }
 
-  const params = {
+  let params = {
     jobId,
     url: resume.url,
     ...(jobFairId && { jobFairId })
   }
+  if (isStudent.value) {
+    const practice = await studentDeliveryFormRef.value.getQueryParams()
+    if (!practice) return
+    params = Object.assign(params, practice)
+  }
 
   if (isEmployment.value) {
     params.recommendUserId = isEmployment.value