zhengpz
2021-08-22 b6d9bbb38cc344d1538439750c3db5a4a6b0d79a
src/views/statisticalQueryManagement/companyDetails.vue
@@ -2,12 +2,19 @@
  <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"
      @row-update="rowUpdates"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
@@ -21,6 +28,12 @@
  name: "公司人员详情",
  data() {
    return {
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      query: {},
      value1: "",
      value2: "",
      tableData: [
@@ -61,11 +74,6 @@
        //   send: "是"
        // }
      ],
      tablePage: {
        pageSize: 10,
        currentPage: 1,
        total: 0
      },
      tableOption: {
        excelBtn: true,
        delBtn: false,
@@ -303,17 +311,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;
          }
    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;
      this.onLoad(this.page, params);
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    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"] = "1412222709480509442";
      param["current"] = page.currentPage;
      param["size"] = page.pageSize;
      selectUIn(param).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.tableData = res.data.data;
        // this.data = data.records;
        this.loading = false;
        // this.selectionClear();
      });
    },
    // getTableData() {
    //   selectUIn(param).then(res => {
    //     if (res.data.code === 200) {
    //       this.tableData = res.data.data;
    //       this.loading = false;
    //     }
    //   });
    // }
    // downExcel() {
    //   let et = XLSX.utils.table_to_book(document.getElementById("table"));
    //   let etout = XLSX.write(et, {
@@ -335,7 +410,7 @@
    // }
  },
  mounted() {
    this.getTableData();
    // this.getTableData();
  }
};
</script>