index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. this.$set(this, `recruitInfo`, res.data);
  48. this.$set(this, `total`, res.total);
  49. },
  50. async deleteData(item) {
  51. const res = await this.delete(item.id);
  52. this.$checkRes(res, '删除成功', '删除失败');
  53. this.search();
  54. },
  55. async edit({ data }) {
  56. console.log('a');
  57. data.status = '1';
  58. let res = await this.update(data);
  59. this.$checkRes(res, '审核成功', '审核失败');
  60. console.log(data);
  61. },
  62. async shibai({ data }) {
  63. console.log('a');
  64. data.status = '2';
  65. let res = await this.update(data);
  66. this.$checkRes(res, '审核成功', '审核失败');
  67. console.log(data);
  68. },
  69. async handleCurrentChange({ skip, limit, currentPage }) {
  70. this.$set(this, `skip`, skip);
  71. this.search();
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. .main {
  78. padding: 20px;
  79. margin: 10px 20px;
  80. border: 1px solid #ccc;
  81. width: 96%;
  82. }
  83. </style>