index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. :forms="forms"
  13. @submit="submit"
  14. @handleDelete="handleDelete"
  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, mapState } 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. forms: {
  38. status: '3',
  39. },
  40. }),
  41. created() {
  42. this.search();
  43. },
  44. computed: {
  45. ...mapState(['user']),
  46. },
  47. methods: {
  48. ...product(['query', 'comquery', 'delete', 'fetch', 'update']),
  49. async submit() {
  50. this.search(this.forms.status);
  51. },
  52. async search({ skip = 0, limit = 10, ...info } = {}) {
  53. if (this.forms.status) {
  54. status = this.forms.status;
  55. skip = this.skip;
  56. let code = this.user.code;
  57. const arr = await this.comquery({ status, code, ...info });
  58. this.$set(this, `recruitInfo`, arr.res);
  59. this.$set(this, `total`, arr.res.length);
  60. } else {
  61. skip = this.skip;
  62. let code = this.user.code;
  63. const arr = await this.comquery({ status: 3, code, ...info });
  64. this.$set(this, `recruitInfo`, arr.res);
  65. this.$set(this, `total`, arr.res.length);
  66. }
  67. },
  68. // 删除
  69. async handleDelete(id) {
  70. const res = await this.delete(id);
  71. if (this.$checkRes(res)) {
  72. this.$message({
  73. message: '删除信息成功',
  74. type: 'success',
  75. });
  76. this.search();
  77. }
  78. },
  79. async handleCurrentChange({ skip, limit, currentPage }) {
  80. this.$set(this, `skip`, skip);
  81. this.search();
  82. },
  83. },
  84. };
  85. </script>
  86. <style lang="less" scoped>
  87. .main {
  88. padding: 20px;
  89. margin: 10px 20px;
  90. border: 1px solid #ccc;
  91. width: 96%;
  92. }
  93. </style>