瀏覽代碼

创建分支提交最新代码

TheLittlePrince 6 年之前
父節點
當前提交
a41d70b314

+ 5 - 5
src/ImgConfig/index.js

@@ -2,13 +2,13 @@ let IMG_BASE_URL = ''
 let APPOR_BASE_URL = ''
 if (process.env.NODE_ENV === 'development') {
     IMG_BASE_URL = 'https://xtimg.sharingschool.com/' //测试环境图片地址
-    APPOR_BASE_URL = 'https://xtkmt.sharingschool.com/kmt/index.html' //测试环境作业批改地址
+    APPOR_BASE_URL = 'https://xtkmt.sharingschool.com/kmt/index.html#/' //测试环境作业批改地址
 } else {
-    // IMG_BASE_URL = 'https://img.sharingschool.com'; //正式环境图片地址;
-    IMG_BASE_URL = 'https://xtimg.sharingschool.com' //实习,测试环境图片地址;
+    IMG_BASE_URL = 'https://img.sharingschool.com'; //正式环境图片地址;
+    // IMG_BASE_URL = 'https://xtimg.sharingschool.com' //实习,测试环境图片地址;
 
-    APPOR_BASE_URL = 'https://xtkmt.sharingschool.com/kmt/index.html' //测试环境作业批改地址
-    // APPOR_BASE_URL = 'https://kmt.sharingschool.com/aijia/kmt/index.html'; //正式环境作业批改地址地址;
+    // APPOR_BASE_URL = 'https://xtkmt.sharingschool.com/kmt/index.html#/' //测试环境作业批改地址
+    APPOR_BASE_URL = 'https://kmt.sharingschool.com/aijia/kmt/index.html#/'; //正式环境作业批改地址地址;
     // APPOR_BASE_URL = 'http://sxkmt.sharingschool.com/kmt/index.html' //实习环境作业批改地址
 }
 export {

+ 10 - 1
src/api/scheduling.js

@@ -13,11 +13,20 @@ const DeleteArrangeByTeacher = urlFn('/api/kmt/arrange/deleteArrangeByTeacher')
 const AddArrangeByTeacher = urlFn('/api/kmt/arrange/addArrangeByTeacher')
 // 组内排班老师列表
 const FindTeamTeacherList = urlFn('/api/kmt/arrange/findTeamTeacherList')
+// 组内排班老师列表
+const TeacherThisMonthDutyList = urlFn('/api/kmt/arrange/teacherThisMonthDutyList')
+// 排班设置保存
+const SaveSysTeacherDuty = urlFn('/api/kmt/arrange/saveSysTeacherDuty')
+// 排班设置接口
+const DutyTemplateList = urlFn('/api/kmt/arrange/dutyTemplateList')
 export {
     FindCalendarList,
     FindHaveTeacherList,
     FindNoHaveTeacherList,
     DeleteArrangeByTeacher,
     AddArrangeByTeacher,
-    FindTeamTeacherList
+    FindTeamTeacherList,
+    TeacherThisMonthDutyList,
+    SaveSysTeacherDuty,
+    DutyTemplateList
 }

+ 502 - 173
src/components/TeamWorkLists.vue

@@ -53,89 +53,133 @@
           <h1 class="tiplog">{{this.month}}月排班情况</h1>
           <div class="canlender" id="canlender">
             <div class="tablebox1">
-              <table class="bgtable">
-                <thead>
-                  <tr>
-                    <!--汉字表头-->
-                    <th class="headTip" v-for="(item,index) in daynamearr" :key="index">
-                      <span :class="{'grayRed': item == '周六' || item == '周日'}">{{item}}</span>
-                    </th>
-                  </tr>
-                </thead>
-                <tbody>
-                  <tr v-for="(week,index1) in theweek()" :key="index1">
-                    <!-- {{week}} -->
-                    <td
-                      @click="showdetailModel(item)"
-                      v-for="(item,index2) in week"
-                      :key="index2"
-                      :class="{'gray': item.prevmonth || item.nextmonth}"
-                    >
-                      {{item.day}}
-                      <!-- :class="{'gray': item.prevmonth || item.nextmonth}" -->
-                      <!-- <div class="number"> <span>13</span> <span>21</span> <span>12</span></div> -->
-                      <div class="number">
-                        <div class="numberItem">
-                          <span>14</span>
-                          <span>23</span>
-                          <span>33</span>
-                        </div>
-                        <div class="numberItem">
-                          <span>最少</span>
-                          <span>饱和</span>
-                          <span>已选</span>
+              <div class="date">
+                <div class="calendar-week">
+                  <div class="week-item" v-for="item of weekList" :key="item">{{ item }}</div>
+                </div>
+                <div class="calendar-inner">
+                  <div
+                    class="calendar-item"
+                    v-for="(item, index) of calendarList"
+                    :key="index"
+                    :class="[item.disable ? 'disabled' : '']"
+                  >
+                    <el-popover placement="bottom" width="500" trigger="click">
+                      <div class="month-day">{{month}}月{{today}}日</div>
+                      <el-table
+                        :data="gridData"
+                        :header-cell-style="{
+                             'color': '#393939',
+                                 'font-size': '14px'
+                                            }"
+                      >
+                        <el-table-column
+                          width="150"
+                          label="日期"
+                          header-align="center"
+                          align="center"
+                        >
+                          <template slot-scope="scope">
+                            <span
+                              :class="[scope.$index == 0?'date-time-active':'']"
+                            >{{scope.row.startInterval}}-{{scope.row.endInterval}}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column width="60" label="最少" header-align="center" align="center">
+                          <template slot-scope="scope">
+                            <span
+                              :class="[scope.$index == 0?'date-time-active':'']"
+                            >{{scope.row.miniNum}}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column width="60" label="饱和" header-align="center" align="center">
+                          <template slot-scope="scope">
+                            <span
+                              :class="[scope.$index == 0?'date-time-active':'']"
+                            >{{scope.row.maxNum}}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column width="60" label="已选" header-align="center" align="center">
+                          <template slot-scope="scope">
+                            <span
+                              :class="[scope.$index == 0?'date-time-active':'']"
+                            >{{scope.row.haveNum}}</span>
+                          </template>
+                        </el-table-column>
+                        <el-table-column
+                          width="130"
+                          property
+                          label
+                          header-align="center"
+                          align="center"
+                        >
+                          <template slot-scope="scope">
+                            <div
+                              :class="[scope.$index == 0?'date-btn-active':'Buttonhole']"
+                              @click="isShow(1,scope.row.id)"
+                            >排班</div>
+                          </template>
+                        </el-table-column>
+                      </el-table>
+                      <div
+                        slot="reference"
+                        @click="classSet(index,item.date,item.month,item.dateList.intervalList)"
+                        :class="[item.status ? 'checked' : '']"
+                        class="day-setting"
+                      >
+                        <!-- {{FindCalendarList}} -->
+                        <div class="date-day">{{ item.date }}</div>
+                        <div class="people">
+                          <div class="people-items">
+                            <div class="people-items-num">{{item.dateList.miniNum}}</div>
+                            <div class="people-items-text">最少</div>
+                          </div>
+                          <div class="people-items">
+                            <div class="people-items-num">{{item.dateList.maxNum}}</div>
+                            <div class="people-items-text">饱和</div>
+                          </div>
+                          <div class="people-items">
+                            <div
+                              class="people-items-num"
+                              :class="[item.dateList.haveNum >= item.dateList.miniNum?'num-red':'']"
+                            >{{item.dateList.haveNum}}</div>
+                            <div class="people-items-text">已选</div>
+                          </div>
                         </div>
                       </div>
-                    </td>
-                  </tr>
-                </tbody>
-              </table>
+                    </el-popover>
+                  </div>
+                </div>
+              </div>
             </div>
           </div>
         </el-col>
       </el-row>
     </el-col>
