123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- //import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/job/job.js'
- import * as API_common from '@/apis/common.js'
- import * as WxJsApi from '@/utils/wxJsApi.js'
- export default {
- data() {
- return {
- isReady:false,
- isReady2:false,
- action:process.car.BASE_URL+"/mobile/jobUserApi/upload",
- header:{
- 'Authorization':this.carhelp.getToken()
- },
- fileList:[
-
- ],
- isObj:false,//是否是修改
- picList:[],
- form: {
- name: '',
- sex: '2',
- value:'',
- resumeUrls:"",
- expJson:"",
- },
- formData:{},
- endyear:2020,
- nowyear:2020,
- pickerShow:false,
- pickerShowS:false,
- pickerShowE:false,
- pickerObj:{},
- expJsonMap:{},
- leftStyle:{
- color: '#2979ff',
- fontSize:'32rpx',
- },
- selectShowIndex:0,
- selectShowTree:false,
- popupList:[],
- selectIndexList:[[],[],[],[]],
- workExp:[],
- educationExp:[],
- actionSheetList: [
- {
- id:1,
- text: '男'
- },
- {
- id:0,
- text: '女'
- },
- {
- id:2,
- text: '保密'
- }
- ],
- actionSheetShow: false,
- dataList:[
-
- "0c3194dc-884d-4ea9-9966-dfb94f537f5c",//性别
- "b5e4a52a-9f89-4e3b-976f-79207a40587d",//月薪
- "7724a25f-a781-46f4-b048-d9812108ff02" , //工作经验
- "c1887d9d-e945-4875-be3f-905195cd8a8e",//学历
- "e03f43d0-46f8-4696-a6f2-331d353dccd8",//工作状态
- "b974b7a8-3609-4717-aee7-67cd32461c22",//期望工作地
- ],
- dataParam:[
-
- "sex",//性别
- "dreamMoney",//月薪
- "workExp" , //工作经验
- "education",//学历
- "jobStatus",//工作状态
- "dreamAdd",//期望工作地
- ],
- dataMap:{},
- pickerShowEList:[],
- pickerShowSList:[]
- }
- },
- methods: {
- uploadPic(){
- if(!this.isReady2){
- return
- }
- WxJsApi.chooseImage().then(res=>{
-
- var formData = {
- 'photoName': '1.jpg',
- 'photoFile': res.localData
- }
- uni.showLoading({
- title:"加载中",mask:true,
- })
-
- API_common.uploadBase64(formData).then(response => {
-
- this.fileList.push(response.data)
-
- uni.showToast({
- title:"上传成功",
- icon:"none"
- })
- this.$forceUpdate()
- }).catch(error => {
- uni.showToast({
- title:error,
- icon:"none"
- })
- })
- })
-
- },
- setObj(info,work,exp){
- this.isObj=true;
- this.form=info;
- this.form.categoryName=info.positionCategoryName
- this.form.categoryId=info.positionCategoryId;
- if(info.resumeUrls){
- this.pirList=info.resumeUrls.split(',');
- this.fileList=this.pirList.map((item)=>{
- return {
- url:item
- }
- });
- }
-
- this.workExp=work.map((item)=>{
- item.timeS=item.startTime;
- item.timeE=item.endTime;
- item.name=item.companyName;
- item.remark=item.job;
- return item;
- })
- this.educationExp=exp.map((item)=>{
- item.timeS=item.startTime;
- item.timeE=item.endTime;
- item.name=item.schoolName;
- item.remark=item.education;
- item.content=item.major
- return item;
- })
- if(!this.isReady){
- this.init();
- this.isReady=true;
- }
- document.body.scrollTop = 0;
- document.documentElement.scrollTop = 0;
- },
- submit(){
- var form=this.form;
- var error=""
- if(!form.categoryId){
- error="请选择应聘职位"
- }else if(!form.dreamMoney){
- error="请选择期望工资"
- }else if(!form.workExp){
- error="请选择工作经验"
- }else if(!form.jobStatus){
- error="请选择工作状态"
- }else if(!form.birthday){
- error="请选择出生年月"
- }else if(!form.dreamAdd){
- error="请填写期望工作地"
- }else if(!form.introduction){
- error="请输入个人介绍"
- }
-
- if(error){
- uni.showToast({
- title:error
- })
- return false;
- }
-
- var b=false;
- this.workExp.find((item)=>{
-
- if(!item.timeS||!item.timeE){
- uni.showToast({
- title:"请完善工作经历中的工作时间"
-
- })
- b=true
- return true;
- }else if(!item.name||!item.remark||!item.content){
- uni.showToast({
- title:"请完善工作经历中的详细信息"
- })
- b=true
- return true;
- }else{
- return false;
- }
- })
- if(b){
- return false;
- }
- this.educationExp.find((item)=>{
-
- if(!item.timeS||!item.timeE){
- uni.showToast({
- title:"请完善教育经历中的在校时间"
-
- })
- b=true
- return true;
- }else if(!item.name||!item.remark||!item.content){
- uni.showToast({
- title:"请完善教育经历中的详细信息"
- })
- b=true
- return true;
- }else{
- return false;
- }
- })
-
- if(b){
- return false;
- }
-
-
-
- uni.showLoading({
- title:"提交中"
- })
- var expJson={
- workExp:this.workExp,
- educationExp:this.educationExp,
- }
- this.form.expJson=JSON.stringify(expJson);
- this.form.resumeUrls=this.picList.filter(item=>{
- if(item){
- return true;
- }else{
- return false;
- }
- }).join();
-
-
- API.submitResume(this.form).then((response) => {
-
- uni.showToast({
-
- title:response.data
- })
- this.$emit("submit")
-
- }).catch(error => {
- uni.showToast({
-
- title:error
- })
- })
- },
- radioChange(e){
- console.log(this.form.sex);
- },
- back(){
- this.$emit("back")
- },
- 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
- })
- })
- },
- confirmSelectTree(obj){
-
- console.log(obj)
- var list=[];
- for(var i in obj){
- if(i==0){
- this.form.categoryId="";
- this.form.categoryName="";
-
- }
- if(obj[i].extra){
- list.push(obj[i].extra);
- }else{
- list.push(0);
-
- }
- if(obj[i].value){
- this.form.categoryId=obj[i].value;
- this.form.categoryName=obj[i].label;
- }
- }
- this.selectIndexList[3]=list;
-
- },
- 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
- }
-
- },
- selectpicker(item){
-
- this.form.birthday=item.year+"-"+item.month+"-"+item.day;
- },
- selectpickerS(item){
-
- this.pickerObj.timeS=item[0].label+item[1].label;
- },
- selectpickerE(item){
-
- this.pickerObj.timeE=item[0].label+(item[1].label?item[1].label:'');
- },
- 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
- })
- })
- },
- // 点击actionSheet回调
- actionSheetCallback(index) {
- var obj=this.getShowDataList[index]
- uni.hideKeyboard();
- this.form[this.dataParam[this.selectShowIndex]] =obj.id
- this.form[this.dataParam[this.selectShowIndex]+"Name"] =obj.text
-
- },
- init(){
-
- // WxJsApi.getWxConfig(['chooseImage']).then(()=>{
- // this.isReady2=true
- // });
- var list=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]
- list=list.map((item)=>{
- return {
- value:item,
- label:item,
- }
- })
- var year=new Date().getYear()+1900;
-
- this.endyear=year-5;
-
-
- console.log(this.endyear)
- var list2=[];
-
- for(var i=0;i< 40;i++){
- list2.push({
- value:year-i+"年",
- label:year-i+"年",
- children:list
- })
- }
- this.pickerShowSList.push(list2)
- this.pickerShowSList.push(list)
-
- this.pickerShowEList=[
- {
- value:'至今',
- label:'至今',
- children:[{}]
- },
- ...list2
- ]
-
-
- this.getDataMap();
- },
- beforeUpload(index, list){
- console.log(list);
- },
- onErrorUpload(){
- this.picList.push("")
- },
- successUpload(data, index, lists, name){
- console.log(this.picList);
- this.picList.push(data.data)
- },
- removeUpload(data, index, lists, name){
-
- this.picList.splice(data,1)
- }
- },
- mounted(){
-
- this.init();
- this.isReady=true;
- },
-
- onReady(){
-
-
- this.init();
- this.isReady=true;
-
- },computed:{
- getShowDataList(){
-
- var list=this.dataMap[this.dataList[this.selectShowIndex]];
- if(list){
- var ls=list.map((it)=>{
- it.text=it.name
- return it
- })
- return ls;
- }else{
- return [];
- }
-
- },
- }
- }
|