Browse Source

fix: 企业信息录入调整

zhangying 9 months ago
parent
commit
127949a101

+ 40 - 19
h5app/src/views/pages/company/edit.vue

@@ -108,25 +108,30 @@
             </ion-select>
 <!--            <ion-note slot="error">企业状态不能为空</ion-note>-->
           </div>
-          <div class="form-select">
-            <ion-label>是否缺工<span class="danger">*</span></ion-label>
-            <ion-select id="isShortAge" name="isShortAge" cancel-text="取消"  v-model="dataModel.isShortage"
-                        interface="action-sheet" placeholder="请选择是否缺工" style="width: 100%;text-align: left;">
-              <ion-select-option v-for="(record,key) in shortAgeTypeList" :key="key"
-                                 v-model:value="record.value">
-                {{ record.name }}
-              </ion-select-option>
-            </ion-select>
-<!--            <ion-note slot="error">是否缺工不能为空</ion-note>-->
+          <div class="form-input">
+            <ion-label>用工情况(人,含临时人员)<span class="danger">*</span></ion-label>
+            <ion-input type="number" placeholder="请输入用工人数" label-placement="stacked" :clear-input="true"
+                       v-model="dataModel.workSituation" class="custom" @ionBlur="workSituationBlur">
+            </ion-input>
           </div>
           <div class="form-title">
-            其他信息
+            扩展信息
             <div style="float:right;">
               <ion-label style="color: red;font-size: 14px;" @click="isShow=!isShow">{{isShow?"收起":"展开"}}</ion-label>
             </div>
           </div>
 
           <div v-show="isShow" >
+            <div class="form-select">
+              <ion-label>是否缺工</ion-label>
+              <ion-select id="isShortAge" name="isShortAge" cancel-text="取消" v-model="dataModel.isShortage"
+                          interface="action-sheet" placeholder="请选择是否缺工" style="width: 100%;text-align: left;">
+                <ion-select-option v-for="(record,key) in shortAgeTypeList" :key="key"
+                                   v-model:value="record.value">
+                  {{ record.name }}
+                </ion-select-option>
+              </ion-select>
+            </div>
             <div class="form-input">
               <ion-label>法定代表人(负责人)</ion-label>
               <ion-input placeholder="请输入法定代表人" label-placement="stacked" :clear-input="true"
@@ -264,12 +269,6 @@
               </ion-select>
             </div>
             <div class="form-input">
-            <ion-label>用工情况(人)</ion-label>
-              <ion-input type="number" placeholder="请输入用工人数" label-placement="stacked" :clear-input="true"
-                         v-model="dataModel.workSituation" class="custom" @ionBlur="workSituationBlur">
-              </ion-input>
-            </div>
-            <div class="form-input">
             <ion-label>参保人数(人)</ion-label>
               <ion-input type="number" placeholder="请输入参保人数" label-placement="stacked" :clear-input="true"
                          v-model="dataModel.insuredCount" class="custom" @ionBlur="insuredCountBlur">
@@ -413,7 +412,7 @@ export default defineComponent({
         estateCategoryID: "",
         tagID:null,
         website:null,
-        companyModel: null,
+        companyModel: "",
         regionCode: null,
         streetCode: null,
         workSituation: null,
@@ -526,6 +525,28 @@ export default defineComponent({
         if(!isStringInteger(formState.dataModel.workSituation)||formState.dataModel.workSituation<1){
           presentAlert("用工情况必须为一个正整数!");
           inputValid.value = false;
+          return;
+        }
+        // 匹配企业规模
+        const workSituationRanges = [
+          {max: 19, model: 1},
+          {min: 20, max: 99, model: 2},
+          {min: 100, max: 299, model: 3},
+          {min: 300, max: 499, model: 4},
+          {min: 500, max: 999, model: 5},
+          {min: 1000, max: 9999, model: 6},
+          {min: 10000, model: 7}
+        ];
+        const workSituation = formState.dataModel.workSituation;
+        formState.dataModel.companyModel = "";  // 默认值,如果所有范围都不匹配
+        for (const range of workSituationRanges) {
+          if (
+              (range.min === undefined || workSituation >= range.min) &&
+              (range.max === undefined || workSituation <= range.max)
+          ) {
+            formState.dataModel.companyModel = range.model + "";
+            break;
+          }
         }
       }
     }
@@ -550,7 +571,7 @@ export default defineComponent({
           userName: {required},
           userMobile: {required},
           recordStatus: {required},
-          isShortage: {required},
+          workSituation: {required},
         }
       }
     });

+ 39 - 18
h5app/src/views/pages/jobUserInfo/companyEdit.vue

