From c69a03fa7f17e9b0f4c2836f3ad6695f35174b6b Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Sun, 22 Aug 2021 11:18:44 +0800
Subject: [PATCH] 保安员查询  跳转公司    公司详情加入  装备 车辆   枪支

---
 src/views/securityEquipment/car.vue        |   20 ++++++
 src/views/securityEquipment/equipments.js  |    1 
 src/views/securityUnitChild/index.vue      |   77 +++++++++++++++++--------
 src/views/securityEquipment/gun.vue        |   20 ++++++
 src/views/securityEquipment/equipments.vue |   26 ++++++++
 5 files changed, 117 insertions(+), 27 deletions(-)

diff --git a/src/views/securityEquipment/car.vue b/src/views/securityEquipment/car.vue
index dfc06cd..f742e84 100644
--- a/src/views/securityEquipment/car.vue
+++ b/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,
diff --git a/src/views/securityEquipment/equipments.js b/src/views/securityEquipment/equipments.js
index 147536b..55e58a7 100644
--- a/src/views/securityEquipment/equipments.js
+++ b/src/views/securityEquipment/equipments.js
@@ -80,6 +80,7 @@
             message: "请输入组织机构",
             trigger: "blur"
         }],
+        hide: false,
         search: true,
         overHidden: true,
         // addDisplay: true,
diff --git a/src/views/securityEquipment/equipments.vue b/src/views/securityEquipment/equipments.vue
index a5c3c54..2f488f0 100644
--- a/src/views/securityEquipment/equipments.vue
+++ b/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,
diff --git a/src/views/securityEquipment/gun.vue b/src/views/securityEquipment/gun.vue
index c1bd8ba..201dc21 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,
@@ -90,6 +91,9 @@
       //   for (var k = 0; k < 13; k++) {
       // form["deptId"] = form.tenantName;
       // delete form.tenantName;
+      if (this.fromDeptId != undefined) {
+        form["deptId"] = this.fromDeptId;
+      }
       adddata(form).then(
         (res) => {
           this.onLoad(this.page);
@@ -120,6 +124,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);
@@ -182,6 +189,19 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
+      params["deptId"] = this.fromDeptId;
+      // console.log(params.deptId);
+      if (params.deptId != undefined) {
+        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,
diff --git a/src/views/securityUnitChild/index.vue b/src/views/securityUnitChild/index.vue
index c23e6c5..a21c28d 100644
--- a/src/views/securityUnitChild/index.vue
+++ b/src/views/securityUnitChild/index.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="dispatch">
     <avue-tabs :option="optionTABS" @change="handleChangeTABS"></avue-tabs>
-    <span v-if="typeTABS.prop === 'tab1'">
+    <span v-if="typeTABS.prop === 'tab1'" class="tab">
       <!-- <avue-crud
         :option="option"
         :data="data"
@@ -37,7 +37,7 @@
         </avue-form>
       </basic-container>
     </span>
-    <span v-else-if="typeTABS.prop === 'tab2'">
+    <span v-else-if="typeTABS.prop === 'tab2'" class="tab">
       <!-- <span v-if="typeTABS.prop === 'tab2'"> -->
       <basic-container>
         <avue-crud
@@ -75,7 +75,7 @@
         </avue-crud>
       </basic-container>
     </span>
-    <span v-else-if="typeTABS.prop === 'tab3'">
+    <span v-else-if="typeTABS.prop === 'tab3'" class="tab">
       <basic-container>
         <avue-crud
           :option="option2"
@@ -112,7 +112,18 @@
         </avue-crud>
       </basic-container>
     </span>
-
+    <span v-else-if="typeTABS.prop === 'tab4'" class="tab">
+      <!-- 装备管理 -->
+      <equipments :fromDeptId="departmentid"></equipments>
+    </span>
+    <span v-else-if="typeTABS.prop === 'tab5'" class="tab">
+      <!-- 车辆管理 -->
+      <car :fromDeptId="departmentid"></car>
+    </span>
+    <span v-else-if="typeTABS.prop === 'tab6'" class="tab">
+      <!-- 枪支管理 -->
+      <gun :fromDeptId="departmentid"></gun>
+    </span>
     <el-dialog
       title="出资人导入"
       append-to-body
@@ -172,8 +183,16 @@
   update2,
   remove2,
 } from "@/api/securityUnit/securityUnit";
+import equipments from "../securityEquipment/equipments.vue";
+import car from "../securityEquipment/car.vue";
+import gun from "../securityEquipment/gun.vue";
 
 export default {
+  components: {
+    equipments: equipments,
+    car: car,
+    gun: gun,
+  },
   data() {
     var DIC = {
       VAILD: [
@@ -198,6 +217,8 @@
       ],
     };
     return {
+      departmentid: "",
+
       excelBox: false, //出资人
       excelForm: {},
       excelOption: {
@@ -272,28 +293,23 @@
             label: "主要管理人员信息",
             prop: "tab3",
           },
+          {
+            // icon: "el-icon-info",
+            label: "装备管理 ",
+            prop: "tab4",
+          },
+          {
+            // icon: "el-icon-info",
+            label: "车辆管理 ",
+            prop: "tab5",
+          },
+          {
+            // icon: "el-icon-info",
+            label: "枪支管理 ",
+            prop: "tab6",
+          },
         ],
       },
-
-      // loading: true, //保安单位基本信息
-      // selectionList: [],
-      // page: {
-      //   pageSize: 10,
-      //   currentPage: 1,
-      //   total: 0,
-      // },
-      // query: {},
-      // data: [],
-      // option: {
-      //   card: true,
-      //   searchSize: "mini",
-      //   searchMenuSpan: 6,
-      //   height: 547,
-      //   menuWidth: 160,
-      //   align: "center",
-      //   selection: true,
-      //   column: column,
-      // },
 
       //全局单位统一社会信用代码
       creditcode: "",
@@ -717,6 +733,7 @@
         row = JSON.parse(that.readLock("danweidata"));
         // that.obj0.title = row.enterprisename;
         // console.log(row, "row");
+        that.departmentid = row.departmentid;
         for (var k in row) {
           that.obj0[k] = row[k];
         }
@@ -788,7 +805,7 @@
 };
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 .dispatch {
   width: 100%;
   height: 100%;
@@ -807,4 +824,14 @@
 .el-collapse-item {
   padding-top: 15px !important;
 }
+
+.tab {
+  position: relative;
+  // border: 1px solid red;
+  height: 92%;
+  display: inline-block;
+  width: 100%;
+  overflow: hidden;
+  top: -10px;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3