员工学生修改

dev_2022-05-11
yujialong 3 years ago
parent 897ebcb03d
commit d3c8999921
  1. 9
      src/api/index.js
  2. 123
      src/pages/setting/list/info.vue
  3. 7
      src/pages/student/list/index.vue
  4. 34
      src/pages/system/list/staff.vue

@ -1,7 +1,7 @@
import Setting from "@/setting";
let host = Setting.apiBaseURL
let uploadURL = Setting.upload.apiURL;
let host1 = "http://39.108.250.202:8080/"; // 川大
const host = Setting.apiBaseURL
const uploadURL = Setting.upload.apiURL;
const host1 = "http://39.108.250.202:8080/"
export default {
queryToken: `liuwanr/userInfo/queryToken`,
@ -178,12 +178,13 @@ export default {
queryCourseProfessional: `nakadai/nakadai/subject/courseProfessional`, //查询专业
// 个人中心
uploadUserAvatars: `users/users/userAccount/updateUserAvatars`, //更改头像
uploadUserAvatars: `${host}users/users/userAccount/updateUserAvatars`, //更改头像
queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`,//个人中心信息展示
updatePersonCenter: `users/users/userAccount/updatePersonCenter`,//个人中心信息修改
examinePassword: `users/users/userAccount/examinePassword`,//更换密码
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
// 系统设置
// 员工组织架构

@ -1,6 +1,6 @@
<template>
<div>
<div class="scroll">
<div class="scroll" v-loading="loading">
<div class="page">
<h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 用户信息</h6>
<div class="page-content">
@ -8,12 +8,12 @@
<div class="line info">
<li>
<label>姓名</label>
<el-input id="username" class="username" placeholder="请输入姓名" type="text" v-model="personalInformation.userName" />
<el-input id="username" class="username" placeholder="请输入姓名" type="text" v-model="form.userName" />
</li>
<li>
<label>所在国家</label>
<el-select
v-model="personalInformation.countries"
v-model="form.countries"
placeholder
>
<el-option
@ -28,7 +28,7 @@
<div class="line info">
<li>
<label>性别</label>
<el-select size="small" v-model="personalInformation.sex">
<el-select size="small" v-model="form.sex">
<el-option v-for="item in sexList" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
@ -36,17 +36,17 @@
<label>所在地</label>
<div class="mul">
<div class="child">
<el-select size="small" v-model="personalInformation.countries" placeholder>
<el-select size="small" v-model="form.countries" placeholder>
<el-option v-for="item in countryList" :key="item.value" :label="item.label" :value="item.label"></el-option>
</el-select>
</div>
<div class="child">
<el-select size="small" v-model="personalInformation.provinceId" placeholder @change="id => getCity(id,1)">
<el-select size="small" v-model="form.provinceId" placeholder @change="id => getCity(id,1)">
<el-option v-for="item in provinceList" :key="item.provinceId" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</div>
<div class="child">
<el-select size="small" v-model="personalInformation.cityId" placeholder :disabled="personalInformation.provinceId ? false : true">
<el-select size="small" v-model="form.cityId" placeholder :disabled="form.provinceId ? false : true">
<el-option v-for="item in cityList" :key="item.cityId" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</div>
@ -57,7 +57,7 @@
<li>
<label>出生年月</label>
<el-date-picker
v-model="personalInformation.dateBirth"
v-model="form.dateBirth"
:clearable="false"
class="block-right"
type="date">
@ -65,19 +65,19 @@
</li>
<li>
<label>身份证</label>
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入身份证" type="text" v-model="personalInformation.idNumber" />
<el-input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入身份证" type="text" v-model="form.idNumber" />
</li>
</div>
<div class="line info">
<li>
<label>教育程度</label>
<el-select size="small" v-model="personalInformation.educationDegree" placeholder="请选择教育程度">
<el-select size="small" v-model="form.educationDegree" placeholder="请选择教育程度">
<el-option v-for="(item,index) in educationDegreeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>当前所在学校</label>
<el-input size="small" readonly placeholder="请输入学校" v-model="personalInformation.schoolName" clearable></el-input>
<el-input size="small" readonly placeholder="请输入学校" v-model="form.schoolName" clearable></el-input>
</li>
</div>
</ul>
@ -98,7 +98,7 @@
</li>
<li>
<label>所在国家</label>
<el-select size="small" v-model="personalInformation.countries" placeholder>
<el-select size="small" v-model="form.countries" placeholder>
<el-option v-for="item in countryList" :key="item.value" :label="item.label" :value="item.label" ></el-option>
</el-select>
</li>
@ -147,22 +147,22 @@
<div class="page-content">
<ul class="list">
<div class="line info imp">
<li>
<label>用户账号</label>
<el-input class="m-r-10" size="small" v-model="personalInformation.account" clearable disabled></el-input>
<el-button type="text" size="small" @click="openAccount">编辑</el-button>
<li style="width: 333px;margin-right: 90px">
<label>学号</label>
<el-input class="m-r-10" size="small" v-model="form.workNumber" clearable disabled></el-input>
</li>
<li>
<label>手机号</label>
<el-input class="m-r-10" type="text" size="small" v-model="personalInformation.phone" disabled></el-input>
<el-button type="text" size="small" @click="bindPhone">更换</el-button>
<el-input class="m-r-10" type="text" size="small" v-model="form.phone" disabled></el-input>
<el-button type="text" size="small" @click="bindPhone">{{ form.phone ? '更换' : '绑定' }}</el-button>
<el-button v-if="form.phone" type="text" size="small" @click="unbind">解绑</el-button>
</li>
</div>
<div class="line info imp">
<li>
<label>邮箱</label>
<el-input class="m-r-10" size="small" v-model="personalInformation.email" disabled></el-input>
<el-button v-if="personalInformation.email" type="text" size="small" @click="bindEmail">更换</el-button>
<el-input class="m-r-10" size="small" v-model="form.email" disabled></el-input>
<el-button v-if="form.email" type="text" size="small" @click="bindEmail">更换</el-button>
<el-button v-else type="text" size="small" @click="bindEmail">添加</el-button>
</li>
<li>
@ -180,12 +180,8 @@
<el-button type="primary" size="small" v-throttle @click="save">更新</el-button>
</div>
<el-dialog
:title="personalInformation.email ? '更换邮箱' : '绑定邮箱'"
:title="form.email ? '更换邮箱' : '绑定邮箱'"
:visible.sync="emailVisible"
:close-on-click-modal="false"
@close="closeEmail"
@ -208,7 +204,7 @@
</el-dialog>
<el-dialog
:title="personalInformation.phone ? '更换手机号' : '绑定手机号'"
:title="form.phone ? '更换手机号' : '绑定手机号'"
:visible.sync="phoneVisible"
:close-on-click-modal="false"
@close="closePhone"
@ -275,11 +271,12 @@ import { mapState, mapActions } from "vuex";
export default {
data() {
return {
loading: false,
editUsername: '',
accountVisible: false,
updateTime: 0,
token: util.local.get(Setting.tokenKey),
personalInformation: {
form: {
userName: "",
name: "",
workNumber: "",
@ -404,7 +401,7 @@ export default {
])
},
mounted() {
this.getdata();
this.getData();
this.getProvince();
this.getSchoolData();
this.getSubject();
@ -416,14 +413,14 @@ export default {
]),
confirmAccount() {
if (this.editUsername) {
this.personalInformation.account = this.editUsername
this.form.account = this.editUsername
this.accountVisible = false
} else {
util.errorMsg('请输入账号')
}
},
openAccount() {
this.editUsername = this.personalInformation.account
this.editUsername = this.form.account
this.accountVisible = true
},
getProvince() {
@ -435,8 +432,8 @@ export default {
//
getCity(id, type, index) {
if (type == 1) {
if (this.personalInformation.provinceId) {
this.personalInformation.cityId = 1;
if (this.form.provinceId) {
this.form.cityId = 1;
this.getCityData(type, index);
}
} else {
@ -448,7 +445,7 @@ export default {
}
},
getCityData(type, index) {
let provinceId = type == 1 ? this.personalInformation.provinceId : this.archivesList[index].provinceId;
let provinceId = type == 1 ? this.form.provinceId : this.archivesList[index].provinceId;
this.$get(this.api.queryCity, { provinceId }).then(res => {
if (type == 1) {
this.cityList = res.list;
@ -462,7 +459,8 @@ export default {
this.archivesList[index].cityName = this.archivesList[index].cityList[id - 1].cityName;
},
getSchoolName(id, index) {
this.archivesList[index].schoolName = this.schoolList[id - 1].schoolName;
const school = this.schoolList.find(e => e.schoolId == id)
if (school) this.archivesList[index].schoolName = school.schoolName
},
//
getSchoolData() {
@ -479,10 +477,10 @@ export default {
this.$el.querySelector(".hiddenInput").click();
},
async accountChange() {
if (this.originAccount != this.personalInformation.account) {
if (this.originAccount != this.form.account) {
let res = await this.$get(this.api.queryAccountIsExist, {
account: this.personalInformation.account,
schoolId: this.personalInformation.schoolId
account: this.form.account,
schoolId: this.form.schoolId
});
if (res.message.user.length) {
util.warningMsg("该账号已存在");
@ -494,20 +492,22 @@ export default {
this.accountReapeat = false;
}
},
getdata() {
this.$get(this.api.queryUserInfoDetails).then(res => {
let userInfo = res.result.hrUserInfo;
let schoolId = userInfo.schoolId;
this.personalInformation = Object.assign(userInfo, res.result.userAccountList[0]);
this.personalInformation.schoolId = schoolId;
this.personalInformation.accountId = userInfo.id;
this.originAccount = this.personalInformation.account;
this.archivesList = res.result.personalFileList;
getData() {
this.loading = true
this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
const userInfo = result.hrUserInfo
const { userAccount } = result
userInfo.account = userAccount.account
userInfo.phone = userAccount.phone
userInfo.workNumber = userAccount.workNumber
this.form = userInfo
this.originAccount = this.form.account;
this.archivesList = result.personalFileList;
this.loading = false
if (userInfo.userAvatars) this.setAvatar(userInfo.userAvatars);
this.$nextTick(() => {
if (this.personalInformation.provinceId) {
if (this.form.provinceId) {
this.getCityData(1);
}
if (this.archivesList.length != 0) {
@ -590,13 +590,24 @@ export default {
this.concatArch();
},
bindEmail() {
this.email = this.personalInformation.email;
this.email = this.form.email;
this.emailVisible = true;
},
bindPhone() {
this.phone = this.personalInformation.phone;
this.phone = this.form.phone;
this.phoneVisible = true;
},
//
unbind() {
this.$confirm('确定要解绑该手机号吗?', '提示', {
type: 'warning'
}).then(() => {
this.$get(this.api.unbindMobilePhone).then(res => {
this.$message.success('解绑成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
bindPassword() {
this.passwordVisible = true;
},
@ -776,8 +787,8 @@ export default {
// });
// if (isEmpty) return util.warningMsg("");
// if (this.accountReapeat) return util.warningMsg("");
if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的身份证号码");
let form = this.personalInformation;
if (this.form.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.form.idNumber)) return util.warningMsg("请输入正确的身份证号码");
let form = this.form;
let personalFileList = [];
this.archivesList.forEach((n, k) => {
n.personalCareerId && personalFileList.push({
@ -896,7 +907,7 @@ export default {
};
this.$put(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");
this.personalInformation.email = this.email;
this.form.email = this.email;
this.emailVisible = false;
}).catch(res => {
});
@ -935,9 +946,9 @@ export default {
code: this.phoneCode,
opener: this.phoneOpener
};
this.$put(this.api.bindPhoneOrEmail, data).then(res => {
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");
this.personalInformation.phone = this.phone;
this.form.phone = this.phone;
this.phoneVisible = false;
}).catch(res => {
});
@ -958,7 +969,7 @@ export default {
},
watch: {
// ,
personalInformation: {
form: {
handler(){
this.updateTime++
// if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)

@ -94,7 +94,7 @@
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入学生姓名/学号/账号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
<el-input style="width: 250px;" placeholder="请输入学生姓名/学号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
</li>
</ul>
<div>
@ -110,7 +110,6 @@
<el-table-column prop="userName" label="学生姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center" min-width="100"></el-table-column>
<el-table-column prop="className" label="班级" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="countries" label="账号角色" align="center" width="100">
<template slot-scope="scope">学生</template>
</el-table-column>
@ -160,10 +159,10 @@
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11" @blur="phoneChange"></el-input>
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码" @blur="emailChange"></el-input>
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码"></el-input>
</el-form-item>
<el-form-item prop="uniqueIdentification" label="唯一标识">
<el-input disabled v-model="form.uniqueIdentification"></el-input>

@ -9,7 +9,7 @@
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入员工账号/姓名/工号" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
<el-input placeholder="请输入员工姓名/工号" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</li>
</ul>
<div>
@ -23,7 +23,6 @@
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column>
<el-table-column prop="userName" label="职工姓名" align="center"></el-table-column>
<el-table-column prop="account" label="账号" align="center"></el-table-column>
<el-table-column prop="workNumber" label="职工工号" align="center"></el-table-column>
<el-table-column prop="dept" label="部门" align="center"></el-table-column>
<el-table-column prop="roleName" label="账号角色" align="center"></el-table-column>
@ -76,10 +75,10 @@
></el-cascader>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11" @blur="phoneChange"></el-input>
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model.trim="form.email" placeholder="请输入邮箱" @blur="emailChange"></el-input>
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
@ -330,21 +329,16 @@ export default {
},
workNumberChange() { //
const form = this.form
const { workNumber } = form
//
if (workNumber && this.isAdd && /^[A-Za-z0-9]*$/.test(workNumber)) {
this.$post(`${this.api.getDetailByAccount}?workNumber=${workNumber}&platformId=${Setting.platformId}&type=0`).then(({ data }) => {
if (data) {
this.form = data
this.renderAccount()
this.$refs.form.clearValidate()
} else {
//
this.form = JSON.parse(JSON.stringify(this.originForm))
this.form.workNumber = workNumber
const { workNumber, accountId } = form
if (workNumber) {
this.$post(`${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=${Setting.platformType}${accountId ? `&accountId=${form.accountId}` : ''}&workNumber=${workNumber}&account=`).then(res => {
if (res.status === 200) {
this.workNumberReapeat = false
this.renderAccount()
}
}).catch(res => {})
}).catch( err => {
this.workNumberReapeat = true
})
} else {
this.renderAccount()
}
@ -421,9 +415,9 @@ export default {
this.$refs[form].validate((valid) => {
if (valid) {
if (this.submiting) return false
if (this.workNumberReapeat) return util.warningMsg("该员工工号已存在");
if (this.phoneRepeat) return util.warningMsg("该手机号已存在");
if (this.emailRepeat) return util.warningMsg("该邮箱已存在");
if (this.workNumberReapeat) return util.errorMsg('工号/学号已存在!');
if (this.phoneRepeat) return util.errorMsg("该手机号已存在");
if (this.emailRepeat) return util.errorMsg("该邮箱已存在");
let data = {
accountId: this.form.accountId,
account: this.form.account,

Loading…
Cancel
Save