bug更新

This commit is contained in:
dengxin
2024-03-29 14:53:16 +08:00
parent 03971176fb
commit 6c6831b394
5 changed files with 904 additions and 877 deletions

View File

@@ -269,6 +269,20 @@ const expeArr = [
] ]
] ]
const companyEnum = [
{ value: 1, label: "机关/事业单位" },
{ value: 2, label: "国有企业" },
{ value: 3, label: "私营企业" },
{ value: 4, label: "外商及港澳台投资企业" },
{ value: 5, label: "股份制企业" },
{ value: 6, label: "学校/下级学院" },
{ value: 7, label: "医院" },
{ value: 8, label: "律师事务所" },
{ value: 9, label: "银行" },
{ value: 10, label: "非盈利社会组织" },
{ value: 11, label: "其它" },
]
export default { export default {
salary, salary,
taskSalary, taskSalary,
@@ -276,5 +290,5 @@ export default {
natureArr, natureArr,
ageArr, ageArr,
eduArr, eduArr,
expeArr expeArr,companyEnum
} }

View File

@@ -89,9 +89,9 @@ export default {
uni.$on('setSkill', ({ uni.$on('setSkill', ({
detail detail
}) => { }) => {
console.log('detail,', detail) console.log('detail,', detail)
// this.skillsId = id // this.skillsId = id
this.skillsName = `${detail.parentLabel }-${detail.parentTwoLabel}-${detail.label}` this.skillsName = `${detail.parentLabel}-${detail.parentTwoLabel}-${detail.label}`
}) })
}, },
methods: { methods: {
@@ -102,9 +102,9 @@ export default {
}, },
skill: function () { skill: function () {
// if (this.tradeId) { // if (this.tradeId) {
uni.navigateTo({ uni.navigateTo({
url: `./skill?id=${this.worktypesId}&tradeId=${this.tradeId}&maxLayer=2&type=1` url: `./skill?id=${this.worktypesId}&tradeId=${this.tradeId}&maxLayer=2&type=1`
}) })
// } else { // } else {
// uni.showToast({ // uni.showToast({
// title: '请先选择从事的行业', // title: '请先选择从事的行业',
@@ -114,24 +114,20 @@ export default {
}, },
skillLevel: function () { skillLevel: function () {
uni.navigateTo({ uni.navigateTo({
url: `./skillLevel?id=${this.skillsId}&worktypesId=${this.worktypesId}&maxLayer=3&type=2` url: `./skillLevel?id=${this.skillsId}&worktypesId=${this.worktypesId}&maxLayer=3&type=2`
}) })
}, },
submit: function () { submit: async function () {
console.log(this.tradeName, this.worktypesName, this.skillsName); // console.log(this.tradeName, this.worktypesName, this.skillsName);
let result = this.worktypesName.split('-'); let result = this.worktypesName.split('-');
let result1 = this.skillsName.split('-'); let result1 = this.skillsName.split('-');
console.log(result, result1);
// 工种 // 工种
addSkills(this.tradeName, result[0], result[1], 0).then(res => { await addSkills(this.tradeName, result[0], result[1], 0)
uni.navigateBack()
})
// 岗位 // 岗位
addSkills(this.tradeName, `${result1[0]}${result1[1]}`, result1[2], 1).then(res => { await addSkills(this.tradeName, `${result1[0]}${result1[1]}`, result1[2], 1)
uni.navigateBack() uni.navigateBack()
})
} }
} }
} }

View File

