培训意愿

This commit is contained in:
2026-03-09 17:26:12 +08:00
parent f107001347
commit cd621f659c
7 changed files with 1307 additions and 205 deletions

View File

@@ -3,36 +3,36 @@
<view class="main-list" :style="getBackgroundStyle('k.png')">
<view class="list-top">
<view class="list-title">
<text>新增求职意愿</text>
<text>{{showTitle}}求职意愿</text>
<view class="title-line"></view>
</view>
</view>
<view class="form-container">
<uni-forms ref="formRef" v-model="formData" :rules="rules" validate-trigger="submit" >
<uni-forms-item label="意向岗位:" name="content" required>
<uni-forms-item label="意向岗位:" name="postType" required>
<uni-easyinput v-model="formData.postType" placeholder="请输入意向岗位"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="期望薪资:" name="content" required>
<uni-forms-item label="期望薪资:" name="salary" required>
<uni-easyinput v-model="formData.salary" placeholder="请输入期望薪资"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="意向工作区域:" name="content" required>
<uni-forms-item label="意向工作区域:" name="regionName" required>
<uni-easyinput v-model="formData.regionName" placeholder="请输入意向工作区域"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="期望福利:" name="content" required>
<uni-forms-item label="期望福利:" name="welfare" required>
<uni-easyinput v-model="formData.welfare" placeholder="请输入期望福利"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="学历:" name="followWay" required >
<uni-data-select v-model="formData.followWay" placeholder="请选择学历" :localdata="followWays" @change="onMethodChange"></uni-data-select>
<uni-forms-item label="学历:" name="education" >
<uni-data-select v-model="formData.education" placeholder="请选择学历" :localdata="educationOptions" @change="onEducationChange"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="岗位类型:" name="followWay" required >
<uni-data-select v-model="formData.followWay" placeholder="请选择岗位类型" :localdata="followWays" @change="onMethodChange"></uni-data-select>
<uni-forms-item label="岗位类型:" name="jobType" >
<uni-data-select v-model="formData.jobType" placeholder="请选择岗位类型" :localdata="jobTypeOptions" @change="onJobTypeChange"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="类型:" name="followWay" required >
<uni-data-select v-model="formData.followWay" placeholder="请选择类型" :localdata="followWays" @change="onMethodChange"></uni-data-select>
<uni-forms-item label="类型:" name="type" >
<uni-data-select v-model="formData.type" placeholder="请选择类型" :localdata="typeOptions" @change="onTypeChange"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="意向自述:" name="content" required>
<uni-easyinput type="textarea" v-model="formData.content" placeholder="请输入意向自述"></uni-easyinput>
<uni-forms-item label="意向自述:" name="description" >
<uni-easyinput type="textarea" v-model="formData.description" placeholder="请输入意向自述"></uni-easyinput>
</uni-forms-item>
</uni-forms>
<!-- 按钮组 -->
@@ -52,6 +52,7 @@ const { $api, navTo, navBack } = inject('globalFunction');
import config from "@/config.js"
const title = ref('');
const showTitle=ref('')
const formData = reactive({
id: null,
goalPersonId: '',
@@ -65,6 +66,9 @@ const formData = reactive({
jobType: '',
type: '',
})
const educationOptions=ref([])
const jobTypeOptions=ref([])
const typeOptions=ref([])
const personInfo=ref({
goalPersonId:'',
name:'',
@@ -73,36 +77,33 @@ const personInfo=ref({
person_id:''
})
const followWays = ref([])
const followList = ref([])
const followListNum=ref(0)
const active=ref(null)
// 表单引用
const formRef = ref(null)
// 校验规则
const rules = {
followDate: {
postType: {
rules: [{
required: true,
errorMessage: '请选择跟进日期'
errorMessage: '请输入意向岗位'
}]
},
followWay: {
salary: {
rules: [{
required: true,
errorMessage: '请选择跟进方式'
errorMessage: '请输入期望薪资'
}]
},
content: {
regionName: {
rules: [{
required: true,
errorMessage: '请填写跟进内容'
errorMessage: '请输入意向工作区域'
}]
},
result: {
welfare: {
rules: [{
required: true,
errorMessage: '请填写跟进结果'
errorMessage: '请输入期望福利'
}]
}
}
@@ -114,62 +115,50 @@ const getBackgroundStyle = (imageName) => ({
backgroundRepeat: 'no-repeat'
});
const onFollowDateChange = (e)=>{
formData.followDate=e
const getDictionary = async () => {
try {
const [eduRes, jobRes, gangweiRes] = await Promise.all([
$api.myRequest('/system/public/dict/data/type/education'),
$api.myRequest('/system/public/dict/data/type/job_type'),
$api.myRequest('/system/public/dict/data/type/gangwei_type')
]);
if (eduRes && eduRes.code == 200) {
eduRes.data.forEach(item => {
educationOptions.value.push({
value: item.dictValue,
text: item.dictLabel
});
});
}
if (jobRes && jobRes.code == 200) {
jobRes.data.forEach(item => {
jobTypeOptions.value.push({
value: item.dictValue,
text: item.dictLabel
});
});
}
if (gangweiRes && gangweiRes.code == 200) {
gangweiRes.data.forEach(item => {
typeOptions.value.push({
value: item.dictValue,
text: item.dictLabel
});
});
}
} catch (error) {
console.error("获取字典数据失败:", error);
throw error; // 抛出错误,让外部调用者知道失败了
}
};
function onEducationChange(e){
formData.education=e
}
const onMethodChange = (e) => {
formData.followWay=e
function onJobTypeChange(e){
formData.jobType=e
}
// 事件处理
const onDateChange = ( e) => {
formData.nextContactDate=e
}
function getFollowList(){
followList.value=[]
let header={
'Authorization':uni.getStorageSync('Padmin-Token'),
'Content-Type': "application/x-www-form-urlencoded"
}
let params={
personId:personInfo.value.person_id,
taskId:personInfo.value.task_id
}
$api.myRequest('/dispatch/assist/records/getFollowList', params,'get',9100,header).then((resData) => {
if(resData && resData.code == 200){
if(resData.data && resData.data.length>0){
followListNum.value=resData.data.length
resData.data.forEach(item=>{
const obj={
title:item.followDate,
desc:`跟进方式:${getFollowWaysLabelByValue(item.followWay)}\n跟进人${item.createByName}\n跟进内容${item.content}\n跟进结果${item.result}\n下一步计划${item.nextPlan}`
}
followList.value.push(obj)
})
}
}
});
}
function getDictionary(){
$api.myRequest('/system/public/dict/data/type/assist_follow_way').then((resData) => {
if(resData && resData.code == 200){
resData.data.forEach(item=>{
const obj = {
value: item.dictValue,
text: item.dictLabel
}
followWays.value.push(obj)
})
}
});
}
function getFollowWaysLabelByValue(value) {
if (!Array.isArray(followWays.value)) {
return ''
}
const item = followWays.value.find(item => item.value === String(value))
return item ? item.text : '暂无跟进方式'
function onTypeChange(e) {
formData.type=e
}
const handleSubmit = () => {
formRef.value?.validate()
@@ -177,26 +166,47 @@ const handleSubmit = () => {
let header={
'Authorization':uni.getStorageSync('Padmin-Token')
}
formData.goalPersonId=personInfo.value.goalPersonId
$api.myRequest('/dispatch/assist/records/addRecords', formData,'post',9100,header).then((resData) => {
console.log("resData",resData)
if(resData && resData.code == 200){
handleReset()
getFollowList()
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
}else{
uni.showToast({
title: resData.msg,
icon: 'none',
duration: 2000
});
}
});
console.log("formData",formData)
if(formData.id){
$api.myRequest('/dispatch/job/willingness', formData,'put',9100,header).then((resData) => {
if(resData && resData.code == 200){
handleReset()
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
uni.navigateBack()
}else{
uni.showToast({
title: resData.msg,
icon: 'none',
duration: 2000
});
}
});
}else{
$api.myRequest('/dispatch/job/willingness', formData,'post',9100,header).then((resData) => {
if(resData && resData.code == 200){
handleReset()
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
});
uni.navigateBack()
}else{
uni.showToast({
title: resData.msg,
icon: 'none',
duration: 2000
});
}
});
}
})
.catch((errors) => {
console.log('校验失败:', errors);
@@ -204,57 +214,35 @@ const handleSubmit = () => {
};
const handleReset = () => {
formData.followDate = '';
formData.followWay = '';
formData.content = '';
formData.result = '';
formData.nextPlan = '';
formData.nextContactDate = '';
formData.postType=''
formData.salary=''
formData.regionId=''
formData.regionName=''
formData.description=''
formData.welfare=''
formData.education=''
formData.jobType=''
formData.type=''
}
onLoad((options) => {
personInfo.value.goalPersonId=options.goalPersonId
personInfo.value.name=options.name
personInfo.value.task_type=options.taskType
personInfo.value.task_id=options.taskId
personInfo.value.person_id=options.personId
getDictionary()
getFollowList()
runAsyncTasks(options)
});
const runAsyncTasks = async (options) => {
await getDictionary()
if(options.goalPersonId){
formData.goalPersonId=options.goalPersonId
showTitle.value='新增'
}
if(options.item){
let dataInfo=JSON.parse(options.item)
Object.assign(formData, dataInfo)
showTitle.value='编辑'
}
}
</script>
<style lang="stylus" scoped>
image
height: 100%
width: 100%
.info-box
margin: 30rpx 30rpx
background: linear-gradient(0deg, #D9ECFF 0%, #F0F7FF 100%)
border-radius: 20rpx
padding: 40rpx 0
display: flex
align-items: center
.info-img
width: 40rpx
height: 40rpx
margin-bottom: 20rpx
.info-line
border-right: 2rpx solid #B7D6FF
.info-item
display: flex
flex-direction: column
align-items: center
justify-content: center
width: 50%
.info-label
font-size: 26rpx
color: #6E7E9B
margin-bottom: 20rpx
.info-value
font-weight: bold
font-size: 28rpx
color: #3D61AC
.main-list
background-color: #ffffff
padding: 20rpx 20rpx 28rpx 20rpx
@@ -279,34 +267,13 @@ image
height: 8rpx
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
border-radius: 4rpx
.title-total
font-size: 24rpx
color: #999999
.total-num
color: #3088FF
margin-left: 4rpx
margin-right: 4rpx
font-weight: bold
font-size: 26rpx
.label
width: 160rpx
font-size: 28rpx
color: #404040
.input,
.picker
flex: 1
.picker-value
color: #666
.list-box
margin-top: 40rpx
.form-container
margin-top: 30rpx
:deep(.uni-forms-item__label)
width: 194rpx !important
width: 235rpx !important
font-size: 28rpx;
color: #404040;
@@ -332,35 +299,4 @@ image
background-color: #368BFF;
color: white;
}
:deep(.uni-steps__column-circle )
width: 24rpx !important
height: 24rpx !important
background: radial-gradient(circle,
#00C0FA 0%,
#015EEA 50%,
#FFFFFF 51%,
#FFFFFF 100%) !important
border-radius: 50%
border: 2rpx solid #015EEA
:deep(.uni-steps__column-title)
font-size: 28rpx !important
color: #006CFF !important
margin-bottom: 24rpx
:deep(.uni-steps__column-desc)
font-size: 28rpx
color: #898989 !important
line-height: 1.5
:deep(.uni-steps__column-text )
padding: 16rpx 0 !important
border: none
:deep(.uni-steps__column-line)
background-color: #368BFF !important
:deep(.uni-steps__column-line--before)
background-color:rgba(0,0,0,0) !important
:deep(.uni-date-x)
background: rgba(0,0,0,0) !important
:deep(.uni-stat-box)
background: rgba(0,0,0,0) !important
:deep(.uni-easyinput__content)
background: rgba(0,0,0,0) !important
</style>