|
@@ -18,26 +18,29 @@
|
|
|
</van-cell-group>
|
|
|
|
|
|
<van-panel title="课时安排" v-if="vipList.length > 0">
|
|
|
- <div class="leaveCell" v-for="(item, index) in vipList" :key="index">
|
|
|
- <div class="leaveCell-l">{{ item.name }}</div>
|
|
|
- <div class="leaveCell-r">
|
|
|
- <div class="left-wrap">
|
|
|
- <p class="classTime">上课时间</p>
|
|
|
- <p>{{ item.classDate | getFormatTime(item.startClassTime) }}</p>
|
|
|
- <div class="line"></div>
|
|
|
- <img src="@/assets/images/switch-icon.png"
|
|
|
- alt=""
|
|
|
- class="icon">
|
|
|
- </div>
|
|
|
- <div class="left-wrap" v-if="item.changeTime">
|
|
|
- <p class="classTime">已调整为</p>
|
|
|
- <p>{{ item.changeTime }} <van-icon @click="onUpdate(item)" name="edit" /></p>
|
|
|
- </div>
|
|
|
- <div class="left-wrap" v-else>
|
|
|
- <van-button @click="onAdd(item)" round type="info" size="small">调整</van-button>
|
|
|
+ <template v-for="(item, index) in vipList">
|
|
|
+ <div class="leaveCell" v-if="item.type == 'VIP'" :key="index">
|
|
|
+ <div class="leaveCell-l">{{ item.name }}</div>
|
|
|
+ <div class="leaveCell-r">
|
|
|
+ <div class="left-wrap">
|
|
|
+ <p class="classTime">上课时间</p>
|
|
|
+ <p>{{ item.classDate | getFormatTime(item.startClassTime) }}</p>
|
|
|
+ <div class="line"></div>
|
|
|
+ <img src="@/assets/images/switch-icon.png"
|
|
|
+ alt=""
|
|
|
+ class="icon">
|
|
|
+ </div>
|
|
|
+ <div class="left-wrap" v-if="item.changeTime">
|
|
|
+ <p class="classTime">已调整为</p>
|
|
|
+ <p>{{ item.changeTime }} <van-icon @click="onUpdate(item)" name="edit" /></p>
|
|
|
+ </div>
|
|
|
+ <div class="left-wrap" v-else>
|
|
|
+ <van-button @click="onAdd(item)" round type="info" size="small">调整</van-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
</van-panel>
|
|
|
|
|
|
<div class="button-group">
|
|
@@ -199,28 +202,31 @@ export default {
|
|
|
let coursesScheduleJson = []
|
|
|
let status = false
|
|
|
this.vipList.forEach(item => {
|
|
|
- if(!item.changeAllTime) {
|
|
|
+ if(!item.changeAllTime && item.type == 'VIP') {
|
|
|
this.$toast('操作无效:您还有VIP未调整')
|
|
|
status = true
|
|
|
}
|
|
|
- let tempI = Object.assign({}, item)
|
|
|
-
|
|
|
- let startStr = '2019/12/18 ' + this.getDateInfo(item.startClassTime),
|
|
|
- endStr = '2019/12/18 ' + this.getDateInfo(item.endClassTime)
|
|
|
- let startDate = new Date(startStr),
|
|
|
- endDate = new Date(endStr)
|
|
|
- let m = parseInt(Math.abs(startDate.getTime() - endDate.getTime()) / 1000 / 60)
|
|
|
- tempI.classDate = this.getFormatDate(item.changeAllTime) + ':00'
|
|
|
- tempI.startClassTime = this.getFormatDate(item.changeAllTime) + ':00'
|
|
|
- let currentDate = new Date(item.changeAllTime)
|
|
|
- currentDate.setMinutes(currentDate.getMinutes() + m)
|
|
|
- tempI.endClassTime = this.getFormatDate(currentDate) + ':00'
|
|
|
+ let tempI = {}
|
|
|
+ if(item.type == 'VIP') {
|
|
|
+ tempI = Object.assign({}, item)
|
|
|
+ let startStr = '2019/12/18 ' + this.getDateInfo(item.startClassTime),
|
|
|
+ endStr = '2019/12/18 ' + this.getDateInfo(item.endClassTime)
|
|
|
+ let startDate = new Date(startStr),
|
|
|
+ endDate = new Date(endStr)
|
|
|
+ let m = parseInt(Math.abs(startDate.getTime() - endDate.getTime()) / 1000 / 60)
|
|
|
+ tempI.classDate = this.getFormatDate(item.changeAllTime) + ':00'
|
|
|
+ tempI.startClassTime = this.getFormatDate(item.changeAllTime) + ':00'
|
|
|
+ let currentDate = new Date(item.changeAllTime)
|
|
|
+ currentDate.setMinutes(currentDate.getMinutes() + m)
|
|
|
+ tempI.endClassTime = this.getFormatDate(currentDate) + ':00'
|
|
|
+ }
|
|
|
coursesScheduleJson.push({
|
|
|
- befor: item,
|
|
|
+ before: item,
|
|
|
after: tempI
|
|
|
})
|
|
|
})
|
|
|
if(status) return
|
|
|
+
|
|
|
askForLeave({
|
|
|
coursesScheduleJson: JSON.stringify(coursesScheduleJson),
|
|
|
startTime: searchList.startText,
|