|
@@ -1,130 +1,353 @@
|
|
//import * as WxJsApi from '@/utils/wxJsApi.js'
|
|
//import * as WxJsApi from '@/utils/wxJsApi.js'
|
|
-import * as API from '@/apis/index.js'
|
|
|
|
-
|
|
|
|
|
|
+import * as API from '@/apis/hr/index.js'
|
|
|
|
+import * as API_common from '@/apis/common.js'
|
|
|
|
+
|
|
|
|
+import ResumeItem from '@/components/hr/ResumeItem.vue'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
- return {
|
|
|
|
- nochange:false,
|
|
|
|
- ing:false,
|
|
|
|
- key:'',
|
|
|
|
- record:[],
|
|
|
|
- result:[],
|
|
|
|
- recordsTotal:0,
|
|
|
|
- back:false,
|
|
|
|
|
|
+ return {
|
|
|
|
+ nochange:false,
|
|
|
|
+ ing:false,
|
|
|
|
+ myfocus:true,
|
|
|
|
+ key:'',
|
|
|
|
+ record:[],
|
|
|
|
+ result:[],
|
|
|
|
+ selectShow:false,
|
|
|
|
+ selectShowTree:false,
|
|
|
|
+
|
|
|
|
+ selectShowIndex:0,
|
|
|
|
+ selectIndexList:[[],[],[],[]],
|
|
|
|
+ pageIndex:1,
|
|
|
|
+
|
|
|
|
+ recordsTotal:0,
|
|
|
|
+ popupList:[],
|
|
|
|
+ back:false,
|
|
src:"",
|
|
src:"",
|
|
isReady:false,
|
|
isReady:false,
|
|
|
|
+ whereDataInit:[
|
|
|
|
+ {
|
|
|
|
+ value:"",
|
|
|
|
+ name:"月薪范围",
|
|
|
|
+ label:"月薪范围"
|
|
|
|
+ },{
|
|
|
|
+ value:"",
|
|
|
|
+ name:"工作经验",
|
|
|
|
+ label:"工作经验"
|
|
|
|
+ },{
|
|
|
|
+ value:"",
|
|
|
|
+ label:"学历",
|
|
|
|
+ name:"学历",
|
|
|
|
+ },{
|
|
|
|
+ value:"",
|
|
|
|
+ name:"招聘岗位",
|
|
|
|
+ label:"招聘岗位"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ whereData:[
|
|
|
|
+
|
|
|
|
+ ],
|
|
|
|
+ dataList:[
|
|
|
|
+ "b5e4a52a-9f89-4e3b-976f-79207a40587d",//月薪
|
|
|
|
+ "7724a25f-a781-46f4-b048-d9812108ff02" , //工作经验
|
|
|
|
+ "c1887d9d-e945-4875-be3f-905195cd8a8e"//学历
|
|
|
|
+ ],
|
|
|
|
+ dataMap:{},
|
|
}
|
|
}
|
|
- },
|
|
|
|
- components: {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- onLoad(op){
|
|
|
|
- //this.id=op.id;
|
|
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
- gotoLine(item){
|
|
|
|
- uni.redirectTo({
|
|
|
|
- url:'/pages/route/index?id='+item.id+"&downid="+item.stationId
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- setHistory(){
|
|
|
|
- //搜索记录保存
|
|
|
|
- var sz=this.carhelp.get("searchHistory");
|
|
|
|
- if(!sz){
|
|
|
|
- sz=[];
|
|
|
|
- }
|
|
|
|
- var temp =[];
|
|
|
|
- //去重 ,后插入的,排队到最前面
|
|
|
|
- if(sz.length){
|
|
|
|
- for(var i in sz){
|
|
|
|
- if(i==0){
|
|
|
|
- temp.push(this.key);
|
|
|
|
- }
|
|
|
|
- if(sz[i]==this.key){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- temp.push(sz[i]);
|
|
|
|
-
|
|
|
|
- if(temp.length==10){
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- temp.push(this.key);
|
|
|
|
- }
|
|
|
|
- this.record=temp;
|
|
|
|
- this.carhelp.set("searchHistory",temp);
|
|
|
|
- },
|
|
|
|
- clearBtn(){
|
|
|
|
- this.carhelp.set("searchHistory",[]);
|
|
|
|
- this.record=[];
|
|
|
|
- this.$refs.common.alert("搜索内容已清空")
|
|
|
|
- },
|
|
|
|
- change(){
|
|
|
|
- if(this.nochange){
|
|
|
|
- this.nochange=false;
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- this.ing=false;
|
|
|
|
- document.getElementsByTagName('uni-page-wrapper')[0].style="background-color: #ffffff;"
|
|
|
|
-
|
|
|
|
- if(this.key==""){
|
|
|
|
- this.result=[]
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ components: {
|
|
|
|
+ ResumeItem
|
|
|
|
+ },
|
|
|
|
+ onLoad(op){
|
|
|
|
+ this.whereData={
|
|
|
|
+ ...this.whereDataInit
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(op.key){
|
|
|
|
+ this.key=op.key;
|
|
|
|
+ }
|
|
|
|
+ if(op.all){
|
|
|
|
+ this.myfocus=false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+
|
|
|
|
+ spiltItem(text){
|
|
|
|
+ if(text){
|
|
|
|
+ return text.split(",")
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getScreenList(){
|
|
|
|
+
|
|
|
|
+ API_common.getScreenList().then((response) => {
|
|
|
|
+
|
|
|
|
+ var list=response.data;
|
|
|
|
+ var tree=[];
|
|
|
|
+ var map=new Map();
|
|
|
|
+ var max=0;
|
|
|
|
+ var all={
|
|
|
|
+ extra:0,
|
|
|
|
+ name:"全部岗位"
|
|
|
|
+ }
|
|
|
|
+ tree.push(all);
|
|
|
|
+ list.forEach((item)=>{
|
|
|
|
+ if(item.level>max){
|
|
|
|
+ max=item.level;
|
|
|
|
+ }
|
|
|
|
+ if(item.parentId){
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ item.extra=tree.length,
|
|
|
|
+ tree.push(item);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ map.set(item.id,item);
|
|
|
|
+ this.setChildren(item,max,item);
|
|
|
|
+ })
|
|
|
|
+ this.setChildren(all,max,all);
|
|
|
|
+
|
|
|
|
+ list.forEach((item)=>{
|
|
|
|
+ if(item.parentId){
|
|
|
|
+ var obj=map.get(item.parentId);
|
|
|
|
+ item.extra=obj.children.length
|
|
|
|
+ obj.children.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.popupList=tree;
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ // .map((item)=>{
|
|
|
|
+ // return item.name;
|
|
|
|
+ // })
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+
|
|
|
|
+ title:error
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ confirmSelect(obj){
|
|
|
|
+ var index=this.selectShowIndex;
|
|
|
|
+ var list=[];
|
|
|
|
+ if(obj[0].extra){
|
|
|
|
+ list.push(obj[0].extra);
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ list.push(0);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.selectIndexList[index]=list;
|
|
|
|
+
|
|
|
|
+ this.whereData[index]=obj[0];
|
|
|
|
+ this.submit()
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ confirmSelectTree(obj){
|
|
|
|
+ console.log(obj)
|
|
|
|
+ var list=[];
|
|
|
|
+ for(var i in obj){
|
|
|
|
+ if(i==0){
|
|
|
|
+ this.whereData[3]=obj[i];
|
|
|
|
+ }
|
|
|
|
+ if(obj[i].extra){
|
|
|
|
+ list.push(obj[i].extra);
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ list.push(0);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if(obj[i].value){
|
|
|
|
+ this.whereData[3]=obj[i];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.selectIndexList[3]=list;
|
|
|
|
+ this.submit()
|
|
|
|
+ },
|
|
|
|
+ setChildren(item,i,it){
|
|
|
|
+
|
|
|
|
+ if(i>1){
|
|
|
|
+ var i2=i-1;
|
|
|
|
+ var myit={extra:0}
|
|
|
|
+ it.children=[myit]
|
|
|
|
+ return this.setChildren(item,i2,myit);
|
|
|
|
+ }else{
|
|
|
|
+ return item
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
- submit( ){
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if(!this.key){
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.setHistory();
|
|
|
|
- var region= this.carhelp.get("car_region");
|
|
|
|
- if(!region){
|
|
|
|
- region= this.carhelp.get("car_region_temp");
|
|
|
|
- }
|
|
|
|
- var form={
|
|
|
|
- name:this.key,
|
|
|
|
- pageIndex:1,
|
|
|
|
- pageSize:20,
|
|
|
|
- regionId:region
|
|
|
|
- }
|
|
|
|
- this.ing=true;
|
|
|
|
- this.result=[{}]
|
|
|
|
- this.$forceUpdate()
|
|
|
|
- return;
|
|
|
|
- API.routeList(form).then((res) => {
|
|
|
|
- this.ing=true;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- this.result=res.data.data;
|
|
|
|
- this.recordsTotal=res.data.recordsTotal
|
|
|
|
- for(var i in this.result){
|
|
|
|
- var item=this.result[i];
|
|
|
|
- var len =item.name.indexOf(this.key)
|
|
|
|
- this.result[i].name1=item.name.substring(0,len);
|
|
|
|
- this.result[i].name2=item.name.substring(len+this.key.length);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- document.getElementsByTagName('uni-page-wrapper')[0].style="background-color: #f7f7f7;"
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }).catch(error => {
|
|
|
|
- this.$refs.common.alert( error);
|
|
|
|
- })
|
|
|
|
|
|
+ getDataMap(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中'
|
|
|
|
+ });
|
|
|
|
+ API_common.getData(this.dataList.join()).then((res) => {
|
|
|
|
+
|
|
|
|
+ this.dataMap=res.data;
|
|
|
|
+
|
|
|
|
+ for(var key in this.dataMap){
|
|
|
|
+ this.dataMap[key].forEach((item,index)=>{
|
|
|
|
+ item.extra=(index+1);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.getScreenList();
|
|
|
|
+
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+
|
|
|
|
+ title:error
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ setHistory(){
|
|
|
|
+
|
|
|
|
+ if(!this.key){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ //搜索记录保存
|
|
|
|
+ var sz=this.carhelp.get("searchHistory");
|
|
|
|
+ if(!sz){
|
|
|
|
+ sz=[];
|
|
|
|
+ }
|
|
|
|
+ var temp =[];
|
|
|
|
+ //去重 ,后插入的,排队到最前面
|
|
|
|
+ if(sz.length){
|
|
|
|
+ for(var i in sz){
|
|
|
|
+ if(i==0){
|
|
|
|
+ temp.push(this.key);
|
|
|
|
+ }
|
|
|
|
+ if(sz[i]==this.key){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ temp.push(sz[i]);
|
|
|
|
+
|
|
|
|
+ if(temp.length==10){
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ temp.push(this.key);
|
|
|
|
+ }
|
|
|
|
+ this.record=temp;
|
|
|
|
+ this.carhelp.set("searchHistory",temp);
|
|
|
|
+ },
|
|
|
|
+ clearBtn(){
|
|
|
|
+ this.carhelp.set("searchHistory",[]);
|
|
|
|
+ this.record=[];
|
|
|
|
+ //this.$refs.common.alert("搜索内容已清空")
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon:'none' ,title:"搜索内容已清空"
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ change(){
|
|
|
|
+ if(this.nochange){
|
|
|
|
+ this.nochange=false;
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.ing=false;
|
|
|
|
+ document.getElementsByTagName('uni-page-wrapper')[0].style="background-color: #ffffff;"
|
|
|
|
+
|
|
|
|
+ if(this.key==""){
|
|
|
|
+ this.result=[]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ noSearch(){
|
|
|
|
+ this.ing=true;
|
|
|
|
+ this.whereData={
|
|
|
|
+ ...this.whereDataInit
|
|
|
|
+ }
|
|
|
|
+ this.key="";
|
|
|
|
+
|
|
|
|
+ this.submit()
|
|
|
|
+ },
|
|
|
|
+ myLoadmore(){
|
|
|
|
+ this.submit(true);
|
|
|
|
+ },
|
|
|
|
+ submit( bl){
|
|
|
|
+
|
|
|
|
+ this.setHistory();
|
|
|
|
+ if(bl){
|
|
|
|
+ this.pageIndex++;
|
|
|
|
+ }else{
|
|
|
|
+ this.pageIndex=1;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ var form= {
|
|
|
|
+ positionName:this.key,
|
|
|
|
+ pageIndex:this.pageIndex,
|
|
|
|
+ pageSize:20,
|
|
|
|
+ dreamMoney:this.whereData[0].value,
|
|
|
|
+ workExp:this.whereData[1].value,
|
|
|
|
+ education:this.whereData[2].value,
|
|
|
|
+ positionId:this.whereData[3].value,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // this.ing=true;
|
|
|
|
+ // this.result=[{}]
|
|
|
|
+ // this.$forceUpdate()
|
|
|
|
+ // return;
|
|
|
|
+ API.loadAllResumes(form).then((res) => {
|
|
|
|
+ this.ing=true;
|
|
|
|
+ if(bl){
|
|
|
|
+ this.result=[
|
|
|
|
+ ...this.result,
|
|
|
|
+ ...res.data.data
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ this.result=res.data.data;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.recordsTotal=res.data.recordsTotal
|
|
|
|
+
|
|
|
|
+ document.getElementsByTagName('uni-page-wrapper')[0].style="background-color: #f7f7f7;"
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+
|
|
|
|
+ title:error
|
|
|
|
+ })
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
- },onReady(){
|
|
|
|
- this.record=this.carhelp.get("searchHistory");
|
|
|
|
|
|
+ },onReady(){
|
|
|
|
|
|
- this.isReady=true;
|
|
|
|
|
|
+ this.record=this.carhelp.get("searchHistory");
|
|
|
|
+ this.getDataMap();
|
|
|
|
+ this.isReady=true;
|
|
|
|
+ if(this.key||!this.myfocus ){
|
|
|
|
+ this.submit()
|
|
|
|
+ }
|
|
},onShow(){
|
|
},onShow(){
|
|
if(this.isReady){
|
|
if(this.isReady){
|
|
|
|
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ },computed:{
|
|
|
|
+ getShowDataList(){
|
|
|
|
+
|
|
|
|
+ var list=this.dataMap[this.dataList[this.selectShowIndex]];
|
|
|
|
+ if(list){
|
|
|
|
+ list.unshift(
|
|
|
|
+ this.whereDataInit[this.selectShowIndex]
|
|
|
|
+ )
|
|
|
|
+ return list;
|
|
|
|
+ }else{
|
|
|
|
+ return [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|