个人招工表单开发

This commit is contained in:
zxy
2024-03-09 15:52:49 +08:00
parent 2b81c75fdc
commit 3af0620a2b
7 changed files with 821 additions and 91 deletions

280
common/dic.js Normal file
View File

@@ -0,0 +1,280 @@
// 发布岗位和个人招工 参考工资
const salary = [{
name: "2000元以下/月",
label: "2000元以下/月",
},
{
name: "2000-5000元/月",
label: "2000-5000元/月",
},
{
name: "5000-8000元/月",
label: "5000-8000元/月",
},
{
name: "8000-10000元/月",
label: "8000-10000元/月",
},
{
name: "10000-15000元/月",
label: "10000-15000元/月",
},
{
name: "15000-20000元/月",
label: "15000-20000元/月",
},
{
name: "20000-25000元/月",
label: "20000-25000元/月",
},
{
name: "25000-30000元/月",
label: "25000-30000元/月",
},
{
name: "30000元以上/月",
label: "30000元以上/月",
},
{
name: "面议、暂无要求",
label: "面议、暂无要求",
},
]
const taskSalary = [
[
"10-15元/小时",
"16-20元/小时",
"21-25元/小时",
"26-30元/小时",
"30元/小时以上",
"100-150元/天",
"151-200元/天",
"201-250元/天",
"251-300元/天",
"300元/天以上",
"30000元以上/月",
"面议、暂无要求"
]
]
const tradeArr = [
[{
"id": "1754327500065390596",
"name": "农、林、牧、渔业",
},
{
"id": "1754327500065390597",
"name": "采矿业",
},
{
"id": "1754327500065390598",
"name": "采矿业,制造业",
},
{
"id": "1754327500065390599",
"name": "制造业",
},
{
"id": "1754327500065390600",
"name": "电力、热力、燃气及水生产和供应业",
},
{
"id": "1754327500065390601",
"name": "建筑业",
},
{
"id": "1754327500065390602",
"name": "批发和零售业",
},
{
"id": "1754327500065390603",
"name": "交通运输、仓储和邮政业",
},
{
"id": "1754327500065390604",
"name": "住宿和餐饮业",
},
{
"id": "1754327500065390605",
"name": "信息传输、软件和信息技术服务业",
},
{
"id": "1754327500065390606",
"name": "金融业",
},
{
"id": "1754327500065390607",
"name": "房地产业",
},
{
"id": "1754327500065390608",
"name": "租赁和商务服务业",
},
{
"id": "1754327500065390609",
"name": "科学研究和技术服务业",
},
{
"id": "1754327500065390610",
"name": "水利、环境和公共设施管理业",
},
{
"id": "1754327500065390611",
"name": "居民服务、修理和其他服务业",
},
{
"id": "1754327500065390612",
"name": "教育",
},
{
"id": "1754327500065390613",
"name": "卫生和社会工作",
},
{
"id": "1754327500065390614",
"name": "文化、体育和娱乐业",
},
{
"id": "1754327500065390615",
"name": "公共管理、社会保障和社会组织",
},
{
"id": "1754327500065390616",
"name": "国际组织",
},
{
"id": "1754327500065390617",
"name": "其他",
},
{
"id": "1754327500065390890",
"name": "111",
},
{
"id": "1758061062381690882",
"name": "11",
},
{
"id": "1758102909546467329",
"name": "服务业",
}
]
]
const natureArr = [
['灵活用工']
]
const ageArr = [
[{
label: "不限年龄",
value: "不限年龄",
},
{
label: "30以下",
value: "30以下",
},
{
label: "35以下",
value: "35以下",
},
{
label: "40以下",
value: "40以下",
},
{
label: "45以下",
value: "45以下",
},
{
label: "50以下",
value: "50以下",
},
{
label: "55以下",
value: "55以下",
},
{
label: "60以下",
value: "60以下",
},
]
]
const eduArr = [
[{
label: "不限",
value: 8,
},
{
label: "初中及以下",
value: 7,
},
{
label: "中专/中技",
value: 6,
},
{
label: "高中",
value: 5,
},
{
label: "大专",
value: 4,
},
{
label: "本科",
value: 3,
},
{
label: "硕士",
value: 2,
},
{
label: "博士",
value: 1,
},
{
label: "MBA/EMBA",
value: 0,
},
]
]
const expeArr = [
[{
label: "不限经验",
value: "不限经验",
},
{
label: "1年以下",
value: "1年以下",
},
{
label: "1~3年",
value: "1~3年",
},
{
label: "3~5年",
value: "3~5年",
},
{
label: "5~10年",
value: "5~10年",
},
{
label: "10年以上",
value: "10年以上",
},
]
]
export default {
salary,
taskSalary,
tradeArr,
natureArr,
ageArr,
eduArr,
expeArr
}

