123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <div id="fhSign">
- <el-row>
- <el-col :span="24" class="main">
- <el-col :span="24" class="crumbs">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item> <i class="el-icon-lx-cascades"></i> 分行客户报名统计 </el-breadcrumb-item>
- </el-breadcrumb>
- </el-col>
- <el-col :span="24" class="container down">
- <el-col :span="24" class="downTop">
- <el-col :span="4">
- <el-select v-model="searchForm.fhid" clearable placeholder="请选择分行" :popper-append-to-body="false">
- <el-option v-for="item in fnList" :key="item.id" :label="item.name" :value="item.tableid"> </el-option>
- </el-select>
- </el-col>
- <el-col :span="6">
- <el-date-picker
- v-model="searchForm.date"
- value-format="yyyy-MM-dd"
- format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- clearable
- >
- </el-date-picker>
- </el-col>
- <el-col :span="14">
- <el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
- </el-col>
- </el-col>
- <el-col :span="24" class="downList">
- <el-col :span="24" class="downListOne">
- <el-col :span="12"> 分行客户总数{{ khtotal }}人 </el-col>
- <el-col :span="12" style="text-align:right;">
- <el-button type="primary" size="mini" @click="selectBtn()">导出数据</el-button>
- </el-col>
- </el-col>
- <el-col :span="24" class="downListTwo">
- <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search"> </data-table>
- </el-col>
- </el-col>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import _ from 'lodash';
- import dataTable from '@/components/frame/filter-page-table.vue';
- import { mapState, createNamespacedHelpers } from 'vuex';
- const { mapActions: sj } = createNamespacedHelpers('sj');
- const { mapActions: xs } = createNamespacedHelpers('xs');
- const { mapActions: kh } = createNamespacedHelpers('kh');
- const { mapActions: count } = createNamespacedHelpers('count');
- export default {
- metaInfo: { title: '分行客户报名统计' },
- name: 'fhSign',
- props: {},
- components: {
- dataTable, //列表组件
- },
- data: function() {
- return {
- // 查询
- searchForm: {},
- fnList: [],
- // 销售员列表
- opera: [],
- fields: [
- { label: '销售员', prop: 'name' },
- { label: '客户总数', prop: 'khtotal' },
- ],
- list: [],
- total: 0,
- khtotal: 0,
- };
- },
- created() {
- this.searchSj();
- },
- methods: {
- ...sj(['query']),
- ...xs({ xsQuery: 'query' }),
- ...kh({ khQuery: 'query' }),
- ...count({ countQuery: 'query', otherselectQuery: 'otherselectQuery' }),
- // 查询分行列表
- async searchSj() {
- let res = await this.query({ js: '1' });
- if (this.$checkRes(res)) {
- let data = res.data;
- data.push({ name: '全部' });
- this.$set(this, `fnList`, data);
- }
- },
- async search({ skip = 0, limit = 10, ...info } = {}) {
- info = {
- ssid: this.searchForm.fhid,
- start: _.get(this.searchForm, 'date[0]'),
- end: _.get(this.searchForm, 'date[1]'),
- table: 'xs',
- };
- let res = await this.countQuery({ skip, limit, ...info });
- if (this.$checkRes(res)) {
- this.$set(this, `list`, res.data);
- this.$set(this, `total`, res.total);
- let khtotal = res.data.reduce((p, n) => p + (n['khtotal'] * 1 || 0), 0);
- if (khtotal) this.$set(this, `khtotal`, khtotal);
- }
- },
- async selectBtn() {
- let info = {
- ssid: this.searchForm.fhid,
- start: _.get(this.searchForm, 'date[0]'),
- end: _.get(this.searchForm, 'date[1]'),
- table: 'xs',
- };
- let res = await this.otherselectQuery({ ...info });
- if (this.$checkRes(res)) {
- window.open(res.data);
- }
- },
- },
- computed: {
- ...mapState(['user']),
- },
- };
- </script>
- <style lang="less" scoped>
- .down {
- .downList {
- .downListOne {
- padding: 15px 0;
- }
- }
- }
- /deep/.el-select-dropdown__wrap {
- max-height: 340px;
- }
- </style>
|