Browse Source

app-企业信息页面修改

Liudijing 11 tháng trước cách đây
mục cha
commit
529737a577

+ 1 - 1
h5app/src/router/index.ts

@@ -49,7 +49,7 @@ const routes: Array<RouteRecordRaw> = [
                 component: () => import('@/views/pages/company/edit.vue')
             },
             {
-                path: 'tabMain/company/postList',
+                path: 'tabMain/company/postList?',
                 component: () => import('@/views/pages/company/postList.vue')
             },
             {

+ 23 - 10
h5app/src/views/pages/company/edit.vue

@@ -3,7 +3,7 @@
     <ion-header class="header-theme2">
       <ion-toolbar>
         <ion-buttons slot="start">
-          <ion-icon :icon="arrowBackOutline" @click="()=>router.push('./list')"></ion-icon>
+          <ion-icon :icon="arrowBackOutline" @click="back"></ion-icon>
         </ion-buttons>
         <ion-title>
           企业信息录入
@@ -120,7 +120,8 @@
               <ion-label style="width: 100px;">所属县区<span class="danger">*</span></ion-label>
             </div>
             <div style="width: 73%;">
-              <ion-select interface="action-sheet" placeholder="请选择所属县区" cancel-text="取消" @ionChange="changeCity" style="max-width: 70%;"
+              <ion-select interface="action-sheet" placeholder="请选择所属县区" cancel-text="取消" @ionChange="changeCity"
+                          style="max-width: 70%;"
                           id="regionCode" v-model="formState.dataModel.regionCode">
                 <ion-select-option v-for="(record,key) in regionList" :key="key"
                                    v-model:value="record.code">
@@ -181,12 +182,12 @@
             <ion-note slot="error">法人代表不能为空</ion-note>
           </ion-item>
           <ion-item v-show="isShow" mode="md" :class="[v$.dataModel.validTime.$error?'ion-invalid':'ion-valid']">
-            <div style="width: 40%;" >
+            <div style="width: 30%;">
               <ion-label style="width: 150px;">营业执照有效期<span class="danger">*</span></ion-label>
             </div>
-            <div style="width: 60%;">
-              <ion-datetime-button datetime="validTime"></ion-datetime-button>
-              <ion-modal :keep-contents-mounted="true" >
+            <div style="width: 70%;">
+              <ion-datetime-button datetime="validTime" style="width: 70%;"></ion-datetime-button>
+              <ion-modal :keep-contents-mounted="true">
                 <ion-datetime id="validTime" placeholder="营业执照有效期"
                               v-model="formState.dataModel.validTime"
                               dataformatas="YYYY-MM-DD" presentation="date" cancel-text="取消" done-text="确定"
@@ -215,6 +216,7 @@ import {alertController, onIonViewDidEnter} from "@ionic/vue";
 import {useVuelidate} from "@vuelidate/core";
 import {chevronDownOutline, chevronUpOutline, arrowBackOutline} from 'ionicons/icons';
 import {minLength, required} from "@vuelidate/validators";
+
 interface FormState {
   dataModel: any;
 }
@@ -286,7 +288,10 @@ export default defineComponent({
       const jsonStr = JSON.stringify(formState.dataModel);
       localStorage.removeItem('companyData');
       localStorage.setItem("companyData", jsonStr);
-      await router.push({path: './postList', query: {pageStatus: 1}});
+      if(route.query.pageStatus=='2')
+        await router.push({path: './postList', query: {pageStatus: 2}});
+      else
+        await router.push({path: './postList', query: {pageStatus: 1}});
     }
     const onCancel = () => {
       router.push("./index");
@@ -317,15 +322,17 @@ export default defineComponent({
     }
 
     const initData = () => {
-
       getRegionListData();
       getSitetListData();
     };
 
     onIonViewDidEnter(() => {
       initData();
-      formState.dataModel={recordStatus:1,statusVal:1};
-      formState.dataModel.validTime = getCurrentDate();
+      if (route.query.pageStatus == '1') {
+        formState.dataModel = {recordStatus: 1, statusVal: 1};
+        formState.dataModel.validTime = getCurrentDate();
+    
+      }
     });
 
     const presentAlert = async (message: string) => {
@@ -349,6 +356,11 @@ export default defineComponent({
       return `${year}-${month}-${day}`;
     }
 
+    const back=()=>{
+      isShow.value=false;
+      router.push('./list');
+    }
+
     return {
       formState,
       stepList,
@@ -356,6 +368,7 @@ export default defineComponent({
       onCancel,
       next,
       route,
+      back,
       arrowBackOutline,
       chevronDownOutline,
       chevronUpOutline,

+ 30 - 24
h5app/src/views/pages/company/editPost.vue

@@ -22,30 +22,34 @@
           </ion-item>
           <ion-item mode="md" :class="[v$.dataModel.recruitCount.$error?'ion-invalid':'ion-valid']">
             <ion-label style="width: 100px;">招聘数量<span class="danger">*</span></ion-label>
-            <ion-input  placeholder="请输入招聘数量" label-placement="stacked" :clear-input="true"
+            <ion-input placeholder="请输入招聘数量" label-placement="stacked" :clear-input="true"
                        v-model="formState.dataModel.recruitCount"
             >
             </ion-input>
             <ion-note slot="error">请输入招聘数量</ion-note>
           </ion-item>
-          <ion-item mode="md" >
-            <ion-label>招聘日期<span class="danger">*</span></ion-label>
-            <ion-datetime-button datetime="jobVacancyTime"></ion-datetime-button>
-            <ion-modal :keep-contents-mounted="true">
-              <ion-datetime placeholder="招聘日期" id="jobVacancyTime"
-                            v-model="jobVacancyTime"
-                            dataformatas="YYYY-MM-DD" presentation="date" cancel-text="取消" done-text="确定"
-                            :show-default-buttons="true">
-              </ion-datetime>
-            </ion-modal>
-          </ion-item>
           <ion-item mode="md" :class="[v$.dataModel.validDay.$error?'ion-invalid':'ion-valid']">
             <ion-label style="width: 100px;">有效天数<span class="danger">*</span></ion-label>
-            <ion-input  placeholder="请输入有效天数" label-placement="stacked" :clear-input="true"
+            <ion-input placeholder="请输入有效天数" label-placement="stacked" :clear-input="true"
                        v-model="formState.dataModel.validDay">
             </ion-input>
             <ion-note slot="error">请输入有效天数</ion-note>
           </ion-item>
+          <ion-item mode="md">
+            <div style="width: 20%">
+              <ion-label>招聘日期<span class="danger">*</span></ion-label>
+            </div>
+            <div style="width: 80%;padding: 0;margin: 0;">
+              <ion-datetime-button datetime="jobVacancyTime" style="width: 70%;"></ion-datetime-button>
+              <ion-modal :keep-contents-mounted="true" >
+                <ion-datetime placeholder="招聘日期" id="jobVacancyTime"
+                              v-model="jobVacancyTime"
+                              dataformatas="YYYY-MM-DD" presentation="date" cancel-text="取消" done-text="确定"
+                              :show-default-buttons="true">
+                </ion-datetime>
+              </ion-modal>
+            </div>
+          </ion-item>
         </ion-list>
       </form>
     </ion-content>
@@ -66,6 +70,7 @@ import {arrowBackOutline} from 'ionicons/icons';
 import {useVuelidate} from "@vuelidate/core";
 import {post} from "@/api/common";
 import {minLength, required} from "@vuelidate/validators";
+
 interface FormState {
   dataModel: {
     postName?: string | null,
@@ -113,10 +118,10 @@ export default defineComponent({
       const indexToUpdate = postList.value.findIndex(post => post.postName === formState.dataModel.postName);
       if (indexToUpdate != -1) {
         postList.value[indexToUpdate].recruitCount = formState.dataModel.recruitCount;
-        postList.value[indexToUpdate].validTime =jobVacancyTime.value;
+        postList.value[indexToUpdate].validTime = jobVacancyTime.value;
         postList.value[indexToUpdate].validDay = formState.dataModel.validDay;
       } else {
-        formState.dataModel.validTime=jobVacancyTime.value;
+        formState.dataModel.validTime = jobVacancyTime.value;
         postList.value.push(formState.dataModel);
       }
       const jsonPostList = JSON.stringify(postList.value);
@@ -124,10 +129,10 @@ export default defineComponent({
       localStorage.setItem("postData", jsonPostList);
       console.log(formState.dataModel);
       console.log(postList.value);
-      if(route.query.id){
-        await router.push({path: "./postList", query: {pageStatus: 2,id:route.query.id}});
-      }else{
-        await router.push({path: "./postList", query: {pageStatus: 2}});
+      if (route.query.id) {
+        await router.push({path: "./postList", query: {pageStatus: 3, id: route.query.id}});
+      } else {
+        await router.push({path: "./postList", query: {pageStatus: 3}});
       }
 
     }
@@ -159,17 +164,17 @@ export default defineComponent({
         formState.dataModel.validDay = null;
         formState.dataModel.postName = null;
       }
-      if (route.query.id){
-        isEdit.value=true;
+      if (route.query.id) {
+        isEdit.value = true;
       }
       loadData(id);
     };
 
     const back = () => {
       if (isEdit.value) {
-        router.push({path:'./postList',query: {pageStatus: 2,id:route.query.id}});
+        router.push({path: './postList', query: {pageStatus: 2, id: route.query.id}});
       } else {
-        router.push({path:'./postList',query: {pageStatus: 2}});
+        router.push({path: './postList', query: {pageStatus: 2}});
       }
     }
 
@@ -210,7 +215,8 @@ export default defineComponent({
 ion-item {
   --border-width: 0;
   --border-style: none;
-  ion-label,input,ion-select,ion-datetime {
+
+  ion-label, input, ion-select, ion-datetime {
     font-size: 14px !important;
   }
 }

+ 11 - 9
h5app/src/views/pages/company/list.vue

@@ -3,7 +3,7 @@
     <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="back"></ion-icon>
         </ion-buttons>
         <ion-title>企业信息收集</ion-title>
         <ion-buttons slot="end">
@@ -95,7 +95,7 @@ export default defineComponent({
     }));
     const searchParams = reactive({
       pageIndex: 1,
-      pageSize: 20,
+      pageSize: 5,
       primaryKey: '',
       companyName: '',
       companyCode: '',
@@ -112,7 +112,7 @@ export default defineComponent({
     const loadData = async function () {
       loading.value = true;
       getCompanyList(searchParams).then(data => {
-        dataList.value = data.list;
+        dataList.value = dataList.value.concat(data.list);
         total.value = data.total;
         dataList.value.map((item: any) => {
           if (item.modifyTime)
@@ -120,9 +120,6 @@ export default defineComponent({
         });
         console.log(dataList.value);
       })
-
-      // dataList.value = [{companyName: '惠州市AA信息科技有限公司', statusName: "正在跟进",updateTime:'2023-12-11'},
-      //   {companyName: '惠州市BB信息科技有限公司', statusName: "正在跟进",updateTime:'2023-12-12'},{companyName: '惠州市CC信息科技有限公司', statusName: "正在跟进",updateTime:'2023-12-13'}];
       loading.value = false;
     }
 
@@ -143,23 +140,28 @@ export default defineComponent({
     }
 
     const onAdd = (item: any) => {
-      router.push({path: './edit', query: {reload: 1, id: ""}});
+      router.push({path: './edit', query: {pageStatus: 1, id: "", date:new Date().getTime()}});
     }
 
-    const enterPost=(companyID:any)=>{
-      router.push({path: './postList', query: {id: companyID,pageStatus:1}});
+    const enterPost = (companyID: any) => {
+      router.push({path: './postList', query: {id: companyID, pageStatus: 1}});
     }
 
     const search = () => {
       loadData();
     }
 
+    const back = () => {
+      router.push({path: '../', query: {reload: 1, date:new Date().getTime()}});
+    }
+
     onIonViewDidEnter(() => {
       reload();
     });
 
     return {
       router,
+      back,
       pagination,
       colors,
       reload,

+ 26 - 6
h5app/src/views/pages/company/postList.vue

@@ -1,5 +1,5 @@
 <template>
-  <ion-page>
+  <ion-page class="list-page company-list-page">
     <ion-header class="header-theme2">
       <ion-toolbar>
         <ion-buttons slot="start">
@@ -152,15 +152,15 @@ export default defineComponent({
           formatDataList();
           console.log(postList.value);
         });
-      } else if (!route.query.id) {
+      } else if (!route.query.id && route.query.pageStatus == "1") {
         isEdit.value = false;
         formState.dataModel.statusVal = 2;
         postList.value = [];
       }
-      if(route.query.id){
+      if (route.query.id) {
         isEdit.value = true;
       }
-      if (route.query.pageStatus == "2") {
+      if (route.query.pageStatus == "3") {
         const jsonPostList = localStorage.getItem("postData");
         postList.value = JSON.parse(jsonPostList ?? "");
         formatDataList();
@@ -201,9 +201,9 @@ export default defineComponent({
 
     const back = () => {
       if (isEdit.value) {
-        router.push('./list');
+        router.push({path: './list'});
       } else {
-        router.push('./edit');
+        router.push({path:'./edit', query: {pageStatus: 2}});
       }
     }
 
@@ -325,6 +325,26 @@ export default defineComponent({
     left: calc(50% - 2px);
     position: absolute;
   }
+
+
+  .company-list-page {
+    .list-content {
+      margin: 0px 15px !important;
+      background-color: white !important;
+      border-radius: 0 !important;
+
+      ion-item {
+        margin-top: 10px;
+        font-size: 14px;
+        border: 1px solid rgb(242, 242, 245);
+
+        p {
+          font-size: 12px;
+        }
+      }
+    }
+  }
+
 }
 
 </style>

+ 1 - 1
h5app/src/views/sapp/tabMain.vue

@@ -13,7 +13,7 @@
               </div>
               <div class="tool-title">求职信息收集</div>
             </a>
-            <a class="tool-item box-line"  @click="router.push('/tabs/tabMain/company/list')">
+            <a class="tool-item box-line"  @click="router.push({path:'/tabs/tabMain/company/list',query:{date:new Date().getTime()}})">
               <div class="tool-img">
                 <img src="@/assets/icon/qyxx.png">
               </div>