From 79d9fc857559982b00b68b2d709807bdc4cd286f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 11 Apr 2022 10:58:17 +0800
Subject: [PATCH] minio 地址修改

---
 src/views/securityUnitChild/index.vue | 1520 ++++++++++++++++++++-------------------------------------
 1 files changed, 541 insertions(+), 979 deletions(-)

diff --git a/src/views/securityUnitChild/index.vue b/src/views/securityUnitChild/index.vue
index 7d3a1b6..bb3669b 100644
--- a/src/views/securityUnitChild/index.vue
+++ b/src/views/securityUnitChild/index.vue
@@ -1,1027 +1,468 @@
 <template>
   <div class="dispatch">
-    <!-- <avue-tabs :option="optionTABS" @change="handleChangeTABS"></avue-tabs>
-    <span v-if="typeTABS.prop === 'tab1'" class="tab">
-      <basic-container>
-        <avue-form
-          ref="form"
-          v-model="obj0"
-          :option="option0"
-          @submit="submit0"
-        >
-        </avue-form>
-      </basic-container>
-    </span>
-    <span v-if="typeTABS.prop === 'tab11'" class="tab">
-      <basic-container>
-        <avue-form
-          ref="form"
-          v-model="obj0"
-          :option="option01"
-          @submit="submit0"
-        >
-        </avue-form>
-      </basic-container>
-    </span>
-    <span v-else-if="typeTABS.prop === 'tab2'" class="tab">
-      <basic-container>
-        <avue-crud
-          :option="option1"
-          :data="data1"
-          :page.sync="page1"
-          ref="crudrec1"
-          :table-loading="loading1"
-          @row-save="rowSave1"
-          @search-change="searchChange1"
-          @search-reset="searchReset1"
-          @row-update="rowUpdate1"
-          @row-del="rowDel1"
-          @selection-change="selectionChange1"
-          @refresh-change="refreshChange1"
-          @on-load="onLoad1"
-        >
-          <template slot="menuLeft">
-            <el-button
-              type="danger"
-              size="small"
-              plain
-              icon="el-icon-delete"
-              @click="handleDelete1"
-              >删 除
-            </el-button>
-            <el-button
-              type="success"
-              size="small"
-              plain
-              icon="el-icon-upload2"
-              @click="handleImport"
-              >批量导入
-            </el-button>
-          </template>
-        </avue-crud>
-      </basic-container>
-    </span>
-    <span v-else-if="typeTABS.prop === 'tab3'" class="tab">
-      <basic-container>
-        <avue-crud
-          :option="option2"
-          :data="data2"
-          :page.sync="page2"
-          ref="crudrec2"
-          :table-loading="loading2"
-          @row-save="rowSave2"
-          @search-change="searchChange2"
-          @search-reset="searchReset2"
-          @row-update="rowUpdate2"
-          @row-del="rowDel2"
-          @selection-change="selectionChange2"
-          @refresh-change="refreshChange2"
-          @on-load="onLoad2"
-        >
-          <template slot="menuLeft">
-            <el-button
-              type="danger"
-              size="small"
-              plain
-              icon="el-icon-delete"
-              @click="handleDelete2"
-              >删 除
-            </el-button>
-            <el-button
-              type="success"
-              size="small"
-              plain
-              icon="el-icon-upload2"
-              @click="handleImport1"
-              >批量导入
-            </el-button>
-          </template>
-        </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 === 'tab9'" class="tab">
-      <social :deptid="obj0.departmentid"></social>
-    </span>
-    <span v-else-if="typeTABS.prop === 'tab7'" class="tab">
-      <businessLicense :row="obj0"></businessLicense>
-    </span>
-    <span v-else-if="typeTABS.prop === 'tab8'" class="tab">
-      <licence :row="obj0"></licence>
-    </span> -->
     <el-tabs v-model="activeName" @tab-click="handleClick">
-      <!-- <span v-if="typeTABS.prop === 'tab1'" class="tab"> -->
-      <el-tab-pane label="保安单位基本信息" name="tab1">
+      <!-- 基本信息 -->
+      <el-tab-pane :label="baseTitle" name="tab1">
         <basic-container>
           <avue-form
             ref="form"
-            v-model="obj0"
-            :option="option0"
-            @submit="submit0"
+            v-model="objBase"
+            :option="optionBase"
+            @submit="submitBase"
           >
           </avue-form>
         </basic-container>
-        <!-- </span> -->
       </el-tab-pane>
-      <!-- <span v-if="typeTABS.prop === 'tab11'" class="tab"> -->
+      <!-- 工商信息 -->
       <el-tab-pane label="工商信息" name="tab11">
         <basic-container>
           <avue-form
+            v-if="businessVisiable"
             ref="form"
-            v-model="obj0"
+            v-model="obj"
             :option="option01"
-            @submit="submit0"
+            @submit="submitBase"
+          >
+          </avue-form>
+          <avue-form
+            v-if="!businessVisiable"
+            ref="businessForm"
+            v-model="businessObj"
+            :option="businessOption"
+            @submit="businessSubmit"
           >
           </avue-form>
         </basic-container>