-    <!-- 排班设置弹框 -->
-    <div class="showModel" @click="allShowModel(2)" v-if="isPigai"></div>
-    <div class="model" style="width:30%; top:30%;" v-if="isPigai">
-      <div class="model-text">
-        <div class="model-text-head">
-          <div>{{this.month}}月{{this.NewDay}}日</div>
-          <div>
-            <img src="../assets/img/del@2x.png" alt @click="allShowModel(2)" />
-          </div>
-        </div>
-        <div>
-          <div class="tr-set table-heads1">
-            <div class="tr-secon">最少</div>
-            <div class="tr-secon">饱和</div>
-            <div class="tr-secon">已选</div>
-          </div>
-          <div class="tr-set">
-            <div class="tr-secon width140">10:10-12:00</div>
-            <div class="tr-secon width140">10</div>
-            <div class="tr-secon tr-sw80">13</div>
-            <div class="tr-secon tr-sw80" style="color:#7297FF">554</div>
-            <div class="Buttonhole" @click="isShow()">排班</div>
-          </div>
-        </div>
-      </div>
-    </div>
     <!-- 添加移除老师弹框 -->
     <div class="showModel" @click="allShowModel(3)" v-if="isApporTeacher"></div>
     <div class="model" style="width:30%; top:10%;" v-if="isApporTeacher">
       <div class="model-text">
         <div class="model-text-head">
-          <div>{{this.month}}月{{this.NewDay}}日</div>
           <div class="teach-block">
+            <div class="Daylog">
+              <span>{{month}}月{{today}}日</span>
+              <!-- {{FindHaveTeacherList}} -->
+              <span>{{FindHaveTeacherList.arrangeDetail.startInterval}}-{{FindHaveTeacherList.arrangeDetail.endInterval}}</span>
+            </div>
             <div class="Dayteach-Allot">
               <input
                 type="text"
                 placeholder="请输入老师名字"
-                v-model="inputValue"
+                v-model="HaveTeacherList.teacherName"
                 class="Dayinput-with-Allot"
               />
-              <span class="DaySeachIcon el-icon-search"></span>
+              <span @click="SearchFindHaveTeacher()" style="right:10%;" class="DaySeachIcon el-icon-search"></span>
+            </div>
+            <div style="font-size:12px;text-align:left;font-weight:700;margin-bottom:10px;">
+              <span class="tr-slogn">最少:{{FindHaveTeacherList.arrangeDetail.miniNum}}</span>
+              <span class="tr-slogn">最多:{{FindHaveTeacherList.arrangeDetail.haveNum}}</span>
+              <span class="tr-slogn">饱和:{{FindHaveTeacherList.arrangeDetail.miniNum}}</span>
             </div>
           </div>
           <div>
@@ -154,23 +198,23 @@
             <span class="addLogicon">+</span> 添加老师
           </div>
           <div class="scrollBox">
-            <div class="tr-set">
-              <div>
-                <!-- <img :src="BASE_URL + v.imgUrl" alt class="table-img" @click="isShow(v,3)" /> -->
-                <img src="../assets/img/attt.png" alt class="table-img" />
+            <div class="tr-set" v-for="(item, index) of FindHaveTeacherList.list" :key="index">
+              <div class="tr-secon">
+                <img :src="BASE_URL + item.photo" alt class="table-img" v-if="item.photo" />
+                <img src="../assets/img/attt.png" alt v-if="item.photo ==''" class="table-img" />
               </div>
-              <div class="tr-secon width140">程歌</div>
-              <div class="tr-secon width140">数学</div>
-              <div class="tr-secon width140">100%</div>
-              <div class="tr-secon tr-sw80">13%</div>
-              <div class="tr-secon tr-sw80" style="color:#7297FF">55</div>
-              <div class="Buttonhole" @click="detailTeacherTeam()">移除</div>
+              <div class="tr-secon">{{item.teacherName}}</div>
+              <div class="tr-secon tr-sw100">{{item.subject}}</div>
+              <div class="tr-secon tr-sw100">{{item.attendanceRatio}}%</div>
+              <div class="tr-secon tr-sw100">{{item.dutyRatio}}%</div>
+              <div class="tr-secon tr-sw100" style="color:#7297FF">{{item.haveCount }}</div>
+              <div class="Buttonhole" @click="detailTeacherTeam(item)">移除</div>
             </div>
           </div>
-          <div class="btsnius">
+          <!-- <div class="btsnius">
             <div class="yesBtn">确定</div>
             <div class="closeBtn">取消</div>
-          </div>
+          </div>-->
         </div>
       </div>
     </div>
@@ -190,7 +234,7 @@
           <div>是否确定将{{name}}老师移除?</div>
         </div>
         <div class="model-btn">
-          <div class="model-btn-items main-gay" @click="ApplyOperate()">是</div>
+          <div class="model-btn-items main-gay" @click="DetetaiApplyOperate()">是</div>
           <div class="model-btn-items model-grdeen" @click="allShowModel(1)">否</div>
         </div>
       </div>
@@ -200,24 +244,30 @@
     <div class="model" style="width:30%; top:10%;" v-if="AddTeacherModel">
       <div class="model-text">
         <div class="model-text-head">
-          <div>选择老师</div>
+          <div class="selectTeacher">选择老师</div>
           <div class="teach-block">
-            <div class="Dayteach-Allot">
+            <div class="Dayteach-Allot1">
               <input
                 type="text"
                 placeholder="请输入老师名字"
-                v-model="inputValue"
+                v-model="NoHaveTeacherList.teacherName"
                 class="Dayinput-with-Allot"
               />
-              <span class="DaySeachIcon el-icon-search"></span>
+              <span @click="SearchNoHaveTeacher()" style="right:40%;" class="DaySeachIcon el-icon-search"></span>
             </div>
+            <span
+              style="font-size:12px;text-align:left;font-weight:700"
+              class="tr-slogn"
+            >最少:{{FindNoHaveTeacherList.arrangeDetail.miniNum}}</span>
+            <span class="tr-slogn">饱和:{{FindNoHaveTeacherList.arrangeDetail.maxNum}}</span>
+            <span class="tr-slogn">已选:{{FindNoHaveTeacherList.arrangeDetail.haveNum}}</span>
           </div>
           <div>
             <img src="../assets/img/del@2x.png" alt @click="allShowModel(4)" />
           </div>
         </div>
         <div>
-          <div class="tr-set table-heads2">
+          <div class="tr-set table-heads3">
             <div class="tr-secon1">老师</div>
             <div class="tr-secon1">科目</div>
             <div class="tr-secon1">出勤率</div>
@@ -225,24 +275,26 @@
             <div class="tr-secon1">当月已选时段</div>
           </div>
           <div class="scrollBox">
-            <div class="tr-set">
-              <div>
-                <!-- <img :src="BASE_URL + v.imgUrl" alt class="table-img" @click="isShow(v,3)" /> -->
-                <img src="../assets/img/attt.png" alt class="table-img" />
+            <div class="tr-set" v-for="(item, index) of FindNoHaveTeacherList.list" :key="index">
+              <div class="tr-secon">
+                <img :src="BASE_URL + item.photo" alt class="table-img" v-if="item.photo" />
+                <img src="../assets/img/attt.png" alt v-if="item.photo ==''" class="table-img" />
               </div>
-              <div class="tr-secon width140">程歌</div>
-              <div class="tr-secon width140">数学</div>
-              <div class="tr-secon width140">100%</div>
-              <div class="tr-secon tr-sw80">13%</div>
-              <div class="tr-secon tr-sw80" style="color:#7297FF">55</div>
-              <div class="Selectradius" @click="AddeacherTeam()">
+              <div class="tr-secon tr-sw100">{{item.teacherName}}</div>
+              <div class="tr-secon tr-sw100">{{item.subject}}</div>
+              <div class="tr-secon tr-sw100">{{item.attendanceRatio}}%</div>
+              <div class="tr-secon tr-sw100">{{item.dutyRatio}}%</div>
+              <div class="tr-secon tr-sw100" style="color:#7297FF">{{item.haveCount}}</div>
+              <div class="Selectradius">
                 <img
