Browse Source

修改bug

Jing 6 days ago
parent
commit
2751d744f8
1 changed files with 12 additions and 6 deletions
  1. 12 6
      src/views/news/addJobHunting.vue

+ 12 - 6
src/views/news/addJobHunting.vue

@@ -539,7 +539,7 @@ export default {
             if (res.data) {
               const nodes = res.data.map(item => ({
                 value: item.id,
-                label: item.name,
+                label: item.alias,
                 leaf: level >= 3,
                 disabled: item.type != 3,
                 children: []
@@ -882,11 +882,18 @@ export default {
         id: this.$route.query.id
       };
       this.$store.dispatch('news/getJobHuntingInfo', data).then(res => {
-        console.log(res);
-
+        console.log('res', res);
+        // this.form.web_site_id = res.data.website_id;
+        if (typeof res.data.website_id === 'string') {
+          this.form.web_site_id = Number(res.data.website_id);
+        } else {
+          this.form.web_site_id = res.data.website_id//站点名称
+        }
         this.form.cat_arr_id = Array.isArray(res.data.cat_arr_id) ? res.data.cat_arr_id : JSON.parse(res.data.cat_arr_id);
         this.parentKey += 1; // 触发级联选择器重新加载
-        // this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
+        this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
+        this.parentKey_2 += 1; // 触发级联选择器重新加载
+        this.loadCascaderPath(this.form.cat_arr_id); // 加载路径数据
 
         this.form.name = res.data.name;
         this.form.sexy = res.data.sexy;
@@ -928,7 +935,6 @@ export default {
         this.form.content = res.data.content;
         this.form.imgUrl = res.data.imgurl;
         this.imgUrl = res.data.imgurl;
-        this.form.web_site_id = res.data.website_id;
         this.form.jobtime = res.data.jobtime ? new Date(res.data.jobtime) : '';
         this.form.birth = res.data.birth ? new Date(res.data.birth) : '';
         this.form.origin = res.data.origin;
@@ -937,7 +943,7 @@ export default {
         // console.log(this.form.job_experience, '-----------------this.form.job_experience----------------------')
         this.form.education_experience = JSON.parse(res.data.education_experience);
         this.form.skillList = JSON.parse(res.data.skillList);
-        this.form.job_name_get = res.data.job_name_get == null ? '' : parseInt(res.data.job_name_get);
+        this.form.job_name_get = res.data.job_name_get == null || res.data.job_name_get == '' ? '' : parseInt(res.data.job_name_get);
 
       }).catch(() => {
         this.$message({