@@ -52,13 +52,13 @@ namespace Learun.Application.WebApi | |||||
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); | var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); | ||||
if (stuInfoBasicEntity == null) | if (stuInfoBasicEntity == null) | ||||
{ | { | ||||
return Fail("当前学员不存在!"); | |||||
return Success(new { msg = "当前学员不存在!" }); | |||||
} | } | ||||
//课程信息 | //课程信息 | ||||
var olpeEntity = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); | var olpeEntity = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); | ||||
if (olpeEntity == null) | if (olpeEntity == null) | ||||
{ | { | ||||
return Fail("当前课程不存在!"); | |||||
return Success(new { msg = "当前课程不存在!" }); | |||||
} | } | ||||
//当前学员本学期是否有报名课程:每学期一门 | //当前学员本学期是否有报名课程:每学期一门 | ||||
@@ -96,11 +96,11 @@ namespace Learun.Application.WebApi | |||||
{ | { | ||||
if (sslleEntity.Status == 1) | if (sslleEntity.Status == 1) | ||||
{ | { | ||||
return Fail("当前课程报名审核中,请耐心等待!"); | |||||
return Success(new { msg = "当前课程报名审核中,请耐心等待!" }); | |||||
} | } | ||||
else if (sslleEntity.Status == 2) | else if (sslleEntity.Status == 2) | ||||
{ | { | ||||
return Fail("当前课程已报名成功!"); | |||||
return Success(new { msg = "当前课程已报名成功!" }); | |||||
} | } | ||||
} | } | ||||
else | else | ||||
@@ -110,7 +110,7 @@ namespace Learun.Application.WebApi | |||||
var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); | var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); | ||||
if (aaa >= olpeEntity.StuNumMax) | if (aaa >= olpeEntity.StuNumMax) | ||||
{ | { | ||||
return Fail("当前课程报名人数已满,请选择其他课程!"); | |||||
return Success(new { msg = "当前课程报名人数已满,请选择其他课程!" }); | |||||
} | } | ||||
//每学期最多两门 | //每学期最多两门 | ||||
var sslleList = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByStuNo(account); | var sslleList = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByStuNo(account); | ||||
@@ -118,15 +118,15 @@ namespace Learun.Application.WebApi | |||||
var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); | var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); | ||||
if (sslleListOfNow1.Count() >= Config.GetValue("OnlineElectiveLessonApplyMax").ToInt()) | if (sslleListOfNow1.Count() >= Config.GetValue("OnlineElectiveLessonApplyMax").ToInt()) | ||||
{ | { | ||||
return Fail("每学期最多选择" + Config.GetValue("OnlineElectiveLessonApplyMax").ToInt() + "门线上选修课!"); | |||||
return Success(new { msg = "每学期最多选择" + Config.GetValue("OnlineElectiveLessonApplyMax").ToInt() + "门线上选修课!" }); | |||||
} | } | ||||
//相同时间不能报名 | //相同时间不能报名 | ||||
if (sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) | |||||
if (!string.IsNullOrEmpty(olpeEntity.LessonSection) && sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) | |||||
{ | { | ||||
//相同时间不能报名 | //相同时间不能报名 | ||||
return Fail("本学期此时间段已有报名的选修课!"); | |||||
return Success(new { msg = "本学期此时间段已有报名的选修课!" }); | |||||
} | } | ||||
} | } | ||||
return Fail("正在提交,请等待!"); | return Fail("正在提交,请等待!"); | ||||
@@ -173,20 +173,11 @@ namespace Learun.Application.WebApi | |||||
public Response GetForm(dynamic _) | public Response GetForm(dynamic _) | ||||
{ | { | ||||
string keyValue = this.GetReqData(); | string keyValue = this.GetReqData(); | ||||
var JournalReceiveData = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); | |||||
if (lessonInfoIbll.GetLessonInfoEntityByLessonNo(JournalReceiveData.LessonNo) != null) | |||||
{ | |||||
if (!string.IsNullOrEmpty(lessonInfoIbll.GetLessonInfoEntityByLessonNo(JournalReceiveData.LessonNo).Introduction)) | |||||
JournalReceiveData.Introduction = WebHelper.NoHtml(WebHelper.HtmlDecode(lessonInfoIbll.GetLessonInfoEntityByLessonNo(JournalReceiveData.LessonNo).Introduction)) ?? ""; | |||||
} | |||||
if (empInfoIbll.GetEmpInfoEntityByEmpNo(JournalReceiveData.EmpNo) != null) | |||||
{ | |||||
if (!string.IsNullOrEmpty(empInfoIbll.GetEmpInfoEntityByEmpNo(JournalReceiveData.EmpNo).resume)) | |||||
JournalReceiveData.resume = WebHelper.NoHtml(WebHelper.HtmlDecode(empInfoIbll.GetEmpInfoEntityByEmpNo(JournalReceiveData.EmpNo).resume)) ?? ""; | |||||
} | |||||
var Data = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); | |||||
var jsonData = new | var jsonData = new | ||||
{ | { | ||||
JournalReceive = JournalReceiveData, | |||||
data = Data, | |||||
}; | }; | ||||
return Success(jsonData); | return Success(jsonData); | ||||
} | } | ||||
@@ -223,7 +214,7 @@ namespace Learun.Application.WebApi | |||||
if (sslleEntity.Status != 2) | if (sslleEntity.Status != 2) | ||||
{ | { | ||||
stuSelectLessonListOfElectiveOnlineIBLL.DeleteEntity(sslleEntity.Id); | stuSelectLessonListOfElectiveOnlineIBLL.DeleteEntity(sslleEntity.Id); | ||||
return Fail("取消成功"); | |||||
return Success("取消成功"); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -12,14 +12,15 @@ export default { | |||||
// "apiHost": [ | // "apiHost": [ | ||||
// "http://123.57.209.16:31174/learun/adms" | // "http://123.57.209.16:31174/learun/adms" | ||||
// ], | // ], | ||||
// "apiHost": [ | |||||
// "http://localhost:8088/" | |||||
// ], | |||||
"apiHost": [ | "apiHost": [ | ||||
"http://10.30.0.10:9002/" | |||||
// "/api/", | |||||
"http://localhost:8088/" | |||||
], | ], | ||||
"webHost":"http://10.30.0.10:8000/", | |||||
// "apiHost": [ | |||||
// "http://10.30.0.10:9002/" | |||||
// // "/api/", | |||||
// ], | |||||
// "webHost":"http://10.30.0.10:8000/", | |||||
"webHost":"http://localhost:8087/", | |||||
// 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 | ||||
"devAccount": [ | "devAccount": [ | ||||
{ username: "system", password: "www.qj.com" } | { username: "system", password: "www.qj.com" } | ||||
@@ -745,6 +745,19 @@ | |||||
"navigationBarTitleText": "查看详情" | "navigationBarTitleText": "查看详情" | ||||
} | } | ||||
}, | }, | ||||
//线上课程选课 | |||||
{ | |||||
"path": "pages/EducationalAdministration/LessonInfoOfElectiveOnline/list", | |||||
"style": { | |||||
"navigationBarTitleText": "线上课程选课" | |||||
} | |||||
}, | |||||
{ | |||||
"path": "pages/EducationalAdministration/LessonInfoOfElectiveOnline/from", | |||||
"style": { | |||||
"navigationBarTitleText": "查看详情" | |||||
} | |||||
}, | |||||
//学费查询 | //学费查询 | ||||
{ | { | ||||
"path": "pages/StuPayFee/list", | "path": "pages/StuPayFee/list", | ||||
@@ -0,0 +1,137 @@ | |||||
<template> | |||||
<view class="page"> | |||||
<l-input title="学年" placeholder="请填写学年" :value="data.AcademicYearNo" disabled right /> | |||||
<l-input title="学期" placeholder="请填写学期" :value="data.Semester" disabled right /> | |||||
<l-input title="课程编号" placeholder="请填写课程编号" :value="data.LessonNo" disabled right /> | |||||
<l-input title="课程名称" placeholder="请填写课程名称" :value="data.LessonName" disabled right /> | |||||
<l-input title="建课教师" placeholder="请填写建课教师" :value="data.EmpName" disabled right /> | |||||
<l-input title="建课学校" placeholder="请填写建课学校" :value="F_SchoolName" disabled right /> | |||||
<l-input title="已报人数" placeholder="请填写已报人数" :value="data.StuNumOfApply" disabled right /> | |||||
<view class="btn" @click="fromBtn" v-show="showFlag">报名</view> | |||||
</view> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
data() { | |||||
return { | |||||
keyValue: '', //列表页面传参 | |||||
data: {}, | |||||
param: {}, //列表页面传参-对象 | |||||
showFlag: true, | |||||
// 数据源 | |||||
dataSource: { | |||||
F_SchoolId: [] | |||||
}, | |||||
F_SchoolName: '', //建课学校名称 | |||||
} | |||||
}, | |||||
methods: { | |||||
init() { | |||||
//this.keyValue = this.GET_PARAM(); //获取页面传递参数 | |||||
// console.log(this.keyValue); | |||||
this.param = this.GET_PARAM(); | |||||
//console.log(this.param); | |||||
this.keyValue = this.param.keyValue; | |||||
//审核中或者报名成功不显示报名按钮 | |||||
if (this.param.Status == 1 || this.param.Status == 2) { | |||||
this.showFlag = false; | |||||
} | |||||
this.LOADING('加载数据中…'); | |||||
this.HTTP_GET('learun/LessonInfoOfElectiveOnline/form', this.keyValue, '加载数据时出错').then(res => { | |||||
this.HIDE_LOADING(); | |||||
this.data = res.data; | |||||
let timer3 = setTimeout(() => { | |||||
let checkedSchool = this.dataSource.F_SchoolId.find((item) => { | |||||
return item.value === this.data.F_SchoolId | |||||
}); | |||||
if (checkedSchool) { | |||||
this.F_SchoolName = checkedSchool.text; | |||||
} | |||||
clearTimeout(timer3); | |||||
}, 500); | |||||
}); | |||||
}, | |||||
fromBtn() { | |||||
var _postData = {} | |||||
// let _this = this; | |||||
let user = this.GET_GLOBAL('loginUser');; | |||||
_postData.keyValue = this.keyValue; | |||||
_postData.StuNo = user.account; | |||||
this.LOADING('正在提交…'); | |||||
this.HTTP_POST('learun/LessonInfoOfElectiveOnline/SignInByMobile', _postData, '加载数据时出错').then((res, info, | |||||
code) => { | |||||
//console.log(res) | |||||
if (res) { // 表单数据保存成功 | |||||
//判断队列结果 | |||||
let timer = setInterval(() => { | |||||
this.HTTP_POST('learun/LessonInfoOfElectiveOnline/GetApplyResult', _postData, | |||||
'报名状态').then( | |||||
(dataresult) => { | |||||
//console.log(dataresult) | |||||
clearInterval(timer); | |||||
if (!dataresult) return | |||||
this.HIDE_LOADING(); | |||||
this.EMIT('LessonInfoOfElectiveOnline') | |||||
this.TOAST(dataresult.msg); | |||||
let timer2 = setTimeout(() => { | |||||
clearTimeout(timer2); | |||||
this.NAV_BACK(); | |||||
}, 2000); | |||||
}); | |||||
}, 5000); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
created() { | |||||
// 拉取加载列表和数据源 | |||||
Promise.all([ | |||||
this.FETCH_DATASOURCE('company').then(result => { | |||||
this.dataSource.F_SchoolId = result.data.map(t => ({ | |||||
text: t.f_fullname, | |||||
value: t.f_companyid | |||||
})) | |||||
}), | |||||
() => {}, | |||||
]); | |||||
this.init() | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less" scoped> | |||||
.txt { | |||||
line-height: 24px; | |||||
font-size: 15px; | |||||
background-color: #fff; | |||||
padding: 10px 0 10px 15px; | |||||
} | |||||
.page { | |||||
background-color: #fff; | |||||
padding-bottom: 1px; | |||||
} | |||||
/deep/ .cu-form-group uni-textarea { | |||||
height: auto; | |||||
} | |||||
.remarks { | |||||
border-bottom: 0.5px solid #eee; | |||||
padding-bottom: 10px; | |||||
} | |||||
.remarks textarea { | |||||
width: 100%; | |||||
padding: 0 15px; | |||||
} | |||||
</style> |
@@ -0,0 +1,304 @@ | |||||
<template> | |||||
<view class="page"> | |||||
<view class="mainpage" :class="sideOpen ? 'show' : ''" style="padding-top: 40px;"> | |||||
<!-- 顶部条目/分页信息栏 --> | |||||
<l-customlist-banner @buttonClick="sideOpen = true">{{ | |||||
tips | |||||
}}</l-customlist-banner> | |||||
<!-- <view class="records">共 {{ records }} 条数据</view> --> | |||||
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="data"> | |||||
<l-customlist :tips="loadState" showTips> | |||||
<view class="pageBox customlist-item" showDelete="true" v-for="(item, ind) in data" :key="item.Id" | |||||
@click="tapClick(item)"> | |||||
<view class=""> | |||||
<text>学年:</text> | |||||
{{ item.AcademicYearNo }} | |||||
</view> | |||||
<view class=""> | |||||
<text>学期:</text> | |||||
{{ item.Semester }} | |||||
</view> | |||||
<view class=""> | |||||
<text>课程编号:</text> | |||||
{{ item.LessonNo }} | |||||
</view> | |||||
<view class=""> | |||||
<text>课程名称:</text> | |||||
{{ item.LessonName }} | |||||
</view> | |||||
<view class=""> | |||||
<text>建课教师:</text> | |||||
{{ item.EmpName }} | |||||
</view> | |||||
<view class=""> | |||||
<text>建课学校:</text> | |||||
{{ dataSource.F_SchoolId.find(x=>x.value==item.F_SchoolId).text }} | |||||
</view> | |||||
<view class=""> | |||||
<text>已报人数:</text> | |||||
{{ item.StuNumOfApply }} | |||||
</view> | |||||
<view class="pageType"> | |||||
<text>报名状态:</text> | |||||
{{ typePd(item.Status) }} | |||||
</view> | |||||
<view class="delbtn" v-if="item.Status == 1" @click.stop="delTap(item)">取消报名</view> | |||||
</view> | |||||
</l-customlist> | |||||
</l-scroll-list> | |||||
</view> | |||||
<!-- 关闭侧边抽屉按钮 --> | |||||
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose"> | |||||
<l-icon type="pullright" color="blue" /> | |||||
</view> | |||||
<!-- 侧边栏,用于设置查询条件 --> | |||||
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y> | |||||
<view v-if="ready" class="padding"> | |||||
<l-input v-model="queryData.LessonNo" @change="searchChange" title="课程编号" placeholder="按课程编号查询" /> | |||||
<l-input v-model="queryData.LessonName" @change="searchChange" title="课程名称" placeholder="按课程名称查询" /> | |||||
<!-- 重置查询条件按钮 --> | |||||
<view class="padding-tb"> | |||||
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> | |||||
</view> | |||||
</view> | |||||
</scroll-view> | |||||
</view> | |||||
</template> | |||||
<script> | |||||
import pickBy from "lodash/pickBy"; | |||||
import mapValues from "lodash/mapValues"; | |||||
export default { | |||||
data() { | |||||
return { | |||||
weekChina: ['一', '二', '三', '四', '五', '六', '日'], | |||||
user: null, | |||||
data: [], | |||||
total: 1, | |||||
records: 0, | |||||
ready: false, | |||||
page: 1, | |||||
rows: 10, | |||||
multipleData: null, | |||||
sideOpen: false, | |||||
tips: "加载中...", | |||||
loadState: '向下翻以加载更多', | |||||
// 数据源 | |||||
dataSource: { | |||||
F_SchoolId: [] | |||||
}, | |||||
// 查询条件 | |||||
searchData: {}, | |||||
defaultQueryData: {}, | |||||
queryData: { | |||||
LessonNo: "", | |||||
LessonName: "", | |||||
}, | |||||
}; | |||||
}, | |||||
onUnload() { | |||||
this.OFF('LessonInfoOfElectiveOnline'); | |||||
}, | |||||
onShow() { | |||||
if (this.data.length) { | |||||
this.pullDown() | |||||
} | |||||
}, | |||||
methods: { | |||||
init() { | |||||
this.ON('LessonInfoOfElectiveOnline', this.refreshList); | |||||
// 拉取加载列表和数据源 | |||||
Promise.all([ | |||||
this.FETCH_DATASOURCE('company').then(result => { | |||||
this.dataSource.F_SchoolId = result.data.map(t => ({ | |||||
text: t.f_fullname, | |||||
value: t.f_companyid | |||||
})) | |||||
}), | |||||
() => {}, | |||||
]); | |||||
// var _this = this; | |||||
this.user = this.GET_GLOBAL('loginUser'); | |||||
this.fetchList(); | |||||
// 初始化查询条件 | |||||
this.defaultQueryData = this.COPY(this.queryData); | |||||
this.ready = true; | |||||
}, | |||||
// 拉取列表 | |||||
async fetchList() { | |||||
if (this.page > this.total) { | |||||
return; | |||||
} | |||||
// let _this = this; | |||||
this.searchData.StuNo = this.user.account; | |||||
this.searchData.StuMajorNo = this.user.majorno; | |||||
this.searchData.StuGrade = this.user.grade; | |||||
let _postParam = { | |||||
pagination: { | |||||
rows: this.rows, | |||||
page: this.page, | |||||
sidx: 'AcademicYearNo DESC, Semester DESC, LessonNo ASC,EmpNo ASC', | |||||
sord: 'asc' | |||||
}, | |||||
//queryJson: '{}' | |||||
queryJson: JSON.stringify(this.searchData), | |||||
}; | |||||
this.LOADING('加载数据中…') | |||||
this.HTTP_GET('learun/LessonInfoOfElectiveOnline/pagelist', _postParam, '加载数据时出错').then(res => { | |||||
this.HIDE_LOADING(); | |||||
this.data = this.data.concat(res.rows); | |||||
this.total = res.total; | |||||
this.records = res.records; | |||||
this.page = res.page + 1; | |||||
this.loadState = res.page >= res.total ? '已加载所有项目' : '向下翻以加载更多'; | |||||
this.tips = `已加载 ${Math.min(res.page, res.total)} / ${ | |||||
res.total | |||||
} 页,共 ${res.records} 项`; | |||||
// console.log(_this.data); | |||||
}); | |||||
}, | |||||
// 列表下拉 | |||||
pullDown() { | |||||
this.refreshList().then(() => { | |||||
this.$refs.data.stopPullDown(); | |||||
}); | |||||
}, | |||||
async refreshList() { | |||||
this.page = 1; | |||||
this.total = 1; | |||||
this.data = []; | |||||
this.fetchList(); | |||||
}, | |||||
tapClick(data) { | |||||
this.NAV_TO('./from', { | |||||
keyValue: data.Id, | |||||
Status: data.Status | |||||
}, true); | |||||
}, | |||||
delTap(item) { | |||||
// console.log(item) | |||||
// let this = this; | |||||
this.CONFIRM('数字化校园提示', '确定要取消报名吗?', true).then(res => { | |||||
if (res) { | |||||
let _postData = { | |||||
keyValue: item.Id, | |||||
StuNo: this.user.account | |||||
} | |||||
this.LOADING('正在取消报名…') | |||||
this.HTTP_POST( | |||||
'learun/LessonInfoOfElectiveOnline/Cancel', | |||||
_postData, | |||||
'加载数据时出错' | |||||
).then(data => { | |||||
this.HIDE_LOADING() | |||||
// console.log(data) | |||||
if (data) { // 成功 | |||||
this.TOAST('取消报名成功!'); | |||||
this.refreshList() | |||||
} | |||||
}) | |||||
} | |||||
}) | |||||
}, | |||||
// 设置搜索条件 | |||||
async searchChange() { | |||||
const result = {}; | |||||
// 将其他查询项添加到查询 JSON 中 | |||||
const queryObj = pickBy(this.queryData, (t) => | |||||
Array.isArray(t) ? t.length > 0 : t | |||||
); | |||||
Object.assign( | |||||
result, | |||||
mapValues(queryObj, (t) => (Array.isArray(t) ? t.join(",") : t)) | |||||
); | |||||
this.searchData = result; | |||||
this.refreshList(); | |||||
}, | |||||
// 点击「清空查询条件」按钮 | |||||
reset() { | |||||
this.queryData = this.COPY(this.defaultQueryData); | |||||
this.searchChange(); | |||||
}, | |||||
}, | |||||
computed: { | |||||
typePd() { | |||||
return num => { | |||||
let txt = ''; | |||||
if (num == 1) { | |||||
txt = '审核中'; | |||||
} else if (num == 2) { | |||||
txt = '报名成功'; | |||||
} else if (num == 3) { | |||||
txt = '报名失败'; | |||||
} else { | |||||
txt = '未报名'; | |||||
} | |||||
return txt; | |||||
}; | |||||
} | |||||
}, | |||||
created() { | |||||
this.init(); | |||||
} | |||||
}; | |||||
</script> | |||||
<style lang="less" scoped> | |||||
@import '~@/common/css/sidepage.less'; | |||||
@import '~@/common/css/customlist.less'; | |||||
.page { | |||||
background-color: #fff; | |||||
} | |||||
.page-content { | |||||
margin-top: 39px; | |||||
} | |||||
.records { | |||||
color: #8f8f94; | |||||
background: #ffffff; | |||||
padding: 10px 12px; | |||||
width: 100%; | |||||
vertical-align: middle; | |||||
border-bottom: 0.5px solid #ddd; | |||||
position: fixed; | |||||
top: var(--window-top); | |||||
z-index: 1024; | |||||
border-bottom: 0.5px solid #ddd; | |||||
height: 40px; | |||||
width: 100%; | |||||
box-shadow: 0 0.5px 3px rgba(0, 0, 0, 0.1); | |||||
// background: #f1f1f1; | |||||
} | |||||
.pageBox { | |||||
// margin-top: 34px; | |||||
padding: 5px 15px; | |||||
line-height: 24px; | |||||
border-bottom: 5px solid #f5f5f5; | |||||
} | |||||
.delbtn { | |||||
position: absolute; | |||||
right: 15px; | |||||
bottom: 7px; | |||||
padding: 3px 10px; | |||||
background: #dd524d; | |||||
color: #fff; | |||||
border-radius: 3px; | |||||
} | |||||
</style> |