-                  v-if="this.isSelected ==false"
+                  @click="DetetaiOrAddeacherTeam(item,2)"
+                  v-if="teacherIds.indexOf(item.teacherId) == -1"
                   class="Littleicon"
                   src="../assets/img/normal.png"
                 />
                 <img
-                  v-if="this.isSelected ==true"
+                  @click="DetetaiOrAddeacherTeam(item,1)"
+                  v-if="teacherIds.indexOf(item.teacherId) != -1"
                   class="Littleicon"
                   src="../assets/img/correct -hint.png"
                 />
@@ -250,8 +302,8 @@
             </div>
           </div>
           <div class="btsnius">
-            <div class="yesBtn">确定</div>
-            <div class="closeBtn">取消</div>
+            <div @click="GetAddArrangeByTeacherStatus()" class="yesBtn">确定</div>
+            <div @click="allShowModel(4)"  class="closeBtn">取消</div>
           </div>
         </div>
       </div>
@@ -261,44 +313,61 @@
 <script>
 import { mapGetters, mapActions } from "vuex";
 import { Message } from "element-ui";
+import { IMG_BASE_URL } from "@/ImgConfig";
 export default {
   name: "model",
   components: {},
   props: {},
   data() {
     return {
-      daynamearr: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
+      weekList: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
       //本月的本期构成
+      BASE_URL: IMG_BASE_URL,
       dayarr: [],
       year: new Date().getFullYear(),
       D: new Date().getDate() + " ",
-      month: new Date().getMonth() + 1,
+      // month: new Date().getMonth() + 1,
       NewDay: "",
       gardeListDownage: false,
       gardeListDown: false,
       selecttitlepag: "选年级",
       selecttitleage: "选科目",
+      teacherIds: [],
       inputValue: "",
       isSelected: false,
       isPigai: false,
+      detetaiTeacherid: [],
       isApporTeacher: false, //移除添加老师
       hiddenModel: false, //移除弹框
       AddTeacherModel: false, //添加老师弹框
+      current: {}, // 当前时间
+      calendarList: [], // 排班列表
+      setCalendarList: [], // 排班设置列表
+      shareDate: new Date(), // 享元模式,用来做优化的
+      month: "",
+      today: "",
       filters: {
-        OptionsValue: "",
-        gradesValue: "",
+        OptionsValue: 8,
+        gradesValue: "语文",
         inputValue: ""
       },
+      HaveTeacherList: {
+        Teacherid: "",
+        teacherName: ""
+      },
+      NoHaveTeacherList: {
+        teacherName: ""
+      },
       options: [
         {
           value: "0",
           label: "匹配知识点",
-          str: "匹配知识点"
+          str: "13"
         },
         {
           value: "1",
           label: "批改老师",
-          str: "批改老师"
+          str: "8"
         },
         {
           value: "2",
@@ -332,7 +401,13 @@ export default {
   },
   watch: {},
   computed: {
-    ...mapGetters(["UnallotHomeworkInfo","DeleteArrangeByTeacher"])
+    ...mapGetters([
+      "UnallotHomeworkInfo",
+      "DeleteArrangeByTeacher",
+      "FindCalendarList",
+      "FindHaveTeacherList",
+      "FindNoHaveTeacherList"
+    ])
   },
   methods: {
     //关闭弹框
@@ -364,17 +439,13 @@ export default {
         Message.error("当前月份未开启,禁止操作!");
       }
     },
-    showAddTeacherModel() {
-      this.isApporTeacher = false;
-      this.AddTeacherModel = true;
-      this.AddTeacherInfoList()
-    },
-    isShow() {
-      this.isApporTeacher = true;
-    },
-    detailTeacherTeam() {
-      this.isApporTeacher = false;
-      this.hiddenModel = true;
+    isShow(str, id) {
+      let _this = this;
+      if (str == 1) {
+        _this.isApporTeacher = true;
+        this.HaveTeacherList.Teacherid = id;
+        this.GetFindHaveTeacherListInfo();
+      }
     },
     AddeacherTeam() {
       this.isSelected = true;
@@ -406,80 +477,233 @@ export default {
     choiceclass() {
       this.gardeListDown = true;
     },
-    // 移除老师
-    async ApplyOperate() {
-      this.$store.dispatch("GetDeleteArrangeByTeacher", {
-        id: "",
-        teacherId:""
-      });
-    },
-    AddTeacherInfoList(){
-      this.$store.dispatch("GetDeleteArrangeByTeacher", {
-        id: "",
-        teacherId:""
-      });
+    // 添加老师勾选数组
+    async DetetaiOrAddeacherTeam(item, type) {
+      if (type == 1) {
+        const index = this.teacherIds.indexOf(item.teacherId);
+        if (index > -1) {
+          this.teacherIds.splice(index, 1);
+        }
+        //   item.dateList.isOpen = 1
+        // this.$set(this.setCalendarList.dateList, Setindex, item);
+      }
+      if (type == 2) {
+        const index = this.teacherIds.indexOf(item.teacherId);
+        if (index == -1) {
+          this.teacherIds.push(item.teacherId);
+        }
+        //   item.dateList.isOpen = 0
+        // this.$set(this.setCalendarList.dateList, Setindex, item);
+      }
     },
-    // 获取校区管理员监控数据
+    // 获取校区管理员排班表
     async GetFindCalendarListInfo() {
       this.$store.dispatch("GetFindCalendarList", {
         type: this.filters.OptionsValue,
         subject: this.filters.gradesValue
       });
     },
-    theweek: function() {
-      var _arr = [];
-      for (var i = 0; i < 6; i++) {
-        var _week = [];
-        for (var j = 0; j < 7; j++) {
-          _week.push(this.dayarr[i * 7 + j]);
-        }
-        _arr.push(_week);
-      }
-      return _arr;
+    // 选中时段老师列表
+    async GetFindHaveTeacherListInfo() {
+      this.$store.dispatch("GetFindHaveTeacherList", {
+        id: this.HaveTeacherList.Teacherid,
+        teacherName: this.HaveTeacherList.teacherName
+      });
+    },
+    // 未选时段老师列表(添加老师)
+    async GetFindNoHaveTeacherListInfo() {
+      this.$store.dispatch("GetFindNoHaveTeacherList", {
+        id: this.HaveTeacherList.Teacherid,
+        teacherName: this.NoHaveTeacherList.teacherName
+      });
+    },
+    // 时段添加老师
+    async GetAddArrangeByTeacherStatus() {
+      this.$store.dispatch("GetAddArrangeByTeacher", {
+        id: this.HaveTeacherList.Teacherid,
+        teacherIds: this.teacherIds
+      });
+    },
+    // 时段移除老师
+    detailTeacherTeam(item) {
+      this.isApporTeacher = false;
+      this.hiddenModel = true;
+      this.detetaiTeacherid = item.teacherId;
     },
+    // 移除老师
+    DetetaiApplyOperate() {
+      this.$store.dispatch("GetDeleteArrangeByTeacher", {
+        id: this.HaveTeacherList.Teacherid,
+        teacherId: this.detetaiTeacherid
+      });
+    },
+    showAddTeacherModel() {
+      this.isApporTeacher = false;
+      this.AddTeacherModel = true;
+      this.GetFindNoHaveTeacherListInfo();
+    },
+    // 日期处理
     Datainit() {
-      //需要知道这个月的第一天是星期几
-      var themonth1stday = new Date(this.year, this.month - 1, 1).getDay();
-      console.log(themonth1stday);
-      //              alert(themonth1stday)
-      //本月有多少天,这个月的最后一天就是下个月的最后一天减去一毫秒
-      var y = this.month == 12 ? this.year + 1 : this.year;
-      var m = this.month == 12 ? 1 : this.month;
-      var themonthdaysamount = new Date(new Date(y, m, 1) - 1).getDate();
-      console.log(themonthdaysamount);
-      //上个月有多少天
-      var prevmonthlastday = new Date(
-        new Date(this.year, this.month - 1, 1) - 1
-      ).getDate();
-      console.log(prevmonthlastday);
-      //              alert(prevmonthlastday)
-      while (themonth1stday-- > 1) {
-        this.dayarr.unshift({
-          day: prevmonthlastday--,
-          prevmonth: true
-        });
+      // 初始化当前时间
+      this.setCurrent();
+      this.calendarCreator();
+    },
+    // 判断当前月有多少天
+    getDaysByMonth(year, month) {
+      return new Date(year, month + 1, 0).getDate();
+    },
+    getFirstDayByMonths(year, month) {
+      return new Date(year, month, 1).getDay();
+    },
+    getLastDayByMonth(year, month) {
+      return new Date(year, month + 1, 0).getDay();
+    },
+    // 对小于 10 的数字,前面补 0
+    pad(str) {
+      return str < 10 ? `0${str}` : str;
+    },
+    // 点击上一月
+    prevMonth() {
+      this.current.month--;
+      // 因为 month的变化 会超出 0-11 的范围, 所以需要重新计算
+      this.correctCurrent();
+      // 生成新日期
+      this.calendarCreator();
+    },
+    // 点击下一月
+    nextMonth() {
+      this.current.month++;
+      // 因为 month的变化 会超出 0-11 的范围, 所以需要重新计算
+      this.correctCurrent();
+      // 生成新日期
+      this.calendarCreator();
+    },
+    // 格式化时间,与主逻辑无关
+    stringify(year, month, date) {
+      let str = [year, this.pad(month + 1), this.pad(date)].join("-");
+      return str;
+    },
+    // 排班点击
+    classSet(k, d, m, intervalList) {
+      // console.log(k,d,m)
+      this.month = m + 1;
+      this.today = d;
+      for (var i in this.calendarList) {
+        this.calendarList[i].status = false;
       }
-      //本月的日期
-      var count = 0;
-      while (themonthdaysamount--) {
-        this.dayarr.push({
-          day: ++count
+      this.calendarList[k].status = !this.calendarList[k].status;
+      this.gridData = intervalList;
+    },
+    // 设置或初始化 current
+    setCurrent(d = new Date()) {
+      let year = d.getFullYear();
+      let month = d.getMonth();
+      let date = d.getDate();
+      this.current = {
+        year,
+        month,
+        date
+      };
+    },
+    // 修正 current
+    correctCurrent() {
+      let { year, month, date } = this.current;
+
+      let maxDate = this.getDaysByMonth(year, month);
+      // 预防其他月跳转到2月,2月最多只有29天,没有30-31
+      date = Math.min(maxDate, date);
+
+      let instance = new Date(year, month, date);
+      this.setCurrent(instance);
+    },
+    // 生成日期
+    calendarCreator() {
+      // 一天有多少毫秒
+      const oneDayMS = 24 * 60 * 60 * 1000;
+
+      let list = [];
+      let setList = [];
+      let { year, month } = this.current;
+
+      // 当前月份第一天是星期几, 0-6
+      let firstDay = this.getFirstDayByMonths(year, month);
+      // 填充多少天
+      let prefixDaysLen = firstDay === 0 ? 6 : firstDay - 1;
+      // 毫秒数
+      let begin = new Date(year, month, 1).getTime() - oneDayMS * prefixDaysLen;
+
+      // 当前月份最后一天是星期几, 0-6
+      let lastDay = this.getLastDayByMonth(year, month);
+      // 填充多少天, 和星期的排放顺序有关
+      let suffixDaysLen = lastDay === 0 ? 0 : 7 - lastDay;
+      // 毫秒数
+      let end =
+        new Date(year, month + 1, 0).getTime() + oneDayMS * suffixDaysLen;
+      // 计算今天几号
+      let today = new Date().getDate();
+      // 饱和度
+      // console.log(today)
+      while (begin <= end) {
+        // 享元模式,避免重复 new Date
+        this.shareDate.setTime(begin);
+        let year = this.shareDate.getFullYear();
+        let curMonth = this.shareDate.getMonth();
+        let date = this.shareDate.getDate();
+        // console.log(FindCalendarList)
+        //  ||  date < today
+        // 排班
+        list.push({
+          year: year,
+          month: curMonth,
+          date: date,
+          disable: curMonth !== month,
+          status: false,
+          value: this.stringify(year, curMonth, date)
         });
-      }
-      var c = 42 - this.dayarr.length;
-      var count2 = 1;
-      while (c-- > 0) {
-        this.dayarr.push({
-          day: count2++,
-          nextmonth: true
+        // 排班设置
+        setList.push({
+          year: year,
+          month: curMonth,
+          date: date,
+          status: false,
+          disable: curMonth !== month,
+          value: this.stringify(year, curMonth, date)
         });
+        begin += oneDayMS;
       }
+      var that = this;
+      for (let i = 0; i < list.length; i++) {
+        if (!list[i].disable) {
+          const dateValue = list[i].value + " 00:00:00";
+          for (let t = 0; t < that.FindCalendarList.list.length; t++) {
+            if (dateValue == that.FindCalendarList.list[t].arrangeDate) {
+              list[i].dateList = that.FindCalendarList.list[t];
+            }
+          }
+        } else {
+          list[i].dateList = {};
+        }
+      }
+      //    for (let i = 0; i < setList.length; i++) {
+      //   if (!setList[i].disable) {
+      //     const dateValue = setList[i].value;
+      //     for (let t = 0; t < that.DutyTemplateListInfo.dayList.length; t++) {
+      //       if (dateValue == that.DutyTemplateListInfo.dayList[t].day) {
+      //         setList[i].dateList = that.DutyTemplateListInfo.dayList[t];
+      //       }
+      //     }
+      //   } else {
+      //     setList[i].dateList = {};
+      //   }
+      // }
+      this.calendarList = list;
+      this.setCalendarList = setList;
     }
   },
 
   mounted() {
-    this.Datainit();
     this.GetFindCalendarListInfo();
+    this.Datainit();
   }
 };
 </script>
@@ -504,6 +728,17 @@ th {
   float: left;
   display: inline-block;
 }
+.date-btn-active {
+  background: rgba(114, 151, 255, 0.3);
+  border: none;
+  cursor: pointer;
+  margin-top: 10px;
+  width: 80px;
+  height: 30px;
+  line-height: 30px;
+  border-radius: 15px;
+  color: #fff;
+}
 .Ageclass {
   display: inline-block;
   height: 40px;
@@ -586,6 +821,7 @@ th {
 table {
   border-collapse: collapse;
   width: 100%;
+  border: 1px solid #e5e5e5;
 }
 
 table.bgtable thead tr th {
@@ -606,6 +842,7 @@ table.bgtable tbody tr td {
 }
 table.bgtable tbody tr td.gray {
   color: rgb(175, 166, 166);
+  /* visibility:hidden; */
   background: #ffff;
 }
 .number {
@@ -648,7 +885,16 @@ table.bgtable tbody tr td.gray {
   padding: 20px;
 }
 .grayRed {
-  color: red;
+  color: #ff6465;
+}
+.grayRedBoder {
+  color: #fff;
+  background-color: #ff6465;
+  height: 30px;
+  width: 40px;
+  display: inline-block;
+  border-radius: 15px;
+  line-height: 30px;
 }
 .model-text {
   background: rgba(255, 255, 255, 1);
@@ -743,10 +989,31 @@ table.bgtable tbody tr td.gray {
   display: inline-block;
 }
 .Dayteach-Allot {
-  width: 400px;
+  width: 260px;
   position: relative;
   height: 40px;
   top: 15px;
+   display: inline-block;
+}
+/* .Dayteach-Allot1 {
+  display: inline-block;
+  width: 200px;
+  position: relative;
+  height: 30px;
+  top: 5px;
+} */
+.tr-slogn {
+  display: inline-block;
+  margin: 0 30px;
+  font-size: 12px;
+  text-align: left;
+  font-weight: 700;
+}
+.Daylog {
+  font-size: 16px;
+  color: #7297ff;
+  height: 40px;
+  display: inline-block;
 }
 .DaySeachIcon {
   position: absolute;
@@ -760,7 +1027,7 @@ table.bgtable tbody tr td.gray {
   border: #b6b6b6;
   border-radius: 20px;
   height: 40px;
-  width: 300px;
+  width: 260px;
   font-size: 8px;
   color: #b6b6b6;
   text-align: left;
@@ -882,4 +1149,66 @@ table.bgtable tbody tr td.gray {
   position: relative;
   top: 0;
 }
+.date {
+  margin-top: 68px;
+}
+.calendar-week {
+  border: 1px solid #e5e5e5;
+  text-align: center;
+  border-right: none;
+  display: flex;
+}
+.week-item {
+  display: inline-block;
+  background: #f9f9f9;
+  width: 14.28%;
+  border-right: 1px solid #e5e5e5;
+}
+.calendar-inner {
+  border-left: 1px solid #e5e5e5;
+}
+.calendar-item {
+  float: left;
+  width: 14.28%;
+  height: 130px;
+  line-height: 130px;
+  text-align: center;
+  border-bottom: 1px solid #e5e5e5;
+  border-right: 1px solid #e5e5e5;
+  border-left: 1px solid #e5e5e5;
+}
+.day-setting {
+  height: 130px;
+  line-height: 130px;
+}
+.calendar-item.disabled {
+  color: #ffff;
+}
+.checked {
+  background: #f6f7fb;
+}
+.date-day {
+  font-size: 16px;
+  line-height: 60px;
+  color: #aaa;
+}
+.people {
+  display: flex;
+  justify-content: space-around;
+  font-size: 14px;
+}
+.people-items {
+  display: inline-block;
+  line-height: 70px;
+  margin-top: 10px;
+}
+.people-items-num {
+  line-height: 15px;
+  padding: 3px 8px;
+}
+.people-items-text {
+  line-height: 30px;
+  font-size: 14px;
+  font-weight: normal;
+}
 </style>

+ 332 - 124
src/components/TeamworkScheduling.vue

@@ -20,7 +20,7 @@
         <el-col :span="5">
           <div class="main-header-item" style="color:red;">
             小组实时在岗率:
-            <span>{{errorWarningList.allErrorCount}}次</span>
+            <span>{{FindTeamTeacherList.dutyRatio}}</span>
           </div>
         </el-col>
         <el-col :span="24">
@@ -32,14 +32,14 @@
               <div>出勤率</div>
                  <div>科目</div>
             </div>
-            <div class="tr" v-for="(v, k) of errorWarningList.list" :key="k">
+            <div class="tr" v-for="(v, k) of FindTeamTeacherList.list" :key="k">
               <div class="tr-first" :class="{BgcColor:k%2 !== 1}">
                   <div>
                 <img src="../assets/img/attt.png" alt class="table-img" />
               </div>
-                <div>{{v.studentName}}</div>
-                <div>{{v.subject}}</div>
-                   <div>{{v.subject}}</div>
+                <div>{{v.teacherName}}</div>
+                <div>{{v.haveCount}}</div>
+                   <div>{{v.attendanceRatio}}</div>
                      <div>{{v.subject}}</div>
                 <div class="tr-seconds">
                   <span
@@ -58,7 +58,6 @@
             @current-change="pageChange1"
             :page-sizes="[10]"
             layout="total, prev, pager, next"
-            :total="parseInt(errorWarningList.pages)"
             :hide-on-single-page="true"
           ></el-pagination>
           <div style="clear:both;"></div>
@@ -71,43 +70,49 @@
       <div class="detailinfo">
             <el-col :span="24">
           <h1 class="tiplog">{{this.month}}月排班情况</h1>
+          <div class="RatyMonth">当月出勤率<span style="color:#333333;font-size:16px;margin-left:10px;">{{TeacherThisMonthDutyList.dutyRate}}%</span></div>
            <div class="canlender" id="canlender">
             <div class="tablebox1">
-              <table class="bgtable">
-                <thead>
-                  <tr>
-                    <!--汉字表头-->
-                    <th v-for="(item,index) in daynamearr" :key="index"><span :class="{'grayRed': item == '周六' || item == '周日'}">{{item}}</span></th>
-                  </tr>
-                </thead>
-                <tbody>
-                  <tr v-for="(week,index1) in theweek()" :key="index1">
-                    <td
-                      v-for="(item,index2) in week"
-                      :key="index2"
-                      :class="{'gray': item.prevmonth || item.nextmonth,menu_bgc:true}"
+                 <el-row :gutter="24">
+          <el-col :span="24" :offset="0">
+            <!-- 日期 -->
+            <div class="date">
+              <div class="calendar-week">
+                <div class="week-item" v-for="item of daynamearr" :key="item">
+                    <span :class="{'grayRed': item == '周六' || item == '周日'}">{{item}}</span>
+                </div>
+              </div>
+              <div class="calendar-inner">
+                <div
+                  class="calendar-item"
+                  v-for="(item, index) of calendarList"
+                  :key="index"
+                
+                >
+                    <div
+                      slot="reference"
+                      :class="[item.status ? 'checked' : '']"
+                      class="day-setting"
                     >
-                      {{item.day}}
-                      <!-- :class="{'gray': item.prevmonth || item.nextmonth}" -->
-                      <!-- <div class="number"> <span>13</span> <span>21</span> <span>12</span></div> -->
-                      <div class="number"  :class="{'grayBlue': item.prevmonth || item.nextmonth}">
-                        <div class="numberItem">
-                          <span>10:00-12:00</span>
-                        </div>
-                        <div class="numberItem">
-                          <span>15:00-17:50</span>
-                        </div>
-                         <div class="numberItem">
-                          <span>15:00-17:50</span>
-                        </div>
-                         <div class="numberItem">
-                          <span>15:00-17:50</span>
+                      <!-- {{FindCalendarList}} -->
+                      <div class="date-day">{{ item.date }}</div>
+                      <div class="people" v-if="item.dateList && item.dateList.timeVoList.length">
+                        <div class="people-items">
+                          <div class="people-items-text" v-for="(v, k) of item.dateList.timeVoList"
+                         :key="k">
+                            <span v-if="v.timeState ==1">{{v.startInterval}}-{{v.endInterval}}</span>
+                            <span class="selectIng" v-if="v.timeState ==2">{{v.startInterval}}-{{v.endInterval}}</span>
+                               <span class="LostselectIng" v-if="v.timeState ==4">{{v.startInterval}}-{{v.endInterval}}</span>
+                                  <span class="MuchselectIng" v-if="v.timeState ==3">{{v.startInterval}}-{{v.endInterval}}</span>
+                            </div>
                         </div>
                       </div>
-                    </td>
-                  </tr>
-                </tbody>
-              </table>
+                    </div>
+                </div>
+              </div>
+            </div>
+          </el-col>
+        </el-row>
             </div>
           </div>
         </el-col>
@@ -124,18 +129,24 @@ export default {
   props: {},
   data() {
     return {
-       daynamearr: ["周日", "周一", "二", "三", "四", "五", "六"],
+       daynamearr:["一", "二", "三", "四", "五", "六", "日"],
       //本月的本期构成
       dayarr: [],
       year: new Date().getFullYear(),
       D: new Date().getDate() + " ",
-      month: new Date().getMonth() + 1,
+      // month: new Date().getMonth() + 1,
       NewDay: "",
       BASE_URL: IMG_BASE_URL,
       accessToken: localStorage.getItem("accessToken"),
       NoAllotManagerModel: false, //token
       Activeindex:false,
-      TEACHERTYPE:"",
+      TEACHERTYPE:8,
+      current: {}, // 当前时间
+      calendarList: [], // 排班列表
+      setCalendarList: [], // 排班设置列表
+      shareDate: new Date(), // 享元模式,用来做优化的
+      month: "",
+      today: "",
       filters1: {
         pageNo: 1,
         pageSize: 10
@@ -146,121 +157,207 @@ export default {
   created() {},
   watch: {},
   computed: {
-    ...mapGetters(["errorWarningList", "errorDetailList","FindTeamTeacherList"])
+    ...mapGetters(["TeacherThisMonthDutyList","FindTeamTeacherList"])
   },
   methods: {
     ...mapActions(["setUser"]),
       // 获取校区管理员监控数据
     async InfoWatch() {},
-    theweek: function() {
-      var _arr = [];
-      for (var i = 0; i < 5; i++) {
-        var _week = [];
-        for (var j = 0; j < 7; j++) {
-          _week.push(this.dayarr[i * 7 + j]);
-        }
-        _arr.push(_week);
-      }
-      return _arr;
-    },
         // 数据监控手动批改
     handApor() {
       this.Activeindex = false;
+      this.TEACHERTYPE = 8
+      this.GetFindTeamTeacherListInfo()
     },
     // 数据监控匹配知识点老师
     AutoApor() {
       this.Activeindex = true;
+       this.TEACHERTYPE = 13
+        this.GetFindTeamTeacherListInfo()
     },
-    // 去批改前分配老师
-    async GeterrorWarningLists() {
-      this.$store.dispatch("GeterrorWarning", {
-        pageNo: this.filters1.pageNo,
-        pageSize: this.filters1.pageSize,
-        accessToken: this.accessToken
-      });
-    },
+  
      // 组内排班老师列表
     async GetFindTeamTeacherListInfo() {
       this.$store.dispatch("GetFindTeamTeacherList", {
-      type:this.TEACHERTYPE
+      type:this.TEACHERTYPE,
+       pageSize:this.filters1.pageSize,
+        pageNo:this.filters1.pageNo
       });
     },
     handleSizeChange1(val) {
       this.filters1.pageSize = val;
-      this.GeterrorWarningLists();
+      this.GetFindTeamTeacherListInfo();
     },
     pageChange1(val) {
       this.filters1.pageNo = val;
-      this.GeterrorWarningLists();
+      this.GetFindTeamTeacherListInfo();
     },
     updateIsShowCarouselPictureModal() {
       this.NoAllotManagerModel = false;
     },
-    //报错详情
+    //老师排班详情
     groupDetail(str) {
+       this.init();
       this.pictureIndex = 0;
       this.NoAllotManagerModel = true;
-      this.$store.dispatch("GeterrorDetail", {
-        pictureId: str.pictureId,
-        accessToken: this.accessToken
+      this.$store.dispatch("GetTeacherThisMonthDutyList", {
+        teacherId: str.teacherId,
       });
     },
-    // 下一页
-    ClickNextebtn() {
-      this.pictureIndex++;
-      console.log(this.pictureIndex);
-      // if (this.pictureIndex >= errorDetailList.list.length){
-      //     return
-      // }
+      // 日期处理
+    init() {
+      // 初始化当前时间
+      this.setCurrent();
+      this.calendarCreator();
+    },
+    // 判断当前月有多少天
+    getDaysByMonth(year, month) {
+      return new Date(year, month + 1, 0).getDate();
+    },
+    getFirstDayByMonths(year, month) {
+      return new Date(year, month, 1).getDay();
+    },
+    getLastDayByMonth(year, month) {
+      return new Date(year, month + 1, 0).getDay();
+    },
+    // 对小于 10 的数字,前面补 0
+    pad(str) {
+      return str < 10 ? `0${str}` : str;
     },
-    // 上一页
-    Clickprvebtn() {
-      this.pictureIndex--;
-      console.log(this.pictureIndex);
-      // if (this.pictureIndex <= errorDetailList.list.length){
-      //     return
+    // 点击上一月
+    prevMonth() {
+      this.current.month--;
+      // 因为 month的变化 会超出 0-11 的范围, 所以需要重新计算
+      this.correctCurrent();
+      // 生成新日期
+      this.calendarCreator();
+    },
+    // 点击下一月
+    nextMonth() {
+      this.current.month++;
+      // 因为 month的变化 会超出 0-11 的范围, 所以需要重新计算
+      this.correctCurrent();
+      // 生成新日期
+      this.calendarCreator();
+    },
+    // 格式化时间,与主逻辑无关
+    stringify(year, month, date) {
+      let str = [year, this.pad(month + 1), this.pad(date)].join("-");
+      return str;
+    },
+    // 设置或初始化 current
+    setCurrent(d = new Date()) {
+      let year = d.getFullYear();
+      let month = d.getMonth();
+      let date = d.getDate();
+      this.current = {
+        year,
+        month,
+        date
+      };
+    },
+    // 修正 current
+    correctCurrent() {
+      let { year, month, date } = this.current;
+
+      let maxDate = this.getDaysByMonth(year, month);
+      // 预防其他月跳转到2月,2月最多只有29天,没有30-31
+      date = Math.min(maxDate, date);
+
+      let instance = new Date(year, month, date);
+      this.setCurrent(instance);
+    },
+    // 生成日期
+    calendarCreator() {
+      // 一天有多少毫秒
+      const oneDayMS = 24 * 60 * 60 * 1000;
+
+      let list = [];
+      let setList = [];
+      let { year, month } = this.current;
+
+      // 当前月份第一天是星期几, 0-6
+      let firstDay = this.getFirstDayByMonths(year, month);
+      // 填充多少天
+      let prefixDaysLen = firstDay === 0 ? 6 : firstDay - 1;
+      // 毫秒数
+      let begin = new Date(year, month, 1).getTime() - oneDayMS * prefixDaysLen;
+
+      // 当前月份最后一天是星期几, 0-6
+      let lastDay = this.getLastDayByMonth(year, month);
+      // 填充多少天, 和星期的排放顺序有关
+      let suffixDaysLen = lastDay === 0 ? 0 : 7 - lastDay;
+      // 毫秒数
+      let end =
+        new Date(year, month + 1, 0).getTime() + oneDayMS * suffixDaysLen;
+      // 计算今天几号
+      let today = new Date().getDate();
+      // 饱和度
+      // console.log(today)
+      while (begin <= end) {
+        // 享元模式,避免重复 new Date
+        this.shareDate.setTime(begin);
+        let year = this.shareDate.getFullYear();
+        let curMonth = this.shareDate.getMonth();
+        let date = this.shareDate.getDate();
+        // console.log(FindCalendarList)
+        //  ||  date < today
+        // 排班
+        list.push({
+          year: year,
+          month: curMonth,
+          date: date,
+          disable: curMonth !== month,
+          status: false,
+          value: this.stringify(year, curMonth, date)
+        });
+        // 排班设置
+        setList.push({
+          year: year,
+          month: curMonth,
+          date: date,
+          status: false,
+          disable: curMonth !== month,
+          value: this.stringify(year, curMonth, date)
+        });
+        begin += oneDayMS;
+      }
+      var that = this;
+      for (let i = 0; i < list.length; i++) {
+        if (!list[i].disable) {
+          const dateValue = list[i].date;
+          // debugger
+          for (let t = 0; t < that.TeacherThisMonthDutyList.dayList.length; t++) {
+            if (dateValue == that.TeacherThisMonthDutyList.dayList[t].day) {
+              list[i].dateList = that.TeacherThisMonthDutyList.dayList[t];
+            }
+          }
+        } else {
+          list[i].dateList = {
+            timeVoList:[]
+          };
+        }
+      }
+      //    for (let i = 0; i < setList.length; i++) {
+      //   if (!setList[i].disable) {
+      //     const dateValue = setList[i].value;
+      //     for (let t = 0; t < that.DutyTemplateListInfo.dayList.length; t++) {
+      //       if (dateValue == that.DutyTemplateListInfo.dayList[t].day) {
+      //         setList[i].dateList = that.DutyTemplateListInfo.dayList[t];
+      //       }
+      //     }
+      //   } else {
+      //     setList[i].dateList = {};
+      //   }
       // }
-    }
+      this.calendarList = list;
+         console.log("000000000000000000000000000000000")
+      console.log(this.calendarList)
+        console.log("000000000000000000000000000000000")
+      this.setCalendarList = setList;
+    },
   },
   mounted() {
-    this.GetFindTeamTeacherListInfo()
-    this.GeterrorWarningLists();
-      //需要知道这个月的第一天是星期几
-    var themonth1stday = new Date(this.year, this.month - 1, 1).getDay();
-    console.log(themonth1stday);
-    //              alert(themonth1stday)
-    //本月有多少天,这个月的最后一天就是下个月的最后一天减去一毫秒
-    var y = this.month == 12 ? this.year + 1 : this.year;
-    var m = this.month == 12 ? 1 : this.month;
-    var themonthdaysamount = new Date(new Date(y, m, 1) - 1).getDate();
-    console.log(themonthdaysamount);
-    //上个月有多少天
-    var prevmonthlastday = new Date(
-      new Date(this.year, this.month - 1, 1) - 1
-    ).getDate();
-    console.log(prevmonthlastday);
-    //              alert(prevmonthlastday)
-    while (themonth1stday-- > 0) {
-      this.dayarr.unshift({
-        day: prevmonthlastday--,
-        prevmonth: true
-      });
-    }
-    //本月的日期
-    var count = 0;
-    while (themonthdaysamount--) {
-      this.dayarr.push({
-        day: ++count
-      });
-    }
-    var c = 35 - this.dayarr.length;
-    var count2 = 1;
-    while (c-- > 0) {
-      this.dayarr.push({
-        day: count2++,
-        nextmonth: true
-      });
-    }
   }
 };
 </script>
@@ -786,13 +883,22 @@ el-table {
   color: #fff;
 }
 .tiplog {
-  height: 100px;
+  height: 30px;
   width: 200px;
-  padding: 15px;
-  margin: 30px;
+  margin: 10px;
   font-size: 25px;
   font-weight: 700;
-  margin: 0 auto;
+  text-align:left;
+  /* margin: 0 auto; */
+}
+.RatyMonth{
+   height: 20px;
+  width: 200px;
+  color:#999999;
+  font-size: 16px;
+  text-align:left;
+  font-weight: 700;
+  margin-bottom:100px;
 }
 .canlender {
   width: 1200px;
@@ -852,4 +958,106 @@ table.bgtable tbody tr td.gray {
   /* background-color: #FF6465; */
   border-radius: 10px;
 }
+.date {
+  margin-top: 68px;
+}
+.calendar-week {
+  /* border: 1px solid #e5e5e5; */
+  text-align: center;
+  border-right: none;
+  display: flex;
+}
+.week-item {
+  display: inline-block;
+  background: #ffff;
+  width: 14.28%;
+  /* border-right: 1px solid #e5e5e5; */
+}
+.calendar-inner {
+  border-left: 1px solid #e5e5e5;
+}
+.calendar-item {
+  float: left;
+  width: 14.28%;
+  height: 250px;
+  line-height: 130px;
+  text-align: center;
+  background-color: #F6F7FB;
+   border:10px solid #fff;
+  padding: 4px;
+  font-weight: 700;
+  cursor: pointer;
+  border-radius: 20px;
+}
+.timeGone{
+    background-color: #F9F9F9;
+}
+.day-setting {
+  height: 130px;
+  line-height: 130px;
+}
+.calendar-item.disabled {
+  color: #ffff;
+}
+.checked {
+  background: #f6f7fb;
+}
+.date-day {
+  font-size: 16px;
+  line-height: 60px;
+  color: #aaa;
+}
+.people {
+  display: flex;
+  justify-content: space-around;
+  font-size: 14px;
+}
+.people-items {
+  display: inline-block;
+  line-height: 70px;
+  margin-top: 10px;
+}
+.people-items-num {
+  line-height: 15px;
+  padding: 3px 8px;
+}
+.people-items-text {
+  line-height: 30px;
+  font-size: 14px;
+  color: #7297FF;
+  font-weight: normal;
+}
+.selectIng{
+  display: block;
+ background-color: #7297FF; 
+ color:#fff;
+ height:30px;
+ line-height: 30px;
+ width: 120px;
+  font-size: 12px;
+  border-radius: 10px;
+  margin:10px;
+}
+.MuchselectIng{
+  display: block;
+ background-color: #BBBBBB; 
+ color:#fff;
+ height:30px;
+ line-height: 30px;
+ width: 120px;
+  font-size: 12px;
+  border-radius: 10px;
+  margin:10px;
+}
+.LostselectIng{
+  display: block;
+ background-color: #FF6465; 
+ color:#fff;
+ height:30px;
+ line-height: 30px;
+ width: 120px;
+  font-size: 12px;
+  border-radius: 10px;
+  margin:10px;
+}
 </style>

+ 2 - 2
src/config/index.js

@@ -2,8 +2,8 @@ let BASE_URL = ''
 if (process.env.NODE_ENV === 'development') {
     BASE_URL = 'https://xt.sharingschool.com/sz'
 } else {
-    BASE_URL = 'https://xt.sharingschool.com/sz' //测试环境服务器地址
-    // BASE_URL = 'https://t.sharingschool.com/sz'; //正式环境地址
+    // BASE_URL = 'https://xt.sharingschool.com/sz' //测试环境服务器地址
+    BASE_URL = 'https://t.sharingschool.com/sz'; //正式环境地址
     // BASE_URL = 'https://sx.sharingschool.com/sz'  //实习环境地址
 }
 const TIME_OUT = 10000

+ 2 - 4
src/pages/home/SchoolManager.vue

@@ -279,10 +279,9 @@
                     >
                       <span>{{v.checkCount}}</span>
                       <span style="color:#bbbbbb;">/{{v.picTotal}}</span>
-                      <el-button type="info">
+                      <el-button type="info"  @click="CheackHomeworkStatus(v)">
                         <span
                           href
-                          @click="CheackHomeworkStatus(v)"
                           style="text-decoration:none;color:#ffffff;"
                         >已检查</span>
                         <!-- <a
@@ -307,10 +306,9 @@
                       v-if="v.status === 3 && v.isCheck ===0"
                       style="width: 25%"
                     >
-                      <el-button type="warning">
+                      <el-button type="warning"    @click="CheackHomeworkStatus(v)">
                         <span
                           href
-                          @click="CheackHomeworkStatus(v)"
                           style="text-decoration:none;color:#ffffff;"
                         >去检查</span>
                         <!-- <a

File diff suppressed because it is too large
+ 1294 - 617
src/pages/super/ComposeType.vue


+ 2 - 4
src/pages/super/SchoolManager.vue

@@ -264,10 +264,9 @@
                     >
                       <span>{{v.checkCount}}</span>
                       <span style="color:#bbbbbb;">/{{v.picTotal}}</span>
-                      <el-button type="info">
+                      <el-button type="info"    @click="CheackHomeworkStatus(v)">
                         <span
                           href
-                          @click="CheackHomeworkStatus(v)"
                           style="text-decoration:none;color:#ffffff;"
                         >已检查</span>
                       </el-button>
@@ -279,10 +278,9 @@
                       v-if="v.status === 3 && v.isCheck ===0"
                       style="width: 25%"
                     >
-                      <el-button type="warning">
+                      <el-button type="warning"     @click="CheackHomeworkStatus(v)">
                         <span
                           href
-                          @click="CheackHomeworkStatus(v)"
                           style="text-decoration:none;color:#ffffff;"
                         >去检查</span>
                       </el-button>

+ 10 - 5
src/store/getters.js

@@ -41,10 +41,15 @@ const getters = {
   AllFindSubjectEngCharts :state => state.user.AllFindSubjectEngCharts,
   GetKnowledgeTeacherSalaryList:state => state.user.GetKnowledgeTeacherSalaryList,
   AllTeacherInfoList:state => state.user.AllTeacherInfoList,
-  FindCalendarList:state => state.user.FindCalendarList,
-  FindHaveTeacherList:state => state.user.FindHaveTeacherList,
-  FindNoHaveTeacherList:state => state.user.FindNoHaveTeacherList,
-  FindTeamTeacherList:state => state.user.FindTeamTeacherList,
-  DeleteArrangeByTeacher:state => state.user.DeleteArrangeByTeacher,
+  // 排班系统
+  FindCalendarList:state => state.scheduling.FindCalendarList,
+  FindHaveTeacherList:state => state.scheduling.FindHaveTeacherList,
+  FindNoHaveTeacherList:state => state.scheduling.FindNoHaveTeacherList,
+  FindTeamTeacherList:state => state.scheduling.FindTeamTeacherList,
+  DeleteArrangeByTeacher:state => state.scheduling.DeleteArrangeByTeacher,
+  TeacherThisMonthDutyList:state => state.scheduling.TeacherThisMonthDutyList,
+  AddArrangeByTeacherStatus:state => state.scheduling.AddArrangeByTeacherStatus,
+  SaveSysTeacherDutyStatus:state => state.scheduling.SaveSysTeacherDutyStatus,
+  DutyTemplateListInfo:state => state.scheduling.DutyTemplateListInfo,
 }
 export default getters

+ 93 - 11
src/store/modules/scheduling .js

@@ -1,7 +1,8 @@
 import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
   DeleteArrangeByTeacher,
   AddArrangeByTeacher,
-  FindTeamTeacherList
+  FindTeamTeacherList,
+  TeacherThisMonthDutyList,SaveSysTeacherDuty,DutyTemplateList
 } from '@/api/scheduling'
     import { APPOR_BASE_URL } from '@/ImgConfig'
   import axios from '@/axios'
@@ -13,7 +14,11 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
       FindHaveTeacherList:[],
       FindNoHaveTeacherList:[],
       FindTeamTeacherList:[],
-      DeleteArrangeByTeacher:''
+      TeacherThisMonthDutyList:[],
+      DeleteArrangeByTeacher:'',
+      AddArrangeByTeacherStatus:'',
+      SaveSysTeacherDutyStatus:'',
+      DutyTemplateListInfo:[]
     },
   
     mutations: {
@@ -32,6 +37,19 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
       SET_DELETETEABTEACHER_INFO: (state, DeleteArrangeByTeacher) => {
         state.DeleteArrangeByTeacher = DeleteArrangeByTeacher
       },
+      SET_THISMONTHDUSTYLIST: (state, TeacherThisMonthDutyList) => {
+        state.TeacherThisMonthDutyList = TeacherThisMonthDutyList
+      },
+      SET_ADDABTEACHER_INFO:(state, AddArrangeByTeacherStatus) => {
+        state.AddArrangeByTeacherStatus = AddArrangeByTeacherStatus
+      },
+      SET_SAVE_SYSTEACHER_DUTY:(state, SaveSysTeacherDutyStatus) => {
+        state.SaveSysTeacherDutyStatus = SaveSysTeacherDutyStatus
+      },
+      SET_TEMPIATE_TEACHER_DUTY:(state, DutyTemplateListInfo) => {
+        // debugger
+        state.DutyTemplateListInfo = DutyTemplateListInfo
+      },
     },
   
     actions: {
@@ -39,8 +57,8 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
      GetFindCalendarList({ commit, state }, data) {
       return new Promise((resolve, reject) => {
         axios.post(FindCalendarList, data).then(response => {
-          const data = response || {}
-          if (data.code === "999"){
+          const data = response.data || {}
+          if (response.code === "999"){
             // debugger
             commit('SET_CALENDAR_LIST', data);
           }
@@ -53,8 +71,8 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
       GetFindHaveTeacherList({ commit, state }, data) {
         return new Promise((resolve, reject) => {
           axios.post(FindHaveTeacherList, data).then(response => {
-            const data = response || {}
-            if (data.code === "999"){
+            const data = response.data || {}
+            if (response.code === "999"){
               // debugger
               commit('SET_HAVETEACHER_LIST', data);
             }
@@ -67,8 +85,8 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
       GetFindNoHaveTeacherList({ commit, state }, data) {
           return new Promise((resolve, reject) => {
             axios.post(FindNoHaveTeacherList, data).then(response => {
-              const data = response || {}
-              if (data.code === "999"){
+              const data = response.data || {}
+              if (response.code === "999"){
                 // debugger
                 commit('SET_NOHAVETEACHER_LIST', data);
               }
@@ -81,9 +99,8 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
       GetFindTeamTeacherList({ commit, state }, data) {
         return new Promise((resolve, reject) => {
           axios.post(FindTeamTeacherList, data).then(response => {
-            const data = response || {}
-            if (data.code === "999"){
-              // debugger
+            const data = response.data || {}
+            if (response.code === "999"){
               commit('SET_TEABTEACHER_LIST', data);
             }
           }).catch(error => {
@@ -91,6 +108,19 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
           })
         })
       },
+                // 老师本月排班情况接口(老师)
+      GetTeacherThisMonthDutyList({ commit, state }, data) {
+        return new Promise((resolve, reject) => {
+          axios.post(TeacherThisMonthDutyList, data).then(response => {
+            const data = response.data || {}
+            if (response.code == "999"){
+              commit('SET_THISMONTHDUSTYLIST', data);
+            }
+          }).catch(error => {
+            reject(error)
+          })
+        })
+      },
       // 时段移除老师
       GetDeleteArrangeByTeacher({ commit, state }, data) {
         return new Promise((resolve, reject) => {
@@ -105,6 +135,58 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
           })
         })
       },
+       // 时段添加老师
+       GetAddArrangeByTeacher({ commit, state }, data) {
+        return new Promise((resolve, reject) => {
+          axios.post(AddArrangeByTeacher, data).then(response => {
+            const data = response || {}
+            if (data.code == "999"){
+              Message.success(response.msg)
+              commit('SET_ADDABTEACHER_INFO', new Date());
+            }
+            if (data.code == "000"){
+              Message.error(data.msg)
+            }
+          }).catch(error => {
+            reject(error)
+          })
+        })
+      },
+       // 保存排班设置
+       GetSaveSysTeacherDuty({ commit, state }, data) {
+        return new Promise((resolve, reject) => {
+          axios.post(SaveSysTeacherDuty, data).then(response => {
+            const data = response || {}
+            if (data.code == "999"){
+              // msg
+              Message.success(data.msg)
+              commit('SET_SAVE_SYSTEACHER_DUTY', new Date());
+            }
+            if (data.code == "000"){
+              Message.error(data.msg)
+            }
+           
+          }).catch(error => {
+            reject(error)
+          })
+        })
+      },
+       // 排班设置
+       GetDutyTemplateList({ commit, state }, data) {
+        return new Promise((resolve, reject) => {
+          axios.post(DutyTemplateList, data).then(response => {
+            const data = response.data || {}
+            // debugger
+            if (response.code === "999"){
+              // debugger
+              Message.success(response.msg)
+              commit('SET_TEMPIATE_TEACHER_DUTY',data);
+            }
+          }).catch(error => {
+            reject(error)
+          })
+        })
+      },
     }
   }
   

+ 4 - 2
src/store/modules/user.js

@@ -191,7 +191,8 @@ const user = {
                         if (isBanned == 0) {
                           if (roles == 0) {
                             localStorage.removeItem("accessToken");
-                            window.open(APPOR_BASE_URL + '?unionid=' + unionid);
+                            window.open(APPOR_BASE_URL + '?unionid=' + unionid  +
+                            "&state=" + 0);
                             Message.error('无用户角色,请先注册')
                           }
                           if (roles == 1) {
@@ -253,7 +254,8 @@ const user = {
                           if (roles == 0) {
                             Message.error('无用户角色,请先注册')
                             localStorage.removeItem("accessToken");
-                            window.open(APPOR_BASE_URL + '?unionid=' + unionid);
+                            window.open(APPOR_BASE_URL + '?unionid=' + unionid +
+                            "&state=" + 0);
                           }
                           if (roles == 1) {
                             Message.success('在线批改老师角色登录成功')