src/views/securityUnitChild/index.vue
@@ -37,7 +37,7 @@
      <!-- 出资人列表信息 -->
      <el-tab-pane :label="tab2label" name="tab2" v-if="shareholderVisiable">
        <shareholder
          v-if="overshareholder"
          v-if="seeWhere == 'tab2'"
          :deptid="departmentid"
          :windowHeight="windowHeight"
        ></shareholder>
@@ -45,7 +45,7 @@
      <!-- 主要管理人信息 -->
      <el-tab-pane :label="managerLabel" name="tab3">
        <manager
          v-if="overmanager"
          v-if="seeWhere == 'tab3'"
          :deptid="departmentid"
          :stats="stats"
        ></manager>
@@ -53,7 +53,7 @@
      <!-- 装备管理列表 -->
      <el-tab-pane label="装备管理" name="tab4" v-if="equipmentVisiable">
        <equipments
          v-if="overzb"
          v-if="seeWhere == 'tab4'"
          :fromDeptId="departmentid"
          :windowHeight="windowHeight"
        ></equipments>
@@ -62,7 +62,7 @@
      <el-tab-pane label="车辆管理" name="tab5" v-if="carVisiable">
        <car
          :fromDeptId="departmentid"
          v-if="overcar"
          v-if="seeWhere == 'tab5'"
          :windowHeight="windowHeight"
        ></car>
      </el-tab-pane>
@@ -71,7 +71,7 @@
        <social
          :deptid="objBase.departmentid"
          :socialRE="social"
          v-if="social"
          v-if="seeWhere == 'tab9'"
        ></social>
        <!-- </span> -->
      </el-tab-pane>
@@ -106,7 +106,7 @@
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
</template>
<script>
import {
@@ -127,7 +127,7 @@
  submit,
  getLicenceDetail,
  licenceSubmit,
  submitGroup,
  submitGroup
} from "@/api/securityUnit/securityUnit";
import manager from "./manager.vue";
import shareholder from "./shareholder.vue";
@@ -149,7 +149,7 @@
    businessLicense,
    social,
    manager,
    shareholder,
    shareholder
  },
  data() {
    return {
@@ -164,6 +164,7 @@
      shareholderVisiable: true,
      equipmentVisiable: true,
      carVisiable: true,
      seeWhere: "tab1",
      //结决id传入、信息获取的优先级
      overzb: false,
      overmanager: false,
@@ -191,7 +192,7 @@
        emptyBtn: false,
        // submitBtn:false,
        submitText: "保存",
        group: businessColumn,
        group: businessColumn
      },
      licenceGroupObj: {},
      licenceGroupOption: {
@@ -204,16 +205,16 @@
            labelWidth: "110",
            prop: "baseInfo",
            icon: "el-icon-user-solid",
            column: lincenceGroupColumn,
            column: lincenceGroupColumn
          },
          {
            label: "分公司许可证信息",
            prop: "detailInfo",
            labelWidth: "110",
            icon: "el-icon-s-order",
            column: lincenceGroupColumns,
          },
        ],
            column: lincenceGroupColumns
          }
        ]
      },
      licenceObj: {},
      licenceOption: {
@@ -221,29 +222,29 @@
        // submitBtn: false,
        submitText: "保存",
        gutter: 30,
        column: lincenceColumn,
        column: lincenceColumn
      },
      optionBase: {
        emptyBtn: false,
        submitBtn: false,
        submitText: "保存",
        gutter: 30,
        column: column,
        column: column
      },
      option01: {
        emptyBtn: false,
        submitBtn: false,
        submitText: "保存",
        gutter: 30,
        column: column11,
      },
        column: column11
      }
    };
  },
  computed: {
    ...mapGetters(["userInfo", "windowHeight"]),
    chuzitime() {
      return this.data1.capitaltime;
    },
    }
  },
  methods: {
    //分公司工商信息修改
@@ -262,7 +263,7 @@
          establishtime: row.establishtime,
          creditcode: row.creditcode,
          registeredcapital: row.registeredcapital,
          business: row.business,
          business: row.business
        };
        //总公司
        var z = {
@@ -272,7 +273,7 @@
          socialCreditCode: row.socialCreditCode,
          capital: row.capital,
          businessScope: row.businessScope,
          trading: row.trading,
          trading: row.trading
        };
      }