@@ -104,16 +104,11 @@
             </ion-select>
             <!--            <ion-note slot="error">企业状态不能为空</ion-note>-->
           </div>
-          <div class="form-select">
-            <ion-label>是否缺工<span class="danger">*</span></ion-label>
-            <ion-select id="isShortAge" name="isShortAge" cancel-text="取消"  v-model="dataModel.isShortage"
-                        interface="action-sheet" placeholder="请选择是否缺工" style="width: 100%;text-align: left;">
-              <ion-select-option v-for="(record,key) in shortAgeTypeList" :key="key"
-                                 v-model:value="record.value">
-                {{ record.name }}
-              </ion-select-option>
-            </ion-select>
-            <!--            <ion-note slot="error">是否缺工不能为空</ion-note>-->
+          <div class="form-input">
+            <ion-label>用工情况(人,含临时人员)<span class="danger">*</span></ion-label>
+            <ion-input type="number" placeholder="请输入用工人数" label-placement="stacked" :clear-input="true"
+                       v-model="dataModel.workSituation" class="custom" @ionBlur="workSituationBlur">
+            </ion-input>
           </div>
           <div class="form-title">
             其他信息
@@ -123,6 +118,16 @@
           </div>
 
           <div v-show="isShow" >
+            <div class="form-select">
+              <ion-label>是否缺工</ion-label>
+              <ion-select id="isShortAge" name="isShortAge" cancel-text="取消" v-model="dataModel.isShortage"
+                          interface="action-sheet" placeholder="请选择是否缺工" style="width: 100%;text-align: left;">
+                <ion-select-option v-for="(record,key) in shortAgeTypeList" :key="key"
+                                   v-model:value="record.value">
+                  {{ record.name }}
+                </ion-select-option>
+              </ion-select>
+            </div>
             <div class="form-input">
               <ion-label>法定代表人(负责人)</ion-label>
               <ion-input placeholder="请输入法定代表人" label-placement="stacked" :clear-input="true"
@@ -260,12 +265,6 @@
                 </ion-select-option>
               </ion-select>
             </div>
-            <div class="form-input">
-              <ion-label>用工情况(人)</ion-label>
-              <ion-input type="number" placeholder="请输入用工人数" label-placement="stacked" :clear-input="true"
-                         v-model="dataModel.workSituation" class="custom" @ionBlur="workSituationBlur">
-              </ion-input>
-            </div>
             <div class="form-input">
               <ion-label>参保人数(人)</ion-label>
               <ion-input type="number" placeholder="请输入参保人数" label-placement="stacked" :clear-input="true"
@@ -386,7 +385,7 @@ export default defineComponent({
         estateCategoryID: "",
         tagID:null,
         website:null,
-        companyModel: null,
+        companyModel: "",
         regionCode: null,
         streetCode: null,
         workSituation: null,
@@ -461,6 +460,28 @@ export default defineComponent({
         if(!isStringInteger(formState.dataModel.workSituation)||formState.dataModel.workSituation<1){
           presentAlert("用工情况必须为一个正整数!");
           inputValid.value = false;
+          return;
+        }
+        // 匹配企业规模
+        const workSituationRanges = [
+          {max: 19, model: 1},
+          {min: 20, max: 99, model: 2},
+          {min: 100, max: 299, model: 3},
+          {min: 300, max: 499, model: 4},
+          {min: 500, max: 999, model: 5},
+          {min: 1000, max: 9999, model: 6},
+          {min: 10000, model: 7}
+        ];
+        const workSituation = formState.dataModel.workSituation;
+        formState.dataModel.companyModel = "";  // 默认值,如果所有范围都不匹配
+        for (const range of workSituationRanges) {
+          if (
+              (range.min === undefined || workSituation >= range.min) &&
+              (range.max === undefined || workSituation <= range.max)
+          ) {
+            formState.dataModel.companyModel = range.model + "";
+            break;
+          }
         }
       }
     }
@@ -485,7 +506,7 @@ export default defineComponent({
           userName: {required},
           userMobile: {required},
           recordStatus: {required},
-          isShortage: {required},
+          workSituation: {required},
         }
       }
     });

+ 60 - 42
vue/src/views/companyService/company/edit.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="card-edit">
     <a-form ref="formRef" :model="dataModel" autocomplete="off" @finish="onFinish">
-      <a-divider orientation="left">企业基础信息</a-divider>
+      <a-divider orientation="left">基本信息</a-divider>
       <a-row :gutter="24">
         <a-col :span="8">
           <a-form-item
