讲师管理接口联调

This commit is contained in:
wangxuemei
2024-06-06 19:44:25 +08:00
parent 0b14492f9a
commit 61e782e2c6
6 changed files with 335 additions and 200 deletions

View File

@@ -122,7 +122,7 @@
<a-input v-if="teacherdialog1 == 0" v-model:value="formParam.mobile"
style="width:200px; height: 40px; " placeholder="请输入11位手机号码" allowClear showSearch>
</a-input>
<span v-if="teacherdialog1 == 1" class=display1>{{ formParam.userNo }}</span>
<span v-if="teacherdialog1 == 1" class=display1>{{ formParam.mobile }}</span>
</div>
<div class="select">
<div style="display:inline-block ;width:5px ;text-align:center ">
@@ -135,14 +135,14 @@
<a-input v-if="teacherdialog1 == 0" v-model:value="formParam.email"
style="width:200px; height: 40px;" placeholder="" allowClear showSearch>
</a-input>
<span v-if="teacherdialog1 == 1" class=display1>{{ formParam.departId }}</span>
<span v-if="teacherdialog1 == 1" class=display1>{{ formParam.email }}</span>
</div>
<div class="select">
<!-- <Editor/> -->
<div class="select">
<span style="display:inline-block ;width:80px ; text-align:center ">讲师介绍 :</span>
</div>
<Editor v-if="teacherdialog1 == 0" v-model="formParam.teacherIntrofuce"
<Editor v-if="teacherdialog1 == 0" v-model="formParam.description"
style="width: 500px ;display:inline-block ; margin-top:-50px ;margin-left:80px " />
<span v-if="teacherdialog1 == 1" style="display: block; width: 500px;">{{ formParam.description }}</span>
</div>
@@ -151,7 +151,7 @@
<a-input type="textarea" v-if="teacherdialog1 == 0" v-model:value="formParam.remark"
style="width:500px; height: 80px; ">
</a-input>
<span v-if="teacherdialog1 == 1" class=display1>{{ formParam.userNo }}</span>
<span v-if="teacherdialog1 == 1" class=display1>{{ formParam.remark }}</span>
</div>
<div class="del_btnbox" v-if="teacherdialog1 == 0">
<a-button class="del_btn btn1" @click="cancelTeacherDialog" style="margin-right: 32px;">取消</a-button>
@@ -245,7 +245,8 @@
<script lang="jsx">
import { reactive, toRefs, ref } from "vue";
import Editor from "@/components/project/Editor";
import {getOutTeacherList ,getOuterTeacherById ,getOuterTeacherCourseList,deleteTeacher,updateInTeacher, updateTeacherState} from "../../api/Lecturer";
import { message } from "ant-design-vue";
import {getOutTeacherList ,getOuterTeacherById ,getOuterTeacherCourseList,deleteInTeacher,updateInTeacher, updateTeacherState,insertTeacherOutSide,updateOutTeacher} from "../../api/Lecturer";
// import {getProjSt} from "../../api/indexProjStu";
// import AddTeacher from "../../components/drawers/project/AddTeacher"
export default {
@@ -256,6 +257,8 @@ export default {
},
setup() {
const state = reactive({
currentPage1: 1,
pageSize1: 10,
promotionrecordsLoading:false , //晋级记录遮罩层
tableLoading:false,
tagsshow:"1",
@@ -263,6 +266,7 @@ export default {
editTeacherid:null,//修改状态id确认
userNoid:null, //讲师详情工号确认
lookTeacherId:null, //讲师详情id确认
newStatus:null , //修改状态码确认
deleteTeacherdialog: false, //删除弹窗
editTeacher:false , //修改状态弹窗
handleOperate1:null, //修改状态弹窗内容
@@ -414,6 +418,8 @@ export default {
// // 翻页
const changePagination = (page) => {
state.searchParam.pageNo = page;
state.currentPage1 = page;
state.pageSize1 = pageSize;
getTableDate();
};
const teacherchangePagination = (page) => {
@@ -431,33 +437,41 @@ export default {
state.teacherdialog1 = 0
state.teacherdialog = true;
state.teacherdialogtitle = '修改信息'
state.lookTeacherId= record.id
TeacherSystem()
}
//保存
const createTeacherDialog =()=>{
//调用新增修改接口
// this.$refs["formParam"].validate(valid => {
// if (valid) {
let objform = {...state.formParam}
// if (state.formParam.userNo != undefined) {
// updateInTeacher (objform).then(response => {
// state.$modal.msgSuccess("修改成功");
// state.teacherdialog = false;
// state.getlist()
// });
// }
// else {
// insertTeacher(objform).then(response => {
// console.log('1')
// state.$modal.msgSuccess("新增成功");
// state.teacherdialog = false;
// getTableDate()
// })
// }
// }
// })
state.teacherdialog = false
}
const createTeacherDialog = () => {
console.log(state.formParam);
// if (state.formParam.id != undefined) {
updateOutTeacher (state.formParam).then(response => {
message.success("修改成功");
});
// }
// let objA = {...state.formParam};
// state.formParam ={
// name:'新增测试',
// userNo:'12315',
// departId:'8465784657',
// defaultTeachingTime:50,
// leveId:1,
// tsystemName:249,
// certStatus:1,
// description:'测试13.00',
// workExperience:'测试13.00',
// courses:'测试13.00',
// }
// else {
// insertTeacherOutSide(state.formParam)
// .then((res) => {
// message.success("保存成功");
// }).catch((err) => {
// console.log(err);
// });
// }
state.teacherdialog = false;
getTableDate();
};
//删除弹窗
const deleteModal = (record) => {
state.deleteTeacherdialog = true
@@ -467,21 +481,20 @@ export default {
const handleOperate = (record) => {
if( record.status == 1){
state.handleOperate1 = record.status
state.newStatus= 2
}
if( record.status == 2){
state.handleOperate1 =record.status
state.newStatus= 1
}
state.editTeacherid =record.id
state.editTeacher = true
};
//确认删除
const closeDeleteTeacher=()=>{
let ids ={
id : state.delTeacherId
}
console.log(ids)
//确认删除
const closeDeleteTeacher=()=>{
//调用删除接口
deleteTeacher(ids).then((res)=>{
deleteInTeacher(state.delTeacherId).then((res)=>{
if(res.data.code == 200 ){
// message.success("删除成功");
state.deleteTeacherdialog = false
@@ -493,7 +506,8 @@ export default {
const closehandleOperate= ()=>{
//调用接口
let ids ={
id : state.editTeacherid
id : state.editTeacherid,
newStatus: state.newStatus
}
console.log(ids)
updateTeacherState(ids).then((res) => {
@@ -537,8 +551,7 @@ export default {
}
//外部讲师详情
const TeacherSystem=()=>{
let ids={userNo : state.userNoid }
getOuterTeacherById(ids).then((res) => {
getOuterTeacherById(state.lookTeacherId).then((res) => {
console.log("外部讲师详情", res.data);
state.formParam= res.data.data
})
@@ -669,14 +682,19 @@ export default {
// getpromotionrecordstableData()
//导出功能
// const handleExport = ()=>{
const handleExport = ()=>{
window.open(
`${process.env.VUE_APP_BASE_API}/teacher/export?pageNo=${
state.currentPage1
}&pageSize=${state.pageSize1}&name=${state.searchParam.name ? state.searchParam.name : ""}&status=${state.searchParam.status ? state.searchParam.status : ""}`
);
// this.download('lesson_records/export', {
// ...state.searchParam
// }, `project_${new Date().getTime()}.xlsx` )
// }
}
return {
...toRefs(state),
// handleExport,
handleExport,
AccountStatusList,
searchSubmit,
searchReset,