Administrator
2022-04-11 79d9fc857559982b00b68b2d709807bdc4cd286f
src/views/securityMan/index.vue
@@ -1,9 +1,10 @@
<template>
  <div class="dispatch">
    <avue-tabs :option="optionTABS" @change="handleChangeTABS"></avue-tabs>
    <span v-if="typeTABS.prop === 'tab1'">
      <avue-form ref="form" v-model="obj0" :option="option0" @submit="submit"> </avue-form>
    </span>
    <!-- <avue-tabs :option="optionTABS" @change="handleChangeTABS"></avue-tabs>
    <span v-if="typeTABS.prop === 'tab1'"> -->
    <avue-form ref="form" v-model="obj0" :option="option0" @submit="submit">
    </avue-form>
    <!-- </span>
    <span v-else-if="typeTABS.prop === 'tab2'">
      <avue-crud
        :option="option1"
@@ -31,7 +32,6 @@
      </avue-crud>
    </span>
    <span v-else-if="typeTABS.prop === 'tab4' && isSecurity">
      <!-- 保安员证 -->
      <div class="baoanzheng" id="baoanzheng">
        <div class="baz-main">
          <div class="baz-m-body" ref="baoanzheng">
@@ -43,12 +43,8 @@
            <div class="imgs">
              <div v-if="erweima == ''">暂无二维码</div>
              <img :src="erweima" alt="" v-else />
              <!-- <img src="/img/register/ewm.png" alt="" /> -->
              <!-- logoSrc="/img/register/ewm.png" -->
              <!-- <vue-qr :text="goToUrl" :size="200"></vue-qr> -->
            </div>
            <!-- <img src="/img/mock/card/card-1.jpg" alt="" /> -->
            <div class="bmb-b">
              姓名:<span class="bmb-b-s">{{ obj0.realName }}</span>
            </div>
@@ -66,21 +62,13 @@
                obj0.paperTime.slice(0, 10)
              }}</span>
            </div>
            <!-- <div class="bmb-b">
              发证机关:<span class="bmb-b-s" style="margin-right: 15px"
                >南昌市公安局</span
              >发证日期:<span class="bmb-b-s">{{
                obj0.createTime.slice(0, 10)
              }}</span>
            </div> -->
          </div>
          <span slot="footer" class="dialog-footer no-print PrintBut">
            <el-button type="primary" @click="Print">打 印</el-button>
            <!-- <el-button type="primary" @click="closePrint"> 取 消 </el-button> -->
          </span>
        </div>
      </div>
    </span>
    </span> -->
  </div>
</template> 
@@ -95,7 +83,7 @@
  updateExperience,
  getUserDetails,
  experienceRemove,
  getExperienceList
  getExperienceList,
} from "@/api/experience/experience";
import {
@@ -107,7 +95,7 @@
  getER,
} from "@/api/performance/performance";
import {update as updateUserInfo} from "@/api/system/user";
import { update as updateUserInfo } from "@/api/system/user";
import { mapState } from "vuex";
@@ -116,7 +104,7 @@
    return {
      typeTABS: {}, //标签页
      row: {}, //数据
      isSecurity:false,
      isSecurity: false,
      optionTABS: {
        column: [
          {
@@ -152,7 +140,7 @@
      },
      option0: {
        emptyBtn: false,
        submitBtn: true,
        submitBtn: false,
        labelWidth: "110",
        gutter: 30,
        column: securityBaseInfoColumn,
@@ -164,11 +152,13 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      page2: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      query1: {},
      query2: {},
@@ -192,7 +182,7 @@
      option2: {
        card: true,
        menu: false,
        addBtn:false,
        addBtn: false,
        height: "auto",
        widtd: "auto",
        calcHeight: 54,
@@ -222,7 +212,6 @@
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
  },
  methods: {
    Print() {
@@ -262,7 +251,7 @@
        securityid: this.id,
      };
      //获取用户从业信息
      getExperienceList(this.current, this.size,param).then((res1) => {
      getExperienceList(this.current, this.size, param).then((res1) => {
        const data = res1.data.data;
        this.page1.total = data.total;
        this.data1 = data.records;
@@ -283,7 +272,6 @@
        this.loading2 = false;
      });
    },
    rowSave2(form, done, loading) {
      form.securityid = this.id;
@@ -391,56 +379,54 @@
        });
    },
    //信息修改
    submit(){
      updateUserInfo(this.obj0).then(()=>{
          this.$message({
    submit() {
      updateUserInfo(this.obj0).then(() => {
        this.$message({
          type: "success",
          message: "操作成功!",
        });
      })
    }
      });
    },
  },
  mounted() {
    this.typeTABS = this.optionTABS.column[0];
    // var data = JSON.parse(this.$route.query.row);
    //查询保安员信息
    console.log(this.userInfo,456);
    console.log(this.userInfo, 456);
    this.id = this.userInfo.Id;
    var roleName  = this.userInfo.role_name;
    debugger;
    var roleName = this.userInfo.role_name;
    // debugger;
    //如果保安,才能看保安证
    if(roleName=="保安"){
      this.isSecurity= true;
    if (roleName == "保安") {
      this.isSecurity = true;
      this.optionTABS.column = [
          {
            // icon: "el-icon-info",
            label: "保安员基本信息",
            prop: "tab1",
          },
          {
            // 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: "tab1",
        },
        {
          // icon: "el-icon-info",
          label: "从业记录",
          prop: "tab2",
        },
        {
          // icon: "el-icon-info",
          label: "现实表现记录",
          prop: "tab3",
        },
        {
          // icon: "el-icon-info",
          label: "保安员证",
          prop: "tab4",
        },
      ];
    }
    getUserDetails(this.id).then((res)=>{
      console.log(res.data.data,123);
    getUserDetails(this.id).then((res) => {
      console.log(res.data.data, 123);
      var data = res.data.data;
      this.obj0 = data;
    })
    });
    var flag = false,
      i = 0,
@@ -524,8 +510,8 @@
    top: 20px;
  }
  .img {
    width: 152px;
    height: 205px;
    width: calc(358px / 2.3);
    height: calc(441px / 2.3);
    border-radius: 10px;
    position: absolute;
    // border: 1px solid rgba($color: #888888, $alpha: 0.5);