Browse Source

创建分支提交最新代码

TheLittlePrince 6 years ago
parent
commit
547b056ecc

+ 5 - 5
src/ImgConfig/index.js

@@ -4,12 +4,12 @@ if (process.env.NODE_ENV === 'development') {
     IMG_BASE_URL = 'https://xtimg.sharingschool.com/' //测试环境图片地址
     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 = 'http://sxkmt.sharingschool.com/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 {
     IMG_BASE_URL,

+ 861 - 0
src/components/SuperworkListSeting.vue

@@ -0,0 +1,861 @@
+<!-- 活动解析 -->
+<template>
+  <div>
+    <!-- table 表格 -->
+    <el-row :gutter="20" class="main-items">
+      <!--排班设置-->
+      <el-col :span="17" class="main" v-if="modelindex == 1">
+        <el-row :gutter="20">
+          <el-col :span="18" class="month" :offset="2">
+            <span>{{currentDateStr }}排班设置</span>
+             <div class="model-btn-items model-grdeen" style="float:right" @click="saveOpenCloseDAys()">保存</div>
+          </el-col>
+        </el-row>
+        <el-row :gutter="24">
+          <el-col :span="20" :offset="2">
+            <!-- 日期 -->
+            <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 setCalendarList"
+                  :key="index"
+                  :class="[item.disable ? 'disabled' : '']"
+                >
+                  <el-popover placement="bottom" width="108" trigger="click">
+                    <div class="date-set">
+                      <div @click="UnOrWaitOpen(item,1,index)">待开放</div>
+                      <div @click="UnOrWaitOpen(item,2,index)">不开放</div>
+                    </div>
+                    <div
+                      slot="reference"
+                      v-if="!item.disable"
+                      @click="settingClick(index)"
+                      :class="[item.status ? 'checked' : '']"
+                      class="day-setting"
+                    >
+                      <div class="date-day-set-num">{{ item.date }}</div>
+                      <div class="date-day-set" v-if="item.dateList.isOpen == 1">待开放</div>
+                      <div
+                        class="date-day-set"
+                        style="color:#FF6465"
+                        v-if="item.dateList.isOpen == 0"
+                      >不开放</div>
+                    </div>
+                  </el-popover>
+                </div>
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+<script>
+import { mapGetters, mapActions } from "vuex";
+import { IMG_BASE_URL } from "@/ImgConfig";
+import { Message } from 'element-ui'
+export default {
+  components: {},
+  name: "actvResolveLabel",
+  props: {},
+  data() {
+    return {
+      BASE_URL: IMG_BASE_URL,
+      current: {}, // 当前时间
+      setCalendarList: [], // 排班设置列表
+      shareDate: new Date(), // 享元模式,用来做优化的
+      month: "",
+      today: "",
+      SettingDays: [],
+    };
+  },
+  watch: {
+       SaveSysTeacherDutyStatus(val, oldVal) {
+      //保存排班设置成功的watch监听回调
+      this.GetDutyTemplateListInfo()
+    },
+  },
+  // ,'homeworkRecoveryList'
+  computed: {
+    ...mapGetters([
+      "SaveSysTeacherDutyStatus",
+      "DutyTemplateListInfo",
+      "DutyTemplateListSTUS"
+    ]),
+    // 显示当前时间
+    currentDateStr() {
+      let { year, month } = this.current;
+      return `${this.pad(month + 1)}月`;
+    }
+  },
+  methods: {
+    ...mapActions(["setUser"]),
+    // 表格头部样式
+    tableheaderClassName({ row, rowIndex }) {
+      return "table-head-th";
+    },
+    // 保存排班设置
+    async saveOpenCloseDAys() {
+      this.$store.dispatch("GetSaveSysTeacherDuty", {
+        days: this.SettingDays
+      });
+    },
+    async UnOrWaitOpen(item, type,Setindex) {
+      if (type == 1) {
+        const index = this.SettingDays.indexOf(item.value);
+        if (index > -1) {
+          this.SettingDays.splice(index, 1);
+        }
+        item.dateList.isOpen = 1 
+      this.$set(this.setCalendarList.dateList, Setindex, item);
+      }
+      if (type == 2) {
+        const index = this.SettingDays.indexOf(item.value);
+        if (index == -1) {
+          this.SettingDays.push(item.value);
+        }
+        item.dateList.isOpen = 0 
+      this.$set(this.setCalendarList.dateList, Setindex, item);
+      }
+    },
+      // 排班设置返回接口
+    async GetDutyTemplateListInfo() {
+      this.$store.dispatch("GetDutyTemplateList", {
+      });
+    },
+    
+    // 日期处理
+    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;
+    },
+    // 点击上一月
+    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 < 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;
+    },
+    // 排班点击
+    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;
+      }
+      this.calendarList[k].status = !this.calendarList[k].status;
+      this.gridData = intervalList;
+    },
+    // 排班设置点击
+    settingClick(k) {
+      for (var i in this.setCalendarList) {
+        this.setCalendarList[i].status = false;
+      }
+      this.setCalendarList[k].status = !this.setCalendarList[k].status;
+    }
+  },
+  mounted() {  
+    this.init();
+    this.GetDutyTemplateListInfo();
+    // console.log(DutyTemplateListInfo)
+  }
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.main {
+  background-color: #fff;
+  margin-top: 16px;
+  padding: 0 !important;
+  border: 1px solid #e1e1e1;
+  min-height: 980px;
+}
+
+el-table {
+  color: #999999;
+  font-size: 18px;
+}
+.main-items {
+  color: #393939;
+  text-align: center;
+  line-height: 80px;
+}
+.aside {
+  background-color: #fff;
+  margin-top: 16px;
+  margin-right: 16px;
+  padding: 0;
+  min-height: 880px;
+}
+.selectBox {
+  position: relative;
+  float: left;
+  display: inline-block;
+  margin-top: 57px;
+}
+.Ageclass {
+  display: inline-block;
+  height: 40px;
+  width: 160px;
+  background-color: #f1f2f4;
+  line-height: 40px;
+  font-size: 16px;
+  cursor: pointer;
+}
+.active {
+  background-color: #52cc60 !important;
+  color: #fff !important;
+}
+.table-aside {
+  color: #666666;
+  font-size: 18px;
+  text-align: center;
+  line-height: 60px;
+  cursor: pointer;
+}
+el-table {
+  color: #999999;
+  font-size: 18px;
+}
+
+.input-with-select .el-input-group__prepend {
+  background-color: #fff;
+}
+
+.showModel {
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background: #000000;
+  opacity: 0.2;
+  overflow: hidden;
+  z-index: 1000;
+  color: #fff;
+}
+.model {
+  z-index: 10000;
+  width: 60%;
+  height: auto;
+  position: fixed;
+  top: 15%;
+  left: 30%;
+  margin: auto;
+  padding: 15px;
+  background: #fff;
+  border-radius: 10px;
+  text-align: center;
+}
+
+.model-text {
+  background: rgba(255, 255, 255, 1);
+  border-radius: 10px;
+}
+
+.model-items-left {
+  width: 100%;
+  color: #393939;
+  font-size: 24px;
+}
+.model-items-left-top {
+  display: flex;
+  justify-content: space-between;
+}
+
+.model-items-left-top-img {
+  width: 68px;
+  height: 68px;
+  border-radius: 8px;
+  position: relative;
+  bottom: 25px;
+}
+.model-items-left-top-number {
+  color: #7e7e7e;
+  font-size: 18px;
+  margin-left: 10px;
+}
+
+.el-table .table-head-th {
+  background-color: #f6f7fb;
+  font-size: 16px !important;
+  color: #393939;
+}
+.month {
+  color: #393939;
+  font-size: 30px;
+  margin-top: 57px;
+}
+.model-manager {
+  display: flex;
+  justify-content: space-between;
+  margin: 30px;
+  color: #393939;
+  font-size: 24px;
+}
+.allocation-items {
+  width: 45%;
+  display: inline-block;
+  margin-right: 20px;
+  margin-bottom: 30px;
+}
+.allocation {
+  color: #52cc60;
+  font-size: 20px;
+  text-decoration: underline;
+  cursor: pointer;
+}
+.el-pagination.is-background .el-pager li:not(.disabled).active {
+  background-color: #52cc60 !important;
+  color: #fff;
+}
+.pages {
+  margin: 15px 0;
+}
+.age-tip {
+  width: 80%;
+  height: 40px;
+  color: #747070;
+  font-size: 12px;
+}
+.class-download {
+  background-color: #fff;
+  width: 160px;
+  z-index: 999999;
+  position: absolute;
+  border: 1px solid #e0dddd;
+  border-radius: 5px;
+  top: 58px;
+}
+.class-download ul li {
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  cursor: pointer;
+  color: #b6b6b6;
+}
+.class-download ul li:hover {
+  background-color: #52cc60;
+  color: #ffff;
+}
+.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 {
+  cursor: pointer;
+  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;
+}
+.num-red {
+  background: rgba(255, 100, 101, 1);
+  border-radius: 9px;
+  color: #fff;
+}
+.month-day {
+  margin: 10px 30px;
+  color: #393939;
+  font-size: 20px;
+}
+.date-set {
+  text-align: center;
+  width: 100%;
+  cursor: pointer;
+}
+.date-set > div {
+  height: 30px;
+  line-height: 30px;
+  /* width: 100%; */
+  color: #393939;
+  font-size: 16px;
+  margin: 25px 0px;
+  /* background-color: #52cc60; */
+}
+.date-set > div:hover {
+  background-color: #52cc60;
+  color: #fff;
+  /* font-size: 25px; */
+}
+.date-day-set {
+  line-height: 40px;
+  color: #393939;
+  font-size: 16px;
+}
+.date-day-set-num {
+  font-size: 16px;
+  line-height: 70px;
+  color: #aaa;
+}
+.date-red {
+  color: #ff6465;
+}
+.date-time-active {
+  color: #e5e5e5;
+}
+.date-btn-active {
+  background: rgba(114, 151, 255, 0.3);
+  border: none;
+}
+.abbTeachers {
+  width: 100%;
+  height: 40px;
+  background-color: #f6f7fb;
+  border-radius: 20px;
+  text-align: left;
+  line-height: 30px;
+  font-size: 14px;
+  padding: 0 20px;
+  margin: 10px 0px;
+  cursor: pointer;
+}
+.addLogicon {
+  font-size: 30px;
+  color: #1989fa;
+  margin: 0px 20px;
+}
+.btsnius {
+  width: 100%;
+  height: 60px;
+}
+.yesBtn {
+  margin-right: 30px;
+  height: 40px;
+  width: 100px;
+  background-color: #52cc60;
+  border-radius: 10px;
+  color: #fff;
+  line-height: 40px;
+  text-align: center;
+  display: inline-block;
+  cursor: pointer;
+}
+.closeBtn {
+  height: 40px;
+  width: 100px;
+  background-color: #fff;
+  border-radius: 10px;
+  color: #52cc60;
+  line-height: 40px;
+  text-align: center;
+  display: inline-block;
+  border: 1px solid #52cc60;
+  cursor: pointer;
+}
+.scrollBox {
+  height: 400px;
+  overflow: auto;
+  padding: 0 15px;
+}
+/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
+::-webkit-scrollbar {
+  width: 5px; /*滚动条宽度*/
+  height: 15px; /*滚动条高度*/
+}
+
+/*定义滚动条轨道 内阴影+圆角*/
+::-webkit-scrollbar-track {
+  -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
+  border-radius: 10px; /*滚动条的背景区域的圆角*/
+  background-color: #fff; /*滚动条的背景颜色*/
+}
+
+/*定义滑块 内阴影+圆角*/
+::-webkit-scrollbar-thumb {
+  border-radius: 10px; /*滚动条的圆角*/
+  -webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
+  background-color: #bcbaba; /*滚动条的背景颜色*/
+}
+.Buttonhole {
+  cursor: pointer;
+  margin-top: 10px;
+  width: 80px;
+  height: 30px;
+  line-height: 30px;
+  border-radius: 15px;
+  background-color: #7297ff;
+  color: #fff;
+  display: inline-block;
+}
+.Selectradius {
+  display: inline-block;
+}
+.table-img {
+  width: 36px;
+  height: 36px;
+  border-radius: 6px;
+  /* margin-left: 14px; */
+  cursor: pointer;
+}
+.Daylog {
+  font-size: 16px;
+  color: #7297ff;
+  height: 40px;
+  display: inline-block;
+}
+.model-text-head {
+  display: flex;
+  color: #393939;
+  font-size: 24px;
+  justify-content: space-between;
+}
+.table-heads1 {
+  margin-left: 150px !important;
+  width: 350px;
+  font-weight: 700;
+  color: #393939 !important;
+  font-size: 18px;
+  text-align: center;
+  display: flex;
+  justify-content: space-around;
+}
+.table-heads2 {
+  background-color: #fff;
+  margin-left: 80px !important;
+  width: 400px;
+  font-weight: 700;
+  color: #393939 !important;
+  font-size: 18px;
+  text-align: center;
+  display: flex;
+  justify-content: space-around;
+}
+.table-heads3 {
+  background-color: #fff;
+  margin-left: 100px !important;
+  width: 400px;
+  font-weight: 700;
+  color: #393939 !important;
+  font-size: 18px;
+  text-align: center;
+  display: flex;
+  justify-content: space-around;
+}
+.table-heads1 > div {
+  width: 30%;
+}
+.tr-secon1 {
+  font-size: 12px;
+  text-align: center;
+  word-wrap: break-word;
+  width: 120px;
+  line-height: 50px;
+}
+.tr-secon {
+  font-size: 12px;
+  text-align: center;
+  word-wrap: break-word;
+  width: 60px;
+  line-height: 50px;
+  display: inline-block;
+}
+
+.tr-sw100 {
+  width: 80px;
+  text-align: center;
+}
+.tiplog {
+  height: 100px;
+  width: 200px;
+  padding: 15px;
+  margin: 30px;
+  font-size: 25px;
+  font-weight: 700;
+  margin: 0 auto;
+}
+.Buttonhole {
+  cursor: pointer;
+  margin-top: 10px;
+  width: 80px;
+  height: 30px;
+  line-height: 30px;
+  border-radius: 15px;
+  background-color: #7297ff;
+  color: #fff;
+}
+.table-img {
+  width: 36px;
+  height: 36px;
+  border-radius: 6px;
+  /* margin-left: 14px; */
+  cursor: pointer;
+}
+.teach-block {
+  display: inline-block;
+}
+.Dayteach-Allot {
+  display: inline-block;
+  width: 200px;
+  position: relative;
+  height: 30px;
+  top: 5px;
+  right: -100px;
+}
+.Dayteach-Allot1 {
+  display: inline-block;
+  width: 200px;
+  position: relative;
+  height: 30px;
+  top: 5px;
+}
+.DaySeachIcon {
+  position: absolute;
+  font-size: 20px;
+  color: #b6b6b6;
+  right: 10%;
+  margin-top: 5px;
+  cursor: pointer;
+}
+.Dayinput-with-Allot {
+  border: #b6b6b6;
+  border-radius: 20px;
+  height: 30px;
+  width: 200px;
+  font-size: 8px;
+  color: #b6b6b6;
+  text-align: left;
+  line-height: 30px;
+  background: #f1f2f4;
+  padding: 0 10px;
+  float: right;
+  outline: none !important;
+  box-shadow: none;
+}
+.tr-slogn {
+  display: inline-block;
+  margin: 0 30px;
+  font-size: 12px;
+  text-align: left;
+  font-weight: 700;
+}
+.selectTeacher {
+  font-size: 12px;
+  text-align: left;
+  font-weight: 700;
+  width: 160px;
+  color: #7297ff;
+  margin-top: 10px;
+}
+.model-grdeen {
+  background-color: #52cc60;
+  color: #fff;
+}
+.model-text-items-close {
+  cursor: pointer;
+  position: absolute;
+  top: 10px;
+  right: -5px;
+}
+.model-text-items {
+  position: relative;
+  color: #000000;
+  font-size: 24px;
+  text-align: center;
+  padding: 40px 0 50px 0;
+  margin: 0 33px;
+}
+.model-btn {
+  display: flex;
+  justify-content: space-around;
+  margin-bottom: 44px;
+  cursor: pointer;
+}
+.model-btn-items {
+  width: 154px;
+  height: 50px;
+  line-height: 50px;
+  text-align: center;
+  font-size: 18px;
+  border-radius: 4px;
+}
+.main-gay {
+  background: rgba(246, 247, 251, 1);
+  color: #7e7e7e;
+}
+.Littleicon {
+  height: 20px;
+  width: 20px;
+  position: relative;
+  top: 0;
+}
+</style>

