shuishen
2021-11-09 bc4f603fe677aecb273e3a192ff1be69202bbd78
src/views/statisticalQueryManagement/securityGuardStatistics.vue
@@ -1,32 +1,60 @@
<template>
  <basic-container>
    <avue-crud
      :option="tableOption"
      :table-loading="loading"
      :data="tableData"
      :page.sync="page"
      :permission="permissionList"
      ref="crud"
      @search-change="searchChange"
      @search-reset="searchReset"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      @row-click="handleRowClick"
      class="rowClick"
  <div>
    <basic-container class="witerFontColorInput">
      <avue-crud
        :option="tableOption"
        :table-loading="loading"
        :data="tableData"
        :page.sync="page"
        :permission="permissionList"
        ref="crud"
        @search-change="searchChange"
        @search-reset="searchReset"
        @current-change="currentChange"
        @size-change="sizeChange"
        @refresh-change="refreshChange"
        @on-load="onLoad"
        @cell-click="handleRowClick"
        class="rowClick"
      >
      </avue-crud>
    </basic-container>
    <el-dialog
      class="tongji-class"
      :title="dialogTitle"
      append-to-body
      :visible.sync="dialogShow"
      v-if="dialogShow"
    >
    </avue-crud>
  </basic-container>
      <companyDetails :fwdeptId="fwdeptId"></companyDetails>
      <!-- <avue-crud
        :option="option2"
        :data="data2"
        :page.sync="page2"
        @row-save="rowSave2"
        @row-update="rowUpdate2"
        @row-del="rowDel2"
        :table-loading="loading2"
      >
      </avue-crud> -->
    </el-dialog>
  </div>
</template>
<script>
import FileSaver from "file-saver";
import XLSX from "xlsx";
import { mapGetters } from "vuex";
import { selectLi } from "../../api/statisticalQueryManagement/statisticalQueryManagement";
import { lazyTreeJu } from "../../api/index/index";
import {
  selectLi,
  dictionaryList
} from "../../api/statisticalQueryManagement/statisticalQueryManagement";
import { lazyTreeJu, lazyTrees } from "../../api/index/index";
import companyDetails from "./companyDetails";
export default {
  name: "业务情况统计",
  components: {
    companyDetails
  },
  data() {
    return {
      page: {
@@ -78,7 +106,7 @@
      tableOption: {
        align: "center",
        viewBtn: true,
        excelBtn: true,
        // excelBtn: true,
        delBtn: false,
        editBtn: false,
        addBtn: false,
@@ -96,17 +124,54 @@
        dialogClickModal: false,
        column: [
          {
            label: "单位注册时间",
            prop: "releaseTimeRange",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchRange: true,
            searchSpan: 6,
            searchLabelWidth: 120,
            labelWidth:160,
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            search: true,
            rules: [
              {
                required: true,
                message: "请选择单位注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "公司名称",
            prop: "deptname",
            search: true,
            searchSpan: 4,
            width: 280,
            display: false
          },
          {
            label: "单位类型",
            prop: "stats",
            search: true,
            searchSpan: 4,
            display: false,
            type: "select",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            dicData: []
          },
          {
            label: "所属辖区",
            prop: "jurname",
            searchSpan: 4,
            type: "select",
            type: "tree",
            props: {
              label: "title",
              value: "value"
@@ -165,12 +230,23 @@
            display: false
          },
          {
            label: "已采集照片人数",
            prop: "ycaijzpnum",
            display: false
          },
          {
            label: "未采集照片人数",
            prop: "wcaijnum",
            display: false
          },
          {
            label: "已采集指纹人数",
            prop: "ycaijzwnum",
            display: false
          },
          {
            label: "资格审查异常人数",
            width: 150,
            prop: "yicnum",
            display: false
          },
@@ -187,7 +263,9 @@
        ]
      },
      companyName: "",
      loading: true
      loading: true,
      dialogShow: false,
      dialogTitle: ""
    };
  },
  computed: {
@@ -203,15 +281,37 @@
  },
  methods: {
    getSubOfficeData() {
      lazyTreeJu().then(res => {
      lazyTrees().then(res => {
        if (res.data.code === 200) {
          this.tableOption.column.forEach(item => {
            if (item.label == "所属辖区") {
              // let data = res.data.data;
              item.dicData = res.data.data;
            }
          });
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    // searchChildren(data) {
    //   data.forEach(item => {
    //     if(item.hasChildren)(
    //     )
    //     else {
    //       this.searchChildren()
    //     }
    //   });
    // },
    getDictionaryList() {
      dictionaryList().then(res => {
        if (res.data.code === 200) {
          this.tableOption.column.forEach(item => {
            if (item.label == "单位类型") {
              item.dicData = res.data.data;
            }
          });
        }
      });
    },
@@ -228,9 +328,11 @@
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
      this.onLoad(this.page, this.query);
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
      this.onLoad(this.page, this.query);
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
@@ -240,28 +342,50 @@
      let param = {};
      param["jurisdiction"] = params["jurname"] || "";
      param["deptid"] = params["deptname"] || "";
      param["stats"] = params["stats"] || "";
      param["current"] = page.currentPage;
      param["size"] = page.pageSize;
      selectLi(param).then(res => {
      const { releaseTimeRange } = this.query;
      let values = {
          ...param,
        };
        if (releaseTimeRange) {
          values = {
            ...param,
            startTime: releaseTimeRange[0],
            endTime: releaseTimeRange[1],
            ...this.query,
          };
          values.releaseTimeRange = null;
        }
      selectLi(values).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.tableData = data.records;
        this.loading = false;
      });
    },
    handleRowClick(row, event, column) {
      this.$router.push({
        path: "/statisticalQueryManagement/companyDetails?deptid=" + row.dept_id
      });
    handleRowClick(row, column, cell, event) {
      if (column.label == "保安员总数") {
        this.dialogTitle = "保安员明细";
        this.fwdeptId = row.dept_id;
        this.dialogShow = true;
      } else {
        this.dialogShow = false;
      }
      // this.$router.push({
      //   path: "/statisticalQueryManagement/companyDetails?deptid=" + row.dept_id
      // });
    }
  },
  mounted() {
    this.getSubOfficeData();
    this.getDictionaryList();
  }
};
</script>
<style lang="scss" scoped>
/deep/ .rowClick .el-table__row:hover td {
/deep/ .rowClick .el-table__row:hover td:nth-child(6) {
  cursor: pointer;
}
</style>