View File

@@ -256,6 +256,30 @@
"enablePullDownRefresh" : false,
"navigationStyle": "custom"
}
},
{
"path" : "pages/recruit/subPage/task",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/recruit/subPage/work",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/recruit/subPage/person",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],
"subPackages": [{

View File

@@ -0,0 +1,405 @@
<!-- 个人招工 -->
<template>
<view>
<view class="u-demo-block__content">
<!-- 注意如果需要兼容微信小程序最好通过setRules方法设置rules规则 -->
<u--form labelPosition="left" :model="info" ref="form1">
<u-form-item label="任务名称" prop="jobName" borderBottom labelWidth="80" ref="item1">
<u--input v-model="info.jobName" border="none" placeholder="请输入任务名称"></u--input>
</u-form-item>
<u-form-item label="发布时间" labelWidth="80" prop="stime" borderBottom
@click="showStime = true; hideKeyboard()" ref="item1">
<u--input v-model="info.stime" disabled disabledColor="#ffffff" placeholder="请选择发布时间"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="结束时间" labelWidth="80" prop="etime" borderBottom
@click="showEtime = true; hideKeyboard()" ref="item2">
<u--input v-model="info.etime" disabled disabledColor="#ffffff" placeholder="请选择结束时间"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="招聘人数" prop="peopleNum" borderBottom labelWidth="80" ref="item3">
<u--input v-model="info.peopleNum" border="none" placeholder="请输入招聘人数"></u--input>
</u-form-item>
<u-form-item label="参考工资" prop="wage" labelWidth="80" borderBottom
@click="showWage = true; hideKeyboard()" ref="item4">
<u--input v-model="info.wage" disabled disabledColor="#ffffff" placeholder="请选择参考工资"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="行业类型" prop="tradeNames" labelWidth="80" borderBottom
@click="showTrade = true; hideKeyboard()" ref="item4">
<u--input v-model="info.tradeNames" disabled disabledColor="#ffffff" placeholder="请选择行业类型"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="工种" prop="skillNames" labelWidth="80" borderBottom
@click="showSkills = true; hideKeyboard()" ref="item4">
<u--input v-model="info.skillNames" disabled disabledColor="#ffffff" placeholder="请选择工种"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="任务描述" prop="jobDescription" borderBottom labelWidth="80" ref="item1">
<u--textarea v-model="info.jobDescription" placeholder="请输入任务描述"></u--textarea>
</u-form-item>
<u-form-item label="人员属性" prop="userNature" labelWidth="80" borderBottom
@click="showNature = true; hideKeyboard()" ref="item4">
<u--input v-model="info.userNature" disabled disabledColor="#ffffff" placeholder="请选择人员属性"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="年龄要求" prop="ageDesc" labelWidth="80" borderBottom
@click="showAge = true; hideKeyboard()" ref="item4">
<u--input v-model="info.ageDesc" disabled disabledColor="#ffffff" placeholder="请选择年龄要求"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="学历要求" prop="education" labelWidth="80" borderBottom
@click="showEdu = true; hideKeyboard()" ref="item4">
<u--input v-model="info.education" disabled disabledColor="#ffffff" placeholder="请选择学历要求"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="经验要求" prop="experienceDesc" labelWidth="80" borderBottom
@click="showExpe = true; hideKeyboard()" ref="item4">
<u--input v-model="info.experienceDesc" disabled disabledColor="#ffffff" placeholder="请选择学历要求"
border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</u--form>
<u-button type="primary" text="提交" customStyle="margin-top: 50px" @click="submit"></u-button>
<u-button type="error" text="重置" customStyle="margin-top: 10px" @click="reset"></u-button>
<u-picker :show="showWage" ref="wagePicker" :columns="wageColumns" @confirm="wageConfirm"
@cancel="wageClose" @close="wageClose">
</u-picker>
<u-picker :show="showTrade" ref="tradePicker" keyName="name" :columns="tradeColumns" @confirm="tradeConfirm"
@cancel="tradeClose" @close="tradeClose">
</u-picker>
<u-picker :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns"
@confirm="skillConfirm" @cancel="skillClose" @close="skillClose">
</u-picker>
<u-picker :show="showNature" ref="naturePicker" :columns="natureColumns"
@confirm="natureConfirm" @cancel="natureClose" @close="natureClose">
</u-picker>
<u-picker :show="showAge" ref="agePicker" keyName="label" :columns="ageColumns"
@confirm="ageConfirm" @cancel="ageClose" @close="ageClose">
</u-picker>
<u-picker :show="showEdu" ref="eduPicker" keyName="label" :columns="eduColumns"
@confirm="eduConfirm" @cancel="eduClose" @close="eduClose">
</u-picker>
<u-picker :show="showExpe" ref="expePicker" keyName="label" :columns="expeColumns"
@confirm="expeConfirm" @cancel="expeClose" @close="expeClose">
</u-picker>
<u-datetime-picker :show="showStime" :value="birthday" mode="date" closeOnClickOverlay
@confirm="stimeConfirm" @cancel="stimeClose" @close="stimeClose"></u-datetime-picker>
<u-datetime-picker :show="showEtime" :value="birthday" mode="date" closeOnClickOverlay
@confirm="etimeConfirm" @cancel="etimeClose" @close="etimeClose"></u-datetime-picker>
</view>
</view>
</template>
<script>
import dic from '@/common/dic.js'
export default {
data() {
return {
value2: '招工内容',
fileList1: [],
disabled1: false,
tips: '',
value: '',
showCalendar: false,
showStime: false,
showEtime: false,
info: {
jobName: '', // 招工名称
stime: '', // 发布时间
etime: '', // 结束时间
peopleNum: '', // 招聘人数
wage: '', // 参考工资
tradeId: '', // 行业类型id
tradeNames: '', // 行业类型名称
worktypeIds: '', // 工种一级id
skillIds: '', // 工种二级id
worktypeNames: '', // 工种名称
skillNames: '', // 工种二级名称
jobDescription: '', // 任务描述
userNature: '', // 人员属性
ageDesc: '', // 年龄要求
education: '', // 学历要求
experienceDesc: '', // 经验要求
// userInfo: {
// name: '楼兰',
// sex: '',
// birthday: ''
// },
// radiovalue1: '苹果',
// checkboxValue1: [],
// intro: '',
// code: ''
},
showWage: false, // 参考工资选项是否展示
showTrade: false, // 行业类型是否显示
showSkills: false, // 工种类型是否显示
showNature: false, // 人员属性
showAge: false, // 年龄要求
showEdu: false, // 学历要求
showExpe: false, // 经验要求
birthday: Number(new Date()),
wageColumns: dic.taskSalary,
tradeColumns: dic.tradeArr,
skillColumns: [],
natureColumns: dic.natureArr,
ageColumns: dic.ageArr,
eduColumns: dic.eduArr,
expeColumns: dic.expeArr,
rules: {
'userInfo.name': [{
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
}, {
// 此为同步验证可以直接返回true或者false如果是异步验证稍微不同见下方说明
validator: (rule, value, callback) => {
// 调用uView自带的js验证规则详见https://www.uviewui.com/js/test.html
return uni.$u.test.chinese(value);
},
message: "姓名必须为中文",
// 触发器可以同时用blur和change二者之间用英文逗号隔开
trigger: ["change", "blur"],
}],
code: {
type: 'string',
required: true,
len: 4,
message: '请填写4位验证码',
trigger: ['blur']
},
'userInfo.sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change']
},
radiovalue1: {
type: 'string',
min: 1,
max: 2,
message: '橙子有毒',
trigger: ['change']
},
checkboxValue1: {
type: 'array',
min: 2,
required: true,
message: '不能太宅,至少选两项',
trigger: ['change']
},
intro: {
type: 'string',
min: 3,
required: true,
message: '不低于3个字',
trigger: ['change']
},
hotel: {
type: 'string',
min: 2,
required: true,
message: '请选择住店时间',
trigger: ['change']
},
'userInfo.birthday': {
type: 'string',
required: true,
message: '请选择生日',
trigger: ['change']
},
},
}
},
methods: {
wageConfirm(e) {
const {
value
} = e
this.info.wage = value[0]
this.showWage = false
},
tradeConfirm(e) {
const { value } = e
this.info.tradeId = value[0].id
this.info.tradeNames = value[0].name
this.showTrade = false
},
skillConfirm() {
this.showSkills = false
},
natureConfirm(e) {
const { value } = e
this.info.userNature = value[0]
this.showNature = false
},
ageConfirm(e) {
const { value } = e
this.info.ageDesc = value[0].label
this.showAge = false
},
eduConfirm(e) {
const { value } = e
this.info.education = value[0].label
this.showEdu = false
},
expeConfirm(e) {
const { value } = e
this.info.experienceDesc = value[0].label
this.showExpe = false
},
expeClose() {
this.showExpe = false
},
eduClose() {
this.showEdu = false
},
ageClose() {
this.showAge = false
},
natureClose() {
this.showNature = false
},
skillClose() {
this.showSkills = false
},
wageClose(e) {
this.showWage = false
},
tradeClose(e) {
this.showTrade = false
},
sexSelect(e) {
this.info.userInfo.sex = e.name
this.$refs.form1.validateField('userInfo.sex')
},
change(e) {
// console.log(e);
},
formatter(day) {
const d = new Date()
let month = d.getMonth() + 1
const date = d.getDate()
if (day.month == month && day.day == date + 3) {
day.bottomInfo = '有优惠'
day.dot = true
}
return day
},
calendarConfirm(e) {
this.showCalendar = false
this.info.hotel = `${e[0]} / ${e[e.length - 1]}`
this.$refs.form1.validateField('hotel')
},
codeChange(text) {
this.tips = text;
},
getCode() {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast('验证码已发送');
// 通知验证码组件内部开始倒计时
this.$refs.uCode.start();
}, 2000);
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
calendarClose() {
this.showCalendar = false
this.$refs.form1.validateField('hotel')
},
stimeClose() {
this.showStime = false
this.$refs.form1.validateField('userInfo.birthday')
},
stimeConfirm(e) {
this.showStime = false
this.info.stime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
this.$refs.form1.validateField('userInfo.birthday')
},
etimeClose() {
this.showEtime = false
this.$refs.form1.validateField('userInfo.birthday')
},
etimeConfirm(e) {
this.showEtime = false
this.info.etime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
this.$refs.form1.validateField('userInfo.birthday')
},
submit() {
// 如果有错误会在catch中返回报错信息数组校验通过则在then中返回true
this.$refs.form1.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
},
reset() {
// jobName: '', // 招工名称
// stime: '', // 发布时间
// etime: '', // 结束时间
// peopleNum: '', // 招聘人数
// wage: '', // 参考工资
// tradeId: '', // 行业类型id
// tradeNames: '', // 行业类型名称
// worktypeIds: '', // 工种一级id
// skillIds: '', // 工种二级id
// worktypeNames: '', // 工种名称
// skillNames: '', // 工种二级名称
// jobDescription: '', // 任务描述
// userNature: '', // 人员属性
// ageDesc: '', // 年龄要求
// education: '', // 学历要求
// experienceDesc: '', // 经验要求
const validateList = [
'jobName',
'stime',
'etime',
'peopleNum',
'wage',
'tradeId',
'tradeNames',
'worktypeIds',
'skillIds',
'worktypeNames',
'skillNames',
'jobDescription',
'userNature',
'ageDesc',
'education',
'experienceDesc'
]
this.$refs.form1.resetFields()
this.$refs.form1.clearValidate()
setTimeout(() => {
this.$refs.form1.clearValidate(validateList)
// 或者使用 this.$refs.form1.clearValidate()
}, 10)
},
hideKeyboard() {
uni.hideKeyboard()
}
}
}
</script>
<style>
</style>

