zhongrj
2024-03-27 cc1c0a396698648256c350f6f0fe2cb2f0b02c7e
src/views/securityUnitOperation/operationTable.vue
@@ -1,29 +1,30 @@
<template>
  <basic-container>
  <basic-container
    :class="[
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '',
    ]"
  >
    <avue-crud
      class="tablesss smileTableFromSize"
      :option="tableOption"
      :table-loading="loading"
      :data="tableData"
      :page.sync="page"
      :permission="permissionList"
      ref="crud"
      @row-update="rowUpdates"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
    >
    </avue-crud>
  </basic-container>
</template>
<script>
import FileSaver from "file-saver";
import XLSX from "xlsx";
import { selectTb } from "../../api/securityUnitOperation/securityUnitOperation";
import { lazyTreeJu } from "../../api/index/index";
import { lazyTreeJu, lazyTrees } from "../../api/index/index";
export default {
  name: "公司运营情况智能分析详情表",
  data() {
@@ -31,8 +32,10 @@
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      query: {},
      value1: "",
      value2: "",
      tableData: [
@@ -92,8 +95,10 @@
        searchShow: true,
        searchMenuSpan: 6,
        index: true,
        indexLabel: "#",
        viewBtn: true,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          // {
          //   label: "类别",
@@ -156,7 +161,8 @@
            prop: "enterpriseName",
            search: true,
            searchSpan: 4,
            display: false
            width: 300,
            display: false,
          },
          {
            label: "所属辖区",
@@ -167,7 +173,7 @@
            // dicMethod:'post',
            props: {
              label: "title",
              value: "id"
              value: "id",
            },
            dicData: [],
            search: true,
@@ -177,9 +183,9 @@
              {
                required: true,
                message: "请选择所属辖区",
                trigger: "blur"
              }
            ]
                trigger: "blur",
              },
            ],
          },
          // {
          //   label: "时间",
@@ -196,22 +202,22 @@
          {
            label: "总保安人数",
            prop: "znum",
            display: false
            display: false,
          },
          {
            label: "正常保安数",
            prop: "zcnum",
            display: false
            display: false,
          },
          {
            label: "持证保安数",
            prop: "cznum",
            display: false
            display: false,
          },
          {
            label: "保安派遣数",
            prop: "pcnum",
            display: false
            display: false,
          },
          // {
          //   label: "过考保安数",
@@ -221,60 +227,28 @@
          {
            label: "服务单位数",
            prop: "ghnum",
            display: false
            display: false,
          },
          {
            label: "缴纳社保保安数",
            prop: "sbnum",
            display: false
            display: false,
          },
          {
            label: "备注",
            prop: "bz",
            display: false
          }
        ]
            display: false,
          },
        ],
      },
      typeValue: "0",
      companyName: "",
      subOfficeData: [],
      subOfficeValue: "",
      loading: true
      loading: true,
    };
  },
  methods: {
    rowSave(row, done, loading) {
      adddata(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        },
        error => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowUpdates(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        },
        error => {
          window.console.log(error);
          loading();
        }
      );
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
@@ -288,9 +262,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);
@@ -302,17 +278,18 @@
      param["enterpriseName"] = params["enterpriseName"] || "";
      param["current"] = page.currentPage;
      param["size"] = page.pageSize;
      selectTb(param).then(res => {
      selectTb(param).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.tableData = res.data.data;
        this.tableData = data.records;
        this.$store.commit("setWindowSizeHeightAdd");
        this.loading = false;
      });
    },
    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 == "所属辖区") {
              item.dicData = res.data.data;
            }
@@ -330,16 +307,20 @@
        let mm = urlArr[i].split("=");
        object[decodeURIComponent(mm[0])] = decodeURIComponent(mm[1]);
      }
      let jurisdiction = object["jurisdiction"] || "";
      let jurisdiction = object["jurisdiction1"] || "";
      let enterpriseName = object["enterpriseName"] || "";
      let obj = { jurisdiction: jurisdiction, enterpriseName: enterpriseName };
      this.onLoad(this.page, obj);
    }
      this.query = {
        jurisdiction: jurisdiction,
        enterpriseName: enterpriseName,
      };
      this.onLoad(this.page, this.query);
    },
  },
  mounted() {
    this.getLocationParams();
    this.getSubOfficeData();
  }
    this.$store.commit("setWindowSizeHeightAdd");
  },
};
</script>
<style lang="scss" scoped>