zhongrj
2024-03-27 cc1c0a396698648256c350f6f0fe2cb2f0b02c7e
src/views/statisticalQueryManagement/companyDetails.vue
@@ -2,12 +2,17 @@
  <basic-container>
    <avue-crud
      :option="tableOption"
      :data="tableData"
      :page.sync="tablePage"
      :table-loading="loading"
      :data="tableData"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      @date-change="dateChange"
      ref="crud"
      @search-change="searchChange"
      @search-reset="searchReset"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
@@ -19,8 +24,15 @@
import { selectUIn } from "../../api/statisticalQueryManagement/statisticalQueryManagement";
export default {
  name: "公司人员详情",
  props: ["fwdeptId"],
  data() {
    return {
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      query: {},
      value1: "",
      value2: "",
      tableData: [
@@ -61,11 +73,6 @@
        //   send: "是"
        // }
      ],
      tablePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      tableOption: {
        excelBtn: true,
        delBtn: false,
@@ -76,37 +83,47 @@
        // dateBtn: true,
        align: "center",
        height: "auto",
        calcHeight: 90,
        calcHeight: 30,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchMenuSpan: 10,
        index: true,
        indexLabel:'序号',
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "保安员姓名",
            searchLabelWidth: 110,
            label: "保安姓名",
            // searchLabelWidth: 90,
            prop: "real_name",
            search: true,
            searchSpan: 4,
            display: false
          },
          {
            label: "企业名称",
            prop: "enterpriseName",
            width: 300,
            display: false
          },
          {
            label: "保安员编号",
            label: "保安证编号",
            prop: "securitynumber",
            width: 180,
            display: false
          },
          {
            label: "身份证号",
            prop: "cardid",
            width: 180,
            display: false
          },
          {
            label: "联系电话",
            label: "联系方式",
            prop: "phone",
            width: 180,
            display: false
          },
          {
@@ -122,12 +139,16 @@
            // dicUrl:subofficeOptions,
            dicData: [
              {
                value: "0",
                value: "1",
                label: "是"
              },
              {
                value: "2",
                label: "否"
              },
              {
                value: "3",
                label: "吊销"
              }
            ],
            search: true,
@@ -142,7 +163,7 @@
          {
            label: "是否缴纳社保",
            //  labelWidth: 120,
            searchLabelWidth: 110,
            searchLabelWidth: 100,
            prop: "soil",
            searchSpan: 4,
            type: "select",
@@ -156,7 +177,7 @@
                label: "是"
              },
              {
                value: "2",
                value: "1",
                label: "否"
              }
            ],
@@ -186,7 +207,7 @@
                label: "是"
              },
              {
                value: "2",
                value: "1",
                label: "否"
              }
            ],
@@ -201,7 +222,7 @@
          },
          {
            label: "资格审查情况",
            searchLabelWidth: 110,
            searchLabelWidth: 100,
            prop: "examination_type",
            searchSpan: 4,
            type: "select",
@@ -212,10 +233,10 @@
            dicData: [
              {
                value: "0",
                label: "通过"
                label: "正常"
              },
              {
                value: "2",
                value: "1",
                label: "异常"
              }
            ],
@@ -272,7 +293,7 @@
                label: "是"
              },
              {
                value: "2",
                value: "1",
                label: "否"
              }
            ],
@@ -288,7 +309,8 @@
        ]
      },
      companyName: "",
      loading: true
      loading: true,
      deptid: ""
    };
  },
  computed: {
@@ -303,44 +325,84 @@
    }
  },
  methods: {
    dateChange() {},
    getTableData() {
      selectUIn({ deptid: "1412222709480509442",current: 1, size: 10 }).then(
        res => {
          if (res.data.code === 200) {
            this.tableData = res.data.data;
            this.loading = false;
          }
        }
      );
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page, this.query);
    },
    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);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      // if (!params) {
      //   params = { current: page.currentPage, size: page.pageSize };
      // }
      let param = {};
      param["deptid"] = this.fwdeptId;
      param["name"] = params["real_name"] || "";
      param["hold"] =
        params["hold"] || params["hold"] == "0" ? Number(params["hold"]) : "";
      param["photo"] =
        params["photo"] || params["photo"] == "0"
          ? Number(params["photo"])
          : "";
      param["examinationtype"] =
        params["examination_type"] || params["examination_type"] == "0"
          ? Number(params["examination_type"])
          : "";
      param["dispatch"] =
        params["dispatch"] || params["dispatch"] == "0"
          ? Number(params["dispatch"])
          : "";
      param["soil"] =
        params["soil"] || params["soil"] == "0" ? Number(params["soil"]) : "";
      param["current"] = page.currentPage;
      param["size"] = page.pageSize;
      selectUIn(param).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.tableData = data.records;
        // this.data = data.records;
        this.loading = false;
      });
    },
    getLocationParams() {
      let url = window.location.href;
      let urlArr = url.split("?")[1].split("&");
      var object = new Object();
      for (var i = 0; i < urlArr.length; i++) {
        let mm = urlArr[i].split("=");
        object[decodeURIComponent(mm[0])] = decodeURIComponent(mm[1]);
      }
      this.deptid = object["deptid"] || "";
      this.query = { deptid: this.deptid };
      this.onLoad(this.page, this.query);
    }
    // downExcel() {
    //   let et = XLSX.utils.table_to_book(document.getElementById("table"));
    //   let etout = XLSX.write(et, {
    //     bookType: "xlsx",
    //     bookSST: true,
    //     type: "array"
    //   });
    //   try {
    //     FileSaver.saveAs(
    //       new Blob([etout], {
    //         type: "application/octet-stream"
    //       }),
    //       `表.xlsx`
    //     ); //导出的文件名
    //   } catch (e) {
    //     console.log(e, etout);
    //   }
    //   return etout;
    // }
  },
  mounted() {
    this.getTableData();
    // this.getTableData();
    // this.getLocationParams();
  }
};
</script>
<style lang="scss" scoped>
/deep/ .avue-crud__menu {
  height: 130px !important;
}
// /deep/ .avue-crud__menu {
//   height: 130px !important;
// }
</style>