@@ -107,22 +107,23 @@
           >
             <a-input v-model:value="dataModel.userMobile" placeholder=""/>
           </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="8">
           <a-form-item
-            label="是否缺工"
-            :label-col="{ span: 8 }"
-            name="isShortage"
-            :rules="[{ required: true, message: '请选择是否缺工!' }]"
+            label="用工情况(人,含临时人员)"
+            :label-col="{ span: 10 }"
+            name="workSituation"
+            :rules="[{ required: true, message: '请输入用工人数!' }]"
           >
-            <a-select
-              ref="select"
-              v-model:value="dataModel.isShortage"
-              :options="shortageStatusList"
-              :field-names="{ label: 'name', value: 'value' }"
-            >
-            </a-select>
+            <a-input-number :min="1" style="width: 286px" :controls="false" v-model:value="dataModel.workSituation"
+                            placeholder=""
+                            @blur="workSituationChange"/>
           </a-form-item>
         </a-col>
       </a-row>
+      <a-divider orientation="left">扩展信息</a-divider>
       <a-row :gutter="24">
         <a-col :span="8">
           <a-form-item
@@ -216,23 +217,6 @@
           <!--          </a-form-item>-->
         </a-col>
       </a-row>
-      <a-row :gutter="24">
-        <a-col :span="8">
-
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item
-            label="企业福利"
-            :label-col="{ span: 24 }"
-            name="bonus"
-          >
-            <a-textarea v-model:value="dataModel.bonus" placeholder="企业福利" :rows="4"/>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-divider orientation="left">其他信息</a-divider>
       <a-row :gutter="24">
         <a-col :span="8">
           <a-form-item
@@ -341,29 +325,42 @@
         </a-col>
         <a-col :span="8">
           <a-form-item
-            label="用工情况(人)"
+            label="参保人数(人)"
             :label-col="{ span: 8 }"
-            name="workSituation"
-            :rules="[{ required: false, message: '请输入用工人数!' }]"
+            name="insuredCount"
+            :rules="[{ required: false, message: '请输入参保人数!' }]"
           >
-            <a-input-number :min="1" style="width: 100%" :controls="false" v-model:value="dataModel.workSituation"
-                            placeholder=""
-                            @blur="workSituationChange"/>
+            <a-input-number :min="0" style="width: 100%" :controls="false" v-model:value="dataModel.insuredCount"
+                            placeholder="" @blur="insuredCountChange"/>
           </a-form-item>
         </a-col>
         <a-col :span="8">
           <a-form-item
-            label="参保人数(人)"
+            label="是否缺工"
             :label-col="{ span: 8 }"
-            name="insuredCount"
-            :rules="[{ required: false, message: '请输入参保人数!' }]"
+            name="isShortage"
           >
-            <a-input-number :min="0" style="width: 100%" :controls="false" v-model:value="dataModel.insuredCount"
-                            placeholder="" @blur="insuredCountChange"/>
+            <a-select
+              ref="select"
+              v-model:value="dataModel.isShortage"
+              :options="shortageStatusList"
+              :field-names="{ label: 'name', value: 'value' }"
+            >
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item
+            label="企业福利"
+            :label-col="{ span: 24 }"
+            name="bonus"
+          >
+            <a-textarea v-model:value="dataModel.bonus" placeholder="企业福利" :rows="4"/>
           </a-form-item>
         </a-col>
       </a-row>
-
       <a-row>
         <a-col class="table-bottom-a1" span="24">
           <a-form-item :label-col="{span:24}" name="businScope" label="经营范围">
@@ -773,7 +770,28 @@ export default defineComponent(
 
       function workSituationChange() {
         if (formState.dataModel.workSituation) {
-          formState.dataModel.workSituation = Math.floor(formState.dataModel.workSituation)
+          formState.dataModel.workSituation = Math.floor(formState.dataModel.workSituation);
+          // 匹配企业规模
+          const workSituationRanges = [
+            {max: 19, model: 1},
+            {min: 20, max: 99, model: 2},
+            {min: 100, max: 299, model: 3},
+            {min: 300, max: 499, model: 4},
+            {min: 500, max: 999, model: 5},
+            {min: 1000, max: 9999, model: 6},
+            {min: 10000, model: 7}
+          ];
+          const workSituation = formState.dataModel.workSituation;
+          formState.dataModel.companyModel = 1;  // 默认值,如果所有范围都不匹配
+          for (const range of workSituationRanges) {
+            if (
+              (range.min === undefined || workSituation >= range.min) &&
+              (range.max === undefined || workSituation <= range.max)
+            ) {
+              formState.dataModel.companyModel = range.model;
+              break;
+            }
+          }
         }
       }