summary.vue 3.87 KB
<template>
  <div class="system-container">
    <div class="container">
      <h1>试乘试驶汇总统计</h1>

      <!-- 搜索区域 开始 -->
      <div class="search_box">
        <el-form :model="searchForm" :inline="true" size="small">
          <el-form-item label="关键字:">
            <el-input v-model="searchForm.dddd" placeholder="特约店编码|店名称"></el-input>
          </el-form-item>
          <el-form-item label="车辆归属:">
          <el-popover v-model="filterVisible" placement="bottom-start" width="400" trigger="click">
            <div>
              <glsx-organization @change="onChange"></glsx-organization>
            </div>
            <el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '所属组织'" slot="reference" readonly clearable>
            </el-input>
          </el-popover>
        </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search">搜索</el-button>
          </el-form-item>
          <el-form-item>
            <el-button type="default" icon="el-icon-refresh" @click="rest()">重置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <!-- 搜索区域 end -->

      <!-- 按钮区域 开始 -->
      <div class="links_group">
        <span>试乘试驾汇总信息</span>
        <el-button class="pull-right" type="primary" icon="el-icon-download" size="small" @click="btnClick('export')">导出Excel</el-button>
      </div>
      <!-- 按钮区域 end -->

      <!-- 列表 开始 -->
      <glsx-table :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getTableList">
      </glsx-table>
      <!-- 列表 end -->
    </div>
  </div>
</template>

<script>
import GlsxTable from "@/components/glsx-table";
import { getList } from "services/report";
import GlsxOrganization from "@/components/glsx-organization";
export default {
  components: {
    GlsxTable,
    GlsxOrganization,
  },
  data() {
    return {
      searchForm: {},
      test: "1",
      tableData: [],
      columnList: [
        { label: "所属大区", prop: "sn", align: "center" },
        { label: "所属省", prop: "shopName" },
        { label: "所属市", prop: "sn" },
        { label: "特约店名称", prop: "" },
        { label: "特约店编码", prop: "" },
        { label: "店级别", prop: "" },
        { label: "线路数量", prop: "" },
        { label: "店围栏", prop: "" },
        { label: "所属车辆数", prop: "" },
        { label: "是否关联", prop: "" },
      ],
      pageTotal: 0,
      filterVisible:false
    };
  },
  mounted() {
    this.getTableList();
  },
  methods: {

    // 重置
    rest(){
      this.searchForm = {}
      this.getTableList()
    },

    // 获取列表
    getTableList(options) {
      let oParams = {};
      oParams.pageSize = options ? options.pageSize || 10 : 10;
      oParams.pageNumber = options ? options.pageNumber || 1 : 1;
      getList(oParams).then((res) => {
        let { data } = res;
        let { list, totalElements } = data;
        this.pageTotal = totalElements;
        this.tableData = list;
      });
    },

    // 查看详情
    lookDetail(row) {
      console.log(row);
      // let query = {}
      // let path = '/oEshield#/reportManage/mileageDetail';
      // history.pushState(query, path, path);
      this.$router.push({ name: "mileageDetail" });
    },

     // 监听树
    onChange(e) {
      this.filterVisible = false;
      console.log(e);
      if (e) {
        this.orgInfo = e.origin;
        this.searchForm.orgId = e.origin.orgId;
        this.searchForm.orgType = e.origin.type;
        this.searchForm.orgName = e.origin.orgName;
      }
    },

  },
};
</script>

<style lang="scss" scoped>
.pre_select {
  width: 100px;
}
.title_tips {
  font-size: 14px;
}
.links_group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
</style>>