dev_202412
yujialong 3 months ago
parent 6b59aaef90
commit 59ebb20971
  1. 1
      src/api/index.js
  2. BIN
      src/assets/img/exts/excel.png
  3. 78
      src/pages/setting/list/info.vue
  4. 2
      src/pages/station/preview/index.vue
  5. 41
      src/pages/system/list/staff.vue

@ -371,6 +371,7 @@ export default {
saveGrade: `occupationlab/occupationlab/staff/saveGrade`, //新增年级
updateGrade: `occupationlab/occupationlab/staff/updateGrade`, //编辑年级
deleteGrade: `occupationlab/occupationlab/staff/deleteGrade`, //删除年级
getStaffArchitectureWithGradeBySchoolId: `occupationlab/occupationlab/staff/getStaffArchitectureWithGradeBySchoolId`,
// 教师管理
saveStaff: `occupationlab/occupationlab/staff/saveStaff`, //新增员工
staffDetail: `occupationlab/occupationlab/staff/staffDetail`, //员工详情

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

@ -78,7 +78,7 @@
</div>
<div class="line info">
<li style="width: 334px;margin-right: 90px">
<label></label>
<label></label>
<el-input class="m-r-10" size="small" v-model="form.workNumber" clearable></el-input>
</li>
</div>
@ -269,8 +269,8 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import Util from '@/libs/util'
import Setting from '@/setting'
import { mapState, mapActions } from "vuex";
export default {
@ -280,7 +280,7 @@ export default {
editUsername: '',
accountVisible: false,
updateTime: 0,
token: util.local.get(Setting.tokenKey),
token: Util.local.get(Setting.tokenKey),
form: {
userName: "",
name: "",
@ -438,7 +438,7 @@ export default {
this.form.account = this.editUsername
this.accountVisible = false
} else {
util.errorMsg('请输入账号')
Util.errorMsg('请输入账号')
}
},
openAccount () {
@ -505,7 +505,7 @@ export default {
schoolId: this.form.schoolId
});
if (res.message.user.length) {
util.warningMsg("该账号已存在");
Util.warningMsg("该账号已存在");
this.accountReapeat = true;
} else {
this.accountReapeat = false;
@ -522,6 +522,7 @@ export default {
userInfo.account = userAccount.account
userInfo.phone = userAccount.phone
userInfo.workNumber = userAccount.workNumber
userInfo.id = userAccount.id
this.form = userInfo
this.originAccount = this.form.account;
this.archivesList = result.personalFileList;
@ -611,7 +612,7 @@ export default {
this.archivesList.forEach((n, k) => {
if (!n.personalCareerId) isEmpty = true;
});
if (isEmpty) return util.warningMsg("请选择职业");
if (isEmpty) return Util.warningMsg("请选择职业");
this.showArch = true;
this.concatArch();
},
@ -639,18 +640,18 @@ export default {
this.passwordVisible = true;
},
editPassword () {
if (!this.passwordForm.password) return util.warningMsg("请输入原密码");
if (!this.passwordForm.newPassword) return util.warningMsg("请输入新密码");
if (!this.passwordForm.reNewPassword) return util.warningMsg("请确认新密码");
if (this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg("请输入6位数以上的密码");
if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg("输入的新密码不一致,请重新确认");
if (this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg("原密码跟新密码不能一致");
if (!this.passwordForm.password) return Util.warningMsg("请输入原密码");
if (!this.passwordForm.newPassword) return Util.warningMsg("请输入新密码");
if (!this.passwordForm.reNewPassword) return Util.warningMsg("请确认新密码");
if (this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return Util.warningMsg("请输入6位数以上的密码");
if (this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return Util.warningMsg("输入的新密码不一致,请重新确认");
if (this.passwordForm.password === this.passwordForm.newPassword) return Util.warningMsg("原密码跟新密码不能一致");
let data = this.passwordForm;
data.userid = this.userId;
this.$post(this.api.examinePassword, data)
.then(res => {
util.successMsg("更换成功");
Util.successMsg("更换成功");
this.passwordVisible = false;
})
.catch(err => {
@ -822,15 +823,9 @@ export default {
}
},
save (close) {
let isEmpty = false;
// this.archivesList.forEach((n, k) => {
// if (!n.personalCareerId) isEmpty = true;
// n.userId = this.userId;
// });
// if (isEmpty) return util.warningMsg("");
// if (this.accountReapeat) return util.warningMsg("");
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;
const { form } = this
if (!form.userName) return Util.warningMsg('请输入姓名')
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 personalFileList = [];
this.archivesList.forEach((n, k) => {
n.personalCareerId && personalFileList.push({
@ -851,11 +846,6 @@ export default {
});
let data = {
userId: form.userId,
userAccountList: [{
id: form.accountId,
account: form.account,
userId: form.userId
}],
hrUserInfo: {
provinceId: form.provinceId,
cityId: form.cityId,
@ -869,6 +859,10 @@ export default {
userName: form.userName,
wechatId: form.wechatId
},
userAccount: {
workNumber: form.workNumber,
id: form.id
},
personalFileList
};
this.$post(this.api.updatePersonCenter, data).then(res => {
@ -920,8 +914,8 @@ export default {
}
},
sendEmailCode () {
if (!this.email) return util.warningMsg("请输入邮箱");
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg("请输入正确的邮箱");
if (!this.email) return Util.warningMsg("请输入邮箱");
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return Util.warningMsg("请输入正确的邮箱");
let data = {
userId: this.userId,
email: this.email,
@ -932,15 +926,15 @@ export default {
this.emailCountdown();
this.emailOpener = res.message.opener;
} else {
util.errorMsg(res.message);
Util.errorMsg(res.message);
}
}).catch(res => {
});
},
emailSubmit () {
if (!this.email) return util.warningMsg("请输入邮箱");
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return util.warningMsg("请输入正确的邮箱");
if (!this.emailCode) return util.warningMsg("请输入验证码");
if (!this.email) return Util.warningMsg("请输入邮箱");
if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)) return Util.warningMsg("请输入正确的邮箱");
if (!this.emailCode) return Util.warningMsg("请输入验证码");
let data = {
userId: this.userId,
email: this.email,
@ -949,7 +943,7 @@ export default {
opener: this.emailOpener
};
this.$put(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");
Util.successMsg("绑定成功");
this.form.email = this.email;
this.emailVisible = false;
}).catch(res => {
@ -961,8 +955,8 @@ export default {
}
},
sendPhoneCode () {
if (!this.phone) return util.warningMsg("请输入手机号");
if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg("请输入正确的手机号");
if (!this.phone) return Util.warningMsg("请输入手机号");
if (!/^1[3456789]\d{9}$/.test(this.phone)) return Util.warningMsg("请输入正确的手机号");
let data = {
userId: this.userId,
phone: this.phone,
@ -973,15 +967,15 @@ export default {
this.phoneCountdown();
this.phoneOpener = res.message.opener;
} else {
util.errorMsg(res.message);
Util.errorMsg(res.message);
}
}).catch(res => {
});
},
phoneSubmit () {
if (!this.phone) return util.warningMsg("请输入手机号");
if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg("请输入正确的手机号");
if (!this.phoneCode) return util.warningMsg("请输入验证码");
if (!this.phone) return Util.warningMsg("请输入手机号");
if (!/^1[3456789]\d{9}$/.test(this.phone)) return Util.warningMsg("请输入正确的手机号");
if (!this.phoneCode) return Util.warningMsg("请输入验证码");
let data = {
userId: this.userId,
phone: this.phone,
@ -990,7 +984,7 @@ export default {
opener: this.phoneOpener
};
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");
Util.successMsg("绑定成功");
this.form.phone = this.phone;
this.phoneVisible = false;
}).catch(res => {

@ -82,6 +82,8 @@
<img v-else-if="section.fileType === 'mp4'" src="@/assets/img/exts/video.png" alt="">
<img v-else-if="section.fileType === 'doc' || section.fileType === 'docx'"
src="@/assets/img/exts/word.png" alt="">
<img v-else-if="section.fileType === 'xlsx' || section.fileType === 'xls'"
src="@/assets/img/exts/excel.png" alt="">
<img v-else-if="section.fileType === 'txt'" src="@/assets/img/exts/txt.png" alt="">
<img v-else-if="section.fileType === 'pdf'" src="@/assets/img/exts/pdf.png" alt="">
<img v-else src="@/assets/img/exts/pic.png" alt="">

@ -113,9 +113,12 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="老师所属部门" prop="dep">
<el-cascader v-model="generateForm.dep" :options="orgList" :props="casProps"
style="width: 100%"></el-cascader>
<el-form-item label="老师所属部门" prop="staffArchitectureId">
<el-select v-model="generateForm.staffArchitectureId">
<el-option v-for="(item, i) in orgs" :key="i" :label="item.architectureGradePath"
:value="item.staffArchitectureId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="账号数" prop="numberOfUsers">
<el-input v-model.trim="generateForm.numberOfUsers" placeholder="请输入账号数"></el-input>
@ -214,16 +217,21 @@ export default {
submiting: false, //
generateVisible: false,
orgs: [],
orgProps: {
value: 'staffArchitectureId',
label: 'architectureGradePath'
},
generateForm: {
roleId: '',
dep: [],
staffArchitectureId: '',
numberOfUsers: '',
},
generateRules: {
roleId: [
{ required: true, message: '请选择账号角色', trigger: 'change' }
],
dep: [
staffArchitectureId: [
{ required: true, message: '请选择老师所属部门', trigger: 'change' }
],
numberOfUsers: [
@ -315,11 +323,18 @@ export default {
this.$refs.form.clearValidate();
this.teacherVisible = false;
},
//
async getOrg () {
const { data } = await this.$post(this.api.getStaffArchitectureWithGradeBySchoolId)
this.orgs = data
},
//
batchGenerate () {
this.getOrg()
this.generateForm = {
roleId: '',
dep: [],
staffArchitectureId: '',
numberOfUsers: '',
}
this.generateVisible = true
@ -328,17 +343,13 @@ export default {
generateSubmit () {
this.$refs.generateForm.validate(async (valid) => {
if (valid) {
const form = _.cloneDeep(this.generateForm)
const { dep } = form
if (dep && dep.length) {
form.staffArchitectureId = dep[0]
if (dep.length > 1) form.gradeId = dep[dep.length - 1]
}
debugger
const form = this.generateForm
const dep = form.staffArchitectureId
form.gradeId = this.orgs.find(e => e.staffArchitectureId === dep).gradeId
await this.$post(this.api.generate, {
...form,
platformId: Setting.platformId,
type: 2,
type: 0,
})
this.generateVisible = false
Util.successMsg('批量生成成功!')
@ -352,7 +363,7 @@ export default {
this.isDetail = false;
this.isAdd = true;
this.teacherVisible = true;
this.orgList = this.$refs.org.orgList;
this.orgList = this.$refs.org.orgList
},
getStaffDetail (accountId) { //
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => {

Loading…
Cancel
Save