View File

@@ -17,50 +17,31 @@
<view class="form-wrapper">
<view class="require">您的招工需求</view>
<!-- <u--textarea v-model="value2" height="140" placeholder="请输入内容" count ></u--textarea>
<u-cell-group style="margin: 20rpx 0;">
<u-cell title="技能要求" :isLink="true"></u-cell>
<u-cell title="任务区域" :isLink="true" value=""></u-cell>
</u-cell-group> -->
<u--form
labelPosition="left"
:model="model1"
:rules="rules"
ref="uForm"
>
<u-form-item
label="名称"
prop="userInfo.name"
borderBottom
ref="item1"
>
<u--input
v-model="model1.userInfo.name"
border="none"
></u--input>
</u-form-item>
<u-form-item
label="性别"
prop="userInfo.sex"
borderBottom
@click="showSex = true; hideKeyboard()"
ref="item1"
>
<u--input
v-model="model1.userInfo.sex"
disabled
disabledColor="#ffffff"
placeholder="请选择性别"
border="none"
></u--input>
<u-icon
slot="right"
name="arrow-right"
></u-icon>
</u-form-item>
</u--form>
<view class="u-demo-block">
<view class="u-demo-block__content">
<view class="typeButtonWrapper">
<view class="typeButtonLeft">
<view v-for="(item, index) in nonReactiveArray" :key="index"
:class="['typeButton', index == activeTab ? 'activeButton' : '']" @click="changeTab(index)">{{ item
}}</view>
</view>
</view>
</view>
</view>
<view v-if="activeTab == 0" class="u-demo-block" style="padding: 20rpx;">
<!-- <view>发布任务</view> -->
<Task></Task>
</view>
<view v-if="activeTab == 1" class="u-demo-block" style="padding: 20rpx;">
<!-- <view>发布岗位</view> -->
<Work></Work>
</view>
<view v-if="activeTab == 2" class="u-demo-block" style="padding: 20rpx;padding-bottom: 140rpx;">
<Person></Person>
</view>
</view>
<view style="font-size: 36rpx;color: #000;font-weight: bold;padding: 0 20rpx;">招工指引</view>
<!-- <view style="font-size: 36rpx;color: #000;font-weight: bold;padding: 0 20rpx;">招工指引</view>
<view class="zhiyin">
<view class="item">
<span>在线填写</span>
@@ -79,17 +60,9 @@
</view>
<view class="bottom">
<view class="btn">提交</view>
</view>
</view> -->
</view>
<u-action-sheet
:show="showSex"
:actions="actions"
title="请选择性别"
description="如果选择保密会报错"
@close="showSex = false"
@select="sexSelect"
>
</u-action-sheet>
<CustomTabbar :currentpage="1"></CustomTabbar>
</view>
</template>
@@ -97,45 +70,17 @@
<script>
import CustomNavbar from '@/components/CustomNavbar/navbar.vue'
import CustomTabbar from '@/components/CustomTabbar/custom_tabbar.vue'
import Task from './task.vue' // 发布任务
import Work from './work.vue' // 发布岗位
import Person from './person.vue' // 个人招工
export default {
components: {CustomTabbar, CustomNavbar},
components: {CustomTabbar, CustomNavbar, Task, Work, Person},
data() {
return {
value2: '招工内容',
showSex: false,
model1: {
userInfo: {
name: 'uView UI',
sex: '',
},
},
actions: [{
name: '男',
},
{
name: '女',
},
{
name: '保密',
},
],
rules: {
'userInfo.name': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
'userInfo.sex': {
type: 'string',
max: 1,
required: true,
message: '请选择男或女',
trigger: ['blur', 'change']
},
},
radio: '',
switchVal: false
fileList1: [],
nonReactiveArray: ["发布任务", "发布岗位", "个人招工"],
activeTab: 0,
}
},
methods: {
@@ -143,7 +88,10 @@
uni.reLaunch({
url: '/pages/my/my'
})
}
},
changeTab: function (e) {
this.activeTab = e;
},
}
}
</script>
@@ -196,6 +144,7 @@
}
.form-wrapper {
padding: 20rpx;
margin-bottom: 40rpx;
.require {
font-size: 36rpx;
font-weight: 500;
@@ -250,4 +199,30 @@
}
}
}
.typeButtonWrapper {
width: 92%;
margin: 0 auto;
display: flex;
justify-content: space-between;
/* margin-bottom: 10rpx; */
}
.typeButtonLeft {
display: flex;
}
.typeButton {
font-size: 14px;
padding: 10rpx 40rpx;
background: #f6f6f6;
border-radius: 50px;
margin-right: 10rpx;
white-space: nowrap;
}
.activeButton {
color: #4171f9;
background-color: #cfdaf8;
}
</style>

View File

@@ -0,0 +1,23 @@
<!-- 发布任务 -->
<template>
<view>
发布任务
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,23 @@
<!-- 发布岗位 -->
<template>
<view>
发布岗位
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@@ -3,8 +3,8 @@ module.exports = {
port: 1887,
proxy: {
'/api': {
target: 'http://192.168.3.108:8000', // 本地服务接口地址
// target: "http://39.98.184.58:8000", // 阿里云后台地址
// target: 'http://192.168.3.108:8000', // 本地服务接口地址
target: "http://39.98.184.58:8000", // 阿里云后台地址
// target: "http://192.168.0.101:8000", // 本地网关
// target: 'http://192.168.3.111:8000', // 本地服务接口地址
ws: true,