Commit bc1c4b9c by 张立顺 Committed by chenwq

feat 功能开发

1 parent 2a2de26e
...@@ -84,6 +84,7 @@ Page({ ...@@ -84,6 +84,7 @@ Page({
curDataId: '', curDataId: '',
isProcessing: false, // 是否正在处理中,防止重复提交 isProcessing: false, // 是否正在处理中,防止重复提交
pageScrollTop: 0, // 保存页面滚动位置 pageScrollTop: 0, // 保存页面滚动位置
popupType: 'initial', // initial or interview
// 时间选择器列表子项展示-格式化处理 // 时间选择器列表子项展示-格式化处理
formatter(type, value) { formatter(type, value) {
if (type === 'year') { if (type === 'year') {
...@@ -137,9 +138,15 @@ Page({ ...@@ -137,9 +138,15 @@ Page({
const month = String(date.getMonth() + 1).padStart(2, '0') const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0') const day = String(date.getDate()).padStart(2, '0')
const formattedDate = `${year}年${month}月${day}日` const formattedDate = `${year}年${month}月${day}日`
const formattedFull = new Date(timestamp) const { formData, pageScrollTop, popupType } = this.data
const { formData, pageScrollTop } = this.data const apiDate = `${year}-${month}-${day} 00:00:00`
formData.interviewTime = `${year}-${month}-${day} 00:00:00`
if (popupType === 'initial') {
formData.expectedInterviewTime = apiDate
} else {
formData.interviewTime = apiDate
}
formData.dipalyTime = formattedDate formData.dipalyTime = formattedDate
this.setData( this.setData(
{ {
...@@ -360,6 +367,9 @@ Page({ ...@@ -360,6 +367,9 @@ Page({
*/ */
handleProcess(e) { handleProcess(e) {
let { id } = e.currentTarget.dataset let { id } = e.currentTarget.dataset
// 查找对应的数据项
const item = this.data.recruitmentPlans.find(i => i.id === id)
if (!item) return
// 保存当前页面滚动位置 // 保存当前页面滚动位置
const query = wx.createSelectorQuery() const query = wx.createSelectorQuery()
...@@ -372,15 +382,25 @@ Page({ ...@@ -372,15 +382,25 @@ Page({
} }
}) })
// Determine popup type based on item status
let popupType = 'initial'
if (item.processResult == 2) {
popupType = 'interview'
}
this.setData({ this.setData({
showPopup: true, showPopup: true,
currentDate: new Date().getTime(), // 重置当前时间为今天 currentDate: new Date().getTime(), // 重置当前时间为今天
popupType: popupType,
formData: { formData: {
id: id, id: id,
processResult: '', // 处理结果 processResult: popupType === 'interview' ? 2 : '', // 处理结果
interviewTime: '', // 面试时间 interviewTime: '', // 面试时间
expectedInterviewTime: '', // 预计面试时间
interviewResult: '', // 面试结果
description: '', // 说明 description: '', // 说明
descriptionLength: 0 // 说明字数 descriptionLength: 0, // 说明字数
dipalyTime: '' // 显示时间
} }
}) })
}, },
...@@ -390,9 +410,10 @@ Page({ ...@@ -390,9 +410,10 @@ Page({
*/ */
selectTag(e) { selectTag(e) {
const { field, value } = e.currentTarget.dataset const { field, value } = e.currentTarget.dataset
const { formData } = this.data const { formData, popupType } = this.data
// 如果点击已选中的标签,则取消选中;否则选中 // 如果点击已选中的标签,则取消选中;否则选中
if (formData[field] === value) { if (formData[field] == value) {
// 使用 == 比较,避免类型问题
formData[field] = '' formData[field] = ''
} else { } else {
formData[field] = value formData[field] = value
...@@ -400,17 +421,14 @@ Page({ ...@@ -400,17 +421,14 @@ Page({
// 当切换"处理结果"标签时,初始化相关表单数据 // 当切换"处理结果"标签时,初始化相关表单数据
if (field === 'processResult') { if (field === 'processResult') {
// 切换到"人员不匹配"时,清空面试相关字段 // 切换到"人员不匹配"时,清空预计面试时间
if (value == 1) { if (value == 1) {
formData.interviewTime = '' formData.expectedInterviewTime = ''
formData.dipalyTime = '' formData.dipalyTime = ''
formData.interviewResult = ''
} }
// 切换到"已完成面试"时,初始化面试相关字段为空 // 切换到"人员符合"时
if (value == 2) { if (value == 2) {
formData.interviewTime = '' // 如果是初始处理阶段,可能需要重置时间(视需求而定,这里暂时保留空)
formData.dipalyTime = ''
formData.interviewResult = ''
} }
} }
...@@ -500,12 +518,13 @@ Page({ ...@@ -500,12 +518,13 @@ Page({
* 确认处理 * 确认处理
*/ */
confirmProcess() { confirmProcess() {
const { formData, isProcessing } = this.data const { formData, isProcessing, popupType, recruitment } = this.data
// 防止重复提交 // 防止重复提交
if (isProcessing) return if (isProcessing) return
// 验证必填项 if (popupType === 'initial') {
// 简历处理阶段验证
if (!formData.processResult) { if (!formData.processResult) {
wx.showToast({ wx.showToast({
title: '请选择处理结果', title: '请选择处理结果',
...@@ -513,28 +532,31 @@ Page({ ...@@ -513,28 +532,31 @@ Page({
}) })
return return
} }
// 对于面试通过和面试不通过,都需要选择面试时间 // 人员符合(2)时,预计面试时间必填
if ( if (formData.processResult == 2 && !formData.expectedInterviewTime) {
(formData.processResult == 2 || formData.processResult == 3) &&
!formData.interviewTime
) {
wx.showToast({ wx.showToast({
title: '请选择面试时间', title: '请选择预计面试时间',
icon: 'none' icon: 'none'
}) })
return return
} }
// 对于面试通过和面试不通过,都需要选择面试时间 } else if (popupType === 'interview') {
if ( // 面试反馈阶段验证
(formData.processResult == 2 || formData.processResult == 3) && if (!formData.interviewResult) {
!formData.interviewResult
) {
wx.showToast({ wx.showToast({
title: '请选择面试结果', title: '请选择面试结果',
icon: 'none' icon: 'none'
}) })
return return
} }
if (!formData.interviewTime) {
wx.showToast({
title: '请选择面试时间',
icon: 'none'
})
return
}
}
// 设置处理状态为true,防止重复提交 // 设置处理状态为true,防止重复提交
this.setData({ this.setData({
...@@ -543,10 +565,21 @@ Page({ ...@@ -543,10 +565,21 @@ Page({
let requestParams = { let requestParams = {
id: formData.id, id: formData.id,
processResult: formData?.processResult, technicalSupervisorName: recruitment.technicalSupervisorName,
interviewTime: formData?.interviewTime, technicalSupervisorPhone: recruitment.technicalSupervisorPhone,
interviewResult: formData?.interviewResult, }
description: formData?.description
if (popupType === 'initial') {
requestParams.processResult=formData?.processResult
if (formData.processResult == 2) {
requestParams.expectedInterviewTime = formData.expectedInterviewTime
}
// requestParams.expectedInterviewTime = formData?.expectedInterviewTime
requestParams.description = formData?.description
} else {
requestParams.interviewTime = formData?.interviewTime
requestParams.interviewResult = formData?.interviewResult
requestParams.interviewExplanation = formData?.description
} }
processResumeAPI(requestParams) processResumeAPI(requestParams)
......
...@@ -360,7 +360,9 @@ page { ...@@ -360,7 +360,9 @@ page {
display: inline-block; display: inline-block;
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
margin-right: 10rpx; // margin-right: 10rpx;
margin-top: 5rpx;
margin-left: 10rpx;
} }
.phone_icon { .phone_icon {
......
...@@ -139,7 +139,12 @@ ...@@ -139,7 +139,12 @@
<view class="card_content"> <view class="card_content">
<view class="btn_group"> <view class="btn_group">
<view class="btn btn_outline" bindtap="handleViewResume" data-url="{{ item.resumeUrl }}">查看简历</view> <view class="btn btn_outline" bindtap="handleViewResume" data-url="{{ item.resumeUrl }}">查看简历</view>
<view wx:if="{{ item.processResult == null }}" class="btn btn_primary" bindtap="handleProcess" data-id="{{ item.id }}">处理</view> <view
wx:if="{{ item.processResult == null || (item.processResult == 2 && item.interviewResult == null) }}"
class="btn btn_primary"
bindtap="handleProcess"
data-id="{{ item.id }}"
>处理</view>
<!-- <van-button wx:if="{{item.status === 0}}"class="btn btn_primary"bindtap="handleProcess"data-id="{{item.id}}"plain type="primary">处理</van-button>--> <!-- <van-button wx:if="{{item.status === 0}}"class="btn btn_primary"bindtap="handleProcess"data-id="{{item.id}}"plain type="primary">处理</van-button>-->
</view> </view>
</view> </view>
...@@ -197,22 +202,24 @@ ...@@ -197,22 +202,24 @@
catchtouchmove="preventTouchMove" catchtouchmove="preventTouchMove"
> >
<view class="popup_content"> <view class="popup_content">
<view class="title">简历处理</view> <view class="title">{{ popupType === 'interview' ? '面试反馈' : '简历处理' }}</view>
<scroll-view scroll-y style="height: var(--fontSize887);" bindtouchmove="stopPropagation"> <scroll-view scroll-y style="height: var(--fontSize887);" bindtouchmove="stopPropagation">
<view class="form"> <view class="form">
<!-- 简历处理模式 -->
<block wx:if="{{ popupType === 'initial' }}">
<view class="form_item"> <view class="form_item">
<view class="label"> <view class="label">
处理结果 处理结果
<text class="required">*</text> <text class="required">*</text>
</view> </view>
<view class="value"> <view class="value">
<text class="tag {{ formData.processResult == 1 ? 'active' : '' }}" bindtap="selectTag" data-field="processResult" data-value="1">人员不匹配</text> <text class="tag {{ formData.processResult == 2 ? 'active' : '' }}" bindtap="selectTag" data-field="processResult" data-value="2">人员符合</text>
<text class="tag {{ formData.processResult == 2 ? 'active' : '' }}" bindtap="selectTag" data-field="processResult" data-value="2">已完成面试</text> <text class="tag {{ formData.processResult == 1 ? 'active' : '' }}" bindtap="selectTag" data-field="processResult" data-value="1">人员不符合</text>
</view> </view>
</view> </view>
<view class="form_item" wx:if="{{ formData.processResult == 2 }}"> <view class="form_item" wx:if="{{ formData.processResult == 2 }}">
<view class="label"> <view class="label">
面试时间 预计面试时间
<text class="required">*</text> <text class="required">*</text>
</view> </view>
<view class="value" catchtap="showTimePicker"> <view class="value" catchtap="showTimePicker">
...@@ -220,7 +227,10 @@ ...@@ -220,7 +227,10 @@
<image class="arrow_right" src="/packageEquity/pages/image/arrow-right.png" mode="aspectFill" /> <image class="arrow_right" src="/packageEquity/pages/image/arrow-right.png" mode="aspectFill" />
</view> </view>
</view> </view>
<view class="form_item" wx:if="{{ formData.processResult == 2 }}"> </block>
<!-- 面试反馈模式 -->
<block wx:elif="{{ popupType === 'interview' }}">
<view class="form_item">
<view class="label"> <view class="label">
面试结果 面试结果
<text class="required">*</text> <text class="required">*</text>
...@@ -230,6 +240,17 @@ ...@@ -230,6 +240,17 @@
<text class="tag {{ formData.interviewResult == '0' ? 'active' : '' }}" bindtap="selectTag" data-field="interviewResult" data-value="0">不通过</text> <text class="tag {{ formData.interviewResult == '0' ? 'active' : '' }}" bindtap="selectTag" data-field="interviewResult" data-value="0">不通过</text>
</view> </view>
</view> </view>
<view class="form_item">
<view class="label">
面试时间
<text class="required">*</text>
</view>
<view class="value" catchtap="showTimePicker">
<view class="{{ formData.dipalyTime ? 'time_text' : 'placeholder_text' }}">{{ formData.dipalyTime || '请选择面试时间'}}</view>
<image class="arrow_right" src="/packageEquity/pages/image/arrow-right.png" mode="aspectFill" />
</view>
</view>
</block>
<view class="form_item form_item_textarea"> <view class="form_item form_item_textarea">
<view class="label">说明</view> <view class="label">说明</view>
<view class="value"> <view class="value">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!