-        <!-- </span> -->
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab2'" class="tab"> -->
-      <el-tab-pane label="保安单位出资人员" name="tab2">
-        <basic-container>
-          <avue-crud
-            :option="option1"
-            :data="data1"
-            :page.sync="page1"
-            ref="crudrec1"
-            :table-loading="loading1"
-            @row-save="rowSave1"
-            @search-change="searchChange1"
-            @search-reset="searchReset1"
-            @row-update="rowUpdate1"
-            @row-del="rowDel1"
-            @selection-change="selectionChange1"
-            @refresh-change="refreshChange1"
-            @on-load="onLoad1"
-          >
-            <template slot="menuLeft">
-              <el-button
-                type="danger"
-                size="small"
-                plain
-                icon="el-icon-delete"
-                @click="handleDelete1"
-                >删 除
-              </el-button>
-              <el-button
-                type="success"
-                size="small"
-                plain
-                icon="el-icon-upload2"
-                @click="handleImport"
-                >批量导入
-              </el-button>
-            </template>
-          </avue-crud>
-        </basic-container>
-        <!-- </span> -->
+      <!-- 出资人列表信息 -->
+      <el-tab-pane :label="tab2label" name="tab2" v-if="shareholderVisiable">
+        <shareholder
+          v-if="seeWhere == 'tab2'"
+          :deptid="departmentid"
+          :windowHeight="windowHeight"
+        ></shareholder>
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab3'" class="tab"> -->
-      <el-tab-pane label="主要管理人员信息" name="tab3">
-        <basic-container>
-          <avue-crud
-            :option="option2"
-            :data="data2"
-            :page.sync="page2"
-            ref="crudrec2"
-            :table-loading="loading2"
-            @row-save="rowSave2"
-            @search-change="searchChange2"
-            @search-reset="searchReset2"
-            @row-update="rowUpdate2"
-            @row-del="rowDel2"
-            @selection-change="selectionChange2"
-            @refresh-change="refreshChange2"
-            @on-load="onLoad2"
-          >
-            <template slot="menuLeft">
-              <el-button
-                type="danger"
-                size="small"
-                plain
-                icon="el-icon-delete"
-                @click="handleDelete2"
-                >删 除
-              </el-button>
-              <el-button
-                type="success"
-                size="small"
-                plain
-                icon="el-icon-upload2"
-                @click="handleImport1"
-                >批量导入
-              </el-button>
-            </template>
-          </avue-crud>
-        </basic-container>
-        <!-- </span> -->
+      <!-- 主要管理人信息 -->
+      <el-tab-pane :label="managerLabel" name="tab3">
+        <manager
+          v-if="seeWhere == 'tab3'"
+          :deptid="departmentid"
+          :stats="stats"
+        ></manager>
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab4'" class="tab"> -->
-      <el-tab-pane label="装备管理" name="tab4">
-        <!-- 装备管理 -->
-        <equipments :fromDeptId="departmentid" v-if="overzb"></equipments>
-        <!-- </span> -->
+      <!-- 装备管理列表 -->
+      <el-tab-pane label="装备管理" name="tab4" v-if="equipmentVisiable">
+        <equipments
+          v-if="seeWhere == 'tab4'"
+          :fromDeptId="departmentid"
+          :windowHeight="windowHeight"
+        ></equipments>
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab5'" class="tab"> -->
-      <el-tab-pane label="车辆管理" name="tab5">
-        <!-- 车辆管理 -->
-        <car :fromDeptId="departmentid" v-if="overcar"></car>
-        <!-- </span> -->
+      <!-- 车辆管理 -->
+      <el-tab-pane label="车辆管理" name="tab5" v-if="carVisiable">
+        <car
+          :fromDeptId="departmentid"
+          v-if="seeWhere == 'tab5'"
+          :windowHeight="windowHeight"
+        ></car>
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab6'" class="tab">
-      枪支管理
-      <gun :fromDeptId="departmentid"></gun>
-    </span> -->
-      <!-- <span v-else-if="typeTABS.prop === 'tab9'" class="tab"> -->
+      <!-- 社保记录  -->
       <el-tab-pane label="社保记录" name="tab9">
-        <!-- 社保记录  -->
         <social
-          :deptid="obj0.departmentid"
+          :deptid="objBase.departmentid"
           :socialRE="social"
-          v-if="social"
+          v-if="seeWhere == 'tab9'"
         ></social>
         <!-- </span> -->
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab7'" class="tab"> -->
-      <el-tab-pane label="营业执照" name="tab7">
-        <!-- 营业执照 -->
-        <businessLicense :row="obj0" v-if="overHtp"></businessLicense>
-        <!-- </span> -->
+      <!-- 营业执照 -->
+      <el-tab-pane label="营业执照" name="tab7" v-if="false">
+        <businessLicense :row="objBase" v-if="overHtp"></businessLicense>
       </el-tab-pane>
-      <!-- <span v-else-if="typeTABS.prop === 'tab8'" class="tab"> -->
-      <el-tab-pane label="许可证" name="tab8">
-        <!-- 许可证  -->
-        <licence :row="obj0" v-if="overHtp"></licence>
-        <!-- </span> -->
+      <!-- 许可证  -->
+      <el-tab-pane :label="licenceLabel" name="tab8" v-if="licenceVisiable">
+        <!-- <licence :row="objBase" v-if="overHtp"></licence> -->
+        <basic-container>
+          <avue-form
+            v-if="true"
+            ref="lincenceForm"
+            v-model="licenceObj"
+            :option="licenceOption"
+            @submit="licenceSubmit"
+          ></avue-form>
+          <avue-form
+            v-if="false"
+            ref="licenceGroupForm"
+            v-model="licenceGroupObj"
+            :option="licenceGroupOption"
+            @submit="licenceGroupSubmit"
+          >
+          </avue-form>
+        </basic-container>
+      </el-tab-pane>
+      <!-- 备案证  -->
+      <el-tab-pane label="备案证" name="tab12" v-if="certificdinedVisiable">
+        <licence :row="objBase" v-if="overHtp"></licence>
       </el-tab-pane>
     </el-tabs>
