Просмотр исходного кода

Signed-off-by: Changpeng Duan <838560574@qq.com>

Changpeng Duan 5 лет назад
Родитель
Сommit
0ec0d443ed

+ 5 - 0
pc/src/api/getApiRes.js

@@ -194,6 +194,11 @@ export function ClassOngoingList(postdata) {
     let url = headapi + 'v1/SchoolTimeTable/ClassOngoingList';
     return getApiBasic(url, postdata);
 }
+// 课程表预览
+export function SchoolTimetablePreview(postdata) {
+    let url = headapi + 'v1/SchoolTimeTable/SchoolTimetablePreview';
+    return getApiBasic(url, postdata);
+}
 // 课程详情判断是否可删除
 export function STTDetailAllowDelCheck(postdata) {
     let url = headapi + 'v1/SchoolTimeTable/STTDetailAllowDelCheck';

+ 4 - 2
pc/src/components/Headside.vue

@@ -16,7 +16,7 @@
             </div>
             <ul class="user-info-menu right-links list-inline list-unstyled">
                 <li class="dropdown user-profile">
-                        <img class="lteHead" src="../assets/img/header/lteHead.png" height="26" width="26"/>
+<!--                        <img class="lteHead" src="../assets/img/header/lteHead.png" height="26" width="26"/>-->
                         <span class="el-dropdown-link customer_serve">
                             {{user.name}}
                           </span>
@@ -89,8 +89,9 @@
                             that.$message.error(json.Memo);
                             that.$router.push({path: '/login', query: {status: 1}});
                             return false
+                        }else{
+                            that.$message.error(json.Memo);
                         }
-                        that.$message.error(json.Memo);
                     }
                 })
             },
@@ -135,6 +136,7 @@
                     SignOut(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
+                            localStorage.clear();
                             that.$router.push({path: '/login', query: {status: 1}});
                             that.$message({
                                 showClose: true,

+ 3 - 2
pc/src/components/Navside.vue

@@ -91,12 +91,13 @@
                         localStorage.shopId = json.Rs.ShopId;
                         this.panelSelect(json.Rs.ShopId);
                     } else {
-                        if (json.Code == 1010) {
+                        if(json.Code == 1010){
                             that.$message.error(json.Memo);
                             that.$router.push({path: '/login', query: {status: 1}});
                             return false
+                        }else{
+                            that.$message.error(json.Memo);
                         }
-                        that.$message.error(json.Memo);
                     }
                 })
             },

+ 6 - 1
pc/src/components/preview.vue

@@ -20,12 +20,17 @@
             <div class="tableContext">
                 <div class="times">
                     <span v-for="time in previewDate.SttPlanPreviewTimeList">{{time.BeginStr}}-{{time.EndStr}}</span>
+                    <span v-for="time in previewDate.SttPreviewTimeList">{{time.BeginStr}}-{{time.EndStr}}</span>
                 </div>
                 <!--                1-->
                 <div class="rows" v-for="i in 7">
                     <em :style="{background:tab.ClassColor}" v-for="tab in previewDate.SttPlanPreviewClassList"
                         v-if="tab.WeekDay == i">
-                        {{tab.ClassName}}{{tab.ClassIndex}}
+                        {{tab.ClassName}}
+                    </em>
+                    <em :style="{background:tab.ClassColor}" v-for="tab in previewDate.SttPreviewClassList"
+                        v-if="tab.WeekDay == i">
+                        {{tab.ClassName}}
                     </em>
                 </div><!--                2-->
             </div>

+ 8 - 6
pc/src/views/LessonTable.vue

@@ -51,7 +51,7 @@
                 >
                     <template slot-scope="scope">
                         <el-switch
-                                v-model="scope.row.ShopId"
+                                v-model="scope.row.allUse"
                                 :active-value="1"
                                 :inactive-value="0"
                                 active-color="#409EFF"
@@ -143,7 +143,7 @@
             </div>
         </el-dialog>
         <el-dialog title="预览本周" :visible.sync="previewShow" width="1200px">
-            <preview  :preview-date="previewDate" :big-title="BigTitle" :small-title="smallTitle" ></preview>
+            <preview :preview-date="previewDate" :big-title="BigTitle" :small-title="smallTitle"></preview>
             <div class="dialogFooter">
                 <el-button @click="previewShow = false" size="small">关闭</el-button>
             </div>
@@ -221,7 +221,7 @@
                         that.smallTitle = ' ';
                         that.previewDate = json.Rs;
                         // 前台排序
-                        that.previewDate.SttPlanPreviewClassList.sort((a,b)=>a.ClassIndex-b.ClassIndex);//升序
+                        that.previewDate.SttPlanPreviewClassList.sort((a, b) => a.ClassIndex - b.ClassIndex);//升序
                         that.previewShow = true;
                     } else {
                         that.$message.error(json.Memo);
@@ -230,13 +230,12 @@
             },
             // 通用修改
             changeShopId(e, row) {
-                console.log(e);
                 let that = this;
-                let shopId = e == 1 ? localStorage.shopId : 0;
+                let shopId = !e ? 0 : 1;
                 let param = {
                     token: localStorage.token,
                     planId: row.PlanId,//
-                    shopId: shopId,//0:跨店课程,通用 >0: 本店特有课程,不通用
+                    shopId: shopId,//跨店课程,通用 >0: 本店特有课程,不通用
                 };
                 let postdata = qs.stringify(param);
                 SttPlanBasicShopEdit(postdata).then(res => {
@@ -478,6 +477,9 @@
                     if (json.Code == 0) {
                         that.loading = false;
                         if (json.Rs) {
+                            json.Rs.map(function (item) {
+                                item.allUse =  item.ShopId > 0 ? 1 :0
+                            })
                             that.allTableData = json.Rs;
                             that.recordsTotal = json.Rs.length;
                         } else {

+ 2 - 1
pc/src/views/Main.vue

@@ -233,8 +233,9 @@
                             that.$message.error(json.Memo);
                             that.$router.push({path: '/login', query: {status: 1}});
                             return false
+                        }else{
+                            that.$message.error(json.Memo);
                         }
-                        that.$message.error(json.Memo);
                     }
                 })
             },

+ 5 - 4
pc/src/views/lessonManage.vue

@@ -199,6 +199,7 @@
         STTBasicEdit,
         testSelect,
         SttPlanPreview,
+        SchoolTimetablePreview,
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -253,20 +254,20 @@
             // 预览本周
             seeWeek(row) {
                 let that = this;
+                console.log(row);
                 let param = {
                     token: localStorage.token,
-                    // planId: row.PlanId,
-                    planId: 26,
+                    stbId : row.StbId,
                 };
                 let postdata = qs.stringify(param);
-                SttPlanPreview(postdata).then(res => {
+                SchoolTimetablePreview(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.BigTitle = row.Name;
                         that.smallTitle = row.BeginDate + '-----' + row.EndDate;
                         that.previewDate = json.Rs;
                         // 前台排序
-                        that.previewDate.SttPlanPreviewClassList.sort((a,b)=>a.ClassIndex-b.ClassIndex);//升序
+                        that.previewDate.SttPreviewClassList.sort((a,b)=>a.ClassIndex-b.ClassIndex);//升序
                         that.previewShow = true;
                     } else {
                         that.$message.error(json.Memo);