Browse Source

手机端-求职信息收集调整

liao-sea 11 tháng trước cách đây
mục cha
commit
93a2e37fe4

+ 74 - 31
h5app/src/views/pages/jobuser/edit.vue

@@ -3,7 +3,7 @@
     <ion-header>
       <ion-toolbar>
         <ion-buttons slot="start">
-          <ion-icon :icon="arrowBackOutline" @click="onCancel" style="padding-left:10px;width:24px;height:24px;"></ion-icon>
+          <ion-icon :icon="arrowBackOutline" @click="onBack" style="padding-left:10px;width:24px;height:24px;"></ion-icon>
         </ion-buttons>
         <ion-title>求职信息录入</ion-title>
       </ion-toolbar>
@@ -207,7 +207,7 @@
             <ion-item v-for="(record,key) in educationList" :key="key" >
               <ion-label>
                 <h3>{{record.schoolName}}</h3>
-                <p>{{record.schoolTime}}至{{record.overTime}}</p>
+                <p>{{record.schoolTimeStr}}至{{record.overTimeStr}}</p>
               </ion-label>
               <img alt="" src="@/assets/icon/forward.png" style="width:32px;height:32px;"
                    @click="onPathForward('./educationEdit',record.educationID,null,2)"  />
@@ -232,9 +232,8 @@
                  @click="onPathForward( './jobHuntEdit',null,record.jobHuntID,3)"  />
           </ion-item>
         </ion-list>
-
         <ion-button class="next-btn" type="submit" v-if="curStepData.statusVal!=3">下一步</ion-button>
-        <ion-button class="next-btn" @click="onCancel" v-if="curStepData.statusVal==3">完  成</ion-button>
+        <ion-button class="next-btn" @click="onFinish" v-if="curStepData.statusVal==3">完  成</ion-button>
       </form>
     </ion-content>
   </ion-page>
@@ -245,18 +244,26 @@ import {reactive,defineComponent, computed,watch,ref,toRefs} from "vue";
 import {useRoute, useRouter} from "vue-router";
 import {required} from "@vuelidate/validators";
 import {useVuelidate} from "@vuelidate/core";
-import {getDataById, baseInfoSave, getEducationList} from "@/api/jobUserInfo";
+import {getRegionCodeList,getStreetCodeList} from "@/api/system/area";
+import {getDataById,baseInfoSave} from "@/api/jobUserInfo";
 import {getEducationListByJobUserID} from "@/api/education";
-import {getRegionCodeList, getStreetCodeList} from "@/api/system/area";
+import {getJobHuntListByJobUserID} from "@/api/jobHuntInfo";
 import {getSiteDataList} from "@/api/siteInfo";
-import {getJobHuntListByJobUserID,jobHuntSave} from "@/api/jobHuntInfo";
 import {getSysDictionaryList} from '@/api/system/dictionary';
-import {alertController} from "@ionic/vue";
+import {alertController, onIonViewDidEnter} from "@ionic/vue";
+import dayjs from "dayjs";
 
 interface SelectProps {
   name: string,
   value: string
 }
