Commit 2209307c authored by 张伯涛's avatar 张伯涛

课程管理接口初步调整

parent 4349254d
import request from '@/utils/request' import request from '@/utils/request'
import Qs from "qs";
// 课程管理列表查询 // 课程管理列表查询
export function queryBLessonsByPagination(query) { export function queryBLessonsByPagination(query) {
...@@ -16,3 +17,119 @@ export function queryBChaptersWithoutAuth(query) { ...@@ -16,3 +17,119 @@ export function queryBChaptersWithoutAuth(query) {
params: query params: query
}) })
} }
// 查询课程方向下拉
export function queryDirectionsList(query) {
return request({
url: '/bdirection/queryDirectionsList',
method: 'get',
params: query
})
}
// 课程管理新增
export function blessonAdd(data) {
data = Qs.stringify(data)
return request({
url: '/blesson/add',
method: 'post',
data,
headers: {}
})
}
// 课程管理删除
export function blessonRemove(data) {
data = Qs.stringify(data)
return request({
url: '/blesson/remove',
method: 'post',
data,
headers: {}
})
}
// 课程管理导入
export function excelImport(data) {
return request({
url: '/blesson/excelImport',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
transformRequest: [(data) => {
return data
}],
data
})
}
// 课程管理恢复封面
export function defaultUrl(data) {
data = Qs.stringify(data)
return request({
url: '/blesson/defaultUrl',
method: 'post',
data,
headers: {}
})
}
// 课程管理修改封面
export function picImport(data) {
data = Qs.stringify(data)
return request({
url: '/blesson/picImport',
method: 'post',
data,
headers: {}
})
}
// 课程管理-目录添加章
export function bchapterAdd(data) {
data = Qs.stringify(data)
return request({
url: '/bchapter/add',
method: 'post',
data,
headers: {}
})
}
// 课程管理-目录删除节
export function bchapterRemove(data) {
data = Qs.stringify(data)
return request({
url: '/bchapter/remove',
method: 'post',
data,
headers: {}
})
}
// 课程管理-目录章节上移
export function updateTopChapter(data) {
data = Qs.stringify(data)
return request({
url: '/bchapter/updateTopChapter',
method: 'post',
data,
headers: {}
})
}
// 课程管理-目录章节下移
export function updateDownChapter(data) {
data = Qs.stringify(data)
return request({
url: '/bchapter/updateDownChapter',
method: 'post',
data,
headers: {}
})
}
// 6.导入
export function uploadVideo(data) {
return request({
url: '/bvideo/uploadVideo',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
transformRequest: [(data) => {
return data
}],
data
})
}
...@@ -227,7 +227,13 @@ import EduVideo from '@/components/Tools/EduVideo' ...@@ -227,7 +227,13 @@ import EduVideo from '@/components/Tools/EduVideo'
import EduPpt from '@/components/Tools/EduPpt' import EduPpt from '@/components/Tools/EduPpt'
import EduPdf from '@/components/Tools/EduPdf' import EduPdf from '@/components/Tools/EduPdf'
import EduFile from '@/components/Tools/EduFile' import EduFile from '@/components/Tools/EduFile'
import {queryBChaptersWithoutAuth, queryBLessonsByPagination} from '@/api/courseManagement/indexApi' import {
queryBChaptersWithoutAuth,
blessonAdd,
bchapterAdd,
bchapterRemove,
updateTopChapter, updateDownChapter, uploadVideo
} from '@/api/courseManagement/indexApi'
export default { export default {
name: "courseCatalogues", name: "courseCatalogues",
components:{ components:{
...@@ -426,16 +432,14 @@ export default { ...@@ -426,16 +432,14 @@ export default {
console.log('修改目录标题'); console.log('修改目录标题');
let bid = $this.attr('data-bid'); let bid = $this.attr('data-bid');
let chapterName = $this.val(); let chapterName = $this.val();
_this.eduUtil.ajaxPostUtil( const params = {
'BChapter/add',
{
businessId: bid, businessId: bid,
pid: -1, pid: -1,
lessonOrSl: '1', lessonOrSl: '1',
lessonId: _this.lessonId, lessonId: _this.lessonId,
chapterName: chapterName chapterName: chapterName
}, }
function (res) { bchapterAdd(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -453,13 +457,13 @@ export default { ...@@ -453,13 +457,13 @@ export default {
$this.val($this.prev('input[type=hidden]').val()); $this.val($this.prev('input[type=hidden]').val());
} }
$this.prop('disabled',true); $this.prop('disabled',true);
}, function (err) { }).catch((err) => {
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'error' type: 'error'
// });
}); });
})
} }
}else{ }else{
$this.prop('disabled',true); $this.prop('disabled',true);
...@@ -477,16 +481,14 @@ export default { ...@@ -477,16 +481,14 @@ export default {
let bid = $this.attr('data-bid'); let bid = $this.attr('data-bid');
let pid = $this.attr('data-pid'); let pid = $this.attr('data-pid');
let chapterName = $this.val(); let chapterName = $this.val();
_this.eduUtil.ajaxPostUtil( const params = {
'BChapter/add',
{
businessId: bid, businessId: bid,
pid: pid, pid: pid,
lessonOrSl: '1', lessonOrSl: '1',
lessonId: _this.lessonId, lessonId: _this.lessonId,
chapterName: chapterName chapterName: chapterName
}, }
function (res) { bchapterAdd(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -503,13 +505,13 @@ export default { ...@@ -503,13 +505,13 @@ export default {
$this.val($this.prev('input[type=hidden]').val()); $this.val($this.prev('input[type=hidden]').val());
} }
$this.prop('disabled',true); $this.prop('disabled',true);
}, function (err) { }).catch((err) => {
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'error' type: 'error'
// });
}); });
})
} }
}else{ }else{
$this.prop('disabled',true); $this.prop('disabled',true);
...@@ -563,11 +565,11 @@ export default { ...@@ -563,11 +565,11 @@ export default {
//关闭loading //关闭loading
loading.close(); loading.close();
}).catch(function() { }).catch(function() {
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'error' type: 'error'
// }); });
loading.close(); loading.close();
}) })
} }
...@@ -584,15 +586,13 @@ export default { ...@@ -584,15 +586,13 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.5)',
}); });
const url = 'BChapter/add'; const params = {
this.eduUtil.ajaxPostUtil(url,
{
lessonId: this.lessonId, lessonId: this.lessonId,
lessonOrSl: '1', lessonOrSl: '1',
chapterName: this.chapterForm.text, chapterName: this.chapterForm.text,
pid: -1 pid: -1
}, }
function (res) { bchapterAdd(params).then(res => {
loading.close(); loading.close();
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -600,15 +600,14 @@ export default { ...@@ -600,15 +600,14 @@ export default {
type: 'success' type: 'success'
}); });
_this.loadCatalog(_this.lessonId, _this.classHours); _this.loadCatalog(_this.lessonId, _this.classHours);
} }).catch((err) => {
, function (err) {
loading.close(); loading.close();
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'error' type: 'error'
// });
}); });
})
this.viewSwitch.chapterForm = false; this.viewSwitch.chapterForm = false;
this.formClear(); this.formClear();
}else{ }else{
...@@ -670,22 +669,18 @@ export default { ...@@ -670,22 +669,18 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.5)',
}); });
this.eduUtil.ajaxPostUtil( const params = {
'BLesson/add',
{
businessId:_this.lessonId, businessId:_this.lessonId,
classHour:_this.classHours, classHour:_this.classHours,
lessonName:_this.lessonName, lessonName:_this.lessonName,
code:_this.code, code:_this.code,
directionId:_this.directionId directionId:_this.directionId
},res =>{ }
//console.log(res); blessonAdd(params).then(res => {
loading.close(); loading.close();
},err =>{ }).catch((err) => {
//console.log(err);
loading.close(); loading.close();
} })
);
}).catch(() => { }).catch(() => {
return false; return false;
}); });
...@@ -700,8 +695,7 @@ export default { ...@@ -700,8 +695,7 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.5)',
}); });
_this.eduUtil.ajaxPostUtil('BChapter/add', const params = {
{
lessonId:_this.lessonId, lessonId:_this.lessonId,
lessonOrSl:'1', lessonOrSl:'1',
pid:_this.sectionForm.chapterId, pid:_this.sectionForm.chapterId,
...@@ -709,8 +703,8 @@ export default { ...@@ -709,8 +703,8 @@ export default {
isTest:_this.sectionForm.stuMeansValue, isTest:_this.sectionForm.stuMeansValue,
classHour:_this.sectionForm.classHours, classHour:_this.sectionForm.classHours,
experimentType:_this.sectionForm.stuMeansFile experimentType:_this.sectionForm.stuMeansFile
}, }
function(res){ bchapterAdd(params).then(res => {
loading.close(); loading.close();
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -719,16 +713,15 @@ export default { ...@@ -719,16 +713,15 @@ export default {
}); });
_this.viewSwitch.sectionForm = false; _this.viewSwitch.sectionForm = false;
_this.loadCatalog(_this.lessonId); _this.loadCatalog(_this.lessonId);
}, }).catch((err) => {
function(err){
loading.close(); loading.close();
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'error' type: 'error'
// });
_this.viewSwitch.sectionForm = false;
}); });
_this.viewSwitch.sectionForm = false;
})
} }
} else { } else {
...@@ -781,14 +774,11 @@ export default { ...@@ -781,14 +774,11 @@ export default {
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.5)',
customClass: 'myLoading' customClass: 'myLoading'
}); });
const params = {
this.eduUtil.ajaxPostUtil(
'BChapter/remove',
{
id:_this.currentChapterId, id:_this.currentChapterId,
lessonOrSl:1 lessonOrSl:1
}, }
function(res){ bchapterRemove(params).then(res => {
loading.close(); loading.close();
if(res.code === 200) { if(res.code === 200) {
_this.$notify({ _this.$notify({
...@@ -805,15 +795,14 @@ export default { ...@@ -805,15 +795,14 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
},function(err){ }).catch((err) => {
loading.close(); loading.close();
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'error' type: 'error'
// }); });
} })
);
}).catch(() => { }).catch(() => {
//无操作 //无操作
}) })
...@@ -821,15 +810,13 @@ export default { ...@@ -821,15 +810,13 @@ export default {
//章节上移 //章节上移
chapterUp(bid,pid,sort){ chapterUp(bid,pid,sort){
let _this = this; let _this = this;
this.eduUtil.ajaxPostUtil( const params = {
'BChapter/updateTopChapter',
{
businessId:bid, businessId:bid,
pid:pid, pid:pid,
sort:sort, sort:sort,
lessonId:_this.lessonId lessonId:_this.lessonId
}, }
function(res){ updateTopChapter(params).then(res => {
if(res.code === 200) { if(res.code === 200) {
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -844,28 +831,24 @@ export default { ...@@ -844,28 +831,24 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}, }).catch((err) => {
function(err){ _this.$notify({
// _this.$notify({ title: '失败',
// title: '失败', message: '网络错误',
// message: '网络错误', type: 'error'
// type: 'error' });
// }); })
}
);
}, },
//章节下移 //章节下移
chapterDown(bid,pid,sort){ chapterDown(bid,pid,sort){
let _this = this; let _this = this;
this.eduUtil.ajaxPostUtil( const params = {
'BChapter/updateDownChapter',
{
businessId:bid, businessId:bid,
pid:pid, pid:pid,
sort:sort, sort:sort,
lessonId:_this.lessonId lessonId:_this.lessonId
}, }
function(res){ updateDownChapter(params).then(res => {
if(res.code === 200) { if(res.code === 200) {
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -880,15 +863,13 @@ export default { ...@@ -880,15 +863,13 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}, }).catch((err) => {
function(err){ _this.$notify({
// _this.$notify({ title: '失败',
// title: '失败', message: '网络错误',
// message: '网络错误', type: 'error'
// type: 'error' });
// }); })
}
);
}, },
//更改课时 //更改课时
changeHour(secHour,bid,pid,chapterName,index,indexChild){ changeHour(secHour,bid,pid,chapterName,index,indexChild){
...@@ -905,20 +886,18 @@ export default { ...@@ -905,20 +886,18 @@ export default {
_this.classHours = parseInt(_this.classHours); _this.classHours = parseInt(_this.classHours);
_this.classHours += 1; _this.classHours += 1;
//更新总课时 //更新总课时
_this.eduUtil.ajaxPostUtil( const params ={
'BLesson/add',
{
businessId:_this.lessonId, businessId:_this.lessonId,
classHour:_this.classHours, classHour:_this.classHours,
lessonName:_this.lessonName, lessonName:_this.lessonName,
code:_this.code, code:_this.code,
directionId:_this.directionId directionId:_this.directionId
},res =>{
// console.log(res);
},err =>{
console.log(err);
} }
); blessonAdd(params).then(res => {
}).catch((err) => {
console.log(err);
})
}).catch(() => { }).catch(() => {
if (secHour == 1){ if (secHour == 1){
this.chapterList[index].childList[indexChild].classHour = "0" this.chapterList[index].childList[indexChild].classHour = "0"
...@@ -931,17 +910,15 @@ export default { ...@@ -931,17 +910,15 @@ export default {
//请求更新课时 //请求更新课时
function updateClassHours(){ function updateClassHours(){
if (!_this.updateCancel){ if (!_this.updateCancel){
_this.eduUtil.ajaxPostUtil( const params ={
'BChapter/add',
{
businessId:bid, businessId:bid,
pid:pid, pid:pid,
lessonOrSl:1, lessonOrSl:1,
lessonId:_this.lessonId, lessonId:_this.lessonId,
chapterName:chapterName, chapterName:chapterName,
classHour:secHour classHour:secHour
}, }
function(res){ bchapterAdd(params).then(res => {
if(res.code===200){ if(res.code===200){
_this.$notify({ _this.$notify({
title: '成功', title: '成功',
...@@ -958,15 +935,14 @@ export default { ...@@ -958,15 +935,14 @@ export default {
duration:'1200' duration:'1200'
}); });
} }
},function(err){ }).catch((err) => {
// _this.$notify({ _this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: 'err', type: 'err',
// duration:'1200' duration:'1200'
// }); });
} })
)
}else{ }else{
_this.updateCancel = false _this.updateCancel = false
} }
...@@ -1109,14 +1085,14 @@ export default { ...@@ -1109,14 +1085,14 @@ export default {
}); });
let bid = this.teaMeans.businessId; let bid = this.teaMeans.businessId;
let _this = this; let _this = this;
_this.eduUtil.ajaxPostUtil( const params ={
'BChapter/add',{
businessId:bid, businessId:bid,
experimentType:_this.teaMeans.expType, experimentType:_this.teaMeans.expType,
lessonOrSl:1, lessonOrSl:1,
isTest:_this.teaMeans.stuMeans, isTest:_this.teaMeans.stuMeans,
chapterName:_this.teaMeans.chapterName chapterName:_this.teaMeans.chapterName
},res=>{ }
bchapterAdd(params).then(res => {
loading.close(); loading.close();
if(res.code===200){ if(res.code===200){
_this.$notify({ _this.$notify({
...@@ -1134,15 +1110,14 @@ export default { ...@@ -1134,15 +1110,14 @@ export default {
'type':'warning' 'type':'warning'
}); });
} }
},err=>{ }).catch((err) => {
loading.close(); loading.close();
// _this.$notify({ _this.$notify({
// 'title':'失败', 'title':'失败',
// 'message':'网络错误', 'message':'网络错误',
// 'type':'error' 'type':'error'
// }); });
} })
);
}, },
confirmUpload(){ confirmUpload(){
let type = this.resForm.type; let type = this.resForm.type;
...@@ -1223,12 +1198,12 @@ export default { ...@@ -1223,12 +1198,12 @@ export default {
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.5)',
customClass: 'myLoading' customClass: 'myLoading'
}); });
_this.eduUtil.ajaxPostFileUtil(_this,'BVideo/uploadVideo',{ var formData = new FormData() // 当前为空
type:type, formData.append('type', type)
chapterId:_this.resForm.businessId, formData.append('chapterId', _this.resForm.businessId)
file:file, formData.append('file', file)
lessonId:_this.lessonId formData.append('lessonId', _this.lessonId)
},res =>{ uploadVideo(formData).then(res => {
loading.close(); loading.close();
if(res.code===200&&_this.progress===100){ if(res.code===200&&_this.progress===100){
_this.success(res); _this.success(res);
...@@ -1238,11 +1213,10 @@ export default { ...@@ -1238,11 +1213,10 @@ export default {
}else{ }else{
_this.warning(res); _this.warning(res);
} }
},err =>{ }).catch((err) => {
loading.close(); loading.close();
_this.error(err); _this.error(err);
} })
);
} }
}, },
//ajax成功的提示 //ajax成功的提示
...@@ -1263,11 +1237,11 @@ export default { ...@@ -1263,11 +1237,11 @@ export default {
}, },
//ajax错误的提示 //ajax错误的提示
error(err){ error(err){
// this.$notify({ this.$notify({
// title: '失败', title: '失败',
// message: '网络错误', message: '网络错误',
// type: "error" type: "error"
// }); });
}, },
//返回 //返回
goBack(){ goBack(){
......
...@@ -228,7 +228,14 @@ ...@@ -228,7 +228,14 @@
<script> <script>
import CurCat from '../courseManagement/courseCatalogues.vue' import CurCat from '../courseManagement/courseCatalogues.vue'
import {queryBLessonsByPagination} from '@/api/courseManagement/indexApi' import {
queryBLessonsByPagination,
queryDirectionsList,
blessonAdd,
blessonRemove,
excelImport,
defaultUrl, picImport,
} from '@/api/courseManagement/indexApi'
import commonField from "@/utils/commonField"; import commonField from "@/utils/commonField";
export default { export default {
name: "index", name: "index",
...@@ -400,8 +407,7 @@ export default { ...@@ -400,8 +407,7 @@ export default {
getCourseDirection() { getCourseDirection() {
let that = this; let that = this;
that.fullscreenLoading=true; that.fullscreenLoading=true;
that.eduUtil.ajaxGetUtil('BDirection/queryDirectionsList', {}, queryDirectionsList().then(res => {
function (res) {
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
let obj = {}; let obj = {};
obj.value = res.data[i].id; obj.value = res.data[i].id;
...@@ -409,15 +415,14 @@ export default { ...@@ -409,15 +415,14 @@ export default {
that.courseDirection[i] = obj; that.courseDirection[i] = obj;
} }
that.fullscreenLoading=false; that.fullscreenLoading=false;
}, function (err) { }).catch((err) => {
that.fullscreenLoading=false; that.fullscreenLoading=false;
that.$notify({ that.$notify({
title: '失败', title: '失败',
message: '网络错误,课程方向获取失败', message: '网络错误,课程方向获取失败',
type: 'error' type: 'error'
}) })
} });
)
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
...@@ -489,14 +494,14 @@ export default { ...@@ -489,14 +494,14 @@ export default {
if (valid) { if (valid) {
that.fullscreenLoading = true; that.fullscreenLoading = true;
that.dialogFormVisible = false; that.dialogFormVisible = false;
that.eduUtil.ajaxPostUtil('BLesson/add', { const params = {
'code': that.form.id, code: that.form.id,
'lessonName': that.form.name, lessonName: that.form.name,
'classHour': that.form.totalStuHours, classHour: that.form.totalStuHours,
'directionId': that.form.couDire, directionId: that.form.couDire,
'credits': that.form.credit credits: that.form.credit
}, }
function (res) { blessonAdd(params).then(res => {
let type = res.code; let type = res.code;
let message = res.message; let message = res.message;
type = (type == 200) ? "success" : "warning"; type = (type == 200) ? "success" : "warning";
...@@ -509,8 +514,7 @@ export default { ...@@ -509,8 +514,7 @@ export default {
if(type=='success') { if(type=='success') {
that.loadData(); that.loadData();
} }
}).catch((err) => {
}, function (err) {
that.fullscreenLoading = false; that.fullscreenLoading = false;
console.log(err); console.log(err);
}) })
...@@ -560,10 +564,9 @@ export default { ...@@ -560,10 +564,9 @@ export default {
dom.value='' dom.value=''
_this.fullscreenLoading = false; _this.fullscreenLoading = false;
}else{ }else{
_this.eduUtil.ajaxPostUtil( var formData = new FormData() // 当前为空
'BLesson/excelImport', formData.append('importFile', dom.files[0])
{importFile:dom.files[0]}, excelImport(formData).then(res => {
function (res){
console.log(res); console.log(res);
dom.value='' dom.value=''
_this.fullscreenLoading = false; _this.fullscreenLoading = false;
...@@ -581,8 +584,7 @@ export default { ...@@ -581,8 +584,7 @@ export default {
type: 'error' type: 'error'
}); });
} }
}, }).catch((err) => {
function (err) {
dom.value='' dom.value=''
_this.$notify({ _this.$notify({
title: '失败', title: '失败',
...@@ -590,8 +592,7 @@ export default { ...@@ -590,8 +592,7 @@ export default {
type: 'error' type: 'error'
}); });
_this.fullscreenLoading = false; _this.fullscreenLoading = false;
} })
);
} }
} }
, ,
...@@ -633,9 +634,10 @@ export default { ...@@ -633,9 +634,10 @@ export default {
// alert(index); // alert(index);
this.fullscreenLoading = true; this.fullscreenLoading = true;
var that = this; var that = this;
this.eduUtil.ajaxPostUtil('BLesson/defaultUrl', { const params = {
code: that.tableData[index].tcode code: that.tableData[index].tcode
}, function (res) { }
defaultUrl(params).then(res => {
that.fullscreenLoading = false; that.fullscreenLoading = false;
if (res.code) { if (res.code) {
that.$notify({ that.$notify({
...@@ -651,10 +653,9 @@ export default { ...@@ -651,10 +653,9 @@ export default {
type: 'warning' type: 'warning'
}); });
} }
}).catch((err) => {
}, function (err) {
console.log(err) console.log(err)
}); })
}, },
...@@ -677,10 +678,11 @@ export default { ...@@ -677,10 +678,11 @@ export default {
}); });
}else { }else {
_this.fullscreenLoading = true; _this.fullscreenLoading = true;
_this.eduUtil.ajaxPostUtil('BLesson/picImport', { const params = {
importFile: cover, importFile: cover,
code: _this.teacode, code: _this.teacode,
}, res => { }
picImport(params).then(res => {
_this.fullscreenLoading = false; _this.fullscreenLoading = false;
_this.dialogVisible = false; _this.dialogVisible = false;
let type = res.code; let type = res.code;
...@@ -693,8 +695,7 @@ export default { ...@@ -693,8 +695,7 @@ export default {
}); });
_this.loadData(); _this.loadData();
_this.filelist = []; _this.filelist = [];
}).catch((err) => {
}, err => {
_this.fullscreenLoading = false; _this.fullscreenLoading = false;
console.log(err); console.log(err);
}) })
...@@ -729,14 +730,15 @@ export default { ...@@ -729,14 +730,15 @@ export default {
}); });
}else{ }else{
that.fullscreenLoading = true; that.fullscreenLoading = true;
that.eduUtil.ajaxPostUtil('BLesson/add', { const params = {
businessId: that.bussid[index], businessId: that.bussid[index],
code: that.formLabelAlign.id, code: that.formLabelAlign.id,
lessonName: that.formLabelAlign.region, lessonName: that.formLabelAlign.region,
credits: that.formLabelAlign.credit, credits: that.formLabelAlign.credit,
directionId: that.formLabelAlign.couDire, directionId: that.formLabelAlign.couDire,
classHour: that.formLabelAlign.totalStuHours classHour: that.formLabelAlign.totalStuHours
}, (function (response) { }
blessonAdd(params).then(response => {
that.fullscreenLoading = false; that.fullscreenLoading = false;
// alert(JSON.stringify(response)); // alert(JSON.stringify(response));
let type = response.code; let type = response.code;
...@@ -750,11 +752,9 @@ export default { ...@@ -750,11 +752,9 @@ export default {
}); });
that.loadData(); that.loadData();
$('.el-popover').css("display", "none"); $('.el-popover').css("display", "none");
}) }).catch((err) => {
, (function (err) {
console.log(err); console.log(err);
}) })
)
} }
} else { } else {
that.fullscreenLoading = false; that.fullscreenLoading = false;
...@@ -792,12 +792,10 @@ export default { ...@@ -792,12 +792,10 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
that.fullscreenLoading = true; that.fullscreenLoading = true;
that.eduUtil.ajaxPostUtil('BLesson/remove', const params = {
{
id: that.bussid[index] id: that.bussid[index]
} }
, (function (response) { blessonRemove(params).then(response => {
that.fullscreenLoading = false; that.fullscreenLoading = false;
// alert(JSON.stringify(response)); // alert(JSON.stringify(response));
var type = response.code; var type = response.code;
...@@ -809,12 +807,10 @@ export default { ...@@ -809,12 +807,10 @@ export default {
type: type type: type
}); });
that.loadData(); that.loadData();
}) }).catch((err) => {
, (function (err) {
that.fullscreenLoading = false; that.fullscreenLoading = false;
console.log(err); console.log(err);
}) })
);
}).catch((err) => { }).catch((err) => {
that.$notify({ that.$notify({
title: '失败', title: '失败',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment