query-detail.vue 7.13 KB
Newer Older
葛齐林's avatar
葛齐林 committed
1
<template lang="pug">
co_dengxiongwen's avatar
co_dengxiongwen committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
el-dialog( :close-on-click-modal="false", :visible.sync="visible", :append-to-body="true", :before-close="handleClose" )
  .title-bold(slot="title") {{'详情' }}
  el-form( :model="dataForm", :rules="dataRule", ref="dataForm", label-width="100px" )
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="所属机构:", prop="orgId")
          el-input.mywidth(v-model="dataForm.orgId" readonly)
      el-col(:span="12")
        el-form-item(label="用户姓名:", prop="name")
          el-input.mywidth(v-model="dataForm.name" readonly)
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="用户账号:", prop="username")
          el-input.mywidth( v-model="dataForm.username" readonly)
      el-col(:span="12")
        el-form-item(label="用户岗位:", prop="job")
          el-input.mywidth(v-model="dataForm.jobName" readonly)
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="工种:", prop="work")
          el-input.mywidth(v-model="dataForm.work" readonly)
      el-col(:span="12")
        el-form-item(label="手机号码:", prop="mobile")
          el-input.mywidth(v-model="dataForm.mobile" readonly)
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="身份证号:", prop="idCard")
          el-input.mywidth(v-model="dataForm.idCard" readonly)
      el-col(:span="12")
        el-form-item(label="电子邮箱:", prop="email")
          el-input.mywidth( v-model="dataForm.email" readonly )
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="学历:", prop="education")
          el-input.mywidth(v-model="dataForm.education" readonly)
      el-col(:span="12")
        el-form-item(label="民族:", prop="nation")
          el-input.mywidth(v-model="dataForm.nationName" readonly)
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="入职时间:", prop="entryTime")
          el-date-picker.mywidth(v-model="dataForm.entryTime", value-format="yyyy-MM-dd", type="date" readonly)
      el-col(:span="12")
        el-form-item(label="工号:", prop="jobNumber")
          el-input.mywidth( v-model="dataForm.jobNumber" readonly )
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="政治面貌:", prop="politicCountenances")
          el-input.mywidth(v-model="dataForm.politicCountenance" readonly)
    el-row(:span="24")
      el-col(:span="12")
        el-form-item(label="性别:", size="mini", prop="gender")
          el-radio-group.my_radio(disabled v-model="dataForm.gender")
            el-radio(:label="1") 男
            el-radio(:label="0") 女
      el-col(:span="12")
        el-form-item(label="账号状态:", size="mini", prop="status")
          el-radio-group.my_radio(disabled v-model="dataForm.status")
            el-radio(:label="1") 正常
            el-radio(:label="0") 禁用
  div(slot="footer")
    el-button(type="primary", size="medium" @click='visible = false') 关闭
葛齐林's avatar
葛齐林 committed
64 65 66 67
</template>