+ 138 - 38
src/components/TeamWorkLists.vue

@@ -50,7 +50,7 @@
           </el-col>
         </el-col>
         <el-col :span="24">
-          <h1 class="tiplog">{{this.month}}月排班情况</h1>
+          <h1 class="tiplog">{{this.Nowmonth}}月排班情况</h1>
           <div class="canlender" id="canlender">
             <div class="tablebox1">
               <div class="date">
@@ -81,28 +81,28 @@
                         >
                           <template slot-scope="scope">
                             <span
-                              :class="[scope.$index == 0?'date-time-active':'']"
+                              :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=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':'']"
+                              :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=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':'']"
+                              :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=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':'']"
+                              :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=0?'date-time-active':'']"
                             >{{scope.row.haveNum}}</span>
                           </template>
                         </el-table-column>
@@ -115,8 +115,8 @@
                         >
                           <template slot-scope="scope">
                             <div
-                              :class="[scope.$index == 0?'date-btn-active':'Buttonhole']"
-                              @click="isShow(1,scope.row.id)"
+                              :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=0?'date-btn-active':'Buttonhole']"
+                              @click="isShow(1,scope.row.id,timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00'),DaytimeFn(scope.row.arrangeDate))"
                             >排班</div>
                           </template>
                         </el-table-column>