-    <el-dialog
-      title="出资人导入"
-      append-to-body
-      :visible.sync="excelBox"
-      width="555px"
-    >
-      <avue-form
-        :option="excelOption"
-        v-model="excelForm"
-        :upload-after="uploadAfter"
-      >
-        <template slot="excelTemplate">
-          <el-button type="primary" @click="handleTemplate">
-            点击下载<i class="el-icon-download el-icon--right"></i>
-          </el-button>
-        </template>
-      </avue-form>
-    </el-dialog>
-
-    <el-dialog
-      title="管理人导入"
-      append-to-body
-      :visible.sync="excelBox1"
-      width="555px"
-    >
-      <avue-form
-        :option="excelOption1"
-        v-model="excelForm1"
-        :upload-after="uploadAfter1"
-      >
-        <template slot="excelTemplate">
-          <el-button type="primary" @click="handleTemplate1">
-            点击下载<i class="el-icon-download el-icon--right"></i>
-          </el-button>
-        </template>
-      </avue-form>
-    </el-dialog>
   </div>
-</template> 
+</template>
 
 <script>
-import { column11, column, column1, column2 } from "./data";
+import {
+  column11,
+  column,
+  filialeColumn,
+  selfColumn,
+  lincenceColumn,
+  businessColumn,
+  lincenceGroupColumn,
+  lincenceGroupColumns,
+  lincenceTrainColumn
+} from "./data";
 import {
   getOncedata,
-  // getdata,
-  // adddata,
   update,
-  // remove,
-  getdataOnce1,
-  getdata1,
-  adddata1,
-  update1,
-  remove1,
-  getdataOnce2,
-  getdata2,
-  adddata2,
-  update2,
-  remove2,
+  getBusinessInfo,
+  submit,
+  getLicenceDetail,
+  licenceSubmit,
+  submitGroup
 } from "@/api/securityUnit/securityUnit";
+import manager from "./manager.vue";
+import shareholder from "./shareholder.vue";
 import equipments from "../securityEquipment/equipments.vue";
 import car from "../securityEquipment/car.vue";
 import gun from "../securityEquipment/gun.vue";
 import licence from "./licence.vue";
 import businessLicense from "./businessLicense.vue";
 import social from "./social.vue";
