fhSign.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div id="fhSign">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="crumbs">
  6. <el-breadcrumb separator="/">
  7. <el-breadcrumb-item> <i class="el-icon-lx-cascades"></i> 分行客户报名统计 </el-breadcrumb-item>
  8. </el-breadcrumb>
  9. </el-col>
  10. <el-col :span="24" class="container down">
  11. <el-col :span="24" class="downTop">
  12. <el-col :span="4">
  13. <el-select v-model="searchForm.fhid" clearable placeholder="请选择分行" :popper-append-to-body="false">
  14. <el-option v-for="item in fnList" :key="item.id" :label="item.name" :value="item.tableid"> </el-option>
  15. </el-select>
  16. </el-col>
  17. <el-col :span="6">
  18. <el-date-picker
  19. v-model="searchForm.date"
  20. value-format="yyyy-MM-dd"
  21. format="yyyy-MM-dd"
  22. type="daterange"
  23. range-separator="-"
  24. start-placeholder="开始日期"
  25. end-placeholder="结束日期"
  26. clearable
  27. >
  28. </el-date-picker>
  29. </el-col>
  30. <el-col :span="14">
  31. <el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  32. </el-col>
  33. </el-col>
  34. <el-col :span="24" class="downList">
  35. <el-col :span="24" class="downListOne">
  36. <el-col :span="12"> 分行客户总数{{ khtotal }}人 </el-col>
  37. <el-col :span="12" style="text-align:right;">
  38. <el-button type="primary" size="mini" @click="selectBtn()">导出数据</el-button>
  39. </el-col>
  40. </el-col>
  41. <el-col :span="24" class="downListTwo">
  42. <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search"> </data-table>
  43. </el-col>
  44. </el-col>
  45. </el-col>
  46. </el-col>
  47. </el-row>
  48. </div>
  49. </template>
  50. <script>
  51. import _ from 'lodash';
  52. import dataTable from '@/components/frame/filter-page-table.vue';
  53. import { mapState, createNamespacedHelpers } from 'vuex';
  54. const { mapActions: sj } = createNamespacedHelpers('sj');
  55. const { mapActions: xs } = createNamespacedHelpers('xs');
  56. const { mapActions: kh } = createNamespacedHelpers('kh');
  57. const { mapActions: count } = createNamespacedHelpers('count');
  58. export default {
  59. metaInfo: { title: '分行客户报名统计' },
  60. name: 'fhSign',
  61. props: {},
  62. components: {
  63. dataTable, //列表组件
  64. },
  65. data: function() {
  66. return {
  67. // 查询
  68. searchForm: {},
  69. fnList: [],
  70. // 销售员列表
  71. opera: [],
  72. fields: [
  73. { label: '销售员', prop: 'name' },
  74. { label: '客户总数', prop: 'khtotal' },
  75. ],
  76. list: [],
  77. total: 0,
  78. khtotal: 0,
  79. };
  80. },
  81. created() {
  82. this.searchSj();
  83. },
  84. methods: {
  85. ...sj(['query']),
  86. ...xs({ xsQuery: 'query' }),
  87. ...kh({ khQuery: 'query' }),
  88. ...count({ countQuery: 'query', otherselectQuery: 'otherselectQuery' }),
  89. // 查询分行列表
  90. async searchSj() {
  91. let res = await this.query({ js: '1' });
  92. if (this.$checkRes(res)) {
  93. let data = res.data;
  94. data.push({ name: '全部' });
  95. this.$set(this, `fnList`, data);
  96. }
  97. },
  98. async search({ skip = 0, limit = 10, ...info } = {}) {
  99. info = {
  100. ssid: this.searchForm.fhid,
  101. start: _.get(this.searchForm, 'date[0]'),
  102. end: _.get(this.searchForm, 'date[1]'),
  103. table: 'xs',
  104. };
  105. let res = await this.countQuery({ skip, limit, ...info });
  106. if (this.$checkRes(res)) {
  107. this.$set(this, `list`, res.data);
  108. this.$set(this, `total`, res.total);
  109. let khtotal = res.data.reduce((p, n) => p + (n['khtotal'] * 1 || 0), 0);
  110. if (khtotal) this.$set(this, `khtotal`, khtotal);
  111. }
  112. },
  113. async selectBtn() {
  114. let info = {
  115. ssid: this.searchForm.fhid,
  116. start: _.get(this.searchForm, 'date[0]'),
  117. end: _.get(this.searchForm, 'date[1]'),
  118. table: 'xs',
  119. };
  120. let res = await this.otherselectQuery({ ...info });
  121. if (this.$checkRes(res)) {
  122. window.open(res.data);
  123. }
  124. },
  125. },
  126. computed: {
  127. ...mapState(['user']),
  128. },
  129. };
  130. </script>
  131. <style lang="less" scoped>
  132. .down {
  133. .downList {
  134. .downListOne {
  135. padding: 15px 0;
  136. }
  137. }
  138. }
  139. /deep/.el-select-dropdown__wrap {
  140. max-height: 340px;
  141. }
  142. </style>