@@ -10,13 +10,13 @@
</u-form-item> </u-form-item>
<u-form-item label="发布时间" labelWidth="80" prop="stime" borderBottom <u-form-item label="发布时间" labelWidth="80" prop="stime" borderBottom
@click="showStime = true; hideKeyboard()" ref="item1"> @click="showStime = true; hideKeyboard()" ref="item1">
<u--input v-model="info.stime" disabledColor="#ffffff" placeholder="请选择发布时间" <u--input v-model="info.stime" disabledColor="#ffffff" placeholder="请选择发布时间"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="结束时间" labelWidth="80" prop="etime" borderBottom <u-form-item label="结束时间" labelWidth="80" prop="etime" borderBottom
@click="showEtime = true; hideKeyboard()" ref="item2"> @click="showEtime = true; hideKeyboard()" ref="item2">
<u--input v-model="info.etime" disabledColor="#ffffff" placeholder="请选择结束时间" <u--input v-model="info.etime" disabledColor="#ffffff" placeholder="请选择结束时间"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@@ -26,31 +26,32 @@
</u-form-item> </u-form-item>
<u-form-item label="参考工资" prop="wage" labelWidth="80" borderBottom <u-form-item label="参考工资" prop="wage" labelWidth="80" borderBottom
@click="showWage = true; hideKeyboard()" ref="item4"> @click="showWage = true; hideKeyboard()" ref="item4">
<u--input v-model="info.wage" disabledColor="#ffffff" placeholder="请选择参考工资" <u--input v-model="info.wage" disabledColor="#ffffff" placeholder="请选择参考工资"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="行业类型" prop="tradeNames" labelWidth="80" borderBottom <u-form-item label="行业类型" prop="tradeNames" labelWidth="80" borderBottom
@click="showTrade = true; hideKeyboard()" ref="item4"> @click="showTrade = true; hideKeyboard()" ref="item4">
<u--input v-model="info.tradeNames" disabledColor="#ffffff" placeholder="请选择行业类型" <u--input v-model="info.tradeNames" disabledColor="#ffffff" placeholder="请选择行业类型"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="工种" prop="skillNames" labelWidth="80" borderBottom <u-form-item label="工种" prop="skillNames" labelWidth="80" borderBottom
@click="showSkills = true; hideKeyboard()" ref="item4"> @click="showSkills = true; hideKeyboard()" ref="item4">
<u--input v-model="info.skillNames" disabledColor="#ffffff" placeholder="请选择工种" <u--input v-model="info.skillNames" disabledColor="#ffffff" placeholder="请选择工种"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="招工描述" prop="jobDescription" borderBottom labelWidth="80" <u-form-item label="招工描述" prop="jobDescription" borderBottom labelWidth="80" ref="item5">
ref="item5">
<!-- <u--textarea v-model="info.jobDescription" placeholder="请输入招工要求"></u--textarea> --> <!-- <u--textarea v-model="info.jobDescription" placeholder="请输入招工要求"></u--textarea> -->
<!-- <u--input v-model="info.jobDescription" disabledColor="#ffffff" border="none" placeholder="请输入招工描述"></u--input> <!-- <u--input v-model="info.jobDescription" disabledColor="#ffffff" border="none" placeholder="请输入招工描述"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> --> <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item> </u-form-item>
<view> <view>
<u--textarea v-model="info.jobDescription" placeholder="参考示例:岗位名称:保姆 工作内容: 一日三餐,卫生打扫 工资: 200元/天 年龄要求: 25-40岁 工作经验要求: 有过住家保姆经验, 会做饭,受过高等教育的优先" count height="100" maxlength="200"></u--textarea> <u--textarea v-model="info.jobDescription"
placeholder="参考示例:岗位名称:保姆 工作内容: 一日三餐,卫生打扫 工资: 200元/天 年龄要求: 25-40岁 工作经验要求: 有过住家保姆经验, 会做饭,受过高等教育的优先"
count height="100" maxlength="200"></u--textarea>
</view> </view>
<view style="font-size: 30rpx;font-weight: bold;padding: 20rpx 0 0;">人员要求</view> <view style="font-size: 30rpx;font-weight: bold;padding: 20rpx 0 0;">人员要求</view>
<!-- <u-form-item label="人员属性" prop="userNature" labelWidth="80" borderBottom <!-- <u-form-item label="人员属性" prop="userNature" labelWidth="80" borderBottom
@@ -61,19 +62,19 @@
</u-form-item> --> </u-form-item> -->
<u-form-item label="年龄要求" prop="ageDesc" labelWidth="80" borderBottom <u-form-item label="年龄要求" prop="ageDesc" labelWidth="80" borderBottom
@click="showAge = true; hideKeyboard()" ref="item4"> @click="showAge = true; hideKeyboard()" ref="item4">
<u--input v-model="info.ageDesc" disabledColor="#ffffff" placeholder="请选择年龄要求" <u--input v-model="info.ageDesc" disabledColor="#ffffff" placeholder="请选择年龄要求"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="学历要求" prop="educationLabel" labelWidth="80" borderBottom <u-form-item label="学历要求" prop="educationLabel" labelWidth="80" borderBottom
@click="showEdu = true; hideKeyboard()" ref="item4"> @click="showEdu = true; hideKeyboard()" ref="item4">
<u--input v-model="info.educationLabel" disabledColor="#ffffff" placeholder="请选择学历要求" <u--input v-model="info.educationLabel" disabledColor="#ffffff" placeholder="请选择学历要求"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="经验要求" prop="experienceDesc" labelWidth="80" borderBottom <u-form-item label="经验要求" prop="experienceDesc" labelWidth="80" borderBottom
@click="showExpe = true; hideKeyboard()" ref="item4"> @click="showExpe = true; hideKeyboard()" ref="item4">
<u--input v-model="info.experienceDesc" disabledColor="#ffffff" placeholder="请选择学历要求" <u--input v-model="info.experienceDesc" disabledColor="#ffffff" placeholder="请选择学历要求"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@@ -95,7 +96,8 @@
<u-icon slot="right" name="arrow-right"></u-icon> --> <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item> </u-form-item>
<view> <view>
<u--textarea v-model="info.jobCompanyDescription" placeholder="请输入企业介绍" count height="100" maxlength="200"></u--textarea> <u--textarea v-model="info.jobCompanyDescription" placeholder="请输入企业介绍" count height="100"
maxlength="200"></u--textarea>
</view> </view>
<u-form-item label="联系人" prop="callName" borderBottom labelWidth="80" ref="item1"> <u-form-item label="联系人" prop="callName" borderBottom labelWidth="80" ref="item1">
<u--input v-model="info.callName" border="none" placeholder="请输入联系人"></u--input> <u--input v-model="info.callName" border="none" placeholder="请输入联系人"></u--input>
@@ -119,7 +121,7 @@
<u-picker :show="showTrade" ref="tradePicker" keyName="name" :columns="tradeColumns" @confirm="tradeConfirm" <u-picker :show="showTrade" ref="tradePicker" keyName="name" :columns="tradeColumns" @confirm="tradeConfirm"
@cancel="tradeClose" @close="tradeClose"> @cancel="tradeClose" @close="tradeClose">
</u-picker> </u-picker>
<u-picker :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns" @change="skillsChange" <u-picker :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns" @change="skillsChange"
@confirm="skillConfirm" @cancel="skillClose" @close="skillClose"> @confirm="skillConfirm" @cancel="skillClose" @close="skillClose">
</u-picker> </u-picker>
<!-- <u-popup :show="showDesc" @close="closeDesc" @open="openDesc"> <!-- <u-popup :show="showDesc" @close="closeDesc" @open="openDesc">
@@ -127,14 +129,14 @@
<text>出淤泥而不染濯清涟而不妖</text> <text>出淤泥而不染濯清涟而不妖</text>
</view> </view>
</u-popup> --> </u-popup> -->
<u-picker :show="showAge" ref="agePicker" keyName="label" :columns="ageColumns" <u-picker :show="showAge" ref="agePicker" keyName="label" :columns="ageColumns" @confirm="ageConfirm"
@confirm="ageConfirm" @cancel="ageClose" @close="ageClose"> @cancel="ageClose" @close="ageClose">
</u-picker> </u-picker>
<u-picker :show="showEdu" ref="eduPicker" keyName="label" :columns="eduColumns" <u-picker :show="showEdu" ref="eduPicker" keyName="label" :columns="eduColumns" @confirm="eduConfirm"
@confirm="eduConfirm" @cancel="eduClose" @close="eduClose"> @cancel="eduClose" @close="eduClose">
</u-picker> </u-picker>
<u-picker :show="showExpe" ref="expePicker" keyName="label" :columns="expeColumns" <u-picker :show="showExpe" ref="expePicker" keyName="label" :columns="expeColumns" @confirm="expeConfirm"
@confirm="expeConfirm" @cancel="expeClose" @close="expeClose"> @cancel="expeClose" @close="expeClose">
</u-picker> </u-picker>
<u-datetime-picker :show="showStime" :value="birthday" mode="date" closeOnClickOverlay <u-datetime-picker :show="showStime" :value="birthday" mode="date" closeOnClickOverlay
@confirm="stimeConfirm" @cancel="stimeClose" @close="stimeClose"></u-datetime-picker> @confirm="stimeConfirm" @cancel="stimeClose" @close="stimeClose"></u-datetime-picker>
@@ -145,422 +147,437 @@
</template> </template>
<script> <script>
import dic from '@/common/dic.js' import dic from '@/common/dic.js'
import { submitInfo, getWorktypesBaseList } from '@/api/userrecruit.js' import { submitInfo, getWorktypesBaseList, findTradeList } from '@/api/userrecruit.js'
export default { export default {
data() { data() {
return { return {
latitude: 31.05, //中心点 latitude: 31.05, //中心点
longitude: 104.20, longitude: 104.20,
covers: [{ //marker标记位置 covers: [{ //marker标记位置
id: 0, id: 0,
latitude: 0, latitude: 0,
longitude: 0, longitude: 0,
// width:30, // width:30,
// height:30, // height:30,
iconPath: '../../../static/img/location.png' iconPath: '../../../static/img/location.png'
}],
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: '', // 学历要求
educationLabel: '', // 学历要求前端显示
experienceDesc: '', // 经验要求
jobCompanyName: '', // 企业名称
jobCompanyScale: '', // 企业信用代码
jobCompanyIndustry: '', // 所属行业
jobCompanyNature: '', // 企业性质
jobCompanyDescription: '', // 企业介绍
callName: '', // 联系人
callTel: '', // 手机号
callNumber: '', // 座机
address: '', // 公司详细地址
// userInfo: {
// name: '楼兰',
// sex: '',
// birthday: ''
// },
// radiovalue1: '苹果',
// checkboxValue1: [],
// intro: '',
// code: ''
},
showWage: false, // 参考工资选项是否展示
showTrade: false, // 行业类型是否显示
showSkills: false, // 工种类型是否显示
showNature: false, // 人员属性
showAge: false, // 年龄要求
showEdu: false, // 学历要求
showExpe: false, // 经验要求
// showDesc: false, // 招工描述
birthday: Number(new Date()),
wageColumns: dic.taskSalary,
tradeColumns: dic.tradeArr,
skillColumns: [],
skillColumnsIndex: [0, 0],
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"],
}], }],
value2: '招工内容', code: {
fileList1: [], type: 'string',
disabled1: false, required: true,
tips: '', len: 4,
value: '', message: '请填写4位验证码',
showCalendar: false, trigger: ['blur']
showStime: false,
showEtime: false,
info: {
jobName: '', // 招工名称
stime: '', // 发布时间
etime: '', // 结束时间
peopleNum: '', // 招聘人数
wage: '', // 参考工资
tradeId: '', // 行业类型id
tradeNames: '', // 行业类型名称
worktypeIds: '', // 工种一级id
skillIds: '', // 工种二级id
worktypeNames: '', // 工种名称
skillNames: '', // 工种二级名称
jobDescription: '', // 任务描述
// userNature: '', // 人员属性
ageDesc: '', // 年龄要求
education: '', // 学历要求
educationLabel: '', // 学历要求前端显示
experienceDesc: '', // 经验要求
jobCompanyName: '', // 企业名称
jobCompanyScale: '', // 企业信用代码
jobCompanyIndustry: '', // 所属行业
jobCompanyNature: '', // 企业性质
jobCompanyDescription: '', // 企业介绍
callName: '', // 联系人
callTel: '', // 手机号
callNumber: '', // 座机
address: '', // 公司详细地址
// userInfo: {
// name: '楼兰',
// sex: '',
// birthday: ''
// },
// radiovalue1: '苹果',
// checkboxValue1: [],
// intro: '',
// code: ''
}, },
showWage: false, // 参考工资选项是否展示 'userInfo.sex': {
showTrade: false, // 行业类型是否显示 type: 'string',
showSkills: false, // 工种类型是否显示 max: 1,
showNature: false, // 人员属性 required: true,
showAge: false, // 年龄要求 message: '请选择男或女',
showEdu: false, // 学历要求 trigger: ['blur', 'change']
showExpe: false, // 经验要求
// showDesc: false, // 招工描述
birthday: Number(new Date()),
wageColumns: dic.taskSalary,
tradeColumns: dic.tradeArr,
skillColumns: [],
skillColumnsIndex: [0,0],
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']
},
}, },
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']
},
},
}
},
props: {
company: {
default: null,
}
},
created() {
if (this.company) {
const { manager, companyTid, comname, companyDesc, telphone } = this.company
this.info.jobCompanyScale = companyTid
this.info.jobCompanyName = comname
this.info.callName = manager
this.info.callTel = telphone
this.info.jobCompanyDescription = companyDesc
}
this.getWorkTypes()
},
watch: {
company(val) {
if (!val) return;
this.getDataInit()
}
},
methods: {
async getDataInit() {
const { companyTid, comname, manager, telphone, companyDesc, tradeId, nature } = this.company
this.info.jobCompanyScale = companyTid
this.info.jobCompanyName = comname
this.info.callName = manager
this.info.callTel = telphone
this.info.jobCompanyDescription = companyDesc
if (tradeId / 1 !== -1) {
const res = await findTradeList()
const tenantArray = res.data.data?.filter(item => item.id === tradeId)
if (tenantArray?.length === 0) return;
this.info.jobCompanyIndustry = tenantArray[0]?.name
}
if (nature / 1 !== -1) {
const tenantArray = dic.companyEnum?.filter(item => item.value === nature)
if (tenantArray?.length === 0) return;
this.info.jobCompanyNature = tenantArray[0]?.label
} }
}, },
props: { wageConfirm(e) {
company: { const {
default: null, value
} } = e
}, this.info.wage = value[0]
created() { this.showWage = false
if(this.company) { },
const { manager, companyTid, comname, companyDesc, telphone } = this.company tradeConfirm(e) {
this.info.jobCompanyScale = companyTid const { value } = e
this.info.jobCompanyName = comname this.info.tradeId = value[0].id
this.info.callName = manager this.info.tradeNames = value[0].name
this.info.callTel = telphone this.showTrade = false
this.info.jobCompanyDescription = companyDesc },
} skillConfirm(e) {
this.getWorkTypes() const { value, indexs } = e
}, this.skillColumnsIndex = indexs
watch: { this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-')
company(val) { this.showSkills = false
if(!val) return; },
const { manager, companyTid, comname, companyDesc, telphone } = val // openDesc() {
this.info.jobCompanyScale = companyTid // this.showDesc = true
this.info.jobCompanyName = comname // },
this.info.callName = manager // closeDesc() {
this.info.callTel = telphone // this.showDesc = false
this.info.jobCompanyDescription = companyDesc // },
} // natureConfirm(e) {
// const { value } = e
}, // this.info.userNature = value[0]
methods: { // this.showNature = false
wageConfirm(e) { // },
const { ageConfirm(e) {
value const { value } = e
} = e this.info.ageDesc = value[0].label
this.info.wage = value[0] this.showAge = false
this.showWage = false },
}, eduConfirm(e) {
tradeConfirm(e) { const { value } = e
const { value } = e this.info.education = value[0].value
this.info.tradeId = value[0].id this.info.educationLabel = value[0].label
this.info.tradeNames = value[0].name this.showEdu = false
this.showTrade = false },
}, expeConfirm(e) {
skillConfirm(e) { const { value } = e
const { value, indexs } = e this.info.experienceDesc = value[0].label
this.skillColumnsIndex = indexs this.showExpe = false
this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-') },
this.showSkills = false expeClose() {
}, this.showExpe = false
// openDesc() { },
// this.showDesc = true eduClose() {
// }, this.showEdu = false
// closeDesc() { },
// this.showDesc = false ageClose() {
// }, this.showAge = false
// natureConfirm(e) { },
// const { value } = e // natureClose() {
// this.info.userNature = value[0] // this.showNature = false
// this.showNature = false // },
// }, skillClose() {
ageConfirm(e) { this.showSkills = false
const { value } = e },
this.info.ageDesc = value[0].label wageClose(e) {
this.showAge = false this.showWage = false
}, },
eduConfirm(e) { tradeClose(e) {
const { value } = e this.showTrade = false
this.info.education = value[0].value },
this.info.educationLabel = value[0].label sexSelect(e) {
this.showEdu = false this.info.userInfo.sex = e.name
}, this.$refs.form1.validateField('userInfo.sex')
expeConfirm(e) { },
const { value } = e change(e) {
this.info.experienceDesc = value[0].label // console.log(e);
this.showExpe = false },
}, formatter(day) {
expeClose() { const d = new Date()
this.showExpe = false let month = d.getMonth() + 1
}, const date = d.getDate()
eduClose() { if (day.month == month && day.day == date + 3) {
this.showEdu = false day.bottomInfo = '有优惠'
}, day.dot = true
ageClose() { }
this.showAge = false return day
}, },
// natureClose() { calendarConfirm(e) {
// this.showNature = false this.showCalendar = false
// }, this.info.hotel = `${e[0]} / ${e[e.length - 1]}`
skillClose() { this.$refs.form1.validateField('hotel')
this.showSkills = false },
}, codeChange(text) {
wageClose(e) { this.tips = text;
this.showWage = false },
}, getCode() {
tradeClose(e) { if (this.$refs.uCode.canGetCode) {
this.showTrade = false // 模拟向后端请求验证码
}, uni.showLoading({
sexSelect(e) { title: '正在获取验证码'
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') + ' 00:00:00'
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') + ' 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('校验失败')
// })
const names = this.getSkilDataNameWhereId( this.skillColumnsIndex, true)
const ids = this.getSkilDataNameWhereId( this.skillColumnsIndex, false)
this.info.jobType = 2
let params = {
...this.info,
worktypeIds: ids[0], // 工种一级id
skillIds: ids[1], // 工种二级id
worktypeNames: names[0], // 工种名称
skillNames: names[1], // 工种二级名称
}
let that = this
submitInfo(params).then(res => {
if(res.data.code == 200) {
that.reset()
uni.$u.toast('发布成功')
}
}) })
},
reset() {
const validateList = [
'jobName',
'stime',
'etime',
'peopleNum',
'wage',
'tradeId',
'tradeNames',
'worktypeIds',
'skillIds',
'worktypeNames',
'skillNames',
'jobDescription',
'ageDesc',
'education',
'educationLabel',
'experienceDesc',
'jobCompanyName',
'jobCompanyScale',
'jobCompanyIndustry',
'jobCompanyNature',
'jobCompanyDescription',
'callName',
'callTel',
'callNumber',
'address'
]
this.$refs.form1.resetFields()
this.$refs.form1.clearValidate()
setTimeout(() => { setTimeout(() => {
this.$refs.form1.clearValidate(validateList) uni.hideLoading();
// 或者使用 this.$refs.form1.clearValidate() // 这里此提示会被this.start()方法中的提示覆盖
}, 10) uni.$u.toast('验证码已发送');
}, // 通知验证码组件内部开始倒计时
hideKeyboard() { this.$refs.uCode.start();
uni.hideKeyboard() }, 2000);
}, } else {
skillsChange(e) { uni.$u.toast('倒计时结束后再发送');
const { columnIndex, index, picker = this.$refs.uPicker } = e }
let [ index1, index2 ] = this.skillColumnsIndex },
switch (columnIndex) { calendarClose() {
case 0: this.showCalendar = false
index1 = index; this.$refs.form1.validateField('hotel')
index2 = 0 },
break stimeClose() {
case 1: this.showStime = false
index2 = index; this.$refs.form1.validateField('userInfo.birthday')
break },
} stimeConfirm(e) {
const Indexs = [index1, index2] this.showStime = false
picker.setColumnValues(1, this.skillData[index1].child.map((item) => item.name)) this.info.stime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 00:00:00'
this.skillColumnsIndex = Indexs this.$refs.form1.validateField('userInfo.birthday')
}, },
getSkilDataNameWhereId(Indexs, type = true) { etimeClose() {
if(!this.skillData) {return} this.showEtime = false
const [ index1, index2 ] = Indexs this.$refs.form1.validateField('userInfo.birthday')
const work1 = this.skillData[index1] },
const work2 = work1.child[index2] etimeConfirm(e) {
if(type) { this.showEtime = false
return [work1.name, work2.name] this.info.etime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 23:59:59'
} else { this.$refs.form1.validateField('userInfo.birthday')
return [work1.id, work2.id] },
} submit() {
}, // 如果有错误会在catch中返回报错信息数组校验通过则在then中返回true
async getWorkTypes() { // this.$refs.form1.validate().then(res => {
let resData = await getWorktypesBaseList({type: 1}) // uni.$u.toast('校验通过')
if(resData.data.code === 200) { // }).catch(errors => {
const { data } = resData.data // uni.$u.toast('校验失败')
const arr = [] // })
// 1、 空间换时间策略/user/userrecruit/saveApp const names = this.getSkilDataNameWhereId(this.skillColumnsIndex, true)
arr.push(data.map((item) => item.name)); const ids = this.getSkilDataNameWhereId(this.skillColumnsIndex, false)
arr.push(data[0].child.map((item) => item.name)) this.info.jobType = 2
this.skillColumnsIndex = [0, 0] let params = {
this.skillData = data ...this.info,
this.skillColumns = arr worktypeIds: ids[0], // 工种一级id
skillIds: ids[1], // 工种二级id
} worktypeNames: names[0], // 工种名称
} skillNames: names[1], // 工种二级名称
}
let that = this
submitInfo(params).then(res => {
if (res.data.code == 200) {
that.reset()
uni.$u.toast('发布成功')
}
})
},
reset() {
const validateList = [
'jobName',
'stime',
'etime',
'peopleNum',
'wage',
'tradeId',
'tradeNames',
'worktypeIds',
'skillIds',
'worktypeNames',
'skillNames',
'jobDescription',
'ageDesc',
'education',
'educationLabel',
'experienceDesc',
'jobCompanyName',
'jobCompanyScale',
'jobCompanyIndustry',
'jobCompanyNature',
'jobCompanyDescription',
'callName',
'callTel',
'callNumber',
'address'
]
this.$refs.form1.resetFields()
this.$refs.form1.clearValidate()
setTimeout(() => {
this.$refs.form1.clearValidate(validateList)
// 或者使用 this.$refs.form1.clearValidate()
}, 10)
},
hideKeyboard() {
uni.hideKeyboard()
},
skillsChange(e) {
const { columnIndex, index, picker = this.$refs.uPicker } = e
let [index1, index2] = this.skillColumnsIndex
switch (columnIndex) {
case 0:
index1 = index;
index2 = 0
break
case 1:
index2 = index;
break
}
const Indexs = [index1, index2]
picker.setColumnValues(1, this.skillData[index1].child.map((item) => item.name))
this.skillColumnsIndex = Indexs
},
getSkilDataNameWhereId(Indexs, type = true) {
if (!this.skillData) { return }
const [index1, index2] = Indexs
const work1 = this.skillData[index1]
const work2 = work1.child[index2]
if (type) {
return [work1.name, work2.name]
} else {
return [work1.id, work2.id]
}
},
async getWorkTypes() {
let resData = await getWorktypesBaseList({ type: 1 })
if (resData.data.code === 200) {
const { data } = resData.data
const arr = []
// 1、 空间换时间策略/user/userrecruit/saveApp
arr.push(data.map((item) => item.name));
arr.push(data[0].child.map((item) => item.name))
this.skillColumnsIndex = [0, 0]
this.skillData = data
this.skillColumns = arr
}
} }
} }
}
</script> </script>
<style> <style>
.map { .map {
width: 100%; width: 100%;
height: 350rpx; height: 350rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
</style> </style>

View File

@@ -306,22 +306,6 @@ export default {
}, },
methods: { methods: {
async backfill(info) { async backfill(info) {
const companyEnum = [
{ value: 1, label: "机关/事业单位" },
{ value: 2, label: "国有企业" },
{ value: 3, label: "私营企业" },
{ value: 4, label: "外商及港澳台投资企业" },
{ value: 5, label: "股份制企业" },
{ value: 6, label: "学校/下级学院" },
{ value: 7, label: "医院" },
{ value: 8, label: "律师事务所" },
{ value: 9, label: "银行" },
{ value: 10, label: "非盈利社会组织" },
{ value: 11, label: "其它" },
]
console.log(info, '99999999999999999999');
const { manager, companyTid, comname, companyDesc, telphone, tradeId, nature } = info const { manager, companyTid, comname, companyDesc, telphone, tradeId, nature } = info
this.info.jobCompanyScale = companyTid this.info.jobCompanyScale = companyTid
this.info.jobCompanyName = comname this.info.jobCompanyName = comname
@@ -331,15 +315,12 @@ export default {
if (tradeId / 1 !== -1) { if (tradeId / 1 !== -1) {
const res = await findTradeList() const res = await findTradeList()
const tenantArray = res.data.data?.filter(item => item.id === tradeId) const tenantArray = res.data.data?.filter(item => item.id === tradeId)
console.log(res, tenantArray, '----------------');
if (tenantArray?.length === 0) return; if (tenantArray?.length === 0) return;
this.info.jobCompanyIndustry = tenantArray[0]?.name this.info.jobCompanyIndustry = tenantArray[0]?.name
} }
if (nature / 1 !== -1) { if (nature / 1 !== -1) {
const tenantArray = companyEnum?.filter(item => item.value === nature) const tenantArray = dic.companyEnum?.filter(item => item.value === nature)
console.log(tenantArray, "00000000000000000000000");
if (tenantArray?.length === 0) return; if (tenantArray?.length === 0) return;
this.info.jobCompanyNature = tenantArray[0]?.label this.info.jobCompanyNature = tenantArray[0]?.label
} }

View File

@@ -10,13 +10,13 @@
</u-form-item> </u-form-item>
<u-form-item label="发布时间" labelWidth="80" prop="stime" borderBottom <u-form-item label="发布时间" labelWidth="80" prop="stime" borderBottom
@click="showStime = true; hideKeyboard()" ref="item1"> @click="showStime = true; hideKeyboard()" ref="item1">
<u--input v-model="info.stime" disabledColor="#ffffff" placeholder="请选择发布时间" <u--input v-model="info.stime" disabledColor="#ffffff" placeholder="请选择发布时间"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="结束时间" labelWidth="80" prop="etime" borderBottom <u-form-item label="结束时间" labelWidth="80" prop="etime" borderBottom
@click="showEtime = true; hideKeyboard()" ref="item2"> @click="showEtime = true; hideKeyboard()" ref="item2">
<u--input v-model="info.etime" disabledColor="#ffffff" placeholder="请选择结束时间" <u--input v-model="info.etime" disabledColor="#ffffff" placeholder="请选择结束时间"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@@ -26,31 +26,33 @@
</u-form-item> </u-form-item>
<u-form-item label="参考工资" prop="wage" labelWidth="80" borderBottom <u-form-item label="参考工资" prop="wage" labelWidth="80" borderBottom
@click="showWage = true; hideKeyboard()" ref="item4"> @click="showWage = true; hideKeyboard()" ref="item4">
<u--input v-model="info.wage" disabledColor="#ffffff" placeholder="请选择参考工资" <u--input v-model="info.wage" disabledColor="#ffffff" placeholder="请选择参考工资"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="行业类型" prop="tradeNames" labelWidth="80" borderBottom <u-form-item label="行业类型" prop="tradeNames" labelWidth="80" borderBottom
@click="showTrade = true; hideKeyboard()" ref="item4"> @click="showTrade = true; hideKeyboard()" ref="item4">
<u--input v-model="info.tradeNames" disabledColor="#ffffff" placeholder="请选择行业类型" <u--input v-model="info.tradeNames" disabledColor="#ffffff" placeholder="请选择行业类型"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="工种" prop="skillNames" labelWidth="80" borderBottom <u-form-item label="工种" prop="skillNames" labelWidth="80" borderBottom
@click="showSkills = true; hideKeyboard()" ref="item4"> @click="showSkills = true; hideKeyboard()" ref="item4">
<u--input v-model="info.skillNames" disabledColor="#ffffff" placeholder="请选择工种" <u--input v-model="info.skillNames" disabledColor="#ffffff" placeholder="请选择工种"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="岗位描述" prop="jobDescription" borderBottom labelWidth="80" ref="item1"> <u-form-item label="岗位描述" prop="jobDescription" borderBottom labelWidth="80" ref="item1">
<!-- <u--textarea v-model="info.jobDescription" placeholder="请输入岗位描述"></u--textarea> --> <!-- <u--textarea v-model="info.jobDescription" placeholder="请输入岗位描述"></u--textarea> -->
<!-- <u--input v-model="info.jobDescription" border="none" placeholder="请输入任务描述"></u--input> <!-- <u--input v-model="info.jobDescription" border="none" placeholder="请输入任务描述"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> --> <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item> </u-form-item>
<view> <view>
<u--textarea v-model="info.jobDescription" placeholder="参考示例:岗位名称:保姆 工作内容: 一日三餐,卫生打扫 工资: 200元/天 年龄要求: 25-40岁 工作经验要求: 有过住家保姆经验, 会做饭,受过高等教育的优先" count height="100" maxlength="200"></u--textarea> <u--textarea v-model="info.jobDescription"
placeholder="参考示例:岗位名称:保姆 工作内容: 一日三餐,卫生打扫 工资: 200元/天 年龄要求: 25-40岁 工作经验要求: 有过住家保姆经验, 会做饭,受过高等教育的优先"
count height="100" maxlength="200"></u--textarea>
</view> </view>
<view style="font-size: 30rpx;font-weight: bold;padding: 20rpx 0 0;">人员要求</view> <view style="font-size: 30rpx;font-weight: bold;padding: 20rpx 0 0;">人员要求</view>
<!-- <u-form-item label="人员属性" prop="userNature" labelWidth="80" borderBottom <!-- <u-form-item label="人员属性" prop="userNature" labelWidth="80" borderBottom
@@ -61,19 +63,19 @@
</u-form-item> --> </u-form-item> -->
<u-form-item label="年龄要求" prop="ageDesc" labelWidth="80" borderBottom <u-form-item label="年龄要求" prop="ageDesc" labelWidth="80" borderBottom
@click="showAge = true; hideKeyboard()" ref="item4"> @click="showAge = true; hideKeyboard()" ref="item4">
<u--input v-model="info.ageDesc" disabledColor="#ffffff" placeholder="请选择年龄要求" <u--input v-model="info.ageDesc" disabledColor="#ffffff" placeholder="请选择年龄要求"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="学历要求" prop="educationLabel" labelWidth="80" borderBottom <u-form-item label="学历要求" prop="educationLabel" labelWidth="80" borderBottom
@click="showEdu = true; hideKeyboard()" ref="item4"> @click="showEdu = true; hideKeyboard()" ref="item4">
<u--input v-model="info.educationLabel" disabledColor="#ffffff" placeholder="请选择学历要求" <u--input v-model="info.educationLabel" disabledColor="#ffffff" placeholder="请选择学历要求"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="经验要求" prop="experienceDesc" labelWidth="80" borderBottom <u-form-item label="经验要求" prop="experienceDesc" labelWidth="80" borderBottom
@click="showExpe = true; hideKeyboard()" ref="item4"> @click="showExpe = true; hideKeyboard()" ref="item4">
<u--input v-model="info.experienceDesc" disabledColor="#ffffff" placeholder="请选择学历要求" <u--input v-model="info.experienceDesc" disabledColor="#ffffff" placeholder="请选择学历要求"
border="none"></u--input> border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@@ -95,7 +97,8 @@
<u-icon slot="right" name="arrow-right"></u-icon> --> <u-icon slot="right" name="arrow-right"></u-icon> -->
</u-form-item> </u-form-item>
<view> <view>
<u--textarea v-model="info.jobCompanyDescription" placeholder="请输入企业介绍" count height="100" maxlength="200"></u--textarea> <u--textarea v-model="info.jobCompanyDescription" placeholder="请输入企业介绍" count height="100"
maxlength="200"></u--textarea>
</view> </view>
<u-form-item label="联系人" prop="callName" borderBottom labelWidth="80" ref="item1"> <u-form-item label="联系人" prop="callName" borderBottom labelWidth="80" ref="item1">
<u--input v-model="info.callName" border="none" placeholder="请输入联系人"></u--input> <u--input v-model="info.callName" border="none" placeholder="请输入联系人"></u--input>
@@ -120,19 +123,19 @@
@cancel="tradeClose" @close="tradeClose"> @cancel="tradeClose" @close="tradeClose">
</u-picker> </u-picker>
<u-picker :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns" @change="skillsChange" <u-picker :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns" @change="skillsChange"
@confirm="skillConfirm" @cancel="skillClose" @close="skillClose"> @confirm="skillConfirm" @cancel="skillClose" @close="skillClose">
</u-picker> </u-picker>
<!-- <u-picker :show="showNature" ref="naturePicker" :columns="natureColumns" <!-- <u-picker :show="showNature" ref="naturePicker" :columns="natureColumns"
@confirm="natureConfirm" @cancel="natureClose" @close="natureClose"> @confirm="natureConfirm" @cancel="natureClose" @close="natureClose">
</u-picker> --> </u-picker> -->
<u-picker :show="showAge" ref="agePicker" keyName="label" :columns="ageColumns" <u-picker :show="showAge" ref="agePicker" keyName="label" :columns="ageColumns" @confirm="ageConfirm"
@confirm="ageConfirm" @cancel="ageClose" @close="ageClose"> @cancel="ageClose" @close="ageClose">
</u-picker> </u-picker>
<u-picker :show="showEdu" ref="eduPicker" keyName="label" :columns="eduColumns" <u-picker :show="showEdu" ref="eduPicker" keyName="label" :columns="eduColumns" @confirm="eduConfirm"
@confirm="eduConfirm" @cancel="eduClose" @close="eduClose"> @cancel="eduClose" @close="eduClose">
</u-picker> </u-picker>
<u-picker :show="showExpe" ref="expePicker" keyName="label" :columns="expeColumns" <u-picker :show="showExpe" ref="expePicker" keyName="label" :columns="expeColumns" @confirm="expeConfirm"
@confirm="expeConfirm" @cancel="expeClose" @close="expeClose"> @cancel="expeClose" @close="expeClose">
</u-picker> </u-picker>
<u-datetime-picker :show="showStime" :value="birthday" mode="date" closeOnClickOverlay <u-datetime-picker :show="showStime" :value="birthday" mode="date" closeOnClickOverlay
@confirm="stimeConfirm" @cancel="stimeClose" @close="stimeClose"></u-datetime-picker> @confirm="stimeConfirm" @cancel="stimeClose" @close="stimeClose"></u-datetime-picker>
@@ -143,408 +146,424 @@
</template> </template>
<script> <script>
import dic from '@/common/dic.js' import dic from '@/common/dic.js'
import { submitInfo, getWorktypesBaseList } from '@/api/userrecruit.js' import { submitInfo, getWorktypesBaseList,findTradeList } from '@/api/userrecruit.js'
export default { export default {
data() { data() {
return { return {
latitude: 31.05, //中心点 latitude: 31.05, //中心点
longitude: 104.20, longitude: 104.20,
covers: [{ //marker标记位置 covers: [{ //marker标记位置
id: 0, id: 0,
latitude: 0, latitude: 0,
longitude: 0, longitude: 0,
// width:30, // width:30,
// height:30, // height:30,
iconPath: '../../../static/img/location.png' iconPath: '../../../static/img/location.png'
}],
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: '', // 学历要求
educationLabel: '', // 学历要求前端显示
experienceDesc: '', // 经验要求
jobCompanyName: '', // 企业名称
jobCompanyScale: '', // 企业信用代码
jobCompanyIndustry: '', // 所属行业
jobCompanyNature: '', // 企业性质
jobCompanyDescription: '', // 企业介绍
callName: '', // 联系人
callTel: '', // 手机号
callNumber: '', // 座机
address: '', // 公司详细地址
// 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: [],
skillColumnsIndex: [0, 0, 0],
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"],
}], }],
value2: '招工内容', code: {
fileList1: [], type: 'string',
disabled1: false, required: true,
tips: '', len: 4,
value: '', message: '请填写4位验证码',
showCalendar: false, trigger: ['blur']
showStime: false,
showEtime: false,
info: {
jobName: '', // 招工名称
stime: '', // 发布时间
etime: '', // 结束时间
peopleNum: '', // 招聘人数
wage: '', // 参考工资
tradeId: '', // 行业类型id
tradeNames: '', // 行业类型名称
worktypeIds: '', // 工种一级id
skillIds: '', // 工种二级id
worktypeNames: '', // 工种名称
skillNames: '', // 工种二级名称
jobDescription: '', // 任务描述
// userNature: '', // 人员属性
ageDesc: '', // 年龄要求
education: '', // 学历要求
educationLabel: '', // 学历要求前端显示
experienceDesc: '', // 经验要求
jobCompanyName: '', // 企业名称
jobCompanyScale: '', // 企业信用代码
jobCompanyIndustry: '', // 所属行业
jobCompanyNature: '', // 企业性质
jobCompanyDescription: '', // 企业介绍
callName: '', // 联系人
callTel: '', // 手机号
callNumber: '', // 座机
address: '', // 公司详细地址
// userInfo: {
// name: '楼兰',
// sex: '',
// birthday: ''
// },
// radiovalue1: '苹果',
// checkboxValue1: [],
// intro: '',
// code: ''
}, },
showWage: false, // 参考工资选项是否展示 'userInfo.sex': {
showTrade: false, // 行业类型是否显示 type: 'string',
showSkills: false, // 工种类型是否显示 max: 1,
showNature: false, // 人员属性 required: true,
showAge: false, // 年龄要求 message: '请选择男或女',
showEdu: false, // 学历要求 trigger: ['blur', 'change']
showExpe: false, // 经验要求
birthday: Number(new Date()),
wageColumns: dic.taskSalary,
tradeColumns: dic.tradeArr,
skillColumns: [],
skillColumnsIndex: [0,0,0],
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']
},
}, },
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']
},
},
}
},
props: {
company: {
default: null,
}
},
created() {
this.getWorkTypes()
if (this.company) {
this.getDataInit()
}
},
methods: {
async getDataInit() {
const { companyTid, comname, manager, telphone, companyDesc, tradeId, nature } = this.company
this.info.jobCompanyScale = companyTid
this.info.jobCompanyName = comname
this.info.callName = manager
this.info.callTel = telphone
this.info.jobCompanyDescription = companyDesc
if (tradeId / 1 !== -1) {
const res = await findTradeList()
const tenantArray = res.data.data?.filter(item => item.id === tradeId)
if (tenantArray?.length === 0) return;
this.info.jobCompanyIndustry = tenantArray[0]?.name
} }
},
props: { if (nature / 1 !== -1) {
company: { const tenantArray = dic.companyEnum?.filter(item => item.value === nature)
default: null, if (tenantArray?.length === 0) return;
} this.info.jobCompanyNature = tenantArray[0]?.label
}, }
created() { },
this.getWorkTypes()
if(this.company) { wageConfirm(e) {
const { companyTid, comname, manager, telphone, companyDesc } = this.company const {
this.info.jobCompanyScale = companyTid value
this.info.jobCompanyName = comname } = e
this.info.callName = manager this.info.wage = value[0]
this.info.callTel = telphone this.showWage = false
this.info.jobCompanyDescription = companyDesc },
} tradeConfirm(e) {
}, const { value } = e
methods: { this.info.tradeId = value[0].id
wageConfirm(e) { this.info.tradeNames = value[0].name
const { this.showTrade = false
value },
} = e skillConfirm(e) {
this.info.wage = value[0] const { value, indexs } = e
this.showWage = false this.skillColumnsIndex = indexs
}, this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-')
tradeConfirm(e) { this.showSkills = false
const { value } = e },
this.info.tradeId = value[0].id // natureConfirm(e) {
this.info.tradeNames = value[0].name // const { value } = e
this.showTrade = false // this.info.userNature = value[0]
}, // this.showNature = false
skillConfirm(e) { // },
const { value, indexs } = e ageConfirm(e) {
this.skillColumnsIndex = indexs const { value } = e
this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-') this.info.ageDesc = value[0].label
this.showSkills = false this.showAge = false
}, },
// natureConfirm(e) { eduConfirm(e) {
// const { value } = e const { value } = e
// this.info.userNature = value[0] this.info.education = value[0].value
// this.showNature = false this.info.educationLabel = value[0].label
// }, this.showEdu = false
ageConfirm(e) { },
const { value } = e expeConfirm(e) {
this.info.ageDesc = value[0].label const { value } = e
this.showAge = false this.info.experienceDesc = value[0].label
}, this.showExpe = false
eduConfirm(e) { },
const { value } = e expeClose() {
this.info.education = value[0].value this.showExpe = false
this.info.educationLabel = value[0].label },
this.showEdu = false eduClose() {
}, this.showEdu = false
expeConfirm(e) { },
const { value } = e ageClose() {
this.info.experienceDesc = value[0].label this.showAge = false
this.showExpe = false },
}, // natureClose() {
expeClose() { // this.showNature = false
this.showExpe = false // },
}, skillClose() {
eduClose() { this.showSkills = false
this.showEdu = false },
}, wageClose(e) {
ageClose() { this.showWage = false
this.showAge = false },
}, tradeClose(e) {
// natureClose() { this.showTrade = false
// this.showNature = false },
// }, sexSelect(e) {
skillClose() { this.info.userInfo.sex = e.name
this.showSkills = false this.$refs.form1.validateField('userInfo.sex')
}, },
wageClose(e) { change(e) {
this.showWage = false // console.log(e);
}, },
tradeClose(e) { formatter(day) {
this.showTrade = false const d = new Date()
}, let month = d.getMonth() + 1
sexSelect(e) { const date = d.getDate()
this.info.userInfo.sex = e.name if (day.month == month && day.day == date + 3) {
this.$refs.form1.validateField('userInfo.sex') day.bottomInfo = '有优惠'
}, day.dot = true
change(e) { }
// console.log(e); return day
}, },
formatter(day) { calendarConfirm(e) {
const d = new Date() this.showCalendar = false
let month = d.getMonth() + 1 this.info.hotel = `${e[0]} / ${e[e.length - 1]}`
const date = d.getDate() this.$refs.form1.validateField('hotel')
if (day.month == month && day.day == date + 3) { },
day.bottomInfo = '有优惠' codeChange(text) {
day.dot = true this.tips = text;
} },
return day getCode() {
}, if (this.$refs.uCode.canGetCode) {
calendarConfirm(e) { // 模拟向后端请求验证码
this.showCalendar = false uni.showLoading({
this.info.hotel = `${e[0]} / ${e[e.length - 1]}` title: '正在获取验证码'
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') + ' 00:00:00'
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') + ' 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('校验失败')
// })
const names = this.getSkilDataNameWhereId( this.skillColumnsIndex, true)
const ids = this.getSkilDataNameWhereId( this.skillColumnsIndex, false)
this.info.jobType = 1
let params = {
...this.info,
worktypeIds: ids.join(','),
worktypeNames: names.join(',')
}
let that = this
submitInfo(params).then(res => {
if(res.data.code == 200) {
that.reset()
uni.$u.toast('发布成功')
}
}) })
},
getSkilDataNameWhereId(Indexs, type = true) {
if(!this.skillData) {return}
const [ index1, index2, index3 ] = Indexs
const work1 = this.skillData[index1]
const work2 = work1.child[index2]
const work3 = work2.child[index3]
if(type) {
return [work1.name, work2.name, work3.name]
} else {
return [work1.id, work2.id, work3.id]
}
},
reset() {
const validateList = [
'jobName',
'stime',
'etime',
'peopleNum',
'wage',
'tradeId',
'tradeNames',
'worktypeIds',
'skillIds',
'worktypeNames',
'skillNames',
'jobDescription',
'ageDesc',
'education',
'educationLabel',
'experienceDesc',
'jobCompanyName',
'jobCompanyScale',
'jobCompanyIndustry',
'jobCompanyNature',
'jobCompanyDescription',
'callName',
'callTel',
'callNumber',
'address'
]
this.$refs.form1.resetFields()
this.$refs.form1.clearValidate()
setTimeout(() => { setTimeout(() => {
this.$refs.form1.clearValidate(validateList) uni.hideLoading();
// 或者使用 this.$refs.form1.clearValidate() // 这里此提示会被this.start()方法中的提示覆盖
}, 10) uni.$u.toast('验证码已发送');
}, // 通知验证码组件内部开始倒计时
hideKeyboard() { this.$refs.uCode.start();
uni.hideKeyboard() }, 2000);
}, } else {
skillsChange(e) { uni.$u.toast('倒计时结束后再发送');
const { columnIndex, index, picker = this.$refs.uPicker } = e }
let [ index1, index2, index3 ] = this.skillColumnsIndex },
switch (columnIndex) { calendarClose() {
case 0: this.showCalendar = false
index1 = index; this.$refs.form1.validateField('hotel')
index2 = 0 },
index3 = 0 stimeClose() {
break this.showStime = false
case 1: this.$refs.form1.validateField('userInfo.birthday')
index2 = index; },
index3 = 0 stimeConfirm(e) {
break this.showStime = false
case 2: this.info.stime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 00:00:00'
index3 = index this.$refs.form1.validateField('userInfo.birthday')
break },
} etimeClose() {
const Indexs = [index1, index2, index3] this.showEtime = false
picker.setColumnValues(1, this.skillData[index1].child.map((item) => item.name)) this.$refs.form1.validateField('userInfo.birthday')
picker.setColumnValues(2, this.skillData[index1].child[index2].child.map((item) => item.name)) },
this.skillColumnsIndex = Indexs etimeConfirm(e) {
}, this.showEtime = false
async getWorkTypes() { this.info.etime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') + ' 23:59:59'
let resData = await getWorktypesBaseList({type: 2}) this.$refs.form1.validateField('userInfo.birthday')
if(resData.data.code === 200) { },
const { data } = resData.data submit() {
const arr = [] // 如果有错误会在catch中返回报错信息数组校验通过则在then中返回true
// 1、 空间换时间策略/user/userrecruit/saveApp // this.$refs.form1.validate().then(res => {
arr.push(data.map((item) => item.name)); // uni.$u.toast('校验通过')
arr.push(data[0].child.map((item) => item.name)) // }).catch(errors => {
arr.push(data[0].child[0].child.map((item) => item.name)) // uni.$u.toast('校验失败')
this.skillColumnsIndex = [0, 0, 0] // })
this.skillData = data const names = this.getSkilDataNameWhereId(this.skillColumnsIndex, true)
this.skillColumns = arr const ids = this.getSkilDataNameWhereId(this.skillColumnsIndex, false)
} this.info.jobType = 1
} let params = {
...this.info,
worktypeIds: ids.join(','),
worktypeNames: names.join(',')
}
let that = this
submitInfo(params).then(res => {
if (res.data.code == 200) {
that.reset()
uni.$u.toast('发布成功')
}
})
},
getSkilDataNameWhereId(Indexs, type = true) {
if (!this.skillData) { return }
const [index1, index2, index3] = Indexs
const work1 = this.skillData[index1]
const work2 = work1.child[index2]
const work3 = work2.child[index3]
if (type) {
return [work1.name, work2.name, work3.name]
} else {
return [work1.id, work2.id, work3.id]
}
},
reset() {
const validateList = [
'jobName',
'stime',
'etime',
'peopleNum',
'wage',
'tradeId',
'tradeNames',
'worktypeIds',
'skillIds',
'worktypeNames',
'skillNames',
'jobDescription',
'ageDesc',
'education',
'educationLabel',
'experienceDesc',
'jobCompanyName',
'jobCompanyScale',
'jobCompanyIndustry',
'jobCompanyNature',
'jobCompanyDescription',
'callName',
'callTel',
'callNumber',
'address'
]
this.$refs.form1.resetFields()
this.$refs.form1.clearValidate()
setTimeout(() => {
this.$refs.form1.clearValidate(validateList)
// 或者使用 this.$refs.form1.clearValidate()
}, 10)
},
hideKeyboard() {
uni.hideKeyboard()
},
skillsChange(e) {
const { columnIndex, index, picker = this.$refs.uPicker } = e
let [index1, index2, index3] = this.skillColumnsIndex
switch (columnIndex) {
case 0:
index1 = index;
index2 = 0
index3 = 0
break
case 1:
index2 = index;
index3 = 0
break
case 2:
index3 = index
break
}
const Indexs = [index1, index2, index3]
picker.setColumnValues(1, this.skillData[index1].child.map((item) => item.name))
picker.setColumnValues(2, this.skillData[index1].child[index2].child.map((item) => item.name))
this.skillColumnsIndex = Indexs
},
async getWorkTypes() {
let resData = await getWorktypesBaseList({ type: 2 })
if (resData.data.code === 200) {
const { data } = resData.data
const arr = []
// 1、 空间换时间策略/user/userrecruit/saveApp
arr.push(data.map((item) => item.name));
arr.push(data[0].child.map((item) => item.name))
arr.push(data[0].child[0].child.map((item) => item.name))
this.skillColumnsIndex = [0, 0, 0]
this.skillData = data
this.skillColumns = arr
}
} }
} }
}
</script> </script>
<style> <style>
.map { .map {
width: 100%; width: 100%;
height: 350rpx; height: 350rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
</style> </style>