-import { mapState } from "vuex";
+import { mapGetters } from "vuex";
 import { getRoleDetail } from "@/api/system/role";
 
 export default {
   components: {
-    equipments: equipments,
-    car: car,
-    gun: gun,
-    licence: licence,
-    businessLicense: businessLicense,
-    social: social,
+    equipments,
+    car,
+    gun,
+    licence,
+    businessLicense,
+    social,
+    manager,
+    shareholder
   },
   data() {
-    var DIC = {
-      VAILD: [
-        {
-          label: "真",
-          value: "true",
-        },
-        {
-          label: "假",
-          value: "false",
-        },
-      ],
-      SEX: [
-        {
-          label: "男",
-          value: 0,
-        },
-        {
-          label: "女",
-          value: 1,
-        },
-      ],
-    };
     return {
-      overcar: false, //结决id传入、信息获取的优先级
-      overzb: false, //结决id传入、信息获取的优先级
-      overcar: false, //结决id传入、信息获取的优先级
-
-      social: false, //解决表格错乱
+      tab2label: "出资人信息",
+      managerLabel: "主要管理人信息",
+      licenceLabel: "许可证信息",
+      baseTitle: "基本信息",
+      visible: false,
+      certificdinedVisiable: false,
+      businessVisiable: true,
+      licenceVisiable: true,
+      shareholderVisiable: true,
+      equipmentVisiable: true,
+      carVisiable: true,
+      seeWhere: "tab1",
+      //结决id传入、信息获取的优先级
+      overzb: false,
+      overmanager: false,
+      overshareholder: false,
+      //结决id传入、信息获取的优先级
+      overcar: false,
+      //解决表格错乱
+      social: false,
       overHtp: false,
-
       activeName: "tab1",
-
+      stats: "",
+      deptId: "",
       departmentid: "",
-
-      excelBox: false, //出资人
-      excelForm: {},
-      excelOption: {
-        submitBtn: false,
-        emptyBtn: false,
-        column: [
-          {
-            label: "文件上传",
-            prop: "excelFile",
-            type: "upload",
-            drag: true,
-            loadText: "文件上传中,请稍等",
-            span: 24,
-            propsHttp: {
-              res: "data",
-            },
-            tip: "请上传 .xls,.xlsx 标准格式文件",
-            action: "/api/shareholder/import-share",
-          },
-          {
-            label: "模板下载",
-            prop: "excelTemplate",
-            formslot: true,
-            span: 24,
-          },
-        ],
-      },
-
-      excelBox1: false, //管理人
-      excelForm1: {},
-      excelOption1: {
-        submitBtn: false,
-        emptyBtn: false,
-        column: [
-          {
-            label: "文件上传",
-            prop: "excelFile",
-            type: "upload",
-            drag: true,
-            loadText: "文件上传中,请稍等",
-            span: 24,
-            propsHttp: {
-              res: "data",
-            },
-            tip: "请上传 .xls,.xlsx 标准格式文件",
-            action: "/api/member/import-member",
-          },
-          {
-            label: "模板下载",
-            prop: "excelTemplate",
-            formslot: true,
-            span: 24,
-          },
-        ],
-      },
-
-      typeTABS: {}, //标签页
-      optionTABS: {
-        column: [
-          {
-            // icon: "el-icon-info",
-            label: "保安单位基本信息",
-            prop: "tab1",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "工商信息",
-            prop: "tab11",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "保安单位出资人员",
-            prop: "tab2",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "主要管理人员信息",
-            prop: "tab3",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "装备管理 ",
-            prop: "tab4",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "车辆管理 ",
-            prop: "tab5",
-          },
-          // {
-          //   // icon: "el-icon-info",
-          //   label: "枪支管理 ",
-          //   prop: "tab6",
-          // },
-          {
-            // icon: "el-icon-info",
-            label: "社保记录 ",
-            prop: "tab9",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "营业执照 ",
-            prop: "tab7",
-          },
-          {
-            // icon: "el-icon-info",
-            label: "许可证 ",
-            prop: "tab8",
-          },
-        ],
-      },
-
       //全局单位统一社会信用代码
       creditcode: "",
       //保安单位信息表单
-      obj0: {
+      objBase: {
         // title: "我是头部标题",
       },
-      option0: {
+      formData: {},
+      businessObj: {},
+      businessOption: {
+        height: "auto",
+        // calcHeight: 80,
+        emptyBtn: false,
+        // submitBtn:false,
+        submitText: "保存",
+        group: businessColumn
+      },
+      licenceGroupObj: {},
+      licenceGroupOption: {
+        height: "auto",
+        emptyBtn: false,
+        submitText: "保存",
+        group: [
+          {
+            label: "总公司许可证信息",
+            labelWidth: "110",
+            prop: "baseInfo",
+            icon: "el-icon-user-solid",
+            column: lincenceGroupColumn
+          },
+          {
+            label: "分公司许可证信息",
+            prop: "detailInfo",
+            labelWidth: "110",
+            icon: "el-icon-s-order",
+            column: lincenceGroupColumns
+          }
+        ]
+      },
+      licenceObj: {},
+      licenceOption: {
+        emptyBtn: false,
+        // submitBtn: false,
+        submitText: "保存",
+        gutter: 30,
+        column: lincenceColumn
+      },
+      optionBase: {
         emptyBtn: false,
         submitBtn: false,
         submitText: "保存",
         gutter: 30,
-        column: column,
+        column: column
       },
-
       option01: {
         emptyBtn: false,
         submitBtn: false,
         submitText: "保存",
         gutter: 30,
-        column: column11,
-      },
-
-      loading1: true, //派遣记录
-      selectionList1: [],
-      page1: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0,
-      },
-      query1: {},
-      data1: [],
-      option1: {
-        // card: true,
-        tip: false,
-        searchSize: "mini",
-        searchMenuSpan: 8,
-        height: 563,
-        menuWidth: 200,
-        align: "center",
-        selection: true,
-        column: column1,
-      },
-
-      loading2: true, //派遣记录
-      selectionList2: [],
-      page2: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0,
-      },
-      query2: {},
-      data2: [],
-      option2: {
-        // card: true,
-        tip: false,
-        searchSize: "mini",
-        searchMenuSpan: 8,
-        height: 563,
-        menuWidth: 200,
-        menuAlign: "center",
-        align: "center",
-        selection: true,
-        column: column2,
-      },
+        column: column11
+      }
     };
   },
   computed: {
-    ...mapState({
-      userInfo: (state) => state.user.userInfo,
-    }),
+    ...mapGetters(["userInfo", "windowHeight"]),
     chuzitime() {
       return this.data1.capitaltime;
-    },
-    // ids() {
-    //   let ids = [];
-    //   this.selectionList.forEach((ele) => {
-    //     ids.push(ele.id);
-    //   });
-    //   return ids.join(",");
-    // },
-    ids1() {
-      let ids1 = [];
-      this.selectionList1.forEach((ele) => {
-        ids1.push(ele.id);
-      });
-      return ids1.join(",");
-    },
-    ids2() {
-      let ids2 = [];
-      this.selectionList2.forEach((ele) => {
-        ids2.push(ele.id);
-      });
-      return ids2.join(",");
-    },
+    }
   },
   methods: {
-    submit0(row, done, loading) {
-      // let nowTab = this.typeTABS.prop;
-      // console.log(this.typeTABS);
-      if (this.userInfo.role_name == "保安公司管理员") {
-        row["departmentid"] = this.userInfo.dept_id;
+    //分公司工商信息修改
+    businessSubmit(row, done, loading) {
+      var that = this;
+      if (
+        this.userInfo.role_name == "保安公司管理员" ||
+        this.userInfo.role_name == "培训公司管理员" ||
+        this.userInfo.role_name == "分公司管理员"
+      ) {
+        //分公司
+        var f = {
+          departmentid: this.userInfo.dept_id,
+          id: this.formData.id,
+          businessLicense: row.businessLicense,
+          establishtime: row.establishtime,
+          creditcode: row.creditcode,
+          registeredcapital: row.registeredcapital,
+          business: row.business
+        };
+        //总公司
+        var z = {
+          id: row.id,
+          deptId: this.userInfo.dept_id,
+          registerTime: row.registerTime,
+          socialCreditCode: row.socialCreditCode,
+          capital: row.capital,
+          businessScope: row.businessScope,
+          trading: row.trading
+        };
       }
-      console.log(row);
-      update(row).then(
+
+      //分公司工商信息修改
+      update(f).then(
         () => {
-          // this.onLoad(this.page);
-          // this.onloads();
           this.$message({
             type: "success",
-            message: "操作成功!",
+            message: "操作成功!"
           });
-          this.onloads();
           done();
         },
-        (error) => {
+        error => {
           window.console.log(error);
           loading();
         }
       );
-
+      //总公司工商信息修改
+      submit(z).then(
+        res => {
+          that.businessObj = row;
+          that.businessObj.id = res.data.data.id;
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
       done();
     },
-    handleImport() {
-      //出资人
-      this.excelBox = true;
-    },
-    uploadAfter(res, done, loading, column) {
-      window.console.log(column);
-      this.excelBox = false;
-      this.refreshChange1();
+    //分公司许可证信息修改
+    licenceSubmit(row, done, loading) {
+      var that = this;
+      if (
+        this.userInfo.role_name == "保安公司管理员" ||
+        this.userInfo.role_name == "培训公司管理员" ||
+        this.userInfo.role_name == "分公司管理员"
+      ) {
+        row["deptId"] = this.userInfo.dept_id;
+        row["id"] = that.licenceObj.id;
+      }
+
+      if (this.stats == "1") {
+        row["type"] = 2;
+      } else {
+        row["type"] = 1;
+      }
+
+      if (row.id) {
+        row["updateUser"] = this.userInfo.Id;
+      } else {
+        row["createUser"] = this.userInfo.Id;
+      }
+      licenceSubmit(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          that.getLicenceInfo();
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
       done();
     },
-    handleTemplate() {
-      window.open(`/api/shareholder/export-template`);
-    },
-
-    handleImport1() {
-      //管理人
-      this.excelBox1 = true;
-    },
-    uploadAfter1(res, done, loading, column) {
-      window.console.log(column);
-      this.excelBox1 = false;
-      this.refreshChange2();
+    //其他公司基本信息,工商信息修改
+    submitBase(row, done, loading) {
+      var that = this;
+      if (
+        this.userInfo.role_name == "保安公司管理员" ||
+        this.userInfo.role_name == "培训公司管理员" ||
+        this.userInfo.role_name == "分公司管理员"
+      ) {
+        row["departmentid"] = this.userInfo.dept_id;
+        row["id"] = this.formData.id;
+      }
+      // console.log(row);
+      update(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          that.formData = row;
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
       done();
     },
-    handleTemplate1() {
-      window.open(`/api/member/export-template`);
-    },
+    //分公司许可信息修改
+    licenceGroupSubmit(row, done, loading) {
+      var that = this;
+      if (
+        this.userInfo.role_name == "保安公司管理员" ||
+        this.userInfo.role_name == "培训公司管理员" ||
+        this.userInfo.role_name == "分公司管理员"
+      ) {
+        row["deptId"] = this.userInfo.dept_id;
+        row["id"] = that.licenceGroupObj.id;
+        row["sid"] = that.licenceGroupObj.sid;
+      }
+      row["type"] = 1;
 
-    // handleChangeTABS(column) {
-    //   // this.typeTABS = column;
-    //   // console.log(column.prop);
-    //   // this.$message.success(JSON.stringify(column));
-    //   if (column.prop == "tab1") {
-    //     this.loading1 = false;
-    //     this.loading2 = false;
-    //     // this.onLoad(this.page);
-    //   } else if (column.prop == "tab2") {
-    //     //  this.loading1 = false;
-    //     this.loading2 = false;
-    //     this.onLoad1(this.page1); //第二个表格不会自动执行
-    //   } else if (column.prop == "tab3") {
-    //     this.loading1 = false;
-    //     // this.loading2 = false;
-    //     this.onLoad2(this.page2); //第二个表格不会自动执行
-    //   }
-    // },
+      if (row.id) {
+        row["updateUser"] = this.userInfo.Id;
+      } else {
+        row["createUser"] = this.userInfo.Id;
+      }
+      // console.log(row);
+      submitGroup(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          that.getLicenceInfo();
+          done();
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+      done();
+    },
+    //从 localStorage 获取数据
+    readLock(name) {
+      return window.localStorage.getItem(name);
+    },
     handleClick(tab, event) {
-      // console.log(tab.name, event);
       if (tab.name == "tab1") {
         this.loading1 = false;
-        this.loading2 = false;
-        // this.onLoad(this.page);
+        this.seeWhere = "tab1";
+      } else if (tab.name == "tab11") {
+        this.seeWhere = "tab11";
+        this.obj = this.formData;
       } else if (tab.name == "tab5") {
+        this.seeWhere = "tab5";
         this.overcar = true;
-        // this.onLoad(this.page);
       } else if (tab.name == "tab4") {
+        this.seeWhere = "tab4";
         this.overzb = true;
-        // this.onLoad(this.page);
       } else if (tab.name == "tab2") {
-        //  this.loading1 = false;
-        this.loading2 = false;
-        this.onLoad1(this.page1); //第二个表格不会自动执行
+        this.seeWhere = "tab2";
+        this.overshareholder = true;
       } else if (tab.name == "tab3") {
-        this.loading1 = false;
-        // this.loading2 = false;
-        this.onLoad2(this.page2); //第二个表格不会自动执行
+        this.seeWhere = "tab3";
+        this.overmanager = true;
       } else if (tab.name == "tab9") {
-        this.social = true; //表格错乱
+        this.seeWhere = "tab9";
+        this.social = true;
+      } else if (tab.name == "tab8") {
+        //获取许可证信息
+        this.seeWhere = "tab8";
+        this.getLicenceInfo();
       } else {
         this.social = false;
         this.overcar = false;
         this.overzb = false;
         this.overcar = false;
+        this.overmanager = false;
+        this.overshareholder = false;
       }
+      this.$store.commit("setWindowSizeHeightAdd");
     },
-    //派遣记录
-    sizeChange1(val) {
-      this.page1.currentPage = 1;
-      this.page1.pageSize = val;
-      // this.getData();
-      this.onLoad1(this.page1, this.query1);
-      //   this.$message.success("行数" + val);
-    },
-    currentChange1(val) {
-      this.page1.currentPage = val;
-      // this.getData();
-      this.onLoad1(this.page1, this.query1);
-      //   this.$message.success("页码" + val);
-    },
-    rowSave1(form, done, loading) {
-      // var that = this;
-      //   var form = this.data[0];
-      //   delete form.id;
-      //   for (var k = 0; k < 13; k++) {
-      form["deptId"] = this.departmentid;
-      adddata1(form).then(
-        () => {
-          this.onLoad1(this.page1);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          done();
-        },
-        (error) => {
-          window.console.log(error);
-          loading();
-        }
-      );
-      //   }
-    },
-    searchChange1(params, done) {
-      this.query1 = params;
-      this.page1.currentPage = 1;
-      this.onLoad1(this.page1, params);
-      done();
-    },
-    searchReset1() {
-      this.query = {};
-      this.onLoad1(this.page1);
-    },
-    rowUpdate1(row, index, done, loading) {
-      delete row.shareholdingratio;
-      delete row.tenantId;
-
-      console.log(row);
-      row["deptId"] = this.departmentid;
-      update1(row).then(
-        () => {
-          this.onLoad1(this.page1);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          done();
-        },
-        (error) => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
-    rowDel1(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          return remove1(row.id);
-        })
-        .then(() => {
-          this.onLoad1(this.page1);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-        });
-    },
-    selectionChange1(list) {
-      this.selectionList1 = list;
-    },
-    handleDelete1() {
-      if (this.selectionList1.length === 0) {
-        this.$message.warning("请选择至少一条数据");
-        return;
-      }
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          return remove1(this.ids1);
-        })
-        .then(() => {
-          this.onLoad1(this.page1);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          this.$refs.crudrec1.toggleSelection();
-        });
-    },
-    refreshChange1() {
-      this.onLoad1(this.page1, this.query1);
-    },
-
-    //
-    onLoad1(page, params = {}) {
-      this.loading1 = true;
-      console.log(page, params, 3435434);
-      params["deptId"] = this.departmentid;
-      getdataOnce1(
-        page.currentPage,
-        page.pageSize,
-        Object.assign(params, this.query)
-      ).then((res) => {
-        // console.log(res);
-        const data = res.data.data;
-        this.page1.total = data.total;
-        this.data1 = data.records;
-        console.log(this.data1);
-        this.loading1 = false;
-
-        this.$refs.crudrec1.refreshTable();
-        this.$refs.crudrec1.doLayout();
-      });
-      // onLoad1(page, params = {}) {
-      //   this.loading1 = true;
-      //   // console.log(page);
-      //   getdata1(
-      //     page.currentPage,
-      //     page.pageSize,
-      //     Object.assign(params, this.query)
-      //   ).then((res) => {
-      //     // console.log(res);
-      //     const data = res.data.data;
-      //     this.page1.total = data.total;
-      //     this.data1 = data.records;
-      //     console.log(this.data1);
-      //     this.loading1 = false;
-      //   });
-    },
-    //派遣记录
-
-    //派遣记录
-    sizeChange2(val) {
-      this.page2.currentPage = 1;
-      this.page2.pageSize = val;
-      // this.getData();
-      this.onLoad2(this.page2, this.query2);
-      //   this.$message.success("行数" + val);
-    },
-    currentChange2(val) {
-      this.page2.currentPage = val;
-      // this.getData();
-      this.onLoad2(this.page2, this.query2);
-      //   this.$message.success("页码" + val);
-    },
-    rowSave2(form, done, loading) {
-      // var that = this;
-      //   var form = this.data[0];
-      //   delete form.id;
-      //   for (var k = 0; k < 13; k++) {
-      form["deptId"] = this.departmentid;
-      adddata2(form).then(
-        () => {
-          this.onLoad2(this.page1);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          done();
-        },
-        (error) => {
-          window.console.log(error);
-          loading();
-        }
-      );
-      //   }
-    },
-    searchChange2(params, done) {
-      this.query2 = params;
-      this.page2.currentPage = 1;
-      this.onLoad2(this.page2, params);
-      done();
-    },
-    searchReset2() {
-      this.query = {};
-      this.onLoad2(this.page2);
-    },
-    rowUpdate2(row, index, done, loading) {
-      console.log(row);
-      delete row.shareholdingratio;
-      row["deptId"] = this.departmentid;
-      update2(row).then(
-        () => {
-          this.onLoad2(this.page2);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          done();
-        },
-        (error) => {
-          window.console.log(error);
-          loading();
-        }
-      );
-    },
-    rowDel2(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          return remove2(row.id);
-        })
-        .then(() => {
-          this.onLoad2(this.page1);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-        });
-    },
-    selectionChange2(list) {
-      this.selectionList2 = list;
-    },
-    handleDelete2() {
-      if (this.selectionList2.length === 0) {
-        this.$message.warning("请选择至少一条数据");
-        return;
-      }
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          return remove2(this.ids2);
-        })
-        .then(() => {
-          this.onLoad2(this.page2);
-          this.$message({
-            type: "success",
-            message: "操作成功!",
-          });
-          this.$refs.crudrec2.toggleSelection();
-        });
-    },
-    refreshChange2() {
-      this.onLoad2(this.page2, this.query2);
-    },
-
-    //
-    onLoad2(page, params = {}) {
-      this.loading2 = true;
-      // console.log(page);
-      // getdata2(
-      params["deptId"] = this.departmentid;
-      getdataOnce2(
-        page.currentPage,
-        page.pageSize,
-        Object.assign(params, this.query)
-      ).then((res) => {
-        // console.log(res);
-        const data = res.data.data;
-        this.page2.total = data.total;
-        this.data2 = data.records;
-        console.log(this.data2);
-        this.loading2 = false;
-        this.$refs.crudrec2.refreshTable();
-        this.$refs.crudrec2.doLayout();
-      });
-    },
-    //派遣记录
-    saveLock(name, val) {
-      window.localStorage.setItem(name, val);
-    },
-    readLock(name) {
-      return window.localStorage.getItem(name);
-    },
-    onloads(tab) {
+    //获取许可证信息
+    getLicenceInfo() {
       var that = this;
-      var doit = (a) => {
-        that.typeTABS = that.optionTABS.column[0];
-        // if (tab) {
-        // that.typeTABS.prop = tab;
-        // }
-        var row = {};
-        if (that.readLock("danweidata") != null) {
-          row = JSON.parse(that.readLock("danweidata"));
-          // that.obj0.title = row.enterprisename;
-          console.log(row, "rowneibu");
-          that.departmentid = row.departmentid;
-          for (var k in row) {
-            that.obj0[k] = row[k];
-          }
-          if (row.creditcode == "") {
-            that.creditcode = 111;
-          } else {
-            that.creditcode = row.creditcode;
-          }
-          that.overHtp = true;
-          if (that.readLock("danweidataS") != null && a == 1) {
-            var b = JSON.parse(that.readLock("danweidataS"));
-            var i = 0;
-            for (var k in b) {
-              if (b[k].enterprisename == row.enterprisename) {
-                i = 1;
-              }
-            }
-            if (i == 1) {
-              // console.log("存在");
-            } else {
-              // console.log("已删除");
-
-              that.obj0 = {};
-              that.obj0.enterprisename = row.enterprisename + "该公司已删除";
-              window.localStorage.removeItem("danweidata");
-              that.creditcode = "";
-            }
-          }
-        } else {
-          // console.log("no");
-          that.obj0.enterprisename = "未选择查询单位";
-        }
-      };
+      getLicenceDetail(this.deptId).then(res => {
+        that.licenceObj = res.data.data;
+      });
+    },
+    //tag 防重复处理
+    tagTraim() {
+      //tag 防重复处理
       var flag = false,
         i = 0,
         ind = null;
       this.$store.state.tags.tagList.forEach((item, index) => {
-        if (item.label == "保安单位详情") {
+        if (item.label == "单位详情") {
           if (flag == false) {
             ind = index;
             flag = true;
@@ -1032,73 +473,199 @@
       if (i > 1) {
         this.$store.state.tags.tagList.splice(ind, 1);
       }
-
-      var getdatas = (roleAlias) => {
-        var fromSecunityGuardId = that.$route.query.fromSecunityGuardId;
-        // var fromSecunityGuardId = that.$route.query;
-        if (fromSecunityGuardId != undefined || roleAlias == "保安公司管理员") {
-          var value = {
-            departmentid: fromSecunityGuardId || that.userInfo.dept_id,
-          };
-          getOncedata(value).then((res) => {
-            // console.log(res.data.data, "get");
-            window.localStorage.setItem(
-              "danweidata",
-              JSON.stringify(res.data.data)
-            );
-            doit();
-          });
-          // return;
-        } else {
-          doit(1);
-        }
-      };
-
-      // console.log(this.userInfo, "userInfo");
-      //获取当前登录人员的角色信息
-      var roleIds = this.userInfo.role_id.split(",");
-      roleIds.forEach((roleId) => {
-        getRoleDetail(roleId).then((res) => {
-          var roleAlias = res.data.data.roleAlias;
-          var d = that.option0.column;
-          var e = that.option01.column;
-          // console.log(roleAlias);
-          if (roleAlias == "保安公司管理员") {
-            that.option0.submitBtn = true;
-            that.option01.submitBtn = true;
-            for (var k in d) {
-              // if (d[k].label != "企业类型") {
-              d[k].disabled = false;
-              // }
-            }
-            for (var n in e) {
-              // if (d[k].label != "企业类型") {
-              e[n].disabled = false;
-              // }
-            }
-          } else {
-            that.option0.submitBtn = false;
-            that.option01.submitBtn = false;
-            for (var k in d) {
-              d[k].disabled = true;
-            }
-            for (var n in e) {
-              e[n].disabled = true;
-            }
-          }
-          getdatas(roleAlias);
-        });
-      });
     },
+    //编辑状态控制
+    editController() {
+      var that = this;
+      if (this.stats == "1") {
+        //培训学校
+        this.licenceOption.column = lincenceTrainColumn;
+      } else {
+        this.licenceOption.column = lincenceColumn;
+      }
+
+      //基本信息列控制
+      if (this.stats == "4") {
+        //分公司
+        this.optionBase.column = filialeColumn;
+      } else if (this.stats == "0") {
+        //自招保安单位
+        this.optionBase.column = selfColumn;
+      } else {
+        //学校,本市保安公司
+        this.optionBase.column = column;
+      }
+
+      //获取当前登录人员的角色信息
+      // var roleIds = this.userInfo.role_id.split(",");
+      // roleIds.forEach((roleId) => {
+      //   getRoleDetail(roleId).then((res) => {
+      //     var roleAlias = res.data.data.roleAlias;
+      var roleAlias = this.userInfo.role_name;
+      var d = that.optionBase.column;
+      var e = that.option01.column;
+      var f = that.businessOption.group;
+      var g = f[0].column;
+      var h = f[1].column;
+      var bb = that.licenceOption.column;
+      //控制按钮,编辑状态
+      if (
+        roleAlias == "保安公司管理员" ||
+        roleAlias == "分公司管理员" ||
+        roleAlias == "培训公司管理员"
+      ) {
+        that.optionBase.submitBtn = true;
+        that.businessOption.submitBtn = true;
+        that.option01.submitBtn = true;
+        that.licenceOption.submitBtn = true;
+        for (var k in d) {
+          d[k].disabled = false;
+        }
+        for (var n in e) {
+          e[n].disabled = false;
+        }
+        for (var l in g) {
+          g[l].disabled = false;
+        }
+        for (var m in h) {
+          h[m].disabled = false;
+        }
+        for (var mm in bb) {
+          bb[mm].disabled = false;
+        }
+      } else {
+        that.optionBase.submitBtn = false;
+        that.option01.submitBtn = false;
+        that.businessOption.submitBtn = false;
+        that.licenceOption.submitBtn = false;
+        for (var a in d) {
+          d[a].disabled = true;
+        }
+        for (var b in e) {
+          e[b].disabled = true;
+        }
+        for (var c in g) {
+          g[c].disabled = true;
+        }
+        for (var z in h) {
+          h[z].disabled = true;
+        }
+        for (var zz in bb) {
+          bb[zz].disabled = true;
+        }
+      }
+      // });
+      // });
+    },
+    //获取保安公司数据
+    getdatas(data) {
+      //页面编辑状态控制
+      this.editController();
+      //数据读取
+      this.doit(data);
+    },
+    doit(data) {
+      var that = this;
+      var row = {};
+      if (data != null) {
+        row = data;
+        that.departmentid = row.departmentid;
+        for (var k in row) {
+          that.objBase[k] = row[k];
+        }
+        if (row.creditcode == "") {
+          that.creditcode = 111;
+        } else {
+          that.creditcode = row.creditcode;
+        }
+        that.overHtp = true;
+      } else {
+        that.objBase.enterprisename = "未选择查询单位";
+      }
+    },
+    //数据初始化
+    initData() {
+      var that = this;
+      var datas = this.$route.query.data;
+      // console.log(datas,123456);
+      //判断进入的入口,单位信息进入,单位列表查看进入
+      if (datas) {
+        var data = JSON.parse(this.$route.query.data);
+        that.formData = data;
+        //单位列表进入
+        var stats = data.stats;
+        var deptId = data.departmentid;
+        //初始tab控制
+        this.initController(stats, deptId);
+        //初始数据获取
+        this.getdatas(data);
+      } else {
+        //单位信息进入
+        var value = {
+          departmentid: that.userInfo.dept_id
+        };
+        getOncedata(value).then(res => {
+          that.formData = res.data.data;
+          var stats = res.data.data.stats;
+          var deptId = res.data.data.departmentid;
+          //初始tab控制
+          this.initController(stats, deptId);
+          //初始数据获取
+          this.getdatas(res.data.data);
+        });
+      }
+    },
+    //tab 初始设置
+    initController(stats, deptId) {
+      this.stats = stats;
+      this.deptId = deptId;
+      var that = this;
+      // 判断按进入的公司类型
+      if (stats == "2") {
+        //本市保安公司
+        that.baseTitle = "保安单位基本信息";
+      }
+      if (stats == "0") {
+        //自招保安单位
+        that.baseTitle = "单位基本信息";
+        that.equipmentVisiable = false;
+        that.carVisiable = false;
+        that.shareholderVisiable = false;
+        that.certificdinedVisiable = true;
+        that.licenceVisiable = false;
+      }
+      if (stats == "4") {
+        //分公司
+        that.baseTitle = "保安单位基本信息";
+        that.certificdinedVisiable = true;
+        that.businessVisiable = false;
+        that.licenceLabel = "总公司许可证信息";
+        //查询分公司(及总公司)工商信息
+        getBusinessInfo(deptId).then(res => {
+          that.businessObj = res.data.data;
+          if (that.businessObj.id == -1) {
+            that.businessObj.id = null;
+          }
+        });
+      }
+      if (stats == "1") {
+        //培训学校
+        that.baseTitle = "学校基本信息";
+        that.managerLabel = "师资力量";
+        that.licenceLabel = "培训许可证信息";
+        that.carVisiable = false;
+        that.shareholderVisiable = false;
+      }
+    }
   },
   mounted() {
-    this.onloads();
+    this.tagTraim();
   },
-  watch: {
-    // chuzitime() {
-    // console.log(this.chuzitime, "chuzitime");
-    // },
+  created() {
+    //初始化信息
+    this.initData();
   },
+  watch: {}
 };
 </script>
 
@@ -1106,17 +673,8 @@
 .dispatch {
   width: 100%;
   height: 100%;
-  //   border: 1px solid #000;
   box-sizing: border-box;
 }
-// .el-card__body {
-//   padding-bottom: 5px !important;
-// }
-// .avue-crud__tip,
-// .el-tag,
-// .el-tag--light {
-//   padding: 0 !important;
-// }
 
 .el-collapse-item {
   padding-top: 15px !important;
@@ -1132,4 +690,8 @@
   overflow: hidden;
   top: -10px;
 }
-</style>
\ No newline at end of file
+
+.manager {
+  height: 755px;
+}
+</style>

--
Gitblit v1.9.3