flat: 暂存
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
<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"
|
||||
<u-picker :show="showSkills" ref="skillPicker" keyName="name" :columns="skillColumns" @change="skillsChange"
|
||||
@confirm="skillConfirm" @cancel="skillClose" @close="skillClose">
|
||||
</u-picker>
|
||||
<!-- <u-popup :show="showDesc" @close="closeDesc" @open="openDesc">
|
||||
@@ -146,7 +146,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 {
|
||||
@@ -217,6 +217,7 @@
|
||||
wageColumns: dic.taskSalary,
|
||||
tradeColumns: dic.tradeArr,
|
||||
skillColumns: [],
|
||||
skillColumnsIndex: [0,0],
|
||||
natureColumns: dic.natureArr,
|
||||
ageColumns: dic.ageArr,
|
||||
eduColumns: dic.eduArr,
|
||||
@@ -288,6 +289,32 @@
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
company: {
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(this.company) {
|
||||
const { manager, companyTid, companyName, companyDesc, telphone } = this.company
|
||||
this.info.jobCompanyScale = companyTid
|
||||
this.info.jobCompanyName = companyName
|
||||
this.info.callName = manager
|
||||
this.info.callTel = telphone
|
||||
this.info.jobCompanyDescription = companyDesc
|
||||
}
|
||||
this.getWorkTypes()
|
||||
},
|
||||
watch: {
|
||||
company(val) {
|
||||
if(!val) return;
|
||||
const { companyId, companyTid, companyName } = val
|
||||
this.info.jobCompanyScale = companyTid
|
||||
this.info.jobCompanyScale = companyTid
|
||||
this.info.jobCompanyName = companyName
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
wageConfirm(e) {
|
||||
const {
|
||||
@@ -302,7 +329,10 @@
|
||||
this.info.tradeNames = value[0].name
|
||||
this.showTrade = false
|
||||
},
|
||||
skillConfirm() {
|
||||
skillConfirm(e) {
|
||||
const { value, indexs } = e
|
||||
this.skillColumnsIndex = indexs
|
||||
this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-')
|
||||
this.showSkills = false
|
||||
},
|
||||
// openDesc() {
|
||||
@@ -424,10 +454,18 @@
|
||||
// }).catch(errors => {
|
||||
// uni.$u.toast('校验失败')
|
||||
// })
|
||||
this.info.jobType = 2
|
||||
// console.log(this.info)
|
||||
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(this.info).then(res => {
|
||||
submitInfo(params).then(res => {
|
||||
if(res.data.code == 200) {
|
||||
that.reset()
|
||||
uni.$u.toast('发布成功')
|
||||
@@ -471,7 +509,48 @@
|
||||
},
|
||||
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>
|
||||
|
||||
@@ -41,14 +41,14 @@
|
||||
|
||||
<view v-if="activeTab == 0" class="u-demo-block" style="padding: 20rpx;padding-bottom: 140rpx;">
|
||||
<!-- <view>发布任务</view> -->
|
||||
<Task></Task>
|
||||
<Task :company="companyInfo"></Task>
|
||||
</view>
|
||||
<view v-if="activeTab == 1" class="u-demo-block" style="padding: 20rpx;padding-bottom: 140rpx;">
|
||||
<!-- <view>发布岗位</view> -->
|
||||
<Work></Work>
|
||||
<Work :company="companyInfo"></Work>
|
||||
</view>
|
||||
<view v-if="activeTab == 2" class="u-demo-block" style="padding: 20rpx;padding-bottom: 140rpx;">
|
||||
<Person></Person>
|
||||
<Person :company="companyInfo"></Person>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view style="font-size: 36rpx;color: #000;font-weight: bold;padding: 0 20rpx;">招工指引</view>
|
||||
@@ -84,6 +84,7 @@
|
||||
import Work from './work.vue' // 发布岗位
|
||||
import Person from './person.vue' // 个体户招工
|
||||
import { mapState } from 'vuex'
|
||||
import {getUserCompanyInfo} from '@/api/userrecruit.js'
|
||||
export default {
|
||||
components: {CustomTabbar, CustomNavbar, Task, Work, Person},
|
||||
data() {
|
||||
@@ -93,6 +94,7 @@
|
||||
fileList1: [],
|
||||
nonReactiveArray: ["发布任务", "发布岗位", "个体户招工"],
|
||||
activeTab: 0,
|
||||
companyInfo: null,
|
||||
}
|
||||
},
|
||||
onLoad({type}) {
|
||||
@@ -103,9 +105,13 @@
|
||||
this.activeTab = 2
|
||||
}
|
||||
// this.getList('refresh')
|
||||
this.getInfo()
|
||||
},
|
||||
computed: {
|
||||
...mapState({enterprise: (state) => state.user.seeEnterprise}),
|
||||
...mapState({
|
||||
enterprise: (state) => state.user.seeEnterprise,
|
||||
idNumber: (state) => state.auth.authInfo.idNumber
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
@@ -116,6 +122,13 @@
|
||||
changeTab: function (e) {
|
||||
this.activeTab = e;
|
||||
},
|
||||
async getInfo() {
|
||||
let resData = await getUserCompanyInfo({idNumber: this.idNumber})
|
||||
if(resData.data.code === 200) {
|
||||
if(!resData.data.data.length) return;
|
||||
this.companyInfo = resData.data.data[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<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"
|
||||
<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"
|
||||
@@ -142,7 +142,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 {
|
||||
@@ -210,7 +210,8 @@
|
||||
birthday: Number(new Date()),
|
||||
wageColumns: dic.taskSalary,
|
||||
tradeColumns: dic.tradeArr,
|
||||
skillColumns: [],
|
||||
skillColumns: [],
|
||||
skillColumnsIndex: [0, 0],
|
||||
natureColumns: dic.natureArr,
|
||||
ageColumns: dic.ageArr,
|
||||
eduColumns: dic.eduArr,
|
||||
@@ -281,8 +282,34 @@
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
props: {
|
||||
company: {
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(this.company) {
|
||||
this.backfill(this.company)
|
||||
}
|
||||
this.getWorkTypes()
|
||||
},
|
||||
watch: {
|
||||
company(val) {
|
||||
if(!val) return;
|
||||
this.backfill(val)
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
backfill(info) {
|
||||
const { manager, companyTid, companyName, companyDesc, telphone } = info
|
||||
this.info.jobCompanyScale = companyTid
|
||||
this.info.jobCompanyName = companyName
|
||||
this.info.callName = manager
|
||||
this.info.callTel = telphone
|
||||
this.info.jobCompanyDescription = companyDesc
|
||||
},
|
||||
wageConfirm(e) {
|
||||
const {
|
||||
value
|
||||
@@ -296,7 +323,10 @@
|
||||
this.info.tradeNames = value[0].name
|
||||
this.showTrade = false
|
||||
},
|
||||
skillConfirm() {
|
||||
skillConfirm(e) {
|
||||
const { value, indexs } = e
|
||||
this.skillColumnsIndex = indexs
|
||||
this.info.skillNames = this.getSkilDataNameWhereId(indexs).join('-')
|
||||
this.showSkills = false
|
||||
},
|
||||
// natureConfirm(e) {
|
||||
@@ -411,10 +441,19 @@
|
||||
// uni.$u.toast('校验通过')
|
||||
// }).catch(errors => {
|
||||
// uni.$u.toast('校验失败')
|
||||
// })
|
||||
this.info.jobType = 0
|
||||
// })
|
||||
const names = this.getSkilDataNameWhereId( this.skillColumnsIndex, true)
|
||||
const ids = this.getSkilDataNameWhereId( this.skillColumnsIndex, false)
|
||||
this.info.jobType = 0
|
||||
let params = {
|
||||
...this.info,
|
||||
worktypeIds: ids[0], // 工种一级id
|
||||
skillIds: ids[1], // 工种二级id
|
||||
worktypeNames: names[0], // 工种名称
|
||||
skillNames: names[1], // 工种二级名称
|
||||
}
|
||||
let that = this
|
||||
submitInfo(this.info).then(res => {
|
||||
submitInfo(params).then(res => {
|
||||
if(res.data.code == 200) {
|
||||
that.reset()
|
||||
uni.$u.toast('发布成功')
|
||||
@@ -463,7 +502,48 @@
|
||||
},
|
||||
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>
|
||||
|
||||
@@ -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