@@ -281,23 +282,23 @@
        () => {
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
      );
      //总公司工商信息修改
      submit(z).then(
        (res) => {
        res => {
          that.businessObj = row;
          that.businessObj.id = res.data.data.id;
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -331,12 +332,12 @@
        () => {
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          that.getLicenceInfo();
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -359,12 +360,12 @@
        () => {
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          that.formData = row;
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -395,12 +396,12 @@
        () => {
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          that.getLicenceInfo();
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -414,20 +415,28 @@
    handleClick(tab, event) {
      if (tab.name == "tab1") {
        this.loading1 = false;
        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;
      } else if (tab.name == "tab4") {
        this.seeWhere = "tab4";
        this.overzb = true;
      } else if (tab.name == "tab2") {
        this.seeWhere = "tab2";
        this.overshareholder = true;
      } else if (tab.name == "tab3") {
        this.seeWhere = "tab3";
        this.overmanager = true;
      } else if (tab.name == "tab9") {
        this.seeWhere = "tab9";
        this.social = true;
      } else if (tab.name == "tab8") {
        //获取许可证信息
        this.seeWhere = "tab8";
        this.getLicenceInfo();
      } else {
        this.social = false;
@@ -437,11 +446,12 @@
        this.overmanager = false;
        this.overshareholder = false;
      }
      this.$store.commit("setWindowSizeHeightAdd");
    },
    //获取许可证信息
    getLicenceInfo() {
      var that = this;
      getLicenceDetail(this.deptId).then((res) => {
      getLicenceDetail(this.deptId).then(res => {
        that.licenceObj = res.data.data;
      });
    },
@@ -470,7 +480,7 @@
      if (this.stats == "1") {
        //培训学校
        this.licenceOption.column = lincenceTrainColumn;
      }else{
      } else {
        this.licenceOption.column = lincenceColumn;
      }
@@ -478,10 +488,10 @@
      if (this.stats == "4") {
        //分公司
        this.optionBase.column = filialeColumn;
      }else if(this.stats == "0"){
      } else if (this.stats == "0") {
        //自招保安单位
        this.optionBase.column = selfColumn;
      }else{
      } else {
        //学校,本市保安公司
        this.optionBase.column = column;
      }
@@ -491,60 +501,60 @@
      // 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;
            }
          }
        // });
      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;
        }
      }
      // });
      // });
    },
    //获取保安公司数据
@@ -592,9 +602,9 @@
      } else {
        //单位信息进入
        var value = {
          departmentid: that.userInfo.dept_id,
          departmentid: that.userInfo.dept_id
        };
        getOncedata(value).then((res) => {
        getOncedata(value).then(res => {
          that.formData = res.data.data;
          var stats = res.data.data.stats;
          var deptId = res.data.data.departmentid;
@@ -631,7 +641,7 @@
        that.businessVisiable = false;
        that.licenceLabel = "总公司许可证信息";
        //查询分公司(及总公司)工商信息
        getBusinessInfo(deptId).then((res) => {
        getBusinessInfo(deptId).then(res => {
          that.businessObj = res.data.data;
          if (that.businessObj.id == -1) {
            that.businessObj.id = null;
@@ -646,7 +656,7 @@
        that.carVisiable = false;
        that.shareholderVisiable = false;
      }
    },
    }
  },
  mounted() {
    this.tagTraim();
@@ -655,7 +665,7 @@
    //初始化信息
    this.initData();
  },
  watch: {},
  watch: {}
};
</script>
@@ -684,4 +694,4 @@
.manager {
  height: 755px;
}
</style>
</style>