zhengpz
2021-08-20 7fbe838496148877bc5fe055e3098b3bc00a113d
src/views/statisticalQueryManagement/businessStatistics.vue
@@ -4,10 +4,13 @@
      :option="tableOption"
      :data="tableData"
      :page.sync="tablePage"
      :table-loading="loading"
      :permission="permissionList"
      :before-open="beforeOpen"
      @date-change="dateChange"
      @row-click="handleRowClick"
      @cell-click="handleRowClick"
      :cell-style="cellStyle"
      class="businessStatisticsStyle"
    >
    </avue-crud>
  </basic-container>
@@ -16,6 +19,7 @@
import FileSaver from "file-saver";
import XLSX from "xlsx";
import { mapGetters } from "vuex";
import { selectYw } from "../../api/statisticalQueryManagement/statisticalQueryManagement";
export default {
  name: "业务情况统计",
  data() {
@@ -23,29 +27,29 @@
      value1: "",
      value2: "",
      tableData: [
        {
          company: "江西省永安保安服务有限公司",
          subOffice: "南昌市公安局",
          customer: "76",
          num: "1124",
        },
        {
          company: "南昌市赣水保安服务有限公司",
          subOffice: "东湖分局",
          customer: "85",
          num: "1428",
        },
        {
          company: "江西中业兴达保安服务有限公司",
          subOffice: "西湖分局",
          customer: "46",
          num: "974",
        },
        // {
        //   company: "江西省永安保安服务有限公司",
        //   subOffice: "南昌市公安局",
        //   customer: "76",
        //   num: "1124"
        // },
        // {
        //   company: "南昌市赣水保安服务有限公司",
        //   subOffice: "东湖分局",
        //   customer: "85",
        //   num: "1428"
        // },
        // {
        //   company: "江西中业兴达保安服务有限公司",
        //   subOffice: "西湖分局",
        //   customer: "46",
        //   num: "974"
        // }
      ],
      tablePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
        total: 0
      },
      tableOption: {
        excelBtn: true,
@@ -68,66 +72,67 @@
        column: [
          {
            label: "公司名称",
            prop: "company",
            prop: "enterpriseName",
            search: true,
            searchSpan: 4,
            display: false,
            display: false
          },
          {
            label: "所属辖区",
            prop: "subOffice",
            prop: "jurname",
            searchSpan: 4,
            type: "select",
            props: {
              label: "label",
              value: "value",
              value: "value"
            },
            // cascaderItem: ["city", "area"],
            // dicUrl:subofficeOptions,
            dicData: [
              {
                value: "0",
                label: "南昌市公安局",
                label: "南昌市公安局"
              },
              {
                value: "2",
                label: "东湖分局",
                label: "东湖分局"
              },
              {
                value: "3",
                label: "西湖分局",
                label: "西湖分局"
              },
              {
                value: "4",
                label: "青云谱分局",
                label: "青云谱分局"
              },
              {
                value: "5",
                label: "青山湖分局",
              },
                label: "青山湖分局"
              }
            ],
            search: true,
            rules: [
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "服务对象数量",
            prop: "customer",
            display: false,
            prop: "fwnum",
            display: false
          },
          {
            label: "保安员人数",
            prop: "num",
            display: false,
          },
        ],
            prop: "znum",
            display: false
          }
        ]
      },
       loading:true,
    };
  },
  computed: {
@@ -137,15 +142,31 @@
        addBtn: this.vaildData(this.permission.post_add, false),
        viewBtn: this.vaildData(this.permission.post_view, false),
        delBtn: this.vaildData(this.permission.post_delete, false),
        editBtn: this.vaildData(this.permission.post_edit, false),
        editBtn: this.vaildData(this.permission.post_edit, false)
      };
    },
    }
  },
  methods: {
    handleRowClick(row, event, column) {
      this.$router.push({ path: "/statisticalQueryManagement/businessStatisticsDetail" });
    handleRowClick(row, column, cell, event) {
      if (column.label == "服务对象数量" || column.label == "保安员人数") {
        this.$router.push({
          path: "/statisticalQueryManagement/businessStatisticsDetail"
        });
      }
    },
    cellStyle(row, column, rowIndex, columnIndex) {
      // if (columnIndex == 4 || columnIndex == 5) {
      // }
    },
    dateChange() {},
    getTableData() {
      selectYw({current: 1, size: 10 }).then(res => {
        if (res.data.code === 200) {
          this.tableData = res.data.data;
          this.loading = false;
        }
      });
    }
    // downExcel() {
    //   let et = XLSX.utils.table_to_book(document.getElementById("table"));
    //   let etout = XLSX.write(et, {
@@ -166,8 +187,14 @@
    //   return etout;
    // }
  },
  mounted() {},
  mounted() {
    this.getTableData();
  }
};
</script>
<style lang="scss" scoped>
/deep/ .businessStatisticsStyle .el-table__row:hover td:nth-child(5),
/deep/ .businessStatisticsStyle .el-table__row:hover td:nth-child(6) {
  cursor: pointer !important;
}
</style>