|
|
@@ -6,12 +6,21 @@ |
|
|
|
<text>{{ semester }}</text> |
|
|
|
</view> |
|
|
|
<!--<span class="tSec1Line"></span>--> |
|
|
|
<view class="tSec1Box" id="weekTime"> |
|
|
|
<!-- <view class="tSec1Box" id="weekTime"> |
|
|
|
<text class="text-xxl cuIcon cuIcon-back" @click="timeTap(1)"></text> |
|
|
|
<text>{{todayWeek.Monday}}</text> |
|
|
|
- |
|
|
|
<text>{{todayWeek.Sunday}}</text> |
|
|
|
<text class="text-xxl cuIcon cuIcon-right" @click="timeTap(2)"></text> |
|
|
|
</view> --> |
|
|
|
<view class="timeSelectBox"> |
|
|
|
<!-- 单选和选择 radio select --> |
|
|
|
<l-select |
|
|
|
@input="timeChange" |
|
|
|
:value="timeValue" |
|
|
|
:range="timeOptions" |
|
|
|
title="" |
|
|
|
/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="timeTable_sec2"> |
|
|
@@ -56,6 +65,9 @@ import common from '@/common/js/common.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
timeValue:'', |
|
|
|
timeOptions:[], |
|
|
|
|
|
|
|
semester: '', |
|
|
|
num: 0, |
|
|
|
user: null, |
|
|
@@ -99,10 +111,8 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async init(obj) { |
|
|
|
//console.log(obj) |
|
|
|
let _this = this; |
|
|
|
_this.todayWeek = common.weekday(obj); |
|
|
|
//console.log(_this.todayWeek) |
|
|
|
_this.semester = common.judgeDate(obj); |
|
|
|
_this.weekDayTime = 7 * common.oneDayTime(); |
|
|
|
_this.user = _this.GET_GLOBAL('loginUser'); |
|
|
@@ -126,14 +136,31 @@ export default { |
|
|
|
_this.semester = common.judgeDate(_this.todayWeek.SundayTime); |
|
|
|
_this.loadData(_this.todayWeek.Monday, _this.todayWeek.Sunday); |
|
|
|
}, |
|
|
|
loadData(start, end) { |
|
|
|
let param = { StartDate: start, EndDate: end }; |
|
|
|
// let param = { StartDate: '2018-11-05', EndDate: '2018-11-11' }; |
|
|
|
async loadData(start, end) { |
|
|
|
// let param = { StartDate: start, EndDate: end }; |
|
|
|
let _this = this; |
|
|
|
_this.LOADING('加载数据中…'); |
|
|
|
if(!this.timeValue){ |
|
|
|
// 加载下拉框 |
|
|
|
let timeOptionRes = await this.HTTP_GET('learun/adms/timetable/weeklist', {}, '加载数据时出错') |
|
|
|
if(!timeOptionRes){ |
|
|
|
this.HIDE_LOADING(); |
|
|
|
return |
|
|
|
} |
|
|
|
this.timeOptions = timeOptionRes.map(e=>{return {value:e.startdate+'~'+e.enddate,text:e.textweek}}) |
|
|
|
// 加载当前周次 |
|
|
|
let currentWeekres = await this.HTTP_GET('learun/adms/timetable/currentweek', {}, '加载数据时出错') |
|
|
|
if(!currentWeekres){ |
|
|
|
this.HIDE_LOADING(); |
|
|
|
return |
|
|
|
} |
|
|
|
let currentweek = currentWeekres.currentweek |
|
|
|
let obj = timeOptionRes.find(e=>e.week == currentweek) |
|
|
|
this.timeValue = obj.startdate + '~' + obj.enddate |
|
|
|
} |
|
|
|
let param = { StartDate: this.timeValue.split('~')[0], EndDate: this.timeValue.split('~')[1] }; |
|
|
|
_this.HTTP_GET('learun/adms/timetable/list', param, '加载数据时出错').then(res => { |
|
|
|
this.HIDE_LOADING(); |
|
|
|
// console.log(res); |
|
|
|
_this.ProcessingData(res); |
|
|
|
}); |
|
|
|
|
|
|
@@ -191,14 +218,10 @@ export default { |
|
|
|
}, |
|
|
|
classTap(data) { |
|
|
|
let _this = this; |
|
|
|
// console.log(_this.user) |
|
|
|
if (_this.user.Description == "教师") { |
|
|
|
//console.log("教师"); |
|
|
|
} else if (_this.user.Description == "学生") { |
|
|
|
let LeaveType = data.LeaveType; |
|
|
|
//console.log(LeaveType); |
|
|
|
let IsCheck = data.IsCheck; |
|
|
|
//console.log(IsCheck); |
|
|
|
if (LeaveType == "1") { |
|
|
|
let msg = "请假申请中"; |
|
|
|
if (IsCheck == "1") { |
|
|
@@ -216,6 +239,13 @@ export default { |
|
|
|
}, |
|
|
|
onfun(obj){ |
|
|
|
this.init(obj); |
|
|
|
}, |
|
|
|
getTimeOptions(){ |
|
|
|
return this.HTTP_GET('learun/adms/timetable/weeklist', {}, '加载数据时出错') |
|
|
|
}, |
|
|
|
timeChange(e){ |
|
|
|
this.timeValue = e |
|
|
|
this.loadData() |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@@ -382,4 +412,11 @@ export default { |
|
|
|
text-align: center; |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
|
|
|
|
.timeSelectBox .cu-form-group{ |
|
|
|
background-color: unset; |
|
|
|
border-bottom:none; |
|
|
|
width: calc(100% - 80px); |
|
|
|
margin: 0 auto; |
|
|
|
} |
|
|
|
</style> |