<script>
export default {
co_dengxiongwen's avatar
co_dengxiongwen committed
68
  data() {
葛齐林's avatar
葛齐林 committed
69
    return {
co_dengxiongwen's avatar
co_dengxiongwen committed
70 71 72
      id: '',
      show: false,
      clickFlag: false,
葛齐林's avatar
葛齐林 committed
73
      visible: false,
co_dengxiongwen's avatar
co_dengxiongwen committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
      roleList: [],
      allJob: [],
      treeData: [],
      defaultProps: {
        children: 'children',
        label: 'name'
      },
      nations: [],
      checkedNode: {},
      sysOrgList: [],
      dataListSelections: [],
      educations: [
        { id: '1', name: '高中' },
        { id: '2', name: '中专' },
        { id: '3', name: '大专' },
        { id: '4', name: '本科' },
        { id: '5', name: '硕士研究生' },
        { id: '6', name: '博士研究生' },
        { id: '7', name: '其它' }
      ],
      politicCountenances: [
        { id: '1', name: '共青团员' },
        { id: '2', name: '预备党员' },
        { id: '3', name: '党员' },
        { id: '4', name: '群众' },
        { id: '5', name: '其它' }
      ],
      dataForm: {
        userId: '',
        orgId: '',
        name: '',
        username: '',
        password: '',
        comfirmPassword: '',
        job: '',
        work: '',
        mobile: '',
        idCard: '',
        email: '',
        education: '',
        nation: '',
        entryTime: '',
        jobNumber: '',
        politicCountenance: '',
        gender: 1,
        status: 1,
        stationId: localStorage.getItem('stationId')
        // byx1:'',
      },
      dataRule: {}
葛齐林's avatar
葛齐林 committed
124 125
    }
  },
co_dengxiongwen's avatar
co_dengxiongwen committed
126 127 128 129
  mounted() {
    this.getAllJob()
    this.getNation()
  },
葛齐林's avatar
葛齐林 committed
130
  methods: {
co_dengxiongwen's avatar
co_dengxiongwen committed
131 132
    init(id) {
      this.clickFlag = false
葛齐林's avatar
葛齐林 committed
133
      this.visible = true
co_dengxiongwen's avatar
co_dengxiongwen committed
134 135 136 137 138 139 140 141 142 143 144 145 146 147
      this.id = id || ''
      if (id) {
        //移除输入密码框
        this.show = false
        this.dataForm.password = null
        this.dataForm.comfirmPassword = null
        this.$http({
          url: this.$http.adornUrl('/sys/user/info/' + id),
          method: 'get',
          params: this.$http.adornParams()
        }).then((data) => {
          // console.log(data)
          this.dataForm = data.user || {}
          this.dataForm.stationId = localStorage.getItem('stationId')
co_dengxiongwen's avatar
co_dengxiongwen committed
148
          this.allJob.map((item) => {
co_dengxiongwen's avatar
co_dengxiongwen committed
149 150 151 152
            if (item.id === this.dataForm.job) {
              this.dataForm.jobName = item.name
            }
          })
co_dengxiongwen's avatar
co_dengxiongwen committed
153
          this.nations.map((item) => {
co_dengxiongwen's avatar
co_dengxiongwen committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
            if (item.id.toString() === this.dataForm.nation) {
              this.dataForm.nationName = item.name
            }
          })
        })
      } else {
        this.show = true
        this.dataForm = {
          user_id: '',
          orgId: '',
          name: '',
          username: '',
          password: '',
          comfirmPassword: '',
          job: '',
          jobName: '',
          work: '',
          mobile: '',
          idCard: '',
          email: '',
          education: '',
          nation: '',
          nationName: '',
          entryTime: '',
          jobNumber: '',
          politicCountenance: '',
          gender: 1,
          status: 1,
          stationId: localStorage.getItem('stationId')
          // byx1: ''
        }
      }
    },
    //关闭前
    handleClose() {
      this.visible = false
      this.$refs.dataForm.resetFields()
    },
    //获取民族信息
    getNation() {
      this.$http({
co_dengxiongwen's avatar
co_dengxiongwen committed
195
        url: this.$http.adornUrl('/sys/user/getAllNation'),
co_dengxiongwen's avatar
co_dengxiongwen committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
        method: 'get'
      }).then((data) => {
        // console.log("data", data);
        if (data && data.code === 0) {
          this.nations = data.result
        }
      })
    },
    //获取职业字典信息
    getAllJob() {
      this.$http({
        url: this.$http.adornUrl('/sysDictionary/getAllJobList'),
        method: 'get',
        params: this.$http.adornParams({
          stationId: localStorage.getItem('stationId')
        })
      }).then((data) => {
        if (data && data.code === 0) {
          this.allJob = data.list
        } else {
          this.$message.error(data.msg)
        }
      })
葛齐林's avatar
葛齐林 committed
219 220 221 222 223 224 225 226
    }
  }
}
</script>
<style>
.el-table__header {
  width: 100% !important;
}
co_dengxiongwen's avatar
co_dengxiongwen committed
227

葛齐林's avatar
葛齐林 committed
228 229 230 231
.el-table__body {
  width: 100% !important;
}
</style>