guhongwei 4 anni fa
parent
commit
ddb1562831

+ 29 - 5
src/layout/personnel/adviserLists.vue

@@ -6,7 +6,7 @@
           {{ columnName }}
         </el-col>
         <el-col :span="24">
-          <el-table :data="recruitData" style="width: 100%" border>
+          <el-table :data="list" style="width: 100%" border>
             <el-table-column label="名称" align="center">
               <template slot-scope="scoped">
                 <el-tooltip effect="dark" content="点击显示详情" placement="left">
@@ -17,6 +17,16 @@
             <el-table-column prop="infotype" label="信息类型" align="center"> </el-table-column>
             <el-table-column prop="user_name" label="发布人" align="center"> </el-table-column>
           </el-table>
+          <el-col class="page" :span="24">
+            <el-pagination
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              layout="total, prev, pager, next, jumper"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -24,6 +34,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'recruitLists',
   props: {
@@ -34,20 +45,33 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 12,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
     },
     clickDetailcm(row) {
       this.$emit('detailcm', { data: row });
     },
   },
+  watch: {
+    recruitData: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
 };
 </script>
 

+ 16 - 3
src/layout/personnel/context.vue

@@ -2,7 +2,12 @@
   <div id="rightcont">
     <el-row>
       <el-col :span="24" class="top">
-        <span>招聘信息</span>
+        <el-col :span="12" class="txt">
+          <span>{{ policyInfo.name }}</span>
+        </el-col>
+        <el-col :span="12" class="btn">
+          <el-button type="primary" size="mini" @click="back()">返回</el-button>
+        </el-col>
       </el-col>
       <el-col :span="24" class="info">
         <p>信用代码:{{ policyInfo.license }}</p>
@@ -30,7 +35,11 @@ export default {
   data: () => ({}),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    back() {
+      history.back(-1);
+    },
+  },
 };
 </script>
 
@@ -44,12 +53,16 @@ p {
   line-height: 60px;
   border-bottom: 1px solid #215299;
 }
-.top span {
+.top .txt span {
   display: inline-block;
   padding: 0 30px;
   background-color: #215299;
   color: #fff;
 }
+.top .btn {
+  text-align: right;
+  padding: 0 10px;
+}
 .info {
   padding: 20px;
 }

+ 28 - 6
src/layout/personnel/contextcm.vue

@@ -2,8 +2,13 @@
   <div id="policyrightcont">
     <el-row>
       <el-col :span="24" class="info">
-        <el-col :span="24" class="topInfo">
-          <span> {{ policyInfo.name }}</span>
+        <el-col :span="24" class="top">
+          <el-col :span="12" class="txt">
+            <span> {{ policyInfo.name }}</span>
+          </el-col>
+          <el-col :span="12" class="btn">
+            <el-button type="primary" size="mini" @click="back()">返回</el-button>
+          </el-col>
         </el-col>
         <el-col :span="24" class="infoMess">
           <el-col :span="24" class="title">
@@ -39,7 +44,11 @@ export default {
   data: () => ({}),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    back() {
+      history.back(-1);
+    },
+  },
 };
 </script>
 
@@ -50,14 +59,27 @@ p {
 }
 .info {
   min-height: 800px;
-  padding: 0 20px;
   background-color: #fff;
 }