@@ -124,7 +124,7 @@
                       <div
                         slot="reference"
                         @click="classSet(index,item.date,item.month,item.dateList.intervalList)"
-                        :class="[item.status ? 'checked' : '']"
+                        :class="[item.pastDay ? 'psatchecked' : '']"
                         class="day-setting"
                       >
                         <!-- {{FindCalendarList}} -->
@@ -141,7 +141,7 @@
                           <div class="people-items">
                             <div
                               class="people-items-num"
-                              :class="[item.dateList.haveNum >= item.dateList.miniNum?'num-red':'']"
+                              :class="[item.dateList.haveNum < item.dateList.miniNum?'num-red':'']"
                             >{{item.dateList.haveNum}}</div>
                             <div class="people-items-text">已选</div>
                           </div>
@@ -174,11 +174,15 @@
                 v-model="HaveTeacherList.teacherName"
                 class="Dayinput-with-Allot"
               />
-              <span @click="SearchFindHaveTeacher()" style="right:10%;" 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.haveNum}}</span>
               <span class="tr-slogn">饱和:{{FindHaveTeacherList.arrangeDetail.miniNum}}</span>
             </div>
           </div>
@@ -231,7 +235,7 @@
               class="model-text-items-close"
             />
           </div>
-          <div>是否确定将{{name}}老师移除?</div>
+          <div>是否确定将{{this.DetailteacherName}}老师移除?</div>
         </div>
         <div class="model-btn">
           <div class="model-btn-items main-gay" @click="DetetaiApplyOperate()">是</div>
@@ -253,7 +257,11 @@
                 v-model="NoHaveTeacherList.teacherName"
                 class="Dayinput-with-Allot"
               />
-              <span @click="SearchNoHaveTeacher()" style="right:40%;" class="DaySeachIcon el-icon-search"></span>
+              <span
+                @click="SearchNoHaveTeacher()"
+                style="right:35%;"
+                class="DaySeachIcon el-icon-search"
+              ></span>
             </div>
             <span
               style="font-size:12px;text-align:left;font-weight:700"
@@ -303,7 +311,7 @@
           </div>
           <div class="btsnius">
             <div @click="GetAddArrangeByTeacherStatus()" class="yesBtn">确定</div>
-            <div @click="allShowModel(4)"  class="closeBtn">取消</div>
+            <div @click="allShowModel(4)" class="closeBtn">取消</div>
           </div>
         </div>
       </div>
@@ -324,15 +332,19 @@ export default {
       //本月的本期构成
       BASE_URL: IMG_BASE_URL,
       dayarr: [],
-      year: new Date().getFullYear(),
+      // year: new Date().getFullYear(),
       D: new Date().getDate() + " ",
-      // month: new Date().getMonth() + 1,
+      Nowyear: new Date().getFullYear(),
+      Nowmonth: new Date().getMonth() + 1,
+      NowHours: new Date().getHours(),
       NewDay: "",
       gardeListDownage: false,
       gardeListDown: false,
-      selecttitlepag: "选年级",
-      selecttitleage: "选科目",
+      selecttitlepag: "批改老师",
+      selecttitleage: "语文",
       teacherIds: [],
+      gridData:[],
+      DetailteacherName:'',
       inputValue: "",
       isSelected: false,
       isPigai: false,
@@ -368,11 +380,6 @@ export default {
           value: "1",
           label: "批改老师",
           str: "8"
-        },
-        {
-          value: "2",
-          label: "全部"
-          // str:''
         }
       ],
       grades: [
@@ -390,23 +397,36 @@ export default {
           value: "2",
           label: "英语",
           str: "英语"
-        },
-        {
-          value: "3",
-          label: "全部"
-          // str:""
         }
       ]
     };
   },
-  watch: {},
+  watch: {
+    DutyTemplateListSTUS(val, oldVal) {
+      // debugger
+      //保存排班设置成功的watch监听回调
+      this.Datainit();
+    },
+    DeleteArrangeByTeacher(val, oldVal) {
+      // debugger
+      //保存排班设置成功的watch监听回调
+      this.GetFindCalendarListInfo();
+    },
+    AddArrangeByTeacherStatus(val, oldVal) {
+      // debugger
+      //保存排班设置成功的watch监听回调
+      this.GetFindCalendarListInfo();
+    }
+  },
   computed: {
     ...mapGetters([
       "UnallotHomeworkInfo",
       "DeleteArrangeByTeacher",
       "FindCalendarList",
       "FindHaveTeacherList",
-      "FindNoHaveTeacherList"
+      "FindNoHaveTeacherList",
+      "DutyTemplateListSTUS",
+      "AddArrangeByTeacherStatus"
     ])
   },
   methods: {
@@ -427,6 +447,45 @@ export default {
         _this.NoAllotManagerModel = false;
       }
     },
