Browse Source

app-【企业所属行业】级联组件调整

liao-sea 10 months ago
parent
commit
36ab868388

+ 18 - 8
h5app/src/components/industrySelection.vue

@@ -139,11 +139,12 @@ ion-segment-button {
 <script lang="ts">
 import {defineComponent, reactive, ref} from 'vue';
 import {getAllIndustryList} from "@/api/recommendmgt";
+import {onIonViewDidEnter} from "@ionic/vue";
 
 export default defineComponent({
   name: "industrySelection",
   props: {
-    CurIndustryID: {type: String, default: ''},
+    IndustryId: {type: String, default: ''},
   },
   setup(props, context) {
     const selectType = {
@@ -170,27 +171,36 @@ export default defineComponent({
         industryId: '',
         industryList: [] as any
       }]);
-    const selectIndustryInfo = reactive({value: '', text: ''})
+    const selectIndustryInfo = reactive({value: '', text: ''});
     const allIndustryList = ref();
 
     const loadIndustryID = () => {
       getAllIndustryList().then(data => {
         allIndustryList.value = data;
-        if (!props.CurIndustryID) {
-          selectIndustryInfo.value = ""
-          selectIndustryInfo.text = ""
+        if (!props.IndustryId) {
+          selectIndustryInfo.text='';
+          selectIndustryInfo.value='';
           selectModelList[selectType.one].isSelect = true;
           selectModelList[selectType.one].disabled = false;
-          selectModelList[selectType.one].industryName = ''
-          selectModelList[selectType.one].industryId = ''
+          selectModelList[selectType.one].industryName = '';
+          selectModelList[selectType.one].industryId = '';
           selectModelList[selectType.one].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "1")
               .map((x: any) => ({
                 ...x,
                 isSelect: false
               }));
+          selectModelList[selectType.two].isSelect = false;
+          selectModelList[selectType.two].disabled = false;
+          selectModelList[selectType.two].industryName = '';
+          selectModelList[selectType.two].industryId = '';
+          selectModelList[selectType.two].industryList = allIndustryList.value.filter((x: any) => x.industryLevel == "2")
+              .map((x: any) => ({
+                ...x,
+                isSelect: false
+              }));
         }
         else {
-          const twoInfo = allIndustryList.value.find((x: any) => x.industryLevel == "2" && x.industryId == props.CurIndustryID);
+          const twoInfo = allIndustryList.value.find((x: any) => x.industryLevel == "2" && x.industryId == props.IndustryId);
           const oneInfo = allIndustryList.value.find((x: any) => x.industryLevel == "1" && x.industryId == twoInfo.parentId);
 
           selectModelList[selectType.one].isSelect = false;

+ 6 - 6
h5app/src/components/ocCategorySelection.vue

@@ -179,8 +179,8 @@ export default defineComponent({
         if (!props.OccupationalID) {
           selectModelList[selectType.one].isSelect = true;
           selectModelList[selectType.one].disabled = false;
-          selectModelList[selectType.one].occupationalName = ''
-          selectModelList[selectType.one].occupationalID = ''
+          selectModelList[selectType.one].occupationalName = '';
+          selectModelList[selectType.one].occupationalID = '';
           selectModelList[selectType.one].occupationList = occupationalCategoryList.value.filter((x: any) => x.occupationalLevel == "1")
               .map((x: any) => ({
                 ...x,
@@ -222,10 +222,10 @@ export default defineComponent({
     const onSelectType = (type: number) => {
       if (selectType.one == type) {
         selectModelList.map(x => {
-          x.isSelect = false
-          x.disabled = true
-          x.occupationalName = ''
-          x.occupationalID = ''
+          x.isSelect = false,
+          x.disabled = true,
+          x.occupationalName = '',
+          x.occupationalID = '',
           x.occupationList = []
         });
 

+ 6 - 6
h5app/src/components/postSelection.vue

@@ -198,8 +198,8 @@ export default defineComponent({
         if (!props.ProfessionID) {
           selectModelList[selectType.one].isSelect = true;
           selectModelList[selectType.one].disabled = false;
-          selectModelList[selectType.one].professionName = ''
-          selectModelList[selectType.one].professionID = ''
+          selectModelList[selectType.one].professionName = '';
+          selectModelList[selectType.one].professionID = '';
           selectModelList[selectType.one].professionList = professionLevelList.value.filter((x: any) => x.professionLevel == "1")
               .map((x: any) => ({
                 ...x,
@@ -253,10 +253,10 @@ export default defineComponent({
     const onSelectType = (type: number) => {
       if (selectType.one == type) {
         selectModelList.map(x => {
-          x.isSelect = false
-          x.disabled = true
-          x.professionName = ''
-          x.professionID = ''
+          x.isSelect = false,
+          x.disabled = true,
+          x.professionName = '',
+          x.professionID = '',
           x.professionList = []
         });
 

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

@@ -195,7 +195,7 @@
                            v-model="dataModel.industryName" class="custom" readonly >
                 </ion-input>
                 <ion-item style="width:22%;float: right;padding:0px;margin: 0px;">
-                  <industry-selection  :CurIndustryID="dataModel.industryID" @SetIndustryID="onSetIndustryID"></industry-selection>
+                  <industry-selection  :IndustryId="dataModel.industryID" @SetIndustryID="onSetIndustryID"></industry-selection>
                 </ion-item>
               </div>
 

+ 3 - 2
h5app/src/views/pages/jobUserInfo/companyEdit.vue

@@ -186,14 +186,14 @@
                 </ion-select-option>
               </ion-select>
             </div>
-            <div class="form-select">
+            <div class="form-input">
               <ion-label>所属行业</ion-label>
               <div>
                 <ion-input placeholder="请选择所属行业" label-placement="stacked" style="float: left;width:78%;"
                            v-model="dataModel.industryName" class="custom" readonly >
                 </ion-input>
                 <ion-item style="width:22%;float: right;padding:0px;margin: 0px;">
-                  <industry-selection  :CurIndustryID="dataModel.industryID" @SetIndustryID="onSetIndustryID"></industry-selection>
+                  <industry-selection  :IndustryId="dataModel.industryID" @SetIndustryID="onSetIndustryID"></industry-selection>
                 </ion-item>
               </div>
 <!--              <ion-select interface="action-sheet" placeholder="请选择所属行业" cancel-text="取消"-->
@@ -313,6 +313,7 @@ interface StepParams{
 }
 export default defineComponent({
   name: "companyInfoEdit",
+  components:{IndustrySelection},
   setup() {
     const route = useRoute();
     const router = useRouter();