index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div id="recruit">
  3. <el-row>
  4. <el-col :span="24" class="top">
  5. <topInfo :topTitle="topTitle"></topInfo>
  6. </el-col>
  7. <el-col :span="24" class="main">
  8. <enterpriseProduct
  9. :recruitInfo="recruitInfo"
  10. :total="total"
  11. @handleCurrentChange="handleCurrentChange"
  12. @delete="deleteData"
  13. @edit="edit"
  14. @shibai="shibai"
  15. ></enterpriseProduct>
  16. </el-col>
  17. </el-row>
  18. </div>
  19. </template>
  20. <script>
  21. import topInfo from '@/layout/public/top.vue';
  22. import enterpriseProduct from '@/layout/enterpriseProduct/enterpriseProduct.vue';
  23. import { createNamespacedHelpers, mapGetters } from 'vuex';
  24. const { mapActions: product } = createNamespacedHelpers('market');
  25. export default {
  26. name: 'recruit',
  27. props: {},
  28. components: {
  29. topInfo,
  30. enterpriseProduct,
  31. },
  32. data: () => ({
  33. topTitle: '审核信息',
  34. recruitInfo: [],
  35. total: 1,
  36. skip: '',
  37. }),
  38. created() {
  39. this.search();
  40. },
  41. computed: {},
  42. methods: {
  43. ...product(['query', 'delete', 'fetch', 'update']),
  44. async search({ skip = 0, limit = 10, ...info } = {}) {
  45. skip = this.skip;
  46. const res = await this.query({ skip, limit, ...info });
  47. let newData = res.data.filter(i => i.status != '3');
  48. this.$set(this, `recruitInfo`, newData);
  49. this.$set(this, `total`, newData.length);
  50. },
  51. async deleteData(item) {
  52. const res = await this.delete(item.id);
  53. this.$checkRes(res, '删除成功', '删除失败');
  54. this.search();
  55. },
  56. async edit({ data }) {
  57. console.log('a');
  58. data.status = '1';
  59. let res = await this.update(data);
  60. this.$checkRes(res, '审核成功', '审核失败');
  61. console.log(data);
  62. },
  63. async shibai({ data }) {
  64. console.log('a');
  65. data.status = '2';
  66. let res = await this.update(data);
  67. this.$checkRes(res, '审核成功', '审核失败');
  68. console.log(data);
  69. },
  70. async handleCurrentChange({ skip, limit, currentPage }) {
  71. this.$set(this, `skip`, skip);
  72. this.search();
  73. },
  74. },
  75. };
  76. </script>
  77. <style lang="less" scoped>
  78. .main {
  79. padding: 20px;
  80. margin: 10px 20px;
  81. border: 1px solid #ccc;
  82. width: 96%;
  83. }
  84. </style>