enterprisedg.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div id="adviserList">
  3. <enterprisedg-detail
  4. :info="info"
  5. :liebiaoList="liebiaoList"
  6. :dinggou1="dinggou1"
  7. :dinggou2="dinggou2"
  8. :dinggou3="dinggou3"
  9. @onsave="onsaveClick"
  10. :total1="total1"
  11. :total2="total2"
  12. :total3="total3"
  13. @handleCurrentChange="change1"
  14. @handleCurrentChange1="change2"
  15. @handleCurrentChange2="change3"
  16. @deletes="deleteData"
  17. ></enterprisedg-detail>
  18. </div>
  19. </template>
  20. <script>
  21. import enterprisedgDetail from '@/components/enterprise/enterpisedg.vue';
  22. import { createNamespacedHelpers, mapGetters } from 'vuex';
  23. const { mapActions: mapSite } = createNamespacedHelpers('site');
  24. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  25. export default {
  26. name: 'adviserList',
  27. props: {},
  28. components: {
  29. enterprisedgDetail,
  30. },
  31. data: () => ({
  32. info: {},
  33. liebiaoList: [{ name: '基本信息' }, { name: '消息管理' }, { name: '我的发布' }, { name: '我的订购' }, { name: '注销账号' }],
  34. total1: 1,
  35. total2: 1,
  36. total3: 1,
  37. dinggou1: [],
  38. dinggou2: [],
  39. dinggou3: [],
  40. }),
  41. created() {
  42. this.searchSite();
  43. this.jiaoyi1();
  44. this.jiaoyi2();
  45. this.jiaoyi3();
  46. },
  47. computed: {},
  48. methods: {
  49. ...mapSite(['showInfo']),
  50. ...transaction({ transactionList: 'query', transactiondtetle: 'delete' }),
  51. // 查询站点信息
  52. async searchSite() {
  53. let res = await this.showInfo();
  54. let object = JSON.parse(JSON.stringify(res.data));
  55. if (object) {
  56. this.$set(this, `info`, res.data);
  57. } else {
  58. this.$message.error(res.errmsg ? res.errmsg : 'error');
  59. }
  60. },
  61. // 查询
  62. async jiaoyi1({ skip = 0, limit = 3, ...info } = {}) {
  63. let status = 1;
  64. skip = this.skip;
  65. console.log();
  66. const res = await this.transactionList({ skip, limit, status, ...info });
  67. console.log(res);
  68. if (this.$checkRes(res)) {
  69. this.$set(this, `dinggou1`, res.data);
  70. this.$set(this, `total1`, res.total);
  71. }
  72. },
  73. async jiaoyi2({ skip = 0, limit = 3, ...info } = {}) {
  74. let status = 2;
  75. skip = this.skip;
  76. console.log();
  77. const res = await this.transactionList({ skip, limit, status, ...info });
  78. console.log(res);
  79. if (this.$checkRes(res)) {
  80. this.$set(this, `dinggou2`, res.data);
  81. this.$set(this, `total2`, res.total);
  82. }
  83. },
  84. async jiaoyi3({ skip = 0, limit = 3, ...info } = {}) {
  85. let status = 3;
  86. skip = this.skip;
  87. console.log();
  88. const res = await this.transactionList({ skip, limit, status, ...info });
  89. console.log(res);
  90. if (this.$checkRes(res)) {
  91. this.$set(this, `dinggou3`, res.data);
  92. this.$set(this, `total3`, res.total);
  93. }
  94. },
  95. async change1({ skip, limit, currentPage }) {
  96. this.$set(this, `skip`, skip);
  97. this.jiaoyi1();
  98. },
  99. async change2({ skip, limit, currentPage }) {
  100. this.$set(this, `skip`, skip);
  101. this.jiaoyi2();
  102. },
  103. async change3({ skip, limit, currentPage }) {
  104. this.$set(this, `skip`, skip);
  105. this.jiaoyi3();
  106. },
  107. async deleteData({ item }) {
  108. const res = await this.transactiondtetle(item.id);
  109. this.$checkRes(res, '删除成功', '删除失败');
  110. },
  111. async onsaveClick({ id }) {
  112. console.log(id);
  113. if (id === '基本信息') {
  114. this.$router.push({ path: '/enterprise/enterprisejb' });
  115. } else if (id === '消息管理') {
  116. this.$router.push({ path: '/enterprise/enterprisexx' });
  117. } else if (id === '我的发布') {
  118. this.$router.push({ path: '/enterprise/enterprisefabu' });
  119. } else if (id === '我的订购') {
  120. this.$router.push({ path: '/enterprise/enterprisedg' });
  121. }
  122. },
  123. },
  124. };
  125. </script>
  126. <style lang="less" scoped></style>