-.topInfo {
+.top {
   height: 60px;
   line-height: 60px;
-  font-size: 22px;
+  border-bottom: 1px solid #215299;
+}
+.top .txt span {
+  display: inline-block;
+  padding: 0 30px;
+  background-color: #215299;
+  color: #fff;
 }
+.top .btn {
+  text-align: right;
+  padding: 0 10px;
+}
+.infoMess {
+  padding: 0 20px;
+}
+
 .infoMess .title {
   line-height: 30px;
   text-align: center;

+ 29 - 5
src/layout/personnel/diligenceLists.vue

@@ -6,7 +6,7 @@
           {{ columnName }}
         </el-col>
         <el-col :span="24">
-          <el-table :data="recruitData" style="width: 100%" border>
+          <el-table :data="list" style="width: 100%" border>
             <el-table-column label="名称" align="center">
               <template slot-scope="scoped">
                 <el-tooltip effect="dark" content="点击显示详情" placement="left">
@@ -17,6 +17,16 @@
             <el-table-column prop="infotype" label="信息类型" align="center"> </el-table-column>
             <el-table-column prop="user_name" label="发布人" align="center"> </el-table-column>
           </el-table>
+          <el-col class="page" :span="24">
+            <el-pagination
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              layout="total, prev, pager, next, jumper"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -24,6 +34,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'recruitLists',
   props: {
@@ -34,20 +45,33 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 12,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
     },
     clickDetailcm(row) {
       this.$emit('detailcm', { data: row });
     },
   },
+  watch: {
+    recruitData: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
 };
 </script>
 

+ 29 - 5
src/layout/personnel/guidanceLists.vue

@@ -6,7 +6,7 @@
           {{ columnName }}
         </el-col>
         <el-col :span="24">
-          <el-table :data="recruitData" style="width: 100%" border>
+          <el-table :data="list" style="width: 100%" border>
             <el-table-column label="名称" align="center">
               <template slot-scope="scoped">
                 <el-tooltip effect="dark" content="点击显示详情" placement="left">
@@ -17,6 +17,16 @@
             <el-table-column prop="infotype" label="信息类型" align="center"> </el-table-column>
             <el-table-column prop="user_name" label="发布人" align="center"> </el-table-column>
           </el-table>
+          <el-col class="page" :span="24">
+            <el-pagination
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              layout="total, prev, pager, next, jumper"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -24,6 +34,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'recruitLists',
   props: {
@@ -34,20 +45,33 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 12,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
     },
     clickDetailcm(row) {
       this.$emit('detailcm', { data: row });
     },
   },
+  watch: {
+    recruitData: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
 };
 </script>
 

+ 29 - 5
src/layout/personnel/practiceLists.vue

@@ -6,7 +6,7 @@
           {{ columnName }}
         </el-col>
         <el-col :span="24">
-          <el-table :data="recruitData" style="width: 100%" border>
+          <el-table :data="list" style="width: 100%" border>
             <el-table-column label="名称" align="center">
               <template slot-scope="scoped">
                 <el-tooltip effect="dark" content="点击显示详情" placement="left">
@@ -17,6 +17,16 @@
             <el-table-column prop="infotype" label="信息类型" align="center"> </el-table-column>
             <el-table-column prop="user_name" label="发布人" align="center"> </el-table-column>
           </el-table>
