diff --git a/src/api/modules/teacher.js b/src/api/modules/teacher.js index 33978bd0..ec6d4807 100644 --- a/src/api/modules/teacher.js +++ b/src/api/modules/teacher.js @@ -25,7 +25,7 @@ const getInfoById = function(id) { * name 姓名 * tlevelId级别 * salaryId发薪地 - tsystemId这个应该是教师体系,他注释没有写明白 + * tsystemId * } query * @returns @@ -187,6 +187,17 @@ const exports=function(query){ const findAllCourses=function(query){ return ajax.post('/xboe/teacher/compose/find/courses',query); } +/** + * 内部讲师-删除模块讲师接口 + * @param { + courseId // 课程id + modId // 模块id + teacherId // 教师id + remark // 备注 + */ + const syncUpdate = function(data) { + return ajax.postJson('/xboe/teacher/update-sync',data); + } export default { findByName, @@ -201,5 +212,6 @@ export default { has, start, end, - exports + exports, + syncUpdate } diff --git a/src/views/manage/TeacherList.vue b/src/views/manage/TeacherList.vue index 867b66c5..00f6e830 100644 --- a/src/views/manage/TeacherList.vue +++ b/src/views/manage/TeacherList.vue @@ -182,6 +182,7 @@ return { query:{ tSystemId:'', + tSystemIds:'', tLevelId:'', queryName:'', salaryId:'', @@ -248,6 +249,7 @@ systemData:[],//体系数组{id,name} levelData:[],//级别数组{id,name} queryLevelData:[], + teacherSystemids:[] } }, watch:{ @@ -257,9 +259,9 @@ } } }, - mounted() { - this.loadData(1); - this.getTeachersystem(); + mounted() { + this.getTeachersystem(); + }, computed: { ...mapGetters(['userInfo']) @@ -281,13 +283,16 @@ this.systemLevelTree=res.result; this.systemData=[]; res.result.forEach(item => { + this.teacherSystemids.push(item.teacher_system_id); this.systemData.push({ id:item.teacher_system_id, name:item.system_name }) }); + this.loadData(1); } else { this.$message.error('教师体系数据获取失败!') + this.loadData(1); } }) }, @@ -522,7 +527,7 @@ }, loadData(pageIndex) { this.query.pageIndex = pageIndex; - console.log(this.query,'this.query'); + this.query.tSystemIds = this.query.tSystemId || this.teacherSystemids.join(); teacherApi .page( this.query diff --git a/src/views/manage/teacherDetails.vue b/src/views/manage/teacherDetails.vue index a6ba863f..979585c6 100644 --- a/src/views/manage/teacherDetails.vue +++ b/src/views/manage/teacherDetails.vue @@ -274,10 +274,10 @@ export default { name: "teacherDetails", components: { imageUpload }, props: { - id:{ + id:{// sysId type: String, }, - newId:{ + newId:{// id type: String, } }, @@ -497,11 +497,47 @@ export default { if (res.status == 200) { const result = res.result; this.form = result; + this.synchronization(res.result); } else { this.$message.error(res.message); } }); + }, + synchronization(result) { + let param = { + id: this.newId,//当前老师记录的id + /**因为有可能部分老师没有这个字段,对应返回的teacher_id*/ + sysId: result.teacher_id, + /**因为有可能部分老师没有这个字段*/ + companyId: result.company_id, + companyName: result.company_name, + teacherCode: result.teacher_code, + /**返回的字段,不知道什么意义*/ + teacherType: result.teacher_type, + userId: result.user_id, + userNo: result.user_no, + gender: result.gender, + teachingTime: result.teaching_time, + certification: result.certification, + language: result.language, + timezone: result.timezone, + tsystemId: result.system_id, + tsystemName: result.system_name, + tlevelId: result.level_id, + tlevelName: result.level_name, + /**认证人*/ + certifyby: result.certify_by, + /**状态;0:临时;1:正式;2:停用*/ + pstatus: result.status, + /**员工状态 2:正常 3:离职*/ + pemployeeStatus: result.employee_status, } + teacherApi.syncUpdate(param).then(res=>{ + if(res.status != 200) { + console.log(res) + } + }) + } } };