From c4e67a8942e514b65ab41bb19781d50576c15725 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 24 Sep 2021 19:56:52 +0800
Subject: [PATCH] 用户

---
 src/views/securityEquipment/gun.vue |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/src/views/securityEquipment/gun.vue b/src/views/securityEquipment/gun.vue
index 2eec3f4..7bc403c 100644
--- a/src/views/securityEquipment/gun.vue
+++ b/src/views/securityEquipment/gun.vue
@@ -36,6 +36,7 @@
 import { getdata, adddata, update, remove } from "@/api/gun/gun";
 
 export default {
+  props: ["fromDeptId"],
   data() {
     return {
       loading: true,
@@ -56,7 +57,9 @@
         index: true,
         menuWidth: 160,
         align: "center",
+        border: true,
         selection: true,
+        labelWidth:110,
         column: column,
       },
     };
@@ -87,8 +90,11 @@
       //   var form = this.data[0];
       //   delete form.id;
       //   for (var k = 0; k < 13; k++) {
-      form["deptId"] = form.tenantName;
-      delete form.tenantName;
+      // form["deptId"] = form.tenantName;
+      // delete form.tenantName;
+      if (this.fromDeptId != undefined) {
+        form["deptId"] = this.fromDeptId;
+      }
       adddata(form).then(
         (res) => {
           this.onLoad(this.page);
@@ -117,8 +123,11 @@
     },
     rowUpdate(row, index, done, loading) {
       // console.log(row);
-      row["deptId"] = row.tenantName;
-      delete row.tenantName;
+      // row["deptId"] = row.tenantName;
+      // delete row.tenantName;
+      if (this.fromDeptId != undefined) {
+        row["deptId"] = this.fromDeptId;
+      }
       update(row).then(
         () => {
           this.onLoad(this.page);
@@ -181,6 +190,19 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
+      // console.log(params.deptId);
+      if (this.fromDeptId != undefined) {
+        params["deptId"] = this.fromDeptId;
+        this.option.column[5].search = false;
+        this.option.column[5].hide = true;
+        this.option.column[5].addDisplay = false;
+        this.option.column[5].editDisplay = false;
+      } else {
+        this.option.column[5].search = true;
+        this.option.column[5].hide = false;
+        this.option.column[5].addDisplay = true;
+        this.option.column[5].editDisplay = true;
+      }
       getdata(
         page.currentPage,
         page.pageSize,

--
Gitblit v1.9.3