+    timeFn(d1) {
+      //di作为一个变量传进来
+      //如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
+      var dateBegin = new Date(d1.replace(/-/g, "/")); //将-转化为/,使用new Date
+      var dateEnd = new Date(); //获取当前时间
+      var dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
+      var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000)); //计算出相差天数
+      var leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
+      var hours = Math.floor(leave1 / (3600 * 1000)); //计算出小时数
+      //计算相差分钟数
+      var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
+      var minutes = Math.floor(leave2 / (60 * 1000)); //计算相差分钟数
+      //计算相差秒数
+      var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
+      var seconds = Math.round(leave3 / 1000);
+      return hours;
+      // return dayDiff
+      // console.log(" 相差" + dayDiff + "天" + hours + "小时 " + minutes + "分钟" + seconds + " 秒")
+      // console.log(dateDiff + "时间差的毫秒数",dayDiff + "计算出相差天数",leave1 + "计算天数后剩余的毫秒数"
+      //     ,hours + "计算出小时数",minutes + "计算相差分钟数",seconds + "计算相差秒数");
+    },
+    DaytimeFn(d1) {
+      //di作为一个变量传进来
+      //如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
+      var dateBegin = new Date(d1.replace(/-/g, "/")); //将-转化为/,使用new Date
+      var dateEnd = new Date(); //获取当前时间
+      var dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
+      var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000)); //计算出相差天数
+      var leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
+      var hours = Math.floor(leave1 / (3600 * 1000)); //计算出小时数
+      //计算相差分钟数
+      var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
+      var minutes = Math.floor(leave2 / (60 * 1000)); //计算相差分钟数
+      //计算相差秒数
+      var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
+      var seconds = Math.round(leave3 / 1000);
+      // return hours
+      return dayDiff;
+    },
     showdetailModel(item) {
       if (!item.prevmonth && !item.nextmonth) {
         this.NewDay = item.day;
@@ -439,12 +498,18 @@ export default {
         Message.error("当前月份未开启,禁止操作!");
       }
     },
-    isShow(str, id) {
+    //弹框
+    isShow(str, id, timeFnd, DaytimeFn) {
       let _this = this;
       if (str == 1) {
-        _this.isApporTeacher = true;
-        this.HaveTeacherList.Teacherid = id;
-        this.GetFindHaveTeacherListInfo();
+        if ((timeFnd < -4 && DaytimeFn <= 0) || DaytimeFn < 0) {
+          _this.isApporTeacher = true;
+          this.HaveTeacherList.teacherName = ''
+          this.HaveTeacherList.Teacherid = id;
+          this.GetFindHaveTeacherListInfo();
+        } else {
+          Message.error("请提前4小时开始排班,当前时间已关闭不可操作!");
+        }
       }
     },
     AddeacherTeam() {
@@ -477,6 +542,9 @@ export default {
     choiceclass() {
       this.gardeListDown = true;
     },
+    SearchNoHaveTeacher() {
+      this.GetFindNoHaveTeacherListInfo();
+    },
     // 添加老师勾选数组
     async DetetaiOrAddeacherTeam(item, type) {
       if (type == 1) {
@@ -498,6 +566,7 @@ export default {
     },
     // 获取校区管理员排班表
     async GetFindCalendarListInfo() {
+        // this.gridData = []
       this.$store.dispatch("GetFindCalendarList", {
         type: this.filters.OptionsValue,
         subject: this.filters.gradesValue
@@ -519,6 +588,8 @@ export default {
     },
     // 时段添加老师
     async GetAddArrangeByTeacherStatus() {
+      // debugger
+      this.AddTeacherModel = false
       this.$store.dispatch("GetAddArrangeByTeacher", {
         id: this.HaveTeacherList.Teacherid,
         teacherIds: this.teacherIds
@@ -526,12 +597,14 @@ export default {
     },
     // 时段移除老师
     detailTeacherTeam(item) {
+      this.DetailteacherName =  item.teacherName;
       this.isApporTeacher = false;
       this.hiddenModel = true;
       this.detetaiTeacherid = item.teacherId;
     },
     // 移除老师
     DetetaiApplyOperate() {
+       this.hiddenModel = false;
       this.$store.dispatch("GetDeleteArrangeByTeacher", {
         id: this.HaveTeacherList.Teacherid,
         teacherId: this.detetaiTeacherid
@@ -540,8 +613,12 @@ export default {
     showAddTeacherModel() {
       this.isApporTeacher = false;
       this.AddTeacherModel = true;
+      this.NoHaveTeacherList.teacherName = ''
       this.GetFindNoHaveTeacherListInfo();
     },
+       SearchFindHaveTeacher() {
+      this.GetFindHaveTeacherListInfo();
+    },
     // 日期处理
     Datainit() {
       // 初始化当前时间
@@ -586,6 +663,7 @@ export default {
     // 排班点击
     classSet(k, d, m, intervalList) {
       // console.log(k,d,m)
+      //  this.gridData = [];
       this.month = m + 1;
       this.today = d;
       for (var i in this.calendarList) {
@@ -658,6 +736,7 @@ export default {
           date: date,
           disable: curMonth !== month,
           status: false,
+           pastDay: date < today && curMonth == month,
           value: this.stringify(year, curMonth, date)
         });
         // 排班设置
@@ -674,7 +753,7 @@ export default {
       var that = this;
       for (let i = 0; i < list.length; i++) {
         if (!list[i].disable) {
-          const dateValue = list[i].value + " 00:00:00";
+          const dateValue = list[i].value;
           for (let t = 0; t < that.FindCalendarList.list.length; t++) {
             if (dateValue == that.FindCalendarList.list[t].arrangeDate) {
               list[i].dateList = that.FindCalendarList.list[t];
@@ -704,6 +783,8 @@ export default {
   mounted() {
     this.GetFindCalendarListInfo();
     this.Datainit();
+    //  var sss = "2019-08-02 10:00:00"
+    //        this.timeFn(sss)
   }
 };
 </script>
@@ -739,6 +820,14 @@ th {
   border-radius: 15px;
   color: #fff;
 }
+.date-time-active {
+  color: #e5e5e5;
+}
+/* .date-btn-active {
+  background: rgba(114, 151, 255, 0.3);
+  border: none;  
+  cursor: pointer;
+} */
 .Ageclass {
   display: inline-block;
   height: 40px;
@@ -993,7 +1082,7 @@ table.bgtable tbody tr td.gray {
   position: relative;
   height: 40px;
   top: 15px;
-   display: inline-block;
+  display: inline-block;
 }
 /* .Dayteach-Allot1 {
   display: inline-block;
@@ -1019,7 +1108,7 @@ table.bgtable tbody tr td.gray {
   position: absolute;
   font-size: 20px;
   color: #b6b6b6;
-  right: 30%;
+  right: 15%;
   margin-top: 10px;
   cursor: pointer;
 }
@@ -1168,6 +1257,7 @@ table.bgtable tbody tr td.gray {
   border-left: 1px solid #e5e5e5;
 }
 .calendar-item {
+  cursor: pointer;
   float: left;
   width: 14.28%;
   height: 130px;
@@ -1182,7 +1272,12 @@ table.bgtable tbody tr td.gray {
   line-height: 130px;
 }
 .calendar-item.disabled {
-  color: #ffff;
+  /* color: rgba(0, 0, 0, 0.3); */
+  color:#ffff;
+}
+.psatchecked{
+    color: rgba(0, 0, 0, 0.3);
+      opacity: 0.5;
 }
 .checked {
   background: #f6f7fb;
@@ -1192,6 +1287,11 @@ table.bgtable tbody tr td.gray {
   line-height: 60px;
   color: #aaa;
 }
+.num-red {
+  background: rgba(255, 100, 101, 1);
+  border-radius: 9px;
+  color: #fff;
+}
 .people {
   display: flex;
   justify-content: space-around;

+ 64 - 20
src/components/TeamworkScheduling.vue

@@ -35,7 +35,13 @@
             <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" />
+                       <img
+                  :src="BASE_URL + v.photo"
+                  v-if="v.photo"
+                  alt
+                 class="table-img"
+                />
+                <img  v-if="!v.photo" src="../assets/img/attt.png" alt class="table-img" />
               </div>
                 <div>{{v.teacherName}}</div>
                 <div>{{v.haveCount}}</div>
@@ -58,6 +64,7 @@
             @current-change="pageChange1"
             :page-sizes="[10]"
             layout="total, prev, pager, next"
+               :total="parseInt(FindTeamTeacherList.totalElements)"
             :hide-on-single-page="true"
           ></el-pagination>
           <div style="clear:both;"></div>
@@ -69,7 +76,7 @@
       <div class="modal-cancel" @click="updateIsShowCarouselPictureModal()">X</div>
       <div class="detailinfo">
             <el-col :span="24">
-          <h1 class="tiplog">{{this.month}}月排班情况</h1>
+          <h1 class="tiplog">{{TeacherThisMonthDutyList.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">
@@ -84,24 +91,25 @@
               </div>
               <div class="calendar-inner">
                 <div
-                  class="calendar-item"
+                  
                   v-for="(item, index) of calendarList"
+                     :class="[item.pastDay ? 'psatchecked' : 'calendar-item']"
                   :key="index"
                 
                 >
                     <div
                       slot="reference"
-                      :class="[item.status ? 'checked' : '']"
                       class="day-setting"
                     >
                       <!-- {{FindCalendarList}} -->
                       <div class="date-day">{{ item.date }}</div>
-                      <div class="people" v-if="item.dateList && item.dateList.timeVoList.length">
+                      <div class="people" v-if="item.dateList && item.dateList.timeVoList">
                         <div class="people-items">
-                          <div class="people-items-text" v-for="(v, k) of item.dateList.timeVoList"
+                          <div :class="[item.pastDay ? 'Past-items-text' : '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="selectIng" v-if="v.timeState ==2 && !item.pastDay">{{v.startInterval}}-{{v.endInterval}}</span>
+                              <span class="MuchselectIng" v-if="v.timeState ==2 && item.pastDay">{{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>
@@ -132,6 +140,7 @@ export default {
        daynamearr:["一", "二", "三", "四", "五", "六", "日"],
       //本月的本期构成
       dayarr: [],
+      managerId:'',
       year: new Date().getFullYear(),
       D: new Date().getDate() + " ",
       // month: new Date().getMonth() + 1,
@@ -154,10 +163,19 @@ export default {
       pictureIndex: 0
     };
   },
-  created() {},
-  watch: {},
+  created() {
+    const managerId = this.$route.query.managerId;
+    this.managerId = managerId;
+  },
+  watch: {
+     TeacherThisMonthDutySucess(val, oldVal) {
+      
+      //保存排班设置成功的watch监听回调
+      this.init();
+    },
+  },
   computed: {
-    ...mapGetters(["TeacherThisMonthDutyList","FindTeamTeacherList"])
+    ...mapGetters(["TeacherThisMonthDutyList","FindTeamTeacherList","TeacherThisMonthDutySucess"])
   },
   methods: {
     ...mapActions(["setUser"]),
@@ -179,6 +197,7 @@ export default {
      // 组内排班老师列表
     async GetFindTeamTeacherListInfo() {
       this.$store.dispatch("GetFindTeamTeacherList", {
+        managerId: this.managerId,
       type:this.TEACHERTYPE,
        pageSize:this.filters1.pageSize,
         pageNo:this.filters1.pageNo
@@ -197,12 +216,12 @@ export default {
     },
     //老师排班详情
     groupDetail(str) {
-       this.init();
       this.pictureIndex = 0;
       this.NoAllotManagerModel = true;
       this.$store.dispatch("GetTeacherThisMonthDutyList", {
         teacherId: str.teacherId,
       });
+      //  this.init();
     },
       // 日期处理
     init() {
@@ -308,6 +327,7 @@ export default {
           month: curMonth,
           date: date,
           disable: curMonth !== month,
+           pastDay: date < today && curMonth == month,
           status: false,
           value: this.stringify(year, curMonth, date)
         });
@@ -358,6 +378,7 @@ export default {
     },
   },
   mounted() {
+    this.GetFindTeamTeacherListInfo()
   }
 };
 </script>
@@ -650,6 +671,21 @@ el-table {
 .tr-first > div {
   width: 14.528%;
 }
+.psatchecked{
+  background-color: #F9F9F9;
+    float: left;
+  width: 14.28%;
+  height: 250px;
+  line-height: 130px;
+  text-align: center;
+  color:#AAAAAA;
+   border:10px solid #fff;
+  padding: 4px;
+  font-weight: 700;
+  cursor: pointer;
+  border-radius: 20px;
+    /* gackgroudcolor: rgba(243, 10, 10, 0.007); */
+}
 .tr-s {
   display: flex;
   justify-content: space-around;
@@ -860,13 +896,6 @@ el-table {
   margin-right: 20px;
   margin-bottom: 30px;
 }
-.table-img {
-  width: 36px;
-  height: 36px;
-  border-radius: 6px;
-  /* margin-left: 14px; */
-  cursor: pointer;
-}
 .ApporStyles {
   display: inline-block;
   width: 180px;
@@ -984,10 +1013,11 @@ table.bgtable tbody tr td.gray {
   text-align: center;
   background-color: #F6F7FB;
    border:10px solid #fff;
-  padding: 4px;
+  padding-bottom: 4px;
   font-weight: 700;
   cursor: pointer;
   border-radius: 20px;
+  /* padding:15px; */
 }
 .timeGone{
     background-color: #F9F9F9;
@@ -1015,7 +1045,15 @@ table.bgtable tbody tr td.gray {
 .people-items {
   display: inline-block;
   line-height: 70px;
-  margin-top: 10px;
+}
+.people-items span {
+display: block;
+ height:30px;
+ line-height: 30px;
+ width: 120px;
+  font-size: 12px;
+  border-radius: 10px;
+  margin:10px;
 }
 .people-items-num {
   line-height: 15px;
@@ -1027,6 +1065,12 @@ table.bgtable tbody tr td.gray {
   color: #7297FF;
   font-weight: normal;
 }
+.Past-items-text {
+  line-height: 30px;
+  font-size: 14px;
+  color: #aaaaaa;
+  font-weight: normal;
+}
 .selectIng{
   display: block;
  background-color: #7297FF; 

File diff suppressed because it is too large
+ 1535 - 0
src/components/bf.vue


+ 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

+ 14 - 1
src/main.js

@@ -41,7 +41,20 @@ Viewer.setDefaults({
 Vue.use(ElementUi);
 Vue.use(Vuex);
 sync(store, router);
-
+// let _this = this
+//     window.onbeforeunload = function (e) {
+//       if (_this.$route.name == "dyyPerformanceCenterSale") {
+//         e = e || window.event;
+//         // 兼容IE8和Firefox 4之前的版本
+//         if (e) {
+//           e.returnValue = '关闭提示1111';
+//         }
+//         // Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
+//         return '关闭提示222';
+//       } else {
+//         window.onbeforeunload = null
+//       }
+//     };
 // register global utility filters.
 Object.keys(filters).forEach(key => {
   Vue.filter(key, filters[key]);

+ 1 - 0
src/pages/Home.vue

@@ -179,6 +179,7 @@
       //   this.navHeight =
       //     document.body.clientHeight - this.$refs.logoUser.offsetHeight;
       // });
+      
     }
   };
 </script>

+ 14 - 5
src/pages/Login.vue

@@ -43,7 +43,13 @@ export default {
   data() {
     return {};
   },
-  watch: {},
+ //监听器
+	watch: {
+		'$route' (to, from) { //监听路由是否变化
+			     console.log(999)
+				location.reload()
+		},
+	},
   created() {
      localStorage.removeItem("accessToken")
     this.getTKByUnionid();
@@ -72,7 +78,10 @@ export default {
       }
       if (window.location.href.indexOf("code") >= 0) {
         // 如果url中包含code,则保存到store中
-        let code = window.location.href.split("?")[1];
+          console.log(window.location.href)
+        let code = window.location.href.split("#/?")[1];
+         console.log("code开始打印")
+        console.log(code)
         code = code.substring(5, code.indexOf("&"));
         let WxCode = code;
         this.WxCode = WxCode;
@@ -91,12 +100,12 @@ export default {
     var obj = new WxLogin({
       self_redirect: false,
       id: "login_container",
-      appid: "wxd18ca9555a939281",
+      appid: "wxd18ca9555a939281", //正式环境
         //  appid: "wx7fe760dc3c45794d", //实训环境
       scope: "snsapi_login",
       redirect_uri: encodeURIComponent(
-        "https://kmt.sharingschool.com/aijia/manager/index.html"
-          // "https://sxkmt.sharingschool.com/manager/index.html" //实训环境
+        "https://kmt.sharingschool.com/aijia/manager/index.html#/" //正式环境
+          // "https://sxkmt.sharingschool.com/manager/index.html#/" //实训环境
       ),
       state: "",
       style: "width: 250px",

+ 23 - 9
src/pages/super/CheckTeacherPay.vue

@@ -6,7 +6,7 @@
       <!--数据监控-->
       <el-col :span="20" class="main" :offset="2">
         <el-row :gutter="20" class="main-header">
-          <el-col :span="3" :offset="1">
+          <el-col :span="3" :offset="2">
             <div class="main-header-item">
               <div class="block">
                 <el-date-picker
@@ -20,7 +20,7 @@
               </div>
             </div>
           </el-col>
-          <el-col :span="10" :offset="1">
+          <el-col :span="10" :offset="3">
             <!-- <div
               @click="handApor()"
               :class="{superactive:Activeindex == false,ApporStyles:true}"
@@ -31,7 +31,7 @@
             >匹配知识点老师</div> -->
 						<div  v-for="(item, key) of teacherList" :key="key" @click="teacherType(key)" :class="{superactive:ActiveIndex == key,ApporStyles:true}">{{item}}</div>
           </el-col>
-          <el-col :span="4" :offset="4">
+          <el-col :span="4" :offset="2">
             <div class="main-header-item">
               <i class="el-icon-printer"></i>
               <span v-if="ActiveIndex == 0" @click="excel()">导出表格</span>
@@ -63,17 +63,24 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column prop="attendanceCount" label="出勤天数" header-align="center"></el-table-column>
+          <el-table-column prop="attendanceCount" label="是否有底薪" header-align="center">
+              <template slot-scope="scope">
+              <div class="scope-list">
+                <span v-if="scope.row.whetherHaveBasicSalary == 1"  class="scope-name">是</span>
+                  <span v-if="scope.row.whetherHaveBasicSalary == 0"  class="scope-name">无</span>
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column prop label="1~2年级" header-align="center" height="200">
             <el-table-column prop="autoLowGradeCount" label="自动批改(0.2元/张)" width="100"></el-table-column>
             <el-table-column prop="manualLowGradeCount" label="手动批改(0.3元/张)" width="100"></el-table-column>
           </el-table-column>
           <el-table-column prop label="3~4年级" header-align="center" height="200">
-            <el-table-column prop="autoMiddleGradeCount" label="自动批改(0.3元/张)" width="100"></el-table-column>
+            <el-table-column prop="autoMiddleGradeCount" label="自动批改(0.2元/张)" width="100"></el-table-column>
             <el-table-column prop="manualMiddleGradeCount" label="手动批改(0.4元/张)" width="100"></el-table-column>
           </el-table-column>
           <el-table-column label="5~6年级" header-align="center" height="200">
-            <el-table-column prop="autoHighGradeCount" label="自动批改(0.4元/张)" width="100"></el-table-column>
+            <el-table-column prop="autoHighGradeCount" label="自动批改(0.2元/张)" width="100"></el-table-column>
             <el-table-column prop="manualHighGradeCount" label="手动批改(0.5元/张)" width="100"></el-table-column>
           </el-table-column>
           <el-table-column prop="total" label="总计" header-align="center" width="400"></el-table-column>
@@ -116,8 +123,15 @@
               </div>
             </template>
           </el-table-column>
-            <el-table-column prop="attendanceCount" label="出勤天数" header-align="center"></el-table-column>
-          <el-table-column  prop="correctCount" label="批改张数(0.2元/张)" header-align="center">
+            <el-table-column prop="attendanceCount" label="是否有底薪" header-align="center">
+              <template slot-scope="scope">
+              <div class="scope-list">
+                <span v-if="scope.row.whetherHaveBasicSalary == 1"  class="scope-name">是</span>
+                  <span v-if="scope.row.whetherHaveBasicSalary == 0"  class="scope-name">无</span>
+              </div>
+            </template>
+            </el-table-column>
+          <el-table-column  prop="correctCount" label="批改张数(0.1元/张)" header-align="center">
           </el-table-column>
           <el-table-column prop="total" label="总计" header-align="center"></el-table-column>
         </el-table>
@@ -763,7 +777,7 @@ el-table {
 }
 .ApporStyles {
   display: inline-block;
-  width: 180px;
+  width: 200px;
   height: 40px;
   line-height: 40px;
   background-color: #fff;

+ 187 - 95
src/pages/super/ComposeType.vue

@@ -61,8 +61,7 @@
           </el-col>
           <el-col :span="12" class="month">
             <span>{{currentDateStr }}排班情况</span>
-                {{NowHours}}
-            <!-- {{DutyTemplateListInfo}} -->
+            <!-- {{DutyTemplateListSTUS}} -->
           </el-col>
         </el-row>
         <el-row :gutter="24">
@@ -91,21 +90,21 @@
                       <el-table-column width="150" label="日期" header-align="center" align="center">
                         <template slot-scope="scope">
                           <span
-                            :class="[scope.$index == 0?'date-time-active':'']"
+                            :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=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':'']"
+                            :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=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':'']"
+                            :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=0?'date-time-active':'']"
                           >{{scope.row.maxNum}}</span>
                         </template>
                       </el-table-column>
@@ -113,7 +112,7 @@
                       <el-table-column width="60" label="已选" header-align="center" align="center">
                         <template slot-scope="scope">
                           <span
-                            :class="[scope.$index == 0?'date-time-active':'']"
+                            :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=0?'date-time-active':'']"
                           >{{scope.row.haveNum}}</span>
                         </template>
                       </el-table-column>
@@ -125,20 +124,18 @@
                         align="center"
                       >
                         <template slot-scope="scope">
-                          <el-button
-                            size="small"
-                            type="primary"
-                            @click="isShow(1,scope.row.id)"
-                            round
-                            :class="[scope.$index == 0?'date-btn-active':'']"
-                          >排班</el-button>
+                          <div
+                            :class="[DaytimeFn(scope.row.arrangeDate) >0 ||timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00') >= -4 && DaytimeFn(scope.row.arrangeDate)>=0?'date-btn-active':'Buttonhole']"
+                            @click="isShow(1,scope.row.id,timeFn(Nowyear+'-'+Nowmonth+'-' + D +scope.row.startInterval+':' + '00'),DaytimeFn(scope.row.arrangeDate))"
+                          >排班</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="[item.pastDay ? 'psatchecked' : '']"
                       class="day-setting"
                     >
                       <!-- {{FindCalendarList}} -->
@@ -155,7 +152,7 @@
                         <div class="people-items">
                           <div
                             class="people-items-num"
-                            :class="[item.dateList.haveNum >= item.dateList.miniNum?'num-red':'']"
+                            :class="[item.dateList.haveNum < item.dateList.miniNum?'num-red':'']"
                           >{{item.dateList.haveNum}}</div>
                           <div class="people-items-text">已选</div>
                         </div>
@@ -169,21 +166,20 @@
         </el-row>
       </el-col>
       <!--排班设置-->
+      <!-- <SuperworkListSeting v-if="this.modelindex == 1"></SuperworkListSeting> -->
       <el-col :span="17" class="main" v-if="modelindex == 1">
         <el-row :gutter="20">
           <el-col :span="18" class="month" :offset="2">
             <span>{{currentDateStr }}排班设置</span>
-             <div class="model-btn-items model-grdeen" style="float:right" @click="saveOpenCloseDAys()">保存</div>
+            <div
+              class="model-btn-items model-grdeen"
+              style="float:right"
+              @click="saveOpenCloseDAys()"
+            >保存</div>
           </el-col>
-          <!-- <el-col  :span="4" >
-            <div class="model-btn">
-
-             </div>
-          </el-col> -->
         </el-row>
         <el-row :gutter="24">
           <el-col :span="20" :offset="2">
-            <!-- 日期 -->
             <div class="date">
               <div class="calendar-week">
                 <div class="week-item" v-for="item of weekList" :key="item">{{ item }}</div>
@@ -196,24 +192,26 @@
                   :class="[item.disable ? 'disabled' : '']"
                 >
                   <el-popover placement="bottom" width="108" trigger="click">
-                    <div class="date-set">
+                    <div class="date-set"  v-if="!item.disable">
                       <div @click="UnOrWaitOpen(item,1,index)">待开放</div>
                       <div @click="UnOrWaitOpen(item,2,index)">不开放</div>
                     </div>
+                      <div class="date-set"  v-if="item.disable">当前时段不可操作!</div>
                     <div
                       slot="reference"
-                      v-if="!item.disable"
                       @click="settingClick(index)"
                       :class="[item.status ? 'checked' : '']"
                       class="day-setting"
                     >
                       <div class="date-day-set-num">{{ item.date }}</div>
-                      <div class="date-day-set" v-if="item.dateList.isOpen == 1">待开放</div>
+                      <div>
+                            <div class="date-day-set" v-if="item.dateList.isOpen == 1">待开放</div>
                       <div
                         class="date-day-set"
                         style="color:#FF6465"
                         v-if="item.dateList.isOpen == 0"
                       >不开放</div>
+                      </div>
                     </div>
                   </el-popover>
                 </div>
@@ -245,7 +243,7 @@
             </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.haveNum}}</span>
               <span class="tr-slogn">饱和:{{FindHaveTeacherList.arrangeDetail.miniNum}}</span>
             </div>
           </div>
@@ -281,7 +279,7 @@
           <!-- <div class="btsnius">
             <div class="yesBtn">确定</div>
             <div class="closeBtn">取消</div>
-          </div> -->
+          </div>-->
         </div>
       </div>
     </div>
@@ -301,14 +299,14 @@
               />
               <span @click="SearchNoHaveTeacher()" class="DaySeachIcon el-icon-search"></span>
             </div>
-          <div>
+            <div>
               <span
-              style="font-size:12px;text-align:left;font-weight:700"
-              class
-            >最少:{{FindNoHaveTeacherList.arrangeDetail.miniNum}}</span>
-            <span class="tr-slogn">饱和:{{FindNoHaveTeacherList.arrangeDetail.maxNum}}</span>
-            <span class="tr-slogn">已选:{{FindNoHaveTeacherList.arrangeDetail.haveNum}}</span>
-          </div>
+                style="font-size:12px;text-align:left;font-weight:700"
+                class
+              >最少:{{FindNoHaveTeacherList.arrangeDetail.miniNum}}</span>
+              <span class="tr-slogn">饱和:{{FindNoHaveTeacherList.arrangeDetail.maxNum}}</span>
+              <span class="tr-slogn">已选:{{FindNoHaveTeacherList.arrangeDetail.haveNum}}</span>
+            </div>
           </div>
           <div>
             <img src="../../assets/img/del@2x.png" alt @click="allShowModel(4)" />
@@ -351,7 +349,7 @@
           </div>
           <div class="btsnius">
             <div @click="GetAddArrangeByTeacherStatus()" class="yesBtn">确定</div>
-            <div @click="allShowModel(4)"  class="closeBtn">取消</div>
+            <div @click="allShowModel(4)" class="closeBtn">取消</div>
           </div>
         </div>
       </div>
@@ -369,7 +367,7 @@
               class="model-text-items-close"
             />
           </div>
-          <div>是否确定将{{name}}老师移除?</div>
+          <div>是否确定将{{this.DetailteacherName}}老师移除?</div>
         </div>
         <div class="model-btn">
           <div class="model-btn-items main-gay" @click="DetetaiApplyOperate()">是</div>
@@ -381,9 +379,11 @@
 </template>
 <script>
 import { mapGetters, mapActions } from "vuex";
+import SuperworkListSeting from "@/components/SuperworkListSeting.vue";
 import { IMG_BASE_URL } from "@/ImgConfig";
+import { Message } from "element-ui";
 export default {
-  components: {},
+  components: {SuperworkListSeting},
   name: "actvResolveLabel",
   props: {},
   data() {
@@ -392,7 +392,7 @@ export default {
       Nowyear: new Date().getFullYear(),
       D: new Date().getDate() + " ",
       Nowmonth: new Date().getMonth() + 1,
-        NowHours: new Date().getHours(),
+      NowHours: new Date().getHours(),
       isSelected: false,
       BASE_URL: IMG_BASE_URL,
       selMonth: "",
@@ -403,7 +403,7 @@ export default {
       gardeListDownage: false,
       AddTeacherModel: false,
       modelindex: 0,
-      selecttitlepag: "匹配知识点",
+      selecttitlepag: "批改老师",
       selecttitleage: "语文",
       current: {}, // 当前时间
       weekList: ["一", "二", "三", "四", "五", "六", "日"],
@@ -414,8 +414,10 @@ export default {
       today: "",
       teacherIds: [],
       detetaiTeacherid: [],
+      DetailteacherName:'',
       gridData: [],
       SettingDays: [],
+      setrefultList:[],
       filters: {
         actvNm: "",
         actvCrtUserId: "",
@@ -451,11 +453,6 @@ export default {
           value: "1",
           label: "批改老师",
           str: "8"
-        },
-        {
-          value: "2",
-          label: "全部"
-          // str:''
         }
       ],
       grades: [
@@ -474,11 +471,6 @@ export default {
           label: "英语",
           str: "英语"
         },
-        {
-          value: "3",
-          label: "全部"
-          // str:""
-        }
       ],
       allotList: {
         pageNo: 1,
@@ -498,10 +490,41 @@ export default {
       }
     };
   },
+  created() {
+    this.GetFindCalendarListInfo();
+    this.GetDutyTemplateListInfo()
+  },
   watch: {
-       SaveSysTeacherDutyStatus(val, oldVal) {
+    SaveSysTeacherDutyStatus(val, oldVal) {
       //保存排班设置成功的watch监听回调
-      this.GetDutyTemplateListInfo()
+      this.GetDutyTemplateListInfo();
+    },
+    DutyTemplateListSTUS(val, oldVal) {
+      // debugger
+      //排班列表请求成功的watch监听回调
+      this.init();
+    },
+       DeleteArrangeByTeacher(val, oldVal) {
+      // debugger
+      //保存排班设置成功的watch监听回调
+      this.GetFindCalendarListInfo();
+    },
+      AddArrangeByTeacherStatus(val, oldVal) {
+      // debugger
+      //保存排班设置成功的watch监听回调
+      this.GetFindCalendarListInfo();
+    },
+    TeacherThisMonthDutyREfultInfo(val, oldVal) {
+           var that = this;
+          if (that.DutyTemplateListInfo && that.DutyTemplateListInfo.dayList){
+          for (let t = 0; t < that.DutyTemplateListInfo.dayList.length; t++) {
+            if (that.DutyTemplateListInfo.dayList[t].isOpen == 0) {
+              this.SettingDays.push(that.DutyTemplateListInfo.dayList[t].day);
+            }
+        
+          }
+           
+        } 
     },
   },
   // ,'homeworkRecoveryList'
@@ -514,6 +537,9 @@ export default {
       "AddArrangeByTeacherStatus",
       "SaveSysTeacherDutyStatus",
       "DutyTemplateListInfo",
+      "DutyTemplateListSTUS",
+      "TeacherThisMonthDutyREfultInfo",
+      "DeleteArrangeByTeacher"
     ]),
     // 显示当前时间
     currentDateStr() {
@@ -528,45 +554,53 @@ export default {
       return "table-head-th";
     },
     //弹框
-    isShow(str, id) {
+    isShow(str, id, timeFnd,DaytimeFn) {
       let _this = this;
       if (str == 1) {
-        _this.isApporTeacher = true;
-        this.HaveTeacherList.Teacherid = id;
-        this.GetFindHaveTeacherListInfo();
+       if (timeFnd < -4 && DaytimeFn <= 0 || DaytimeFn < 0 ){
+          _this.isApporTeacher = true;
+             this.HaveTeacherList.teacherName = '';
+          this.HaveTeacherList.Teacherid = id;
+          this.GetFindHaveTeacherListInfo();
+        } else {
+          Message.error("请提前4小时开始排班,当前时间已关闭不可操作!");
+        }
       }
     },
     // 添加老师勾选数组
-        async  DetetaiOrAddeacherTeam(item, type) {
+    async DetetaiOrAddeacherTeam(item, type) {
       if (type == 1) {
-        const index =  this.teacherIds.indexOf(item.teacherId);
+        const index = this.teacherIds.indexOf(item.teacherId);
         if (index > -1) {
-           this.teacherIds.splice(index, 1);
+          this.teacherIds.splice(index, 1);
         }
-      //   item.dateList.isOpen = 1 
-      // this.$set(this.setCalendarList.dateList, Setindex, item);
+        //   item.dateList.isOpen = 1
+        // this.$set(this.setCalendarList.dateList, Setindex, item);
       }
       if (type == 2) {
-        const index =  this.teacherIds.indexOf(item.teacherId);
+        const index = this.teacherIds.indexOf(item.teacherId);
         if (index == -1) {
-           this.teacherIds.push(item.teacherId);
+          this.teacherIds.push(item.teacherId);
         }
-      //   item.dateList.isOpen = 0 
-      // this.$set(this.setCalendarList.dateList, Setindex, item);
+        //   item.dateList.isOpen = 0
+        // this.$set(this.setCalendarList.dateList, Setindex, item);
       }
     },
     showAddTeacherModel() {
+      this.NoHaveTeacherList.teacherName = ''
       this.isApporTeacher = false;
       this.AddTeacherModel = true;
       this.GetFindNoHaveTeacherListInfo();
     },
     // 时段移除老师
     detailTeacherTeam(item) {
+        this.DetailteacherName =  item.teacherName;
       this.isApporTeacher = false;
       this.hiddenModel = true;
       this.detetaiTeacherid = item.teacherId;
     },
     DetetaiApplyOperate() {
+      this.hiddenModel = false;
       this.$store.dispatch("GetDeleteArrangeByTeacher", {
         id: this.HaveTeacherList.Teacherid,
         teacherId: this.detetaiTeacherid
@@ -581,6 +615,7 @@ export default {
       } else if (str == 2) {
         _this.isPigai = false;
       } else if (str == 3) {
+        this.HaveTeacherList.teacherName = '';
         _this.isApporTeacher = false;
       } else if (str == 4) {
         _this.AddTeacherModel = false;
@@ -589,6 +624,43 @@ export default {
         _this.NoAllotManagerModel = false;
       }
     },
+    timeFn(d1) {
+      //di作为一个变量传进来
+      //如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
+      var dateBegin = new Date(d1.replace(/-/g, "/")); //将-转化为/,使用new Date
+      var dateEnd = new Date(); //获取当前时间
+      var dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
+      var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000)); //计算出相差天数
+      var leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
+      var hours = Math.floor(leave1 / (3600 * 1000)); //计算出小时数
+      //计算相差分钟数
+      var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
+      var minutes = Math.floor(leave2 / (60 * 1000)); //计算相差分钟数
+      //计算相差秒数
+      var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
+      var seconds = Math.round(leave3 / 1000);
+      return hours;
+      // console.log(" 相差" + dayDiff + "天" + hours + "小时 " + minutes + "分钟" + seconds + " 秒")
+      // console.log(dateDiff + "时间差的毫秒数",dayDiff + "计算出相差天数",leave1 + "计算天数后剩余的毫秒数"
+      //     ,hours + "计算出小时数",minutes + "计算相差分钟数",seconds + "计算相差秒数");
+    },
+            DaytimeFn (d1) {//di作为一个变量传进来
+    //如果时间格式是正确的,那下面这一步转化时间格式就可以不用了
+    var dateBegin = new Date(d1.replace(/-/g, "/"));//将-转化为/,使用new Date
+    var dateEnd = new Date();//获取当前时间
+    var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
+    var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000));//计算出相差天数
+    var leave1 = dateDiff % (24 * 3600 * 1000)    //计算天数后剩余的毫秒数
+    var hours = Math.floor(leave1 / (3600 * 1000))//计算出小时数
+    //计算相差分钟数
+    var leave2 = leave1 % (3600 * 1000)    //计算小时数后剩余的毫秒数
+    var minutes = Math.floor(leave2 / (60 * 1000))//计算相差分钟数
+    //计算相差秒数
+    var leave3 = leave2 % (60 * 1000)      //计算分钟数后剩余的毫秒数
+    var seconds = Math.round(leave3 / 1000)
+    // return hours
+    return dayDiff
+},
     // 获取校区管理员排班表
     async GetFindCalendarListInfo() {
       this.$store.dispatch("GetFindCalendarList", {
@@ -612,6 +684,7 @@ export default {
     },
     // 时段添加老师
     async GetAddArrangeByTeacherStatus() {
+        this.AddTeacherModel = false
       this.$store.dispatch("GetAddArrangeByTeacher", {
         id: this.HaveTeacherList.Teacherid,
         teacherIds: this.teacherIds
@@ -623,28 +696,28 @@ export default {
         days: this.SettingDays
       });
     },
-    async UnOrWaitOpen(item, type,Setindex) {
+        async UnOrWaitOpen(item, type, Setindex) {
       if (type == 1) {
         const index = this.SettingDays.indexOf(item.value);
         if (index > -1) {
           this.SettingDays.splice(index, 1);
         }
-        item.dateList.isOpen = 1 
-      this.$set(this.setCalendarList.dateList, Setindex, item);
+        item.dateList.isOpen = 1;
+        this.$set(this.setCalendarList.dateList, Setindex, item);
       }
       if (type == 2) {
         const index = this.SettingDays.indexOf(item.value);
         if (index == -1) {
           this.SettingDays.push(item.value);
         }
-        item.dateList.isOpen = 0 
-      this.$set(this.setCalendarList.dateList, Setindex, item);
+        item.dateList.isOpen = 0;
+        this.$set(this.setCalendarList.dateList, Setindex, item);
       }
     },
-      // 排班设置返回接口
+    // 排班设置返回接口
     async GetDutyTemplateListInfo() {
-      this.$store.dispatch("GetDutyTemplateList", {
-      });
+        this.SettingDays = []
+      this.$store.dispatch("GetDutyTemplateList", {});
     },
     SearchNoHaveTeacher() {
       this.GetFindNoHaveTeacherListInfo();
@@ -665,18 +738,19 @@ export default {
       this.gardeListDownage = false;
     },
     selectTitle(k) {
-     this.modelindex = k;
-      if (k == 0){
-            if (this.Nowmonth !== this.current.month + 1) {
-           this.prevMonth()
-            }
-              this.GetFindCalendarListInfo();
+      this.modelindex = k;
+      if (k == 0) {
+        if (this.Nowmonth !== this.current.month + 1) {
+          this.prevMonth();
+        }
+        this.GetFindCalendarListInfo();
       }
-      if (k == 1){
-         if (this.Nowmonth == this.current.month + 1) {
-            this.nextMonth()
-            }
-          this.GetDutyTemplateListInfo()
+      if (k == 1) {
+        if (this.Nowmonth == this.current.month + 1) {
+          this.nextMonth();
+        }
+        this.SettingDays = []
+        this.GetDutyTemplateListInfo();
       }
     },
     selectTip(item) {
@@ -850,8 +924,9 @@ export default {
           year: year,
           month: curMonth,
           date: date,
-          disable: curMonth !== month,
+          disable: curMonth !== month ,
           status: false,
+          pastDay: date < today && curMonth == month,
           value: this.stringify(year, curMonth, date)
         });
         // 排班设置
@@ -866,19 +941,23 @@ export default {
         begin += oneDayMS;
       }
       var that = this;
+        if (that.FindCalendarList && that.FindCalendarList.list){
       for (let i = 0; i < list.length; i++) {
         if (!list[i].disable) {
-          const dateValue = list[i].value + " 00:00:00";
+          const dateValue = list[i].value;
           for (let t = 0; t < that.FindCalendarList.list.length; t++) {
             if (dateValue == that.FindCalendarList.list[t].arrangeDate) {
               list[i].dateList = that.FindCalendarList.list[t];
+              console.log(list[i].dateList)
             }
           }
         } else {
           list[i].dateList = {};
         }
       }
-         for (let i = 0; i < setList.length; i++) {
+        }
+     if (that.DutyTemplateListInfo && that.DutyTemplateListInfo.dayList){
+        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++) {
@@ -890,12 +969,13 @@ export default {
           setList[i].dateList = {};
         }
       }
+     }
       this.calendarList = list;
       this.setCalendarList = setList;
     },
     // 排班点击
     classSet(k, d, m, intervalList) {
-      // console.log(k,d,m)
+      console.log(k,d,m)
       this.month = m + 1;
       this.today = d;
       for (var i in this.calendarList) {
@@ -913,10 +993,9 @@ export default {
     }
   },
   mounted() {
+    // debugger
     sessionStorage.setItem("tabIndex", 5);
-    this.init();
-    this.GetFindCalendarListInfo();
-       console.log("hahahahhahahahah")
+
     // console.log(DutyTemplateListInfo)
   }
 };
@@ -1118,6 +1197,7 @@ el-table {
   border-left: 1px solid #e5e5e5;
 }
 .calendar-item {
+  cursor: pointer;
   float: left;
   width: 14.28%;
   height: 130px;
@@ -1132,11 +1212,15 @@ el-table {
   line-height: 130px;
 }
 .calendar-item.disabled {
-  color: #ffff;
+   color:#fff;
 }
 .checked {
   background: #f6f7fb;
 }
+.psatchecked{
+    color: rgba(0, 0, 0, 0.3);
+     opacity: 0.5;
+}
 .date-day {
   font-size: 16px;
   line-height: 60px;
@@ -1175,18 +1259,18 @@ el-table {
   cursor: pointer;
 }
 .date-set > div {
-  height: 40px;
-  line-height: 40px;
+  height: 30px;
+  line-height: 30px;
   /* width: 100%; */
   color: #393939;
   font-size: 16px;
-  margin: 25px;
+  margin: 25px 0px;
   /* background-color: #52cc60; */
 }
 .date-set > div:hover {
   background-color: #52cc60;
   color: #fff;
-  font-size: 25px;
+  /* font-size: 25px; */
 }
 .date-day-set {
   line-height: 40px;
@@ -1207,6 +1291,14 @@ el-table {
 .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;
+  margin:0 auto;
+  color: #fff;
 }
 .abbTeachers {
   width: 100%;

+ 9 - 13
src/pages/super/SchoolManager.vue

@@ -623,6 +623,8 @@
           </el-col>
         </el-row>
       </el-col>
+        <!-- 组内排班 -->
+             <TeamworkScheduling v-if="this.modelindex == 3"></TeamworkScheduling>
       <!-- 分页显示 -->
     </el-row>
     <!--可分配老师-->
@@ -1089,8 +1091,9 @@
 <script>
 import { mapGetters, mapActions } from "vuex";
 import { IMG_BASE_URL, APPOR_BASE_URL } from "@/ImgConfig";
+import TeamworkScheduling from "@/components/TeamworkScheduling";
 export default {
-  components: {},
+  components: {TeamworkScheduling},
   name: "actvResolveLabel",
   props: {},
   data() {
@@ -1125,8 +1128,8 @@ export default {
       isDown: false,
       gardeListDown: false,
       gardeListDownage: false,
-      selecttitlepag: "选年级",
-      selecttitleage: "选科目",
+      selecttitlepag: "批改老师",
+      selecttitleage: "语文",
       teachList: [],
       TeacherType: 8,
       TeacherCheackStyle: 2,
@@ -1152,11 +1155,6 @@ export default {
           label: "5~6年级",
           str: "五年级,六年级"
         },
-        {
-          value: "3",
-          label: "全部"
-          // str:'全部'
-        }
       ],
       grades: [
         {
@@ -1174,11 +1172,6 @@ export default {
           label: "英语",
           str: "英语"
         },
-        {
-          value: "3",
-          label: "全部"
-          // str:""
-        }
       ],
       ItemList: [
         {
@@ -1189,6 +1182,9 @@ export default {
         },
         {
           text: "当月"
+        },
+           {
+          text: "组内排班"
         }
       ],
       filters: {

+ 2 - 2
src/pages/super/SuperAdmin.vue

@@ -84,7 +84,7 @@
                 <span v-if="parseInt(getManagerList.pageNo)>1">{{scope.row.status}}</span>
             </template>
           </el-table-column>
-          <el-table-column prop="status" label="" header-align="center" width="250">
+          <el-table-column prop="status" label="" header-align="center" width="350">
             <template slot-scope="scope">
                  <div class="UpTeacherTeam"  @click="groupDetail(scope.row.managerId)">
                   <span>小组详情</span>
@@ -615,7 +615,7 @@
 .UpTeacherIDiNfo {
   display: inline-block;
   height: 40px;
-  width: 120px;
+  width: 150px;
   color: #fff;
   background-color: #67c23a;
   border-color: #67c23a;

+ 3 - 0
src/store/getters.js

@@ -51,5 +51,8 @@ const getters = {
   AddArrangeByTeacherStatus:state => state.scheduling.AddArrangeByTeacherStatus,
   SaveSysTeacherDutyStatus:state => state.scheduling.SaveSysTeacherDutyStatus,
   DutyTemplateListInfo:state => state.scheduling.DutyTemplateListInfo,
+  DutyTemplateListSTUS:state => state.scheduling.DutyTemplateListSTUS,
+  TeacherThisMonthDutySucess:state => state.scheduling.TeacherThisMonthDutySucess,
+  TeacherThisMonthDutyREfultInfo:state => state.scheduling.TeacherThisMonthDutyREfultInfo,
 }
 export default getters

+ 22 - 3
src/store/modules/scheduling .js

@@ -18,7 +18,10 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
       DeleteArrangeByTeacher:'',
       AddArrangeByTeacherStatus:'',
       SaveSysTeacherDutyStatus:'',
-      DutyTemplateListInfo:[]
+      DutyTemplateListInfo:[],
+      DutyTemplateListSTUS:'',
+      TeacherThisMonthDutySucess:'',
+      TeacherThisMonthDutyREfultInfo:""
     },
   
     mutations: {
@@ -50,6 +53,18 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
         // debugger
         state.DutyTemplateListInfo = DutyTemplateListInfo
       },
+      SET_TEMPIATE_TEACHER_STATUS:(state, DutyTemplateListSTUS) => {
+        // debugger
+        state.DutyTemplateListSTUS = DutyTemplateListSTUS
+      },
+      SET__THISMONTHDUSTYLISTR_INFO:(state, TeacherThisMonthDutySucess) => {
+        // debugger
+        state.TeacherThisMonthDutySucess = TeacherThisMonthDutySucess
+      },
+      SET_TEMPIATE_TEACHER_REFULT:(state, TeacherThisMonthDutyREfultInfo) => {
+        // debugger
+        state.TeacherThisMonthDutyREfultInfo = TeacherThisMonthDutyREfultInfo
+      },
     },
   
     actions: {
@@ -60,6 +75,7 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
           const data = response.data || {}
           if (response.code === "999"){
             // debugger
+            commit('SET_TEMPIATE_TEACHER_STATUS',new Date());
             commit('SET_CALENDAR_LIST', data);
           }
         }).catch(error => {
@@ -69,6 +85,7 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
     },
       // 已选时段老师列表(校区管理员)
       GetFindHaveTeacherList({ commit, state }, data) {
+        commit('SET_HAVETEACHER_LIST', []);
         return new Promise((resolve, reject) => {
           axios.post(FindHaveTeacherList, data).then(response => {
             const data = response.data || {}
@@ -115,6 +132,7 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
             const data = response.data || {}
             if (response.code == "999"){
               commit('SET_THISMONTHDUSTYLIST', data);
+              commit('SET__THISMONTHDUSTYLISTR_INFO', new Date());
             }
           }).catch(error => {
             reject(error)
@@ -126,8 +144,8 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
         return new Promise((resolve, reject) => {
           axios.post(DeleteArrangeByTeacher, data).then(response => {
             const data = response || {}
-            if (data.code === "999"){
-              // debugger
+            if (data.code == "999"){
+              Message.success(response.msg)
               commit('SET_DELETETEABTEACHER_INFO', new Date());
             }
           }).catch(error => {
@@ -181,6 +199,7 @@ import {FindCalendarList,FindHaveTeacherList,FindNoHaveTeacherList,
               // debugger
               Message.success(response.msg)
               commit('SET_TEMPIATE_TEACHER_DUTY',data);
+              commit('SET_TEMPIATE_TEACHER_REFULT',new Date());
             }
           }).catch(error => {
             reject(error)