liuyg
2022-02-16 19e0b728e8cd41f9ddcd62eea6c15ebf769d9977
src/views/statisticalQueryManagement/securityGuardStatistics.vue
@@ -14,6 +14,7 @@
        :page.sync="page"
        :permission="permissionList"
        ref="crud"
        :search.sync="search"
        @search-change="searchChange"
        @search-reset="searchReset"
        @current-change="currentChange"
@@ -23,6 +24,16 @@
        @cell-click="handleRowClick"
        class="rowClick tablesss"
      >
        <template slot="menuLeft">
          <el-button
            type="warning"
            size="small"
            plain
            icon="el-icon-download"
            @click="handleExportSecurityStatisInfo"
            >导出
          </el-button>
        </template>
      </avue-crud>
    </basic-container>
    <el-dialog
@@ -33,22 +44,10 @@
      v-if="dialogShow"
    >
      <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,
@@ -56,6 +55,8 @@
} from "../../api/statisticalQueryManagement/statisticalQueryManagement";
import { lazyTreeJu, lazyTrees } from "../../api/index/index";
import companyDetails from "./companyDetails";
import Qs from "qs";
import { getToken } from "@/util/auth";
export default {
  name: "业务情况统计",
  components: {
@@ -69,6 +70,7 @@
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      search: {},
      query: {},
      value1: "",
      value2: "",
@@ -113,7 +115,7 @@
      tableOption: {
        align: "center",
        viewBtn: true,
        excelBtn: true,
        // excelBtn: true,
        delBtn: false,
        editBtn: false,
        addBtn: false,
@@ -128,26 +130,24 @@
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        indexLabel: "序号",
        indexLabel: "#",
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "公司名称",
            label: "企业名称",
            prop: "deptname",
            search: true,
            searchSpan: 4,
            minWidth: 210,
            overHidden: true,
            width: 280,
            display: false,
          },
          {
            label: "单位类型",
            label: "企业属性",
            prop: "stats",
            search: true,
            searchSpan: 4,
            display: false,
            width: 110,
            type: "select",
            props: {
              label: "dictValue",
@@ -158,38 +158,13 @@
          {
            label: "所属辖区",
            prop: "jurname",
            width: 110,
            searchSpan: 4,
            overHidden: true,
            type: "tree",
            props: {
              label: "title",
              value: "value",
            },
            // dicUrl: "/api/information/lazyTreeJu",
            // dicMethod:'post',
            dicData: [
              // {
              //   value: "0",
              //   label: "南昌市公安局"
              // },
              // {
              //   value: "2",
              //   label: "东湖分局"
              // },
              // {
              //   value: "3",
              //   label: "西湖分局"
              // },
              // {
              //   value: "4",
              //   label: "青云谱分局"
              // },
              // {
              //   value: "5",
              //   label: "青山湖分局"
              // }
            ],
            dicData: [],
            search: true,
            rules: [
              {
@@ -234,43 +209,38 @@
          },
          {
            label: "未派遣人数",
            prop: "wpaiqnum",
            prop: "wpqnum",
            display: false,
          },
          {
            label: "派遣人数",
            prop: "paiqnum",
            prop: "pqnum",
            display: false,
          },
          {
            label: "已采集照片人数",
            prop: "ycaijzpnum",
            prop: "ycjzpnum",
            display: false,
          },
          {
            label: "未采集照片人数",
            prop: "wcaijnum",
            prop: "wcjzpnum",
            display: false,
          },
          {
            label: "已采集指纹人数",
            prop: "ycaijzwnum",
            prop: "ycjzwnum",
            display: false,
          },
          {
            label: "资格审查异常人数",
            width: 150,
            prop: "yicnum",
            prop: "scycnum",
            display: false,
          },
          // {
          //   label: "过考保安人数",
          //   prop: "pass",
          //   display: false,
          // },
          {
            label: "缴纳社保人数",
            prop: "sbnum",
            prop: "jnsbnum",
            display: false,
          },
        ],
@@ -293,6 +263,36 @@
    },
  },
  methods: {
    //保安员统计信息导出
    handleExportSecurityStatisInfo() {
      this.$confirm("是否导出保安员统计信息数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        //获取查询条件
        const { releaseTimeRange } = this.search;
        if (releaseTimeRange) {
          this.search["startTime"] = releaseTimeRange[0];
          this.search["endTime"] = releaseTimeRange[1];
        }
        var data = {
          jurisdiction: this.search.jurname,
          stats: this.search.stats,
          deptid: this.search.deptname,
          startTime: this.search.startTime,
          endTime: this.search.endTime,
        };
        // console.log(data,123);
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(
          `/api/information/export-security-statis-info?${
            this.website.tokenHeader
          }=${getToken()}&` + data
        );
      });
    },
    getSubOfficeData() {
      lazyTrees().then((res) => {
        if (res.data.code === 200) {
@@ -307,21 +307,11 @@
        }
      });
    },
    // 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 == "单位类型") {
            if (item.label == "企业属性") {
              item.dicData = res.data.data;
            }
          });
@@ -351,6 +341,7 @@
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      params = this.search;
      this.loading = true;
      let param = {};
      param["jurisdiction"] = params["jurname"] || "";
@@ -375,7 +366,6 @@
        const data = res.data.data;
        this.page.total = data.total;
        this.tableData = data.records;
        this.$store.commit("setWindowSizeHeightAdd");
        this.loading = false;
      });
    },
@@ -395,7 +385,6 @@
  mounted() {
    this.getSubOfficeData();
    this.getDictionaryList();
    this.$store.commit("setWindowSizeHeightAdd");
  },
};
</script>