+interface educationModel{
+  schoolName:string,
+  schoolTimeStr:string,
+  schoolTime:Date,
+  overTimeStr:string
+  overTime:Date
+}
 interface StepParams{
   name: string,
   statusVal: number
@@ -289,11 +296,11 @@ export default defineComponent({
     const regionList  = ref<SelectProps[]>([]);
     const streetList  = ref<SelectProps[]>([]);
 
-    const educationList = ref<SelectProps[]>([]);
+
+    const educationList = ref<educationModel[]>([]);
     const jobHuntList = ref<SelectProps[]>([]);
 
     const baseInfoData = reactive({baseData:{
-
         jobUserID:null,
         name:null,
         identityNumber: null,
@@ -352,7 +359,6 @@ export default defineComponent({
 
       await alert.present();
     }
-
     const onSave = async function (){
       if (curStepData.value.statusVal==1){
         const isFormCorrect = await baseDataValid.value.$validate();
@@ -362,23 +368,34 @@ export default defineComponent({
         }
         baseInfoSave(baseInfoData.baseData).then(result => {
           if (result) {
-            router.push({path: './edit', query: {jobUserID: baseInfoData.baseData.jobUserID,status:2}});
+            router.push({path: './edit', query: {reload:1,jobUserID: baseInfoData.baseData.jobUserID,status:2}});
           }
         });
       }
-      else if(curStepData.value.statusVal==2){
-         router.push({path: './edit', query: {jobUserID: baseInfoData.baseData.jobUserID,status:3}});
+      else{
+         await router.push({path: './edit', query: {reload:1,jobUserID: baseInfoData.baseData.jobUserID,status:3}});
       }
     }
 
     const onPathForward = (pathValue:string,educationIDValue:any,jobHuntIDValue:any,statusValue:any)=>{
-      router.push({path: pathValue, query: {educationID:educationIDValue,jobHuntID:jobHuntIDValue,jobUserID: baseInfoData.baseData.jobUserID,status:statusValue}});
+      router.push({path: pathValue, query: {reload:1,educationID:educationIDValue,jobHuntID:jobHuntIDValue,jobUserID: baseInfoData.baseData.jobUserID,status:statusValue}});
     }
 
-
-    const onCancel = () => {
+    const onFinish = () => {
       router.push("./list");
     }
+
+    const onBack = () => {
+      const toStepValue :number = curStepData.value.statusVal-1;
+      console.log("toStepValue",toStepValue);
+      console.log("jobUserID",baseInfoData.baseData.jobUserID);
+      if(toStepValue > 0){
+        router.push({path: './edit', query: {reload:1,jobUserID: baseInfoData.baseData.jobUserID,toStepValue}});
+      }else{
+        router.push("./list");
+      }
+    }
+
     const getSiteInfoList = async function(){
       const siteInfoResult :any = await getSiteDataList();
       siteInfoList.value = siteInfoResult;
@@ -431,21 +448,11 @@ export default defineComponent({
       await regionChange();
     }
 
-
     const loadData = async (jobUserID: any,status:any) => {
       pageParams.jobUserID = jobUserID;
+      baseInfoData.baseData.jobUserID = jobUserID;
       curStepData.value.statusVal = status;
       if(curStepData.value.statusVal==1){
-        await getSiteInfoList();
-        await getGenderList();
-        await getJobUserStatusList();
-        await getKeyPersonTypeList();
-        await getCultureRankList();
-        await getHealthTypeList();
-        await getBloodTypeList();
-        await getMaritalStatusList();
-        await getRegionList();
-        await getStreetList();
         const reqData = await getDataById(jobUserID);
         baseInfoData.baseData = reqData;
         console.log('baseData',baseInfoData.baseData);
@@ -453,6 +460,11 @@ export default defineComponent({
       else if(curStepData.value.statusVal==2){
         const data :any = await getEducationListByJobUserID(pageParams);
         educationList.value = data.list;
+        educationList.value.map(item=>{
+          item.schoolTimeStr = dayjs(item.schoolTime).format('YYYY-MM-DD');
+          item.overTimeStr = dayjs(item.overTime).format('YYYY-MM-DD');
+        })
+        console.log('educationList',educationList.value);
       }
       else if(curStepData.value.statusVal==3){
         const reqData = await getJobHuntListByJobUserID(pageParams);
@@ -461,11 +473,20 @@ export default defineComponent({
     };
 
     watch(() => route.query, () => {
-      if (route.query) {
-        loadData(route.query.id,route.query.status);
+      if (route.query.reload) {
+        loadData(route.query.jobUserID,route.query.status);
       }
     });
 
+    const reload = (jobUserID:any,status:any) => {
+      loadData(jobUserID,status);
+    }
+
+    onIonViewDidEnter(() => {
+      if (route.query.reload)
+        reload(route.query.jobUserID,route.query.status);
+    });
+
     return {
       ...toRefs(baseInfoData),
       arrowBackOutline,
@@ -492,15 +513,37 @@ export default defineComponent({
       provinceChange,
       regionChange,
       onSave,
-      onCancel,
+      onBack,
+      onFinish,
       onPathForward,
       loadData,
+      reload,
       route,
       router,
       baseDataValid,
+      getSiteInfoList,
+      getGenderList,
+      getJobUserStatusList,
+      getKeyPersonTypeList,
+      getCultureRankList,
+      getHealthTypeList,
+      getBloodTypeList,
+      getMaritalStatusList,
+      getRegionList,
+      getStreetList
     }
   },
   mounted(){
+    this.getSiteInfoList();
+    this.getGenderList();
+    this.getJobUserStatusList();
+    this.getKeyPersonTypeList();
+    this.getCultureRankList();
+    this.getHealthTypeList();
+    this.getBloodTypeList();
+    this.getMaritalStatusList();
+    this.getRegionList();
+    this.getStreetList();
     const jobUserID = this.route.query.jobUserID;
     const status = this.route.query.status;
     this.loadData(jobUserID,status);

+ 31 - 24
h5app/src/views/pages/jobuser/educationEdit.vue

@@ -12,9 +12,9 @@
       <div class="stepFlex">
         <div v-for="(record,key) in stepList" :key="key" class="stepFlex-item">
           <div
-              :class="[(record.val < curStepData?.statusVal || curStepData?.statusVal==stepList.val) ? 'greenCircle' :record.val == curStepData?.statusVal ? 'now' : 'greyCircle']"></div>
+              :class="[(record.val < curStepData?.statusVal || curStepData?.statusVal==stepList.val) ? 'greenCircle' :record.val == curStepData?.statusVal ? 'now' : 'grayCircle']"></div>
           <div v-if="key !== stepList.length - 1"
-               :class="[record.val < curStepData?.statusVal ? 'greenline' : 'greyline']"></div>
+               :class="[record.val < curStepData?.statusVal ? 'greenLine' : 'grayLine']"></div>
           <div class="stepFlex-item-label">
             <p class="stepFlex-item-label-title">{{ record.title }}</p>
             <p class="stepFlex-item-label-desc">{{ record.desc }}</p>
@@ -24,12 +24,12 @@
       <form ref="editForm" @submit.prevent="onSave">
         <ion-list class="canvasWrapper" >
           <ion-item-group>
-            <ion-item :class="[v$.dataModel.schoolName.$error?'ion-invalid':'ion-valid']">
+            <ion-item :class="[educationValid.dataModel.schoolName.$error?'ion-invalid':'ion-valid']">
               <ion-label>毕业院校/培训机构<span class="danger">*</span></ion-label>
               <ion-input name="schoolName" id="schoolName"  placeholder="请输入毕业院校/培训机构" v-model="dataModel.schoolName" ></ion-input>
               <ion-note slot="error">毕业院校/培训机构不能为空</ion-note>
             </ion-item>
-            <ion-item :class="[v$.dataModel.cultureRank.$error?'ion-invalid':'ion-valid']">
+            <ion-item :class="[educationValid.dataModel.cultureRank.$error?'ion-invalid':'ion-valid']">
               <ion-label>最高学历<span class="danger">*</span></ion-label>
               <ion-select name="cultureRank"  id="cultureRank" okText="确定" cancelText="取消" v-model="dataModel.cultureRank"
                           interface="action-sheet" placeholder="请选择最高学历" >
@@ -39,7 +39,7 @@
               </ion-select>
               <ion-note slot="error">最高学历不能为空</ion-note>
             </ion-item>
-            <ion-item :class="[v$.dataModel.major.$error?'ion-invalid':'ion-valid']">
+            <ion-item :class="[educationValid.dataModel.major.$error?'ion-invalid':'ion-valid']">
               <ion-label>专业<span class="danger">*</span></ion-label>
               <ion-input name="major" id="major"  placeholder="请输入专业" v-model="dataModel.major" ></ion-input>
               <ion-note slot="error">专业不能为空</ion-note>
@@ -78,7 +78,7 @@ import {required} from "@vuelidate/validators";
 import {useVuelidate} from "@vuelidate/core";
 import {getEducationByID,saveEducation} from "@/api/education";
 import {getSysDictionaryList} from '@/api/system/dictionary';
-import {alertController} from "@ionic/vue";
+import {alertController, onIonViewDidEnter} from "@ionic/vue";
 
 interface educationModel {
   dataModel: any;
@@ -101,13 +101,11 @@ export default defineComponent({
       name:"",
       statusVal: 2
     });
-    const stepList = ref([{title: '基础信息', desc: '个人基础信息', val: 1}, {
-      title: '教育经历',
-      desc: '完事个人教育经历',
-      val: 2
-    }, {title: '求职意向', desc: '个人求职意向', val: 3}]);
+    const stepList = ref([
+        {title: '基础信息', desc: '个人基础信息', val: 1},
+        {title: '教育经历', desc: '完事个人教育经历',val: 2},
+        {title: '求职意向', desc: '个人求职意向', val: 3}]);
     const cultureRankList = ref<SelectProps[]>([]);
-    const educationList = ref<SelectProps[]>([]);
     const educationData = reactive<educationModel>({ dataModel:{
         jobuserID:null,
         schoolName:null,
@@ -116,7 +114,7 @@ export default defineComponent({
         schoolTime:null,
         overTime:null,
     }});
-    const rules = computed(()=>{
+    const educationRules = computed(()=>{
       return {dataModel:{
           schoolName:{required},
           cultureRank:{required},
@@ -124,7 +122,7 @@ export default defineComponent({
           schoolTime:{required},
           overTime:{required},
         }}});
-    const v$ = useVuelidate(rules,educationData);
+    const educationValid = useVuelidate(educationRules,educationData);
     const presentAlert = async (message: string) => {
       const alert = await alertController.create({
         header: '错误!',
@@ -138,21 +136,21 @@ export default defineComponent({
     }
 
     const onSave = async function (){
-      const isFormCorrect = await v$.value.$validate();
+      const isFormCorrect = await educationValid.value.$validate();
       if(!isFormCorrect){
-        console.log("当前dataModel数据",educationData.dataModel);
+        console.log("当前教育经历数据",educationData.dataModel);
         await presentAlert("请填写完整的信息!");
         return null;
       }
       saveEducation(educationData.dataModel).then(result => {
         if (result) {
-          router.push({path: './edit', query: {jobUserID: educationData.dataModel.jobuserID,status:2}});
+          router.push({path: './edit', query: {reload:1,jobUserID: educationData.dataModel.jobuserID,status:2}});
         }
       });
     }
 
     const onCancel = () => {
-      router.push({path: './edit', query: {jobUserID: educationData.dataModel.jobuserID,status:2}});
+      router.push({path: './edit', query: {reload:1,jobUserID: educationData.dataModel.jobuserID,status:2}});
     }
 
     const getCultureRankList = async function(){
@@ -166,9 +164,19 @@ export default defineComponent({
       curStepData.value.statusVal = status;
       educationData.dataModel = reqData;
       educationData.dataModel.jobuserID = jobUserID;
-      console.log("初始化dataModel",educationData.dataModel);
+      educationData.dataModel.schoolTime == null ?new Date():educationData.dataModel.schoolTime;
+      educationData.dataModel.overTime == null ?new Date():educationData.dataModel.overTime;
+      console.log("初始化教育经历",educationData.dataModel);
     };
 
+    const reload = (educationID: any,jobUserID:any,status:any) => {
+      loadData(educationID,jobUserID,status);
+    }
+
+    onIonViewDidEnter(() => {
+      if (route.query.reload)
+        reload(route.query.educationID,route.query.jobUserID,route.query.status);
+    });
 
     return {
       ...toRefs(educationData),
@@ -177,14 +185,13 @@ export default defineComponent({
       editForm,
       curStepData,
       stepList,
-      educationList,
       cultureRankList,
       onSave,
       onCancel,
       loadData,
       route,
       router,
-      v$
+      educationValid
     }
   },
   mounted(){
@@ -253,7 +260,7 @@ export default defineComponent({
     border: 4px solid #c5e8f9;
   }
 
-  .greyCircle {
+  .grayCircle {
     top: calc(50% - 15px);
     left: calc(50% - 4px);
     position: absolute;
@@ -264,7 +271,7 @@ export default defineComponent({
     background-color: #ccc;
   }
 
-  .greenline {
+  .greenLine {
     width: 100%;
     top: calc(50% - 11px);
     left: calc(50% - 2px);
@@ -273,7 +280,7 @@ export default defineComponent({
     position: absolute;
   }
 
-  .greyline {
+  .grayLine {
     height: 0;
     border: 1px dashed #ccc;
     width: 100%;

+ 14 - 11
h5app/src/views/pages/jobuser/jobHuntEdit.vue

@@ -86,7 +86,7 @@ import {required} from "@vuelidate/validators";
 import {useVuelidate} from "@vuelidate/core";
 import {getJobHuntByID,jobHuntSave} from "@/api/jobHuntInfo";
 import {getSysDictionaryList} from '@/api/system/dictionary';
-import {alertController} from "@ionic/vue";
+import {alertController, onIonViewDidEnter} from "@ionic/vue";
 
 interface huntModel {
   dataModel: any;
@@ -115,6 +115,7 @@ export default defineComponent({
       {title: '求职意向', desc: '个人求职意向', val: 3}]);
     const jobHuntTypeList = ref<SelectProps[]>([]);
     const jobUserTypeList =ref<SelectProps[]>([]);
+
     const jobHuntData = reactive<huntModel>({dataModel:{
         jobUserID:null,
         workName:null,
@@ -159,19 +160,19 @@ export default defineComponent({
     const onSave = async function (){
       const isFormCorrect = await huntDataValid.value.$validate();
       if(!isFormCorrect){
-        console.log("当前dataModel数据",jobHuntData.dataModel);
+        console.log("当前求职意向数据",jobHuntData.dataModel);
         await presentAlert("请填写完整的信息!");
         return null;
       }
       jobHuntSave(jobHuntData.dataModel).then(result => {
         if (result) {
-          router.push({path: './edit', query: {jobUserID: jobHuntData.dataModel.jobUserID,status:3}});
+          router.push({path: './edit', query: {reload:1,jobUserID: jobHuntData.dataModel.jobUserID,status:3}});
         }
       });
     }
 
     const onCancel = () => {
-      router.push({path: './edit', query: {jobUserID: jobHuntData.dataModel.jobUserID,status:3}});
+      router.push({path: './edit', query: {reload:1,jobUserID: jobHuntData.dataModel.jobUserID,status:3}});
     }
 
 
@@ -182,9 +183,17 @@ export default defineComponent({
       curStepData.value.statusVal = status;
       jobHuntData.dataModel = reqData;
       jobHuntData.dataModel.jobUserID = jobUserID;
-      console.log("初始化dataModel ",jobHuntData.dataModel);
+      console.log("初始化求职意向 ",jobHuntData.dataModel);
     };
 
+    const reload = (educationID: any,jobUserID:any,status:any) => {
+      loadData(educationID,jobUserID,status);
+    }
+
+    onIonViewDidEnter(() => {
+      if (route.query.reload)
+        reload(route.query.jobHuntID,route.query.jobUserID,route.query.status);
+    });
 
     return {
       ...toRefs(jobHuntData),
@@ -202,12 +211,6 @@ export default defineComponent({
       router,
       huntDataValid
     }
-  },
-  mounted(){
-    const jobHuntID = this.route.query.jobHuntID;
-    const jobUserID = this.route.query.jobUserID;
-    const status = this.route.query.status;
-    this.loadData(jobHuntID,jobUserID,status);
   }
 });
 </script>

+ 10 - 6
h5app/src/views/pages/jobuser/list.vue

@@ -3,11 +3,11 @@
     <ion-header  class="header-theme2">
       <ion-toolbar>
         <ion-buttons slot="start">
-          <ion-icon :icon="arrowBackOutline" @click="()=>router.push('../')"></ion-icon>
+          <ion-icon :icon="arrowBackOutline" @click="onBack"></ion-icon>
         </ion-buttons>
         <ion-title>求职信息收集</ion-title>
         <ion-buttons slot="end">
-          <ion-icon :icon="addCircleOutline" @click="onAdd()"></ion-icon>
+          <ion-icon :icon="addCircleOutline" @click="onAdd"></ion-icon>
         </ion-buttons>
       </ion-toolbar>
     </ion-header>
@@ -44,7 +44,7 @@
 import dayjs from "dayjs";
 import {useRouter} from "vue-router";
 import {computed, defineComponent, reactive, ref} from 'vue';
-import {arrowBackOutline, ellipse,addCircleOutline} from 'ionicons/icons';
+import {arrowBackOutline,addCircleOutline} from 'ionicons/icons';
 import {IonIcon, onIonViewDidEnter} from '@ionic/vue';
 import {getList} from "@/api/jobUserInfo";
 
@@ -97,11 +97,15 @@ export default defineComponent({
     }
 
     const onAdd = () => {
-      router.push({path: './edit', query: {id:null,status:1}});
+      router.push({path: './edit', query: {reload:1,id:null,status:1}});
     }
+    const onBack =()=>{
+      router.push('../');
+    }
+
 
     const onDetail = (jobUserID:string) =>{
-      router.push({path: './edit', query: {jobUserID: jobUserID,status: 1}});
+      router.push({path: './edit', query: {reload:1,jobUserID: jobUserID,status: 1}});
     }
 
     onIonViewDidEnter(() => {
@@ -118,10 +122,10 @@ export default defineComponent({
       dayjs,
       onScroll,
       onAdd,
+      onBack,
       onDetail,
       loadData,
       reload,
-      ellipse,
       arrowBackOutline,
       addCircleOutline,
     }