|
@@ -5,7 +5,6 @@
|
|
|
老师管理
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
-
|
|
|
<!-- 搜索标题 -->
|
|
|
<save-form
|
|
|
:inline="true"
|
|
@@ -19,8 +18,8 @@
|
|
|
<el-input
|
|
|
v-model.trim="searchForm.search"
|
|
|
clearable
|
|
|
- @keyup.enter.native="
|
|
|
- (e) => {
|
|
|
+ @keyup.enter.native="
|
|
|
+ e => {
|
|
|
e.target.blur();
|
|
|
$refs.searchForm.save();
|
|
|
search();
|
|
@@ -97,7 +96,8 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="tenantConfig.tenantId != 28">
|
|
|
<el-select
|
|
|
v-model.trim="searchForm.jobNature"
|
|
|
filterable
|
|
@@ -119,7 +119,12 @@
|
|
|
filterable
|
|
|
placeholder="员工状态"
|
|
|
>
|
|
|
- <el-option v-for="item in ProbationPeriodList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="item in ProbationPeriodList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
<!-- <el-option label="正式" value="0"></el-option>
|
|
|
<el-option label="试用" value="1"></el-option>
|
|
|
<el-option label="实习" value="3"></el-option> -->
|
|
@@ -144,12 +149,13 @@
|
|
|
type="primary"
|
|
|
v-permission="'export/teacherList'"
|
|
|
@click="downLoadTeacher"
|
|
|
- >导出</el-button>
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</save-form>
|
|
|
<el-button
|
|
|
v-permission="'/teacherOperationAdd'"
|
|
|
- @click="onTeacher('create')"
|
|
|
+ @click="onTeacher('create')"
|
|
|
type="primary"
|
|
|
style="margin-bottom:20px"
|
|
|
>
|
|
@@ -205,9 +211,12 @@
|
|
|
label="联系电话"
|
|
|
></el-table-column>
|
|
|
<el-table-column align="center" label="工作类型">
|
|
|
- <template slot-scope="scope">{{
|
|
|
- scope.row.jobNature | jobNature
|
|
|
- }}</template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p v-if="scope.row.tenantId === 28">
|
|
|
+ 自由工作者
|
|
|
+ </p>
|
|
|
+ <p v-else>{{ scope.row.jobNature | jobNature }}</p>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="员工状态">
|
|
|
<template slot-scope="scope">
|
|
@@ -271,19 +280,26 @@
|
|
|
<router-link
|
|
|
class="el-button--text"
|
|
|
:to="{
|
|
|
- path: `/business/teacherDetail?teacherId=${scope.row.id}&teacherName=${scope.row.realName}`,
|
|
|
+ path: `/business/teacherDetail?teacherId=${
|
|
|
+ scope.row.id
|
|
|
+ }&teacherName=${scope.row.realName}`
|
|
|
}"
|
|
|
- >查看</router-link>
|
|
|
+ >查看</router-link
|
|
|
+ >
|
|
|
</auth>
|
|
|
<auth auths="/teacherOperationUpdate">
|
|
|
- <el-button
|
|
|
- @click="onTeacher('update', scope.row)"
|
|
|
- type="text"
|
|
|
+ <el-button @click="onTeacher('update', scope.row)" type="text"
|
|
|
>修改</el-button
|
|
|
>
|
|
|
</auth>
|
|
|
|
|
|
- <auth :auths="scope.row.lockFlag == 1 ? 'employee/employeeOperate/UNLOCK' : 'employee/employeeOperate/LOCK'">
|
|
|
+ <auth
|
|
|
+ :auths="
|
|
|
+ scope.row.lockFlag == 1
|
|
|
+ ? 'employee/employeeOperate/UNLOCK'
|
|
|
+ : 'employee/employeeOperate/LOCK'
|
|
|
+ "
|
|
|
+ >
|
|
|
<el-button
|
|
|
@click="onStaffOperation('LOCK_UNLOCK', scope.row)"
|
|
|
type="text"
|
|
@@ -292,9 +308,7 @@
|
|
|
</auth>
|
|
|
|
|
|
<auth auths="user/updatePassword2">
|
|
|
- <el-button
|
|
|
- @click="resetPassWrod(scope.row)"
|
|
|
- type="text"
|
|
|
+ <el-button @click="resetPassWrod(scope.row)" type="text"
|
|
|
>修改密码</el-button
|
|
|
>
|
|
|
</auth>
|
|
@@ -303,7 +317,8 @@
|
|
|
v-if="scope.row.contractUrl"
|
|
|
@click="onDownloadProtocol(scope.row)"
|
|
|
type="text"
|
|
|
- >下载协议</el-button>
|
|
|
+ >下载协议</el-button
|
|
|
+ >
|
|
|
<!-- -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -335,8 +350,8 @@
|
|
|
{
|
|
|
pattern: /^1\d{10}$/,
|
|
|
message: '请输入正确的手机号',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
]"
|
|
|
>
|
|
|
<copy-text>{{ passwrodForm.phone }}</copy-text>
|
|
@@ -350,8 +365,8 @@
|
|
|
{
|
|
|
pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/,
|
|
|
message: '密码为6-20位数字和字母组合',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
]"
|
|
|
>
|
|
|
<el-input v-model.trim="passwrodForm.password"></el-input>
|
|
@@ -365,8 +380,8 @@
|
|
|
{
|
|
|
pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/,
|
|
|
message: '密码为6-20位数字和字母组合',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
]"
|
|
|
>
|
|
|
<el-input v-model.trim="passwrodForm.password2"></el-input>
|
|
@@ -386,13 +401,17 @@ import { employeeOperate } from "@/api/systemManage";
|
|
|
// import { subjectListTree } from "@/api/specialSetting";
|
|
|
import { resetPassword2 } from "@/api/buildTeam";
|
|
|
import { Export } from "@/utils/downLoadFile";
|
|
|
-import cleanDeep from 'clean-deep'
|
|
|
-import { jobNature, teacherStatus, ProbationPeriodList } from "@/utils/searchArray";
|
|
|
+import cleanDeep from "clean-deep";
|
|
|
+import {
|
|
|
+ jobNature,
|
|
|
+ teacherStatus,
|
|
|
+ ProbationPeriodList
|
|
|
+} from "@/utils/searchArray";
|
|
|
import store from "@/store";
|
|
|
export default {
|
|
|
name: "teacherList",
|
|
|
components: {
|
|
|
- pagination,
|
|
|
+ pagination
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -403,7 +422,7 @@ export default {
|
|
|
subjectId: null,
|
|
|
organId: [],
|
|
|
search: null, // 老师姓名或电话
|
|
|
- isSupportExtraPracticeLesson: null,
|
|
|
+ isSupportExtraPracticeLesson: null
|
|
|
},
|
|
|
jobNature: jobNature, // 工作类型
|
|
|
teacherStatus: teacherStatus, // 老师状态
|
|
@@ -417,17 +436,18 @@ export default {
|
|
|
limit: 10, // 限制显示条数
|
|
|
page: 1, // 当前页
|
|
|
total: 1, // 总条数
|
|
|
- page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
},
|
|
|
passwrodVisiable: false,
|
|
|
passwrodForm: {
|
|
|
phone: "",
|
|
|
password: "",
|
|
|
- password2: "",
|
|
|
+ password2: ""
|
|
|
},
|
|
|
activatedRow: null,
|
|
|
lookServer: false,
|
|
|
infoList: [],
|
|
|
+ tenantConfig: {}
|
|
|
};
|
|
|
},
|
|
|
// activated() {
|
|
@@ -435,7 +455,10 @@ export default {
|
|
|
// this.getList();
|
|
|
// },
|
|
|
mounted() {
|
|
|
- if (this.$route.params.search) {
|
|
|
+ let tenantConfig = sessionStorage.getItem("tenantConfig");
|
|
|
+ tenantConfig = tenantConfig ? JSON.parse(tenantConfig) : {};
|
|
|
+ this.tenantConfig = tenantConfig;
|
|
|
+ if (this.$route.params.search) {
|
|
|
this.searchForm.search = this.$route.params.search;
|
|
|
}
|
|
|
this.__init();
|
|
@@ -454,7 +477,7 @@ export default {
|
|
|
},
|
|
|
onTeacher(type, row) {
|
|
|
let params = {
|
|
|
- type: type,
|
|
|
+ type: type
|
|
|
};
|
|
|
if (row) {
|
|
|
params.teacherId = row.id;
|
|
@@ -466,9 +489,9 @@ export default {
|
|
|
this.$router.push(
|
|
|
{
|
|
|
path: path,
|
|
|
- query: params,
|
|
|
+ query: params
|
|
|
},
|
|
|
- (router) => {
|
|
|
+ router => {
|
|
|
if (type == "update") {
|
|
|
router.meta.title = "老师修改";
|
|
|
} else {
|
|
@@ -478,7 +501,7 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
downLoadTeacher() {
|
|
|
- let params = {...this.searchForm};
|
|
|
+ let params = { ...this.searchForm };
|
|
|
params.lockFlag ? params.lockFlag : (params.lockFlag = null);
|
|
|
params.isProbationPeriod
|
|
|
? params.isProbationPeriod
|
|
@@ -487,7 +510,7 @@ export default {
|
|
|
// params.subjectId?params.subjectId:params.subjectId = null
|
|
|
params.subjectId ? params.subjectId : (params.subjectId = null);
|
|
|
params.search ? params.search : (params.search = null);
|
|
|
- params.organId = this.searchForm.organId.join(',')
|
|
|
+ params.organId = this.searchForm.organId.join(",");
|
|
|
params.isSupportExtraPracticeLesson
|
|
|
? params.isSupportExtraPracticeLesson
|
|
|
: (params.isSupportExtraPracticeLesson = null);
|
|
@@ -495,10 +518,10 @@ export default {
|
|
|
this,
|
|
|
{
|
|
|
url: "/api-web/export/teacherList",
|
|
|
- fileName:`老师列表导出.xls`,
|
|
|
- params:cleanDeep( {
|
|
|
+ fileName: `老师列表导出.xls`,
|
|
|
+ params: cleanDeep({
|
|
|
...params
|
|
|
- }),
|
|
|
+ })
|
|
|
},
|
|
|
"是否确认导出老师列表?"
|
|
|
);
|
|
@@ -507,7 +530,7 @@ export default {
|
|
|
window.location.href = item.contractUrl;
|
|
|
},
|
|
|
getList() {
|
|
|
- let params = {...this.searchForm};
|
|
|
+ let params = { ...this.searchForm };
|
|
|
// params.organId = this.organId
|
|
|
// searchForm: {
|
|
|
// lockFlag: null,
|
|
@@ -531,8 +554,8 @@ export default {
|
|
|
: (params.isSupportExtraPracticeLesson = null);
|
|
|
params.rows = this.pageInfo.limit;
|
|
|
params.page = this.pageInfo.page;
|
|
|
- params.organId = this.searchForm.organId.join(',')
|
|
|
- teacherQueryPage(params).then((res) => {
|
|
|
+ params.organId = this.searchForm.organId.join(",");
|
|
|
+ teacherQueryPage(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
// (res)
|
|
|
this.tableList = res.data.rows;
|
|
@@ -550,13 +573,13 @@ export default {
|
|
|
this.$confirm(str, "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
+ type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
employeeOperate({
|
|
|
employeeId: data.id,
|
|
|
- operate: type,
|
|
|
- }).then((res) => {
|
|
|
+ operate: type
|
|
|
+ }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success("更改成功");
|
|
|
this.roleStatus = false;
|
|
@@ -575,9 +598,9 @@ export default {
|
|
|
jobNature: null,
|
|
|
organId: [],
|
|
|
subjectId: null,
|
|
|
- search: null,
|
|
|
+ search: null
|
|
|
};
|
|
|
- this.search()
|
|
|
+ this.search();
|
|
|
},
|
|
|
resetPassWrod(row) {
|
|
|
this.activatedRow = row;
|
|
@@ -589,7 +612,7 @@ export default {
|
|
|
this.passwrodForm = {
|
|
|
phone: "",
|
|
|
password: "",
|
|
|
- password2: "",
|
|
|
+ password2: ""
|
|
|
};
|
|
|
this.$refs["passwrodForm"].resetFields();
|
|
|
this.passwrodVisiable = false;
|
|
@@ -599,14 +622,14 @@ export default {
|
|
|
this.$message.error("两次密码必须相同");
|
|
|
return;
|
|
|
}
|
|
|
- this.$refs["passwrodForm"].validate((res) => {
|
|
|
+ this.$refs["passwrodForm"].validate(res => {
|
|
|
if (res) {
|
|
|
// 发请求
|
|
|
resetPassword2({
|
|
|
mobile: this.passwrodForm.phone,
|
|
|
newPassword: this.passwrodForm.password,
|
|
|
- userId: this.activatedRow.id,
|
|
|
- }).then((res) => {
|
|
|
+ userId: this.activatedRow.id
|
|
|
+ }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
// 修改成功
|
|
|
this.$message.success("修改成功");
|
|
@@ -615,10 +638,8 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
@@ -631,5 +652,4 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
}
|
|
|
-
|
|
|
</style>
|