liuyg
2021-09-16 22bbdc4cf63f0c82cafd445bc475e2128fcd43c3
src/views/statisticalQueryManagement/securityGuardStatistics.vue
@@ -23,8 +23,11 @@
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";
export default {
  name: "业务情况统计",
  data() {
@@ -32,7 +35,7 @@
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
        total: 0,
      },
      query: {},
      value1: "",
@@ -100,16 +103,30 @@
            prop: "deptname",
            search: true,
            searchSpan: 4,
            display: false
            width: 300,
            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"
              value: "value",
            },
            // dicUrl: "/api/information/lazyTreeJu",
            // dicMethod:'post',
@@ -140,39 +157,39 @@
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "blur"
              }
            ]
                trigger: "blur",
              },
            ],
          },
          {
            label: "保安员总数",
            prop: "num",
            display: false
            display: false,
          },
          {
            label: "持证上岗人数",
            prop: "cznum",
            display: false
            display: false,
          },
          {
            label: "未派遣人数",
            prop: "wpaiqnum",
            display: false
            display: false,
          },
          {
            label: "派遣人数",
            prop: "paiqnum",
            display: false
            display: false,
          },
          {
            label: "未采集照片人数",
            prop: "wcaijnum",
            display: false
            display: false,
          },
          {
            label: "资格审查异常人数",
            prop: "yicnum",
            display: false
            display: false,
          },
          // {
          //   label: "过考保安人数",
@@ -182,12 +199,12 @@
          {
            label: "缴纳社保人数",
            prop: "sbnum",
            display: false
          }
        ]
            display: false,
          },
        ],
      },
      companyName: "",
      loading: true
      loading: true,
    };
  },
  computed: {
@@ -197,21 +214,43 @@
        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: {
    getSubOfficeData() {
      lazyTreeJu().then(res => {
      lazyTrees().then((res) => {
        if (res.data.code === 200) {
          this.tableOption.column.forEach(item => {
          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 +267,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,9 +281,10 @@
      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 => {
      selectLi(param).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.tableData = data.records;
@@ -251,13 +293,15 @@
    },
    handleRowClick(row, event, column) {
      this.$router.push({
        path: "/statisticalQueryManagement/companyDetails?deptid=" + row.dept_id
        path:
          "/statisticalQueryManagement/companyDetails?deptid=" + row.dept_id,
      });
    }
    },
  },
  mounted() {
    this.getSubOfficeData();
  }
    this.getDictionaryList();
  },
};
</script>
<style lang="scss" scoped>