+          <el-col class="page" :span="24">
+            <el-pagination
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              layout="total, prev, pager, next, jumper"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -24,6 +34,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'recruitLists',
   props: {
@@ -34,20 +45,33 @@ export default {
   components: {},
   data: () => ({
     currentPage: 1,
+    pageSize: 12,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
     },
     clickDetailcm(row) {
       this.$emit('detailcm', { data: row });
     },
   },
+  watch: {
+    recruitData: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
 };
 </script>
 

+ 21 - 7
src/layout/personnel/recruitList.vue

@@ -6,7 +6,7 @@
           <el-col :span="20" class="left">{{ title }}</el-col>
         </el-col>
         <el-col :span="24" class="list">
-          <el-table :data="recruitData" stripe style="width: 100%">
+          <el-table :data="list" stripe style="width: 100%">
             <el-table-column prop="title" label="招聘信息名称a" align="center" :show-overflow-tooltip="true"> </el-table-column>
             <el-table-column prop="company" label="公司名称" align="center" :show-overflow-tooltip="true"> </el-table-column>
             <el-table-column prop="address" label="工作地点" align="center" :show-overflow-tooltip="true"> </el-table-column>
@@ -18,11 +18,11 @@
           </el-table>
           <el-col :span="24" class="page">
             <el-pagination
-              @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
               :current-page="currentPage"
               layout="total, prev, pager, next, jumper"
-              :total="1"
+              :total="total"
+              :page-size="pageSize"
             >
             </el-pagination>
           </el-col>
@@ -33,6 +33,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'recruitList',
   props: {
@@ -42,15 +43,28 @@ export default {
   data: () => ({
     title: '招聘信息',
     currentPage: 1,
+    pageSize: 12,
+    origin: [],
+    list: [],
   }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+  },
+  watch: {
+    recruitData: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
     },
   },
 };

+ 19 - 8
src/layout/personnel/recruitLists.vue

@@ -6,7 +6,7 @@
           {{ columnName }}
         </el-col>
         <el-col :span="24" class="info">
-          <el-table :data="recruitData" style="width: 100%" border>
+          <el-table :data="list" style="width: 100%" border>
             <el-table-column label="招聘信息名称" align="center" :show-overflow-tooltip="true">
               <template slot-scope="scoped">
                 <el-tooltip effect="dark" content="点击显示详情" placement="left">
@@ -23,11 +23,11 @@
 
         <el-col class="page" :span="24">
           <el-pagination
-            @size-change="handleSizeChange"
             @current-change="handleCurrentChange"
             :current-page="currentPage"
-            layout="total,  prev, pager, next, jumper"
+            layout="total, prev, pager, next, jumper"
             :total="total"
+            :page-size="pageSize"
           >
           </el-pagination>
         </el-col>
@@ -37,6 +37,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'recruitLists',
   props: {
@@ -45,20 +46,30 @@ export default {
     total: null,
   },
   components: {},
-  data: () => ({ currentPage: 1 }),
+  data: () => ({ currentPage: 1, pageSize: 12, origin: [], list: [] }),
   created() {},
   computed: {},
   methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
     },
     clickDetailcm(row) {
       this.$emit('detailcm', { data: row });
     },
   },
+  watch: {
+    recruitData: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
 };
 </script>
 

+ 30 - 35
src/views/personnel/adviserList.vue

@@ -25,63 +25,58 @@ export default {
     adviserListDetail,
   },
   data: () => ({
+    // 站点信息
     info: {},
+    // 栏目列表
     liebiaoList: [],
+    // 右侧信息头部标题
     columnName: '',
+    // 右侧信息列表
     recruitData: [],
+    total: 0,
   }),
-  created() {
-    this.searchSite();
-    this.searchColumn();
-    this.searchName();
-    this.searchList();
+  async created() {
+    await this.search();
+    await this.searchList();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
   },
-  computed: {},
   methods: {
     ...mapSite(['showInfo']),
     ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
     ...mapRecruit({ recruitList: 'query' }),
-    // 查询站点信息
-    async searchSite() {
+    // 查询站点信息+栏目列表
+    async search({ ...info } = {}) {
       let res = await this.showInfo();
       let object = JSON.parse(JSON.stringify(res.data));
       if (object) {
         this.$set(this, `info`, res.data);
-      } else {
-        this.$message.error(res.errmsg ? res.errmsg : 'error');
       }
-    },
-    // 查询科技政务栏目
-    async searchColumn({ ...info } = {}) {
-      const res = await this.columnList({ ...info });
+      res = await this.columnList({ ...info });
       this.$set(this, `liebiaoList`, res.data);
     },
-    async onsaveClick({ id }) {
-      const res = await this.columnInfo(id);
-      if (res.data.site === 'zpxx') {
-        this.$router.push({ path: '/personnel/recruitList', query: { id: res.data.id } });
-      } else if (res.data.site === 'gzgw') {
-        this.$router.push({ path: '/personnel/guidanceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'qgjx') {
-        this.$router.push({ path: '/personnel/practiceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'xxsj') {
-        this.$router.push({ path: '/personnel/diligenceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'jyzd') {
-        this.$router.push({ path: '/personnel/adviserList', query: { id: res.data.id } });
-      }
-    },
-    async searchName() {
-      let nameId = this.$route.query.id;
-      const res = await this.columnInfo(nameId);
-      this.$set(this, `columnName`, res.data.name);
-    },
+    // 查询右侧信息列表
     async searchList({ skip = 0, limit = 10, column_id } = {}) {
-      const res = await this.recruitList({ skip, limit, column_id: this.$route.query.id });
+      const res = await this.recruitList({ column_id: this.id });
+      let column = this.liebiaoList.find(i => i.id == this.id);
       if (this.$checkRes(res)) {
         this.$set(this, `recruitData`, res.data);
-        console.log(res.data);
+        this.$set(this, `total`, res.total);
+        this.$set(this, `columnName`, column.name);
       }
     },
+    // 点击左侧切换栏目
+    async onsaveClick({ id }) {
+      let column = this.liebiaoList.find(i => i.id == id);
+      if (column.site === 'zpxx') this.$router.push({ path: '/personnel/recruitList', query: { id: column.id } });
+      if (column.site === 'gzgw') this.$router.push({ path: '/personnel/guidanceList', query: { id: column.id } });
+      if (column.site === 'qgjx') this.$router.push({ path: '/personnel/practiceList', query: { id: column.id } });
+      if (column.site === 'xxsj') this.$router.push({ path: '/personnel/diligenceList', query: { id: column.id } });
+      if (column.site === 'jyzd') this.$router.push({ path: '/personnel/adviserList', query: { id: column.id } });
+    },
     clickDetailcm({ data }) {
       this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
     },

+ 30 - 36
src/views/personnel/diligenceList.vue

@@ -25,64 +25,58 @@ export default {
     diligenceListDetail,
   },
   data: () => ({
-    total: 1,
+    // 站点信息
     info: {},
+    // 栏目列表
     liebiaoList: [],
+    // 右侧信息头部标题
     columnName: '',
+    // 右侧信息列表
     recruitData: [],
+    total: 0,
   }),
-  created() {
-    this.searchSite();
-    this.searchColumn();
-    this.searchName();
-    this.searchList();
+  async created() {
+    await this.search();
+    await this.searchList();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
   },
-  computed: {},
   methods: {
     ...mapSite(['showInfo']),
     ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
     ...mapRecruit({ recruitList: 'query' }),
-    // 查询站点信息
-    async searchSite() {
+    // 查询站点信息+栏目列表
+    async search({ ...info } = {}) {
       let res = await this.showInfo();
       let object = JSON.parse(JSON.stringify(res.data));
       if (object) {
         this.$set(this, `info`, res.data);
-      } else {
-        this.$message.error(res.errmsg ? res.errmsg : 'error');
       }
-    },
-    // 查询科技政务栏目
-    async searchColumn({ ...info } = {}) {
-      const res = await this.columnList({ ...info });
+      res = await this.columnList({ ...info });
       this.$set(this, `liebiaoList`, res.data);
     },
-    async onsaveClick({ id }) {
-      const res = await this.columnInfo(id);
-      if (res.data.site === 'zpxx') {
-        this.$router.push({ path: '/personnel/recruitList', query: { id: res.data.id } });
-      } else if (res.data.site === 'gzgw') {
-        this.$router.push({ path: '/personnel/guidanceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'qgjx') {
-        this.$router.push({ path: '/personnel/practiceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'xxsj') {
-        this.$router.push({ path: '/personnel/diligenceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'jyzd') {
-        this.$router.push({ path: '/personnel/adviserList', query: { id: res.data.id } });
-      }
-    },
-    async searchName() {
-      let nameId = this.$route.query.id;
-      const res = await this.columnInfo(nameId);
-      this.$set(this, `columnName`, res.data.name);
-    },
+    // 查询右侧信息列表
     async searchList({ skip = 0, limit = 10, column_id } = {}) {
-      const res = await this.recruitList({ skip, limit, column_id: this.$route.query.id });
+      const res = await this.recruitList({ column_id: this.id });
+      let column = this.liebiaoList.find(i => i.id == this.id);
       if (this.$checkRes(res)) {
         this.$set(this, `recruitData`, res.data);
-        console.log(res.data);
+        this.$set(this, `total`, res.total);
+        this.$set(this, `columnName`, column.name);
       }
     },
+    // 点击左侧切换栏目
+    async onsaveClick({ id }) {
+      let column = this.liebiaoList.find(i => i.id == id);
+      if (column.site === 'zpxx') this.$router.push({ path: '/personnel/recruitList', query: { id: column.id } });
+      if (column.site === 'gzgw') this.$router.push({ path: '/personnel/guidanceList', query: { id: column.id } });
+      if (column.site === 'qgjx') this.$router.push({ path: '/personnel/practiceList', query: { id: column.id } });
+      if (column.site === 'xxsj') this.$router.push({ path: '/personnel/diligenceList', query: { id: column.id } });
+      if (column.site === 'jyzd') this.$router.push({ path: '/personnel/adviserList', query: { id: column.id } });
+    },
     clickDetailcm({ data }) {
       this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
     },

+ 30 - 36
src/views/personnel/guidanceList.vue

@@ -25,64 +25,58 @@ export default {
     guidanceListDetail,
   },
   data: () => ({
-    total: 1,
+    // 站点信息
     info: {},
+    // 栏目列表
     liebiaoList: [],
+    // 右侧信息头部标题
     columnName: '',
+    // 右侧信息列表
     recruitData: [],
+    total: 0,
   }),
-  created() {
-    this.searchSite();
-    this.searchColumn();
-    this.searchName();
-    this.searchList();
+  async created() {
+    await this.search();
+    await this.searchList();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
   },
-  computed: {},
   methods: {
     ...mapSite(['showInfo']),
     ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
     ...mapRecruit({ recruitList: 'query' }),
-    // 查询站点信息
-    async searchSite() {
+    // 查询站点信息+栏目列表
+    async search({ ...info } = {}) {
       let res = await this.showInfo();
       let object = JSON.parse(JSON.stringify(res.data));
       if (object) {
         this.$set(this, `info`, res.data);
-      } else {
-        this.$message.error(res.errmsg ? res.errmsg : 'error');
       }
-    },
-    // 查询科技政务栏目
-    async searchColumn({ ...info } = {}) {
-      const res = await this.columnList({ ...info });
+      res = await this.columnList({ ...info });
       this.$set(this, `liebiaoList`, res.data);
     },
-    async onsaveClick({ id }) {
-      const res = await this.columnInfo(id);
-      if (res.data.site === 'zpxx') {
-        this.$router.push({ path: '/personnel/recruitList', query: { id: res.data.id } });
-      } else if (res.data.site === 'gzgw') {
-        this.$router.push({ path: '/personnel/guidanceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'qgjx') {
-        this.$router.push({ path: '/personnel/practiceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'xxsj') {
-        this.$router.push({ path: '/personnel/diligenceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'jyzd') {
-        this.$router.push({ path: '/personnel/adviserList', query: { id: res.data.id } });
-      }
-    },
-    async searchName() {
-      let nameId = this.$route.query.id;
-      const res = await this.columnInfo(nameId);
-      this.$set(this, `columnName`, res.data.name);
-    },
+    // 查询右侧信息列表
     async searchList({ skip = 0, limit = 10, column_id } = {}) {
-      const res = await this.recruitList({ skip, limit, column_id: this.$route.query.id });
+      const res = await this.recruitList({ column_id: this.id });
+      let column = this.liebiaoList.find(i => i.id == this.id);
       if (this.$checkRes(res)) {
         this.$set(this, `recruitData`, res.data);
-        console.log(res.data);
+        this.$set(this, `total`, res.total);
+        this.$set(this, `columnName`, column.name);
       }
     },
+    // 点击左侧切换栏目
+    async onsaveClick({ id }) {
+      let column = this.liebiaoList.find(i => i.id == id);
+      if (column.site === 'zpxx') this.$router.push({ path: '/personnel/recruitList', query: { id: column.id } });
+      if (column.site === 'gzgw') this.$router.push({ path: '/personnel/guidanceList', query: { id: column.id } });
+      if (column.site === 'qgjx') this.$router.push({ path: '/personnel/practiceList', query: { id: column.id } });
+      if (column.site === 'xxsj') this.$router.push({ path: '/personnel/diligenceList', query: { id: column.id } });
+      if (column.site === 'jyzd') this.$router.push({ path: '/personnel/adviserList', query: { id: column.id } });
+    },
     clickDetailcm({ data }) {
       this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
     },

+ 28 - 72
src/views/personnel/personnel.vue

@@ -41,9 +41,11 @@ export default {
     liebiaoList: [],
     // 人才
     rencaiData: [],
-
+    // 工作
     jobsData: [],
+    // 专家
     zhuanjiaData: [],
+    // 参谋
     canmoData: [],
     messList: [
       {
@@ -71,7 +73,6 @@ export default {
         title: '标题',
       },
     ],
-    canmouId: '',
   }),
   async created() {
     await this.search();
@@ -85,13 +86,6 @@ export default {
     ...mapxinxi({ xinxiList: 'query', xinxiInfo: 'fetch' }),
     ...mapzhuanjia({ zhuanjiaList: 'query', zhuanjiaInfo: 'fetch' }),
     ...mapcanmou({ canmouList: 'query', canmouInfo: 'fetch' }),
-
-    clickDetail() {},
-    clickDetailgz() {},
-    clickDetailzj() {},
-    clickDetailcm() {},
-    onsaveClick() {},
-
     //  查询站点信息+栏目信息
     async search({ ...info } = {}) {
       let res = await this.showInfo();
@@ -126,69 +120,31 @@ export default {
         this.$set(this, `canmoData`, res.data);
       }
     },
-    // async onsaveClick({ id }) {
-    //   const res = await this.columnInfo(id);
-    //   if (res.data.site === 'zpxx') {
-    //     this.$router.push({ path: '/personnel/recruitList', query: { id: res.data.id } });
-    //   } else if (res.data.site === 'gzgw') {
-    //     this.$router.push({ path: '/personnel/guidanceList', query: { id: res.data.id } });
-    //   } else if (res.data.site === 'qgjx') {
-    //     this.$router.push({ path: '/personnel/practiceList', query: { id: res.data.id } });
-    //   } else if (res.data.site === 'xxsj') {
-    //     this.$router.push({ path: '/personnel/diligenceList', query: { id: res.data.id } });
-    //   } else if (res.data.site === 'jyzd') {
-    //     this.$router.push({ path: '/personnel/adviserList', query: { id: res.data.id } });
-    //   }
-    // },
-    // // 人才详情
-    // clickDetail({ data }) {
-    //   this.$router.push({ path: '/personnel/rencai', query: { id: data.id } });
-    // },
-    // // 工作详情
-    // clickDetailgz({ data }) {
-    //   this.$router.push({ path: '/personnel/personnelwork', query: { id: data.id } });
-    // },
-    // // 专家详情
-    // clickDetailzj({ data }) {
-    //   this.$router.push({ path: '/personnel/personnelexpert', query: { id: data.id } });
-    // },
-    // // 参谋详情
-    // clickDetailcm({ data }) {
-    //   this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
-    // },
-    // // 查询
-    // async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
-    //   // 人才
-    //   const res = await this.newsList({ skip, limit, ...info });
-    //   if (this.$checkRes(res)) {
-    //     this.$set(this, `rencaiData`, res.data);
-    //     this.$set(this, `rencaiShowList`, res.data);
-    //   }
-    //   // 工作
-    //   const resJob = await this.xinxiList({ skip, limit, ...info });
-    //   if (this.$checkRes(resJob)) {
-    //     this.$set(this, `jobsData`, resJob.data);
-    //   }
-    //   // 专家
-    //   const resZhuanjia = await this.zhuanjiaList({ skip, limit, ...info });
-    //   if (this.$checkRes(resZhuanjia)) {
-    //     // this.$set(this, `zhuanjiaData`, resZhuanjia.data);
-    //   }
-    //   //找参谋
-    //   const rescanmou = await this.columnList({ ...info });
-    //   for (const val of rescanmou.data) {
-    //     if (val.site === 'jyzd') {
-    //       this.$set(this, `canmouId`, val.id);
-    //       this.searchCanmou();
-    //     }
-    //   }
-    // },
-    // async searchCanmou({ skip = 0, limit = 10, column_id } = {}) {
-    //   const res = await this.canmouList({ skip, limit, column_id: this.canmouId });
-    //   if (this.$checkRes(res)) {
-    //     this.$set(this, `canmoData`, res.data);
-    //   }
-    // },
+    // 科技人才-栏目点击
+    async onsaveClick({ id }) {
+      let column = this.liebiaoList.find(i => i.id == id);
+      if (column.site === 'zpxx') this.$router.push({ path: '/personnel/recruitList', query: { id: column.id } });
+      if (column.site === 'gzgw') this.$router.push({ path: '/personnel/guidanceList', query: { id: column.id } });
+      if (column.site === 'qgjx') this.$router.push({ path: '/personnel/practiceList', query: { id: column.id } });
+      if (column.site === 'xxsj') this.$router.push({ path: '/personnel/diligenceList', query: { id: column.id } });
+      if (column.site === 'jyzd') this.$router.push({ path: '/personnel/adviserList', query: { id: column.id } });
+    },
+    // 人才详情
+    clickDetail({ data }) {
+      this.$router.push({ path: '/personnel/rencai', query: { id: data.id } });
+    },
+    // 工作详情
+    clickDetailgz({ data }) {
+      this.$router.push({ path: '/personnel/personnelwork', query: { id: data.id } });
+    },
+    // 专家详情
+    clickDetailzj({ data }) {
+      this.$router.push({ path: '/personnel/personnelexpert', query: { id: data.id } });
+    },
+    // 参谋详情
+    clickDetailcm({ data }) {
+      this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
+    },
   },
 };
 </script>

+ 31 - 36
src/views/personnel/practiceList.vue

@@ -25,64 +25,59 @@ export default {
     practiceListDetail,
   },
   data: () => ({
+    // 站点信息
     info: {},
+    // 栏目列表
     liebiaoList: [],
+    // 右侧信息头部标题
     columnName: '',
+    // 右侧信息列表
     recruitData: [],
-    total: 1,
+    total: 0,
   }),
-  created() {
-    this.searchSite();
-    this.searchColumn();
-    this.searchName();
-    this.searchList();
+  async created() {
+    await this.search();
+    await this.searchList();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
   },
-  computed: {},
   methods: {
     ...mapSite(['showInfo']),
     ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
     ...mapRecruit({ recruitList: 'query' }),
-    // 查询站点信息
-    async searchSite() {
+    // 查询站点信息+栏目列表
+    async search({ ...info } = {}) {
       let res = await this.showInfo();
       let object = JSON.parse(JSON.stringify(res.data));
       if (object) {
         this.$set(this, `info`, res.data);
-      } else {
-        this.$message.error(res.errmsg ? res.errmsg : 'error');
       }
-    },
-    // 查询科技政务栏目
-    async searchColumn({ ...info } = {}) {
-      const res = await this.columnList({ ...info });
+      res = await this.columnList({ ...info });
       this.$set(this, `liebiaoList`, res.data);
     },
-    async onsaveClick({ id }) {
-      const res = await this.columnInfo(id);
-      if (res.data.site === 'zpxx') {
-        this.$router.push({ path: '/personnel/recruitList', query: { id: res.data.id } });
-      } else if (res.data.site === 'gzgw') {
-        this.$router.push({ path: '/personnel/guidanceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'qgjx') {
-        this.$router.push({ path: '/personnel/practiceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'xxsj') {
-        this.$router.push({ path: '/personnel/diligenceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'jyzd') {
-        this.$router.push({ path: '/personnel/adviserList', query: { id: res.data.id } });
-      }
-    },
-    async searchName() {
-      let nameId = this.$route.query.id;
-      const res = await this.columnInfo(nameId);
-      this.$set(this, `columnName`, res.data.name);
-    },
+    // 查询右侧信息列表
     async searchList({ skip = 0, limit = 10, column_id } = {}) {
-      const res = await this.recruitList({ skip, limit, column_id: this.$route.query.id });
+      const res = await this.recruitList({ column_id: this.id });
+      let column = this.liebiaoList.find(i => i.id == this.id);
       if (this.$checkRes(res)) {
         this.$set(this, `recruitData`, res.data);
-        console.log(res.data);
+        this.$set(this, `total`, res.total);
+        this.$set(this, `columnName`, column.name);
       }
     },
+    // 点击左侧切换栏目
+    async onsaveClick({ id }) {
+      let column = this.liebiaoList.find(i => i.id == id);
+      if (column.site === 'zpxx') this.$router.push({ path: '/personnel/recruitList', query: { id: column.id } });
+      if (column.site === 'gzgw') this.$router.push({ path: '/personnel/guidanceList', query: { id: column.id } });
+      if (column.site === 'qgjx') this.$router.push({ path: '/personnel/practiceList', query: { id: column.id } });
+      if (column.site === 'xxsj') this.$router.push({ path: '/personnel/diligenceList', query: { id: column.id } });
+      if (column.site === 'jyzd') this.$router.push({ path: '/personnel/adviserList', query: { id: column.id } });
+    },
+    // 点击查询详情
     clickDetailcm({ data }) {
       this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
     },

+ 31 - 36
src/views/personnel/recruitList.vue

@@ -25,64 +25,59 @@ export default {
     recruitListDetail,
   },
   data: () => ({
+    // 站点信息
     info: {},
+    // 栏目列表
     liebiaoList: [],
+    // 右侧信息头部标题
     columnName: '',
+    // 右侧信息列表
     recruitData: [],
-    total: 1,
+    total: 0,
   }),
-  created() {
-    this.searchSite();
-    this.searchColumn();
-    this.searchName();
-    this.searchList();
+  async created() {
+    await this.search();
+    await this.searchList();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
   },
-  computed: {},
   methods: {
     ...mapSite(['showInfo']),
     ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
     ...mapRecruit({ recruitList: 'query' }),
-    // 查询站点信息
-    async searchSite() {
+    // 查询站点信息+栏目列表
+    async search({ ...info } = {}) {
       let res = await this.showInfo();
       let object = JSON.parse(JSON.stringify(res.data));
       if (object) {
         this.$set(this, `info`, res.data);
-      } else {
-        this.$message.error(res.errmsg ? res.errmsg : 'error');
       }
-    },
-    // 查询科技政务栏目
-    async searchColumn({ ...info } = {}) {
-      const res = await this.columnList({ ...info });
+      res = await this.columnList({ ...info });
       this.$set(this, `liebiaoList`, res.data);
     },
-    async onsaveClick({ id }) {
-      const res = await this.columnInfo(id);
-      if (res.data.site === 'zpxx') {
-        this.$router.push({ path: '/personnel/recruitList', query: { id: res.data.id } });
-      } else if (res.data.site === 'gzgw') {
-        this.$router.push({ path: '/personnel/guidanceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'qgjx') {
-        this.$router.push({ path: '/personnel/practiceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'xxsj') {
-        this.$router.push({ path: '/personnel/diligenceList', query: { id: res.data.id } });
-      } else if (res.data.site === 'jyzd') {
-        this.$router.push({ path: '/personnel/adviserList', query: { id: res.data.id } });
-      }
-    },
-    async searchName() {
-      let nameId = this.$route.query.id;
-      const res = await this.columnInfo(nameId);
-      this.$set(this, `columnName`, res.data.name);
-    },
+    // 查询右侧信息列表
     async searchList({ skip = 0, limit = 10, column_id } = {}) {
-      const res = await this.recruitList({ skip, limit, column_id: this.$route.query.id });
+      const res = await this.recruitList({ column_id: this.id });
+      let column = this.liebiaoList.find(i => i.id == this.id);
       if (this.$checkRes(res)) {
         this.$set(this, `recruitData`, res.data);
-        console.log(res.data);
+        this.$set(this, `total`, res.total);
+        this.$set(this, `columnName`, column.name);
       }
     },
+    // 点击左侧切换栏目
+    async onsaveClick({ id }) {
+      let column = this.liebiaoList.find(i => i.id == id);
+      if (column.site === 'zpxx') this.$router.push({ path: '/personnel/recruitList', query: { id: column.id } });
+      if (column.site === 'gzgw') this.$router.push({ path: '/personnel/guidanceList', query: { id: column.id } });
+      if (column.site === 'qgjx') this.$router.push({ path: '/personnel/practiceList', query: { id: column.id } });
+      if (column.site === 'xxsj') this.$router.push({ path: '/personnel/diligenceList', query: { id: column.id } });
+      if (column.site === 'jyzd') this.$router.push({ path: '/personnel/adviserList', query: { id: column.id } });
+    },
+    // 点击查询详情
     clickDetailcm({ data }) {
       this.$router.push({ path: '/personnel/personnelwork', query: { id: data.id } });
     },