liuyg
2021-08-22 c69a03fa7f17e9b0f4c2836f3ad6695f35174b6b
src/views/securityEquipment/equipments.vue
@@ -62,6 +62,7 @@
import { getdata, adddata, update, remove } from "@/api/equipments/equipments";
export default {
  props: ["fromDeptId"],
  data() {
    return {
      excelBox: false,
@@ -154,9 +155,14 @@
      //   var form = this.data[0];
      //   delete form.id;
      //   for (var k = 0; k < 13; k++) {
      console.log(form, "12135");
      // console.log(form, "12135");
      // form["deptId"] = form.tenantName;
      // delete form.tenantName;
      // console.log(this.fromDeptId);
      // console.log(form);
      if (this.fromDeptId != undefined) {
        form["deptId"] = this.fromDeptId;
      }
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
@@ -186,7 +192,10 @@
    rowUpdate(row, index, done, loading) {
      // row["deptId"] = row.tenantName;
      // delete row.tenantName;
      console.log(row.deptId);
      // console.log(row.deptId);
      if (this.fromDeptId != undefined) {
        row["deptId"] = this.fromDeptId;
      }
      update(row).then(
        () => {
          this.onLoad(this.page);
@@ -249,6 +258,19 @@
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["deptId"] = this.fromDeptId;
      // console.log(params.deptId);
      if (params.deptId != undefined) {
        this.option.column[6].search = false;
        this.option.column[6].hide = true;
        this.option.column[6].addDisplay = false;
        this.option.column[6].editDisplay = false;
      } else {
        this.option.column[6].search = true;
        this.option.column[6].hide = false;
        this.option.column[6].addDisplay = true;
        this.option.column[6].editDisplay = true;
      }
      getdata(
        page.currentPage,
        page.pageSize,