瀏覽代碼

feat: 企业所属行业与产业类别关联

zhangying 9 月之前
父節點
當前提交
86ad2b6da3

+ 15 - 1
h5app/src/views/pages/company/edit.vue

@@ -410,7 +410,7 @@ export default defineComponent({
         companyType: null,
         industryID:null,
         industryName:null,
-        estateCategoryID:null,
+        estateCategoryID: "",
         tagID:null,
         website:null,
         companyModel: null,
@@ -668,6 +668,20 @@ export default defineComponent({
     const onSetIndustryID = (data: any)=>{
       formState.dataModel.industryID = data.value;
       formState.dataModel.industryName = data.text;
+      const text = data.text.split("-")[0] as string;
+      // 所属产业判断
+      const categoryMap: { [key: string]: any } = {
+        '农、林、牧、渔业': 1,
+        '采矿业': 2,
+        '制造业': 2,
+        '电力、热力、燃气及水生产和供应业': 2,
+        '建筑业': 2
+      };
+      if (text) {
+        formState.dataModel.estateCategoryID = categoryMap[text] || 3;
+      } else {
+        formState.dataModel.estateCategoryID = "3";
+      }
     }
 
     const inputValid = ref(true);

+ 15 - 1
h5app/src/views/pages/jobUserInfo/companyEdit.vue

@@ -383,7 +383,7 @@ export default defineComponent({
         companyType: null,
         industryID:null,
         industryName:null,
-        estateCategoryID:null,
+        estateCategoryID: "",
         tagID:null,
         website:null,
         companyModel: null,
@@ -604,6 +604,20 @@ export default defineComponent({
     const onSetIndustryID = (data: any)=>{
       formState.dataModel.industryID = data.value;
       formState.dataModel.industryName = data.text;
+      const text = data.text.split("-")[0] as string;
+      // 所属产业判断
+      const categoryMap: { [key: string]: any } = {
+        '农、林、牧、渔业': 1,
+        '采矿业': 2,
+        '制造业': 2,
+        '电力、热力、燃气及水生产和供应业': 2,
+        '建筑业': 2
+      };
+      if (text) {
+        formState.dataModel.estateCategoryID = categoryMap[text] || 3;
+      } else {
+        formState.dataModel.estateCategoryID = "3";
+      }
     }
 
     const inputValid = ref(true);

+ 14 - 0
vue/src/views/companyService/company/edit.vue

@@ -697,6 +697,20 @@ export default defineComponent(
         if (value.length >= 2) {
           formState.dataModel.industryName = selectedOptions[1].label;
         }
+        // 所属产业判断
+        const categoryMap = {
+          '农、林、牧、渔业': 1,
+          '采矿业': 2,
+          '制造业': 2,
+          '电力、热力、燃气及水生产和供应业': 2,
+          '建筑业': 2
+        };
+        if (selectedOptions[0]) {
+          formState.dataModel.estateCategoryID = categoryMap[selectedOptions[0].label] || 3;
+        } else {
+          formState.dataModel.estateCategoryID = 3;
+        }
+
       }
 
       // 同步获取企业信息