adviserList.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div id="adviserList">
  3. <adviserList-detail :info="info" :liebiaoList="liebiaoList" @onsave="onsaveClick" :columnName="columnName"></adviserList-detail>
  4. </div>
  5. </template>
  6. <script>
  7. import adviserListDetail from '@/components/personnel/adviserList.vue';
  8. import { createNamespacedHelpers, mapGetters } from 'vuex';
  9. const { mapActions: mapSite } = createNamespacedHelpers('site');
  10. const { mapActions: mapColumn } = createNamespacedHelpers('policiesColumn');
  11. export default {
  12. name: 'adviserList',
  13. props: {},
  14. components: {
  15. adviserListDetail,
  16. },
  17. data: () => ({
  18. info: {},
  19. liebiaoList: [],
  20. columnName: '',
  21. }),
  22. created() {
  23. this.searchSite();
  24. this.searchColumn();
  25. this.searchName();
  26. },
  27. computed: {},
  28. methods: {
  29. ...mapSite(['showInfo']),
  30. ...mapColumn({ columnList: 'query', columnInfo: 'fetch' }),
  31. // 查询站点信息
  32. async searchSite() {
  33. let res = await this.showInfo();
  34. let object = JSON.parse(JSON.stringify(res.data));
  35. if (object) {
  36. this.$set(this, `info`, res.data);
  37. } else {
  38. this.$message.error(res.errmsg ? res.errmsg : 'error');
  39. }
  40. },
  41. // 查询科技政务栏目
  42. async searchColumn({ ...info } = {}) {
  43. const res = await this.columnList({ ...info });
  44. this.$set(this, `liebiaoList`, res.data);
  45. },
  46. async onsaveClick({ id }) {
  47. const res = await this.columnInfo(id);
  48. if (res.data.name === '招聘信息') {
  49. this.$router.push({ path: '/personnel/recruitList', query: { id: id } });
  50. } else if (res.data.name === '就业指导') {
  51. this.$router.push({ path: '/personnel/guidanceList', query: { id: id } });
  52. } else if (res.data.name === '学习实践') {
  53. this.$router.push({ path: '/personnel/practiceList', query: { id: id } });
  54. } else if (res.data.name === '勤工俭学') {
  55. this.$router.push({ path: '/personnel/diligenceList', query: { id: id } });
  56. } else if (res.data.name === '工作顾问') {
  57. this.$router.push({ path: '/personnel/adviserList', query: { id: id } });
  58. }
  59. },
  60. async searchName() {
  61. let nameId = this.$route.query.id;
  62. const res = await this.columnInfo(nameId);
  63. this.$set(this, `columnName`, res.data.name);
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang="less" scoped></style>