flat: 暂存
This commit is contained in:
@@ -35,13 +35,15 @@
|
||||
<u--input v-model="info.tradeNames" disabledColor="#ffffff" placeholder="请选择行业类型"
|
||||
border="none"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="工种" prop="skillNames" labelWidth="80" borderBottom
|
||||
@click="showSkills = true; hideKeyboard()" ref="item4">
|
||||
<u--input v-model="info.skillNames" disabledColor="#ffffff" placeholder="请选择工种"
|
||||
border="none"></u--input>
|
||||
<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--textarea v-model="info.jobDescription" placeholder="请输入岗位描述"></u--textarea> -->
|
||||
<!-- <u--input v-model="info.jobDescription" border="none" placeholder="请输入任务描述"></u--input>
|
||||
@@ -117,8 +119,8 @@
|
||||
<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 :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns" @change="skillsChange"
|
||||
@confirm="skillConfirm" @cancel="skillClose" @close="skillClose">
|
||||
</u-picker>
|
||||
<!-- <u-picker :show="showNature" ref="naturePicker" :columns="natureColumns"
|
||||
@confirm="natureConfirm" @cancel="natureClose" @close="natureClose">
|
||||
@@ -142,7 +144,7 @@
|
||||
|
||||
<script>
|
||||
import dic from '@/common/dic.js'
|
||||
import { submitInfo } from '@/api/userrecruit.js'
|
||||
import { submitInfo, getWorktypesBaseList } from '@/api/userrecruit.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -211,11 +213,12 @@
|
||||
birthday: Number(new Date()),
|
||||
wageColumns: dic.taskSalary,
|
||||
tradeColumns: dic.tradeArr,
|
||||
skillColumns: [],
|
||||
skillColumns: [],
|
||||
skillColumnsIndex: [0,0,0],
|
||||
natureColumns: dic.natureArr,
|
||||
ageColumns: dic.ageArr,
|
||||
eduColumns: dic.eduArr,
|
||||
expeColumns: dic.expeArr,
|
||||
expeColumns: dic.expeArr,
|
||||
rules: {
|
||||
'userInfo.name': [{
|
||||
type: 'string',
|
||||
@@ -282,7 +285,23 @@
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
props: {
|
||||
company: {
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getWorkTypes()
|
||||
if(this.company) {
|
||||
const { companyTid, companyName, manager, telphone, companyDesc } = this.company
|
||||
this.info.jobCompanyScale = companyTid
|
||||
this.info.jobCompanyName = companyName
|
||||
this.info.callName = manager
|
||||
this.info.callTel = telphone
|
||||
this.info.jobCompanyDescription = companyDesc
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
wageConfirm(e) {
|
||||
const {
|
||||
@@ -297,8 +316,11 @@
|
||||
this.info.tradeNames = value[0].name
|
||||
this.showTrade = false
|
||||
},
|
||||
skillConfirm() {
|
||||
this.showSkills = false
|
||||
skillConfirm(e) {
|
||||
const { value, indexs } = e
|
||||
this.skillColumnsIndex = indexs
|
||||
this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-')
|
||||
this.showSkills = false
|
||||
},
|
||||
// natureConfirm(e) {
|
||||
// const { value } = e
|
||||
@@ -412,16 +434,35 @@
|
||||
// uni.$u.toast('校验通过')
|
||||
// }).catch(errors => {
|
||||
// uni.$u.toast('校验失败')
|
||||
// })
|
||||
this.info.jobType = 1
|
||||
let that = this
|
||||
submitInfo(this.info).then(res => {
|
||||
// })
|
||||
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',
|
||||
@@ -459,7 +500,43 @@
|
||||
},
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user