index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-col :span="24" class="leftTop"> <span>|</span> <span>数据动态</span> </el-col>
  6. <el-col :span="24" class="info">
  7. <el-tabs v-model="activeName" type="card">
  8. <el-tab-pane label="正在洽谈" name="first">
  9. <zzqt :zzqtList="zzqtList" :total="zzqtTotal"></zzqt>
  10. </el-tab-pane>
  11. <el-tab-pane label="达成意向" name="second">
  12. <dcyx :dcyxList="dcyxList" :total="dxyxTotal"></dcyx>
  13. </el-tab-pane>
  14. <el-tab-pane label="交易完成" name="third">
  15. <jywc :jywcList="jywcList" :total="jywcTotal"></jywc>
  16. </el-tab-pane>
  17. </el-tabs>
  18. </el-col>
  19. </el-col>
  20. </el-row>
  21. </div>
  22. </template>
  23. <script>
  24. import { mapState, createNamespacedHelpers } from 'vuex';
  25. import zzqt from './parts/zzqt.vue';
  26. import dcyx from './parts/dcyx.vue';
  27. import jywc from './parts/jywc.vue';
  28. const { mapActions: transactions } = createNamespacedHelpers('transaction');
  29. const { mapActions: dock } = createNamespacedHelpers('dock');
  30. export default {
  31. name: 'index',
  32. props: {},
  33. components: {
  34. zzqt,
  35. dcyx,
  36. jywc,
  37. },
  38. data: function() {
  39. return {
  40. activeName: 'first',
  41. dock_id: '',
  42. zzqtList: [],
  43. zzqtTotal: 0,
  44. dcyxList: [],
  45. dxyxTotal: 0,
  46. jywcList: [],
  47. jywcTotal: 0,
  48. };
  49. },
  50. created() {
  51. this.searchInfo();
  52. },
  53. methods: {
  54. ...transactions({ transactionsfetch: 'fetch', transactionslist: 'query', transactiondetele: 'detele', transactionupdate: 'update' }),
  55. ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
  56. async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
  57. let res = await this.dockFetch(this.user.remark);
  58. this.$set(this, `dock_id`, res.data.id);
  59. let arr = await this.transactionslist({ skip, limit, dockid: this.dock_id, ...info });
  60. var zzqt = arr.data.filter(item => item.status === '0');
  61. var dcyx = arr.data.filter(item => item.status === '1');
  62. var jywc = arr.data.filter(item => item.status === '2');
  63. this.$set(this, `zzqtList`, zzqt);
  64. this.$set(this, `zzqtTotal`, zzqt.length);
  65. this.$set(this, `dcyxList`, dcyx);
  66. this.$set(this, `dxyxTotal`, dcyx.length);
  67. this.$set(this, `jywcList`, jywc);
  68. this.$set(this, `jywcTotal`, jywc.length);
  69. },
  70. },
  71. computed: {
  72. ...mapState(['user']),
  73. pageTitle() {
  74. return `${this.$route.meta.title}`;
  75. },
  76. },
  77. metaInfo() {
  78. return { title: this.$route.meta.title };
  79. },
  80. };
  81. </script>
  82. <style lang="less" scoped>
  83. .leftTop {
  84. font-size: 18px;
  85. width: 96%;
  86. height: 41px;
  87. line-height: 35px;
  88. border-bottom: 1px solid #e5e5e5;
  89. position: relative;
  90. bottom: 1px;
  91. margin: 10px;
  92. font-weight: 600;
  93. color: #22529a;
  94. }
  95. .info {
  96. padding: 0 40px 0 0;
  97. }
  98. </style>