发布招工
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
<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 labelPosition="left" :model="info" ref="form1">
|
||||
<view style="font-size: 30rpx;font-weight: 500;padding: 20rpx 0 0;">招工信息</view>
|
||||
<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">
|
||||
@@ -18,7 +19,8 @@
|
||||
<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>
|
||||
<view style="font-size: 30rpx;font-weight: 500;padding: 20rpx 0 0;">招工要求</view>
|
||||
<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>
|
||||
@@ -40,9 +42,12 @@
|
||||
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 label="招工描述" prop="jobDescription" borderBottom labelWidth="80" ref="item1">
|
||||
<!-- <u--textarea v-model="info.jobDescription" placeholder="请输入招工要求"></u--textarea> -->
|
||||
<u--input v-model="info.jobDescription" border="none" placeholder="请输入招工描述"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
<view style="font-size: 30rpx;font-weight: 500;padding: 20rpx 0 0;">人员要求</view>
|
||||
<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="请选择人员属性"
|
||||
@@ -55,9 +60,9 @@
|
||||
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
|
||||
<u-form-item label="学历要求" prop="educationLabel" labelWidth="80" borderBottom
|
||||
@click="showEdu = true; hideKeyboard()" ref="item4">
|
||||
<u--input v-model="info.education" disabled disabledColor="#ffffff" placeholder="请选择学历要求"
|
||||
<u--input v-model="info.educationLabel" disabled disabledColor="#ffffff" placeholder="请选择学历要求"
|
||||
border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
@@ -66,7 +71,8 @@
|
||||
<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-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>
|
||||
@@ -100,7 +106,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dic from '@/common/dic.js'
|
||||
import dic from '@/common/dic.js'
|
||||
import { submitInfo } from '@/api/userrecruit.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -128,6 +135,7 @@
|
||||
userNature: '', // 人员属性
|
||||
ageDesc: '', // 年龄要求
|
||||
education: '', // 学历要求
|
||||
educationLabel: '', // 学历要求前端显示
|
||||
experienceDesc: '', // 经验要求
|
||||
// userInfo: {
|
||||
// name: '楼兰',
|
||||
@@ -250,7 +258,8 @@
|
||||
},
|
||||
eduConfirm(e) {
|
||||
const { value } = e
|
||||
this.info.education = value[0].label
|
||||
this.info.education = value[0].value
|
||||
this.info.educationLabel = value[0].label
|
||||
this.showEdu = false
|
||||
},
|
||||
expeConfirm(e) {
|
||||
@@ -331,7 +340,7 @@
|
||||
},
|
||||
stimeConfirm(e) {
|
||||
this.showStime = false
|
||||
this.info.stime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
|
||||
this.info.stime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 00:00:00'
|
||||
this.$refs.form1.validateField('userInfo.birthday')
|
||||
},
|
||||
etimeClose() {
|
||||
@@ -340,34 +349,27 @@
|
||||
},
|
||||
etimeConfirm(e) {
|
||||
this.showEtime = false
|
||||
this.info.etime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
|
||||
this.info.etime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 23:59:59'
|
||||
this.$refs.form1.validateField('userInfo.birthday')
|
||||
},
|
||||
submit() {
|
||||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
this.$refs.form1.validate().then(res => {
|
||||
uni.$u.toast('校验通过')
|
||||
}).catch(errors => {
|
||||
uni.$u.toast('校验失败')
|
||||
// this.$refs.form1.validate().then(res => {
|
||||
// uni.$u.toast('校验通过')
|
||||
// }).catch(errors => {
|
||||
// uni.$u.toast('校验失败')
|
||||
// })
|
||||
this.info.jobType = 2
|
||||
// console.log(this.info)
|
||||
let that = this
|
||||
submitInfo(this.info).then(res => {
|
||||
if(res.data.code == 200) {
|
||||
that.reset()
|
||||
uni.$u.toast('发布成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
// jobName: '', // 招工名称
|
||||
// stime: '', // 发布时间
|
||||
// etime: '', // 结束时间
|
||||
// peopleNum: '', // 招聘人数
|
||||
// wage: '', // 参考工资
|
||||
// tradeId: '', // 行业类型id
|
||||
// tradeNames: '', // 行业类型名称
|
||||
// worktypeIds: '', // 工种一级id
|
||||
// skillIds: '', // 工种二级id
|
||||
// worktypeNames: '', // 工种名称
|
||||
// skillNames: '', // 工种二级名称
|
||||
// jobDescription: '', // 任务描述
|
||||
// userNature: '', // 人员属性
|
||||
// ageDesc: '', // 年龄要求
|
||||
// education: '', // 学历要求
|
||||
// experienceDesc: '', // 经验要求
|
||||
reset() {
|
||||
const validateList = [
|
||||
'jobName',
|
||||
'stime',
|
||||
@@ -384,6 +386,7 @@
|
||||
'userNature',
|
||||
'ageDesc',
|
||||
'education',
|
||||
'educationLabel',
|
||||
'experienceDesc'
|
||||
]
|
||||
this.$refs.form1.resetFields()
|
||||
@@ -401,5 +404,9 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.map {
|
||||
width: 100%;
|
||||
height: 350rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user