transaction.vue 2.2 KB

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