修改教师提交

This commit is contained in:
daihh
2022-06-06 20:43:44 +08:00
parent efbc1b0518
commit c3a61d1272
2 changed files with 37 additions and 46 deletions

View File

@@ -3,17 +3,17 @@
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<div style="display: flex;justify-content:flex-start;"> <div style="display: flex;justify-content:flex-start;">
<div style="padding: 0px 5px;"> <div style="padding: 0px 5px;">
<el-select v-model="query.tSystemId" value-key="id" clearable @change="queryChangeSystem" placeholder="请选择教师体系"> <el-select v-model="query.tsystemId" value-key="id" clearable @change="queryChangeSystem" placeholder="请选择教师体系">
<el-option v-for="item in systemData" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in systemData" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<!-- 要在换一个变量与新建区别开 --> <!-- 要在换一个变量与新建区别开 -->
<div style="padding: 0px 5px;"> <div style="padding: 0px 5px;">
<el-select v-model="query.tLevelId" clearable value-key="id" placeholder="请选择教师级别"> <el-select v-model="query.tlevelId" clearable value-key="id" placeholder="请选择教师级别">
<el-option v-for="item in queryLevelData" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in queryLevelData" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<div style="padding: 0px 5px;"><el-input placeholder="请输入姓名" v-model="query.queryName" clearable></el-input></div> <div style="padding: 0px 5px;"><el-input placeholder="请输入姓名" v-model="query.name" clearable></el-input></div>
<div style="padding: 0px 5px;"> <div style="padding: 0px 5px;">
<el-select v-model="query.salaryId" clearable value-key="id" placeholder="请选择发薪地"> <el-select v-model="query.salaryId" clearable value-key="id" placeholder="请选择发薪地">
<el-option v-for="item in placeList" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in placeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
@@ -186,10 +186,10 @@
data(){ data(){
return { return {
query:{ query:{
tSystemId:'', tsystemId:'',
tSystemIds:'', tsystemIds:'',
tLevelId:'', tlevelId:'',
queryName:'', name:'',
salaryId:'', salaryId:'',
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
@@ -232,7 +232,6 @@
] ]
}, },
selectList:[], selectList:[],
queryName:"",
dialogVisible:false, dialogVisible:false,
tableData:[], tableData:[],
searchName:null, searchName:null,
@@ -349,10 +348,9 @@
this.levelData=array; this.levelData=array;
}, },
reset (){ reset (){
this.query.queryName = ''; this.query.name = '';
this.query.tSystemId='', this.query.tsystemId='',
this.query.tLevelId='', this.query.tlevelId='',
this.query.queryName='',
this.query.salaryId='', this.query.salaryId='',
this.query.pageIndex= 1, this.query.pageIndex= 1,
this.query.pageSize= 10, this.query.pageSize= 10,
@@ -588,15 +586,8 @@
}, },
loadData(pageIndex) { loadData(pageIndex) {
this.query.pageIndex = pageIndex; this.query.pageIndex = pageIndex;
this.query.tSystemIds = this.query.tSystemId || this.teacherSystemids.join(); this.query.tsystemIds = this.query.tsystemId || this.teacherSystemids.join();
teacherApi teacherApi.page(this.query).then((res) => {
.page(
this.query
// pageIndex: this.pageIndex,
// pageSize: this.pageSize,
// name: this.queryName,
)
.then((res) => {
if (res.status == 200) { if (res.status == 200) {
const result = res.result; const result = res.result;
this.tableData = result.list; this.tableData = result.list;
@@ -667,33 +658,32 @@
}) })
ids = ids.join(); ids = ids.join();
} }
//如果是勾选的那需要传id的值使用逗号分隔
//get请求
// var eleLink = document.createElement('a');
// eleLink.download = '教师列表';
// eleLink.style.display = 'none';
// eleLink.href = `${process.env.VUE_APP_BASE_API}/xboe/teacher/export?name=${this.queryName}`;
// document.body.appendChild(eleLink);
// eleLink.click();
// 然后移除
// document.body.removeChild(eleLink);
//post请求 //post请求
var eleForm=document.createElement('form'); var eleForm=document.createElement('form');
eleForm.style="display:none;"; eleForm.style="display:none;";
eleForm.method='post'; eleForm.method='post';
eleForm.action=`${process.env.VUE_APP_BASE_API}/xboe/teacher/export?name=${this.queryName}`; eleForm.action=`${process.env.VUE_APP_BASE_API}/xboe/teacher/export?name=${this.query.name}`;
//添加ids条件
var hdnFilePath = document.createElement('input'); var hdnFilePath = document.createElement('input');
hdnFilePath.type = 'hidden'; hdnFilePath.type = 'hidden';
hdnFilePath.name = 'ids'; hdnFilePath.name = 'ids';
hdnFilePath.value = ids; hdnFilePath.value = ids;
eleForm.appendChild(hdnFilePath); eleForm.appendChild(hdnFilePath);
//添加查询姓名
var hdnName = document.createElement('input');
hdnName.type = 'hidden';
hdnName.name = 'name';
hdnName.value = this.query.name;
eleForm.appendChild(hdnName);
document.body.appendChild(eleForm); document.body.appendChild(eleForm);
eleForm.submit(); eleForm.submit();
document.body.removeChild(eleForm); document.body.removeChild(eleForm);
}, },
exportCourse(row){ exportCourse(row){
if(!row.sysId){
this.$message({message:'无原系统教师关联,只导出新系统的教师课程',type:'warning'});
}
var eleLink = document.createElement('a'); var eleLink = document.createElement('a');
eleLink.download = '教师授课信息'; eleLink.download = '教师授课信息';
eleLink.style.display = 'none'; eleLink.style.display = 'none';

View File

@@ -26,7 +26,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="初始授课时长:">{{formatSeconds(form.default_teaching_time)}}</el-form-item></el-col> <el-form-item label="初始授课时长:">{{formatSeconds(form.default_teaching_time)}}</el-form-item></el-col>
</el-form-item> </el-form-item>
<el-form-item label="讲师体系:"> <el-form-item label="讲师体系:">
<el-col :span="12">{{form.system_name}}</el-col> <el-col :span="12">{{form.system_name}}</el-col>
<el-col :span="12"> <el-col :span="12">
@@ -52,7 +52,7 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<!-- <el-form-item label="认证人:"> --> <!-- <el-form-item label="认证人:"> -->
<!-- <el-col :span="12">--</el-col> --> <!-- <el-col :span="12">--</el-col> -->
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
@@ -374,8 +374,8 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let data = { let data = {
courseId:row.courseId, // 课程id courseId:row.courseId, // 课程id
modId:row.modId, // 模块id modId:row.modId, // 模块id
teacherId:row.teacherId, // 教师id teacherId:row.teacherId, // 教师id
remark:'', // 备注 remark:'', // 备注
} }
@@ -387,17 +387,17 @@ export default {
message: '删除成功!' message: '删除成功!'
}); });
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
}); });
}); });
}, },
recordsUpdate(row) { recordsUpdate(row) {
this.records.row = row; this.records.row = row;
@@ -454,8 +454,8 @@ export default {
}, },
editModelTeacher() { editModelTeacher() {
let data = { let data = {
courseId:this.records.row.courseId, // 课程id courseId:this.records.row.courseId, // 课程id
modId:this.records.row.modId, // 模块id modId:this.records.row.modId, // 模块id
teacherId:this.records.row.teacherId, // 教师id teacherId:this.records.row.teacherId, // 教师id
teachingTime:this.records.row.teachingTime, // 授课时间 teachingTime:this.records.row.teachingTime, // 授课时间
} }
@@ -495,13 +495,14 @@ export default {
this.getCourseScore() this.getCourseScore()
}, },
getDetail() { getDetail() {
//应该是自己系统的教师信息呀
teacherBoeApi.teacherInfo(this.id).then(res => { teacherBoeApi.teacherInfo(this.id).then(res => {
if (res.status == 200) { if (res.status == 200) {
const result = res.result; const result = res.result;
this.form = result; this.form = result;
this.synchronization(res.result); this.synchronization(res.result);
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
}); });
}, },
@@ -539,7 +540,7 @@ export default {
console.log(res) console.log(res)
} }
}) })
} }
} }
}; };
</script> </script>