Administrator
2021-08-27 f1f8c07651efd7db7b86f05824af51cadca2a947
保安员信息修改
3 files modified
162 ■■■■■ changed files
src/api/experience/experience.js 11 ●●●●● patch | view | raw | blame | history
src/views/securityMan/data.js 51 ●●●●● patch | view | raw | blame | history
src/views/securityMan/index.vue 100 ●●●●● patch | view | raw | blame | history
src/api/experience/experience.js
@@ -53,4 +53,15 @@
            id,
        }
    })
}
export const getUserDetails = (id) => {
    return request({
        url: '/api/blade-user/getUserDetails',
        method: 'get',
        params: {
            id,
        }
    })
}
src/views/securityMan/data.js
@@ -11,14 +11,7 @@
    },
    {
        label: "所属保安公司",
        prop: "deptId",
        type: "tree",
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
        // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
        props: {
            label: "title",
            value: "id",
        },
        prop: "deptName",
        disabled: true,
        span: 24,
    },
@@ -30,37 +23,37 @@
    {
        label: "用户姓名",
        prop: "realName",
        disabled: true,
        disabled: false,
    },
    {
        label: "用户昵称",
        prop: "name",
        disabled: true
        disabled: false
    },
    {
        label: "手机号码",
        prop: "phone",
        disabled: true
        disabled: false
    },
    {
        label: "电子邮箱",
        prop: "email",
        disabled: true
        disabled: false
    },
    {
        label: "身份证号",
        prop: "cardid",
        disabled: true
        disabled: false
    },
    {
        label: "籍贯",
        prop: "nativeplace",
        disabled: true
        disabled: false
    },
    {
        label: "民族",
        prop: "nation",
        disabled: true
        disabled: false
    },
    {
        label: "是否持证",
@@ -88,7 +81,7 @@
            label: "title",
            value: "id",
        },
        disabled: true
        disabled: false
    },
    {
        label: "最高学历",
@@ -101,27 +94,27 @@
        },
        dataType: "number",
        slot: true,
        disabled: true
        disabled: false
    },
    {
        label: "政治面貌",
        prop: "politicaloutlook",
        disabled: true
        disabled: false
    },
    {
        label: "身高",
        prop: "height",
        disabled: true
        disabled: false
    },
    {
        label: "联系地址",
        prop: "address",
        disabled: true
        disabled: false
    },
    {
        label: "户口所在地",
        prop: "registered",
        disabled: true
        disabled: false
    },
    {
        label: "入职时间",
@@ -129,7 +122,7 @@
        type: 'date',
        format: "yyyy-MM-dd",
        valueFormat: "yyyy-MM-dd",
        disabled: true
        disabled: false
    },
    {
        label: "用户性别",
@@ -148,14 +141,14 @@
                value: 3
            }
        ],
        disabled: true
        disabled: false
    },
    {
        label: "用户生日",
        type: "date",
        prop: "birthday",
        disabled: true
    }
    // {
    //     label: "用户生日",
    //     type: "date",
    //     prop: "birthday",
    //     disabled: true
    // }
]
src/views/securityMan/index.vue
@@ -2,7 +2,7 @@
  <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"> </avue-form>
      <avue-form ref="form" v-model="obj0" :option="option0" @submit="submit"> </avue-form>
    </span>
    <span v-else-if="typeTABS.prop === 'tab2'">
      <avue-crud
@@ -30,7 +30,7 @@
      >
      </avue-crud>
    </span>
    <span v-else-if="typeTABS.prop === 'tab4'">
    <span v-else-if="typeTABS.prop === 'tab4' && isSecurity">
      <!-- 保安员证 -->
      <div class="baoanzheng" id="baoanzheng">
        <div class="baz-main">
@@ -93,7 +93,7 @@
import {
  addExperience,
  updateExperience,
  getExperienceDetail,
  getUserDetails,
  experienceRemove,
  getExperienceList
} from "@/api/experience/experience";
@@ -107,13 +107,16 @@
  getER,
} from "@/api/performance/performance";
// import vueQr from "vue-qr";
import {update as updateUserInfo} from "@/api/system/user";
import { mapState } from "vuex";
export default {
  data() {
    return {
      typeTABS: {}, //标签页
      row: {}, //数据
      isSecurity:false,
      optionTABS: {
        column: [
          {
@@ -131,11 +134,11 @@
            label: "现实表现记录",
            prop: "tab3",
          },
          {
            // icon: "el-icon-info",
            label: "保安员证",
            prop: "tab4",
          },
          // {
          //   // icon: "el-icon-info",
          //   label: "保安员证",
          //   prop: "tab4",
          // },
        ],
      },
      current: 1,
@@ -145,11 +148,11 @@
      dispatcherCompany: "",
      id: "",
      obj0: {
        title: "我是头部标题",
        title: "",
      },
      option0: {
        emptyBtn: false,
        submitBtn: false,
        submitBtn: true,
        labelWidth: "110",
        gutter: 30,
        column: securityBaseInfoColumn,
@@ -188,7 +191,8 @@
      },
      option2: {
        card: true,
        menu: true,
        menu: false,
        addBtn:false,
        height: "auto",
        widtd: "auto",
        calcHeight: 54,
@@ -215,12 +219,10 @@
      });
      return ids1.join(",");
    },
    // goToUrl() {
    //   var url =
    //     "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html?securityNumber=" +
    //     this.obj0.securitynumber;
    //   return url;
    // },
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
  },
  methods: {
    Print() {
@@ -260,7 +262,6 @@
        securityid: this.id,
      };
      //获取用户从业信息
      console.log(this.id, "cid");
      getExperienceList(this.current, this.size,param).then((res1) => {
        const data = res1.data.data;
        this.page1.total = data.total;
@@ -389,24 +390,57 @@
          });
        });
    },
    //信息修改
    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(data);
    if (data) {
      var row = data;
      // var row = this.$route.query.row;
      for (var k in row) {
        this.obj0[k] = row[k];
      }
      this.obj0.title = "";
      this.cardid = row.id;
      this.name = row.name;
      this.dispatcherCompany = row.dispatcherCompany;
      this.id = row.id;
      console.log(this.obj0);
    // var data = JSON.parse(this.$route.query.row);
    //查询保安员信息
    console.log(this.userInfo,456);
    this.id = this.userInfo.Id;
    var roleName  = this.userInfo.role_name;
    debugger;
    //如果保安,才能看保安证
    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",
          },
        ]
    }
    getUserDetails(this.id).then((res)=>{
      console.log(res.data.data,123);
      var data = res.data.data;
      this.obj0 = data;
    })
    var flag = false,
      i = 0,