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`, //新增年级 saveGrade: `occupationlab/occupationlab/staff/saveGrade`, //新增年级
updateGrade: `occupationlab/occupationlab/staff/updateGrade`, //编辑年级 updateGrade: `occupationlab/occupationlab/staff/updateGrade`, //编辑年级
deleteGrade: `occupationlab/occupationlab/staff/deleteGrade`, //删除年级 deleteGrade: `occupationlab/occupationlab/staff/deleteGrade`, //删除年级
getStaffArchitectureWithGradeBySchoolId: `occupationlab/occupationlab/staff/getStaffArchitectureWithGradeBySchoolId`,
// 教师管理 // 教师管理
saveStaff: `occupationlab/occupationlab/staff/saveStaff`, //新增员工 saveStaff: `occupationlab/occupationlab/staff/saveStaff`, //新增员工
staffDetail: `occupationlab/occupationlab/staff/staffDetail`, //员工详情 staffDetail: `occupationlab/occupationlab/staff/staffDetail`, //员工详情

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

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

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

Loading…
Cancel
Save