Browse Source

修改请假逻辑

lex-xin 5 years ago
parent
commit
d91c11b4f1

File diff suppressed because it is too large
+ 0 - 0
dist/css/Business.0f79c9a9.css


File diff suppressed because it is too large
+ 0 - 0
dist/css/Leave.336c79bc.css


File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/js/Business.3372f5e4.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Business.a2ab9f61.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Leave.157a8e09.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/Leave.a33ab35a.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.5a044f84.js


+ 1 - 1
src/views/teacher/Business.vue

@@ -18,7 +18,7 @@
             <h2 class="title">业务申请</h2>
             <div class="module-item">
                 <router-link :to="{ path: '/leave' }"
-                            class="module-link"><i class="icon icon_4"></i>批量调课</router-link>
+                            class="module-link"><i class="icon icon_4"></i>课程请假</router-link>
                 <router-link :to="{ path: '/periodadjust' }" 
                             class="module-link"><i class="icon icon_5"></i>课时调整</router-link>
                 <router-link :to="{ path: '/VIPApply' }" 

+ 38 - 32
src/views/teacher/Leave.vue

@@ -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,

Some files were not shown because too many files changed in this diff