liuyg
2021-08-22 c69a03fa7f17e9b0f4c2836f3ad6695f35174b6b
src/views/securityEquipment/car.vue
@@ -62,6 +62,7 @@
import { getdata, adddata, update, remove } from "@/api/car/car";
export default {
  props: ["fromDeptId"],
  data() {
    return {
      excelBox: false,
@@ -158,6 +159,9 @@
      // form["deptId"] = form.tenantName;
      // delete form.tenantName;
      // console.log(form);
      if (this.fromDeptId != undefined) {
        form["deptId"] = this.fromDeptId;
      }
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
@@ -188,6 +192,9 @@
      // console.log(row);
      // row["deptId"] = row.tenantName;
      // delete row.tenantName;
      if (this.fromDeptId != undefined) {
        row["deptId"] = this.fromDeptId;
      }
      update(row).then(
        () => {
          this.onLoad(this.page);
@@ -250,6 +257,19 @@
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["deptId"] = this.fromDeptId;
      // console.log(params.deptId);
      if (params.deptId != undefined) {
        this.option.column[4].search = false;
        this.option.column[4].hide = true;
        this.option.column[4].addDisplay = false;
        this.option.column[4].editDisplay = false;
      } else {
        this.option.column[4].search = true;
        this.option.column[4].hide = false;
        this.option.column[4].addDisplay = true;
        this.option.column[4].editDisplay = true;
      }
      getdata(
        page.currentPage,
        page.pageSize,