Browse Source

04/11 对外教学

11
Xiao_Mo 5 years ago
parent
commit
238766dde7

+ 8 - 0
src/api/afterSchool.js

@@ -26,4 +26,12 @@ export function findStudentExtraExerciseDetail(data) {
       method: 'get',
       params: data
     })
+}
+// 课外训练(教学)
+export function findStudentExtracurricularExercisesSituations(data) {
+  return request({
+    url: api + '/exercisesSituation/findStudentExtracurricularExercisesSituations',
+    method: 'get',
+    params: data
+  })
 }

+ 1 - 3
src/views/afterSchoolManager/afterSchoolList.vue

@@ -249,9 +249,7 @@ export default {
       let rules = JSON.stringify(this.rules);
       let searchForm = JSON.stringify(this.searchForm);
       this.$router.push({path:'/business/afterSchoolDetail',query:{extracurricularExercisesId:row.id,rules,searchForm,title:row.title}})
-      // this.extracurricularExercisesId
-      // getExtracurricularExercisesId
-      // this.$emit('getExtracurricularExercisesId',row.id)
+
     }
   }
 };

+ 238 - 49
src/views/afterSchoolManager/afterSchoolTeach.vue

@@ -7,7 +7,7 @@
           <el-input
             v-model.trim="searchForm.search"
             @keyup.enter.native="search"
-            placeholder="学生姓名"
+            placeholder="学生姓名 老师姓名"
           ></el-input>
         </el-form-item>
         <el-form-item prop="organId">
@@ -26,17 +26,32 @@
             ></el-option>
           </el-select>
         </el-form-item>
-
         <el-form-item>
-          <el-select placeholder="预期安排" v-model="searchForm.status" clearable>
-            <el-option label="是" value="1"></el-option>
-            <el-option label="否" value="0"></el-option>
+          <el-select placeholder="实际安排" v-model="searchForm.actualExercisesNumIsAchieve" clearable>
+            <el-option label="符合预期" value="1"></el-option>
+            <el-option label="不符合预期" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select placeholder="提交次数" v-model="searchForm.exercisesReplyNumIsAchieve" clearable>
+            <el-option label="符合预期" value="1"></el-option>
+            <el-option label="不符合预期" value="0"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-select placeholder="实际安排" v-model="searchForm.isReplied" clearable>
-            <el-option label="是" value="1"></el-option>
-            <el-option label="否" value="0"></el-option>
+          <el-select placeholder="评价次数" v-model="searchForm.exercisesMessageNumIsAchieve" clearable>
+            <el-option label="符合预期" value="1"></el-option>
+            <el-option label="不符合预期" value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            placeholder="及时评价"
+            v-model="searchForm.exercisesMessageTimelyNumIsAchieve"
+            clearable
+          >
+            <el-option label="符合预期" value="1"></el-option>
+            <el-option label="不符合预期" value="0"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="周次选择">
@@ -51,6 +66,7 @@
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
+            @change="getWeekTime"
           ></el-date-picker>
         </el-form-item>
         <el-form-item>
@@ -59,7 +75,7 @@
           <el-button
             @click="onExport"
             type="primary"
-            v-permission="'export/extraExercisesReplys'"
+            v-permission="'export/exercisesSituations'"
             style=" background: #14928a; border:1px solid #14928a;"
           >导出</el-button>
         </el-form-item>
@@ -70,51 +86,33 @@
           :header-cell-style="{background:'#EDEEF0',color:'#444'}"
           :data="tableList"
         >
-          <el-table-column align="center" prop="createTime" label="布置时间" width="150">
-            <template slot-scope="scope">
-              <div>
-                {{scope.row.createTime | dateForMinFormat}}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" prop="expireDate" label="截止时间" width="150">
-            <template slot-scope="scope">
-              <div>
-                {{scope.row.createTime | dateForMinFormat}}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" prop="title" label="训练标题">
+          <el-table-column align="center" prop="studentId" label="学员编号"></el-table-column>
+          <el-table-column align="center" prop="studentName" label="学生姓名"></el-table-column>
+          <el-table-column align="center" prop="organName" label="所属分部"></el-table-column>
+          <el-table-column align="center" prop="teacherName" label="指导老师"></el-table-column>
+          <el-table-column align="center" prop label="预期安排">
             <template slot-scope="scope">
-              <div>
-                <div
-                  v-if="scope.row.extracurricularExercises"
-                >{{scope.row.extracurricularExercises.title}}</div>
-              </div>
+              <div>{{scope.row.expectExercisesNum+'次'}}</div>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="teacherName" label="老师"></el-table-column>
-          <el-table-column align="center" prop="organName" label="分部"></el-table-column>
-          <el-table-column align="center" prop="createTime" label="学生姓名">
+          <el-table-column align="center" prop label="实际安排">
             <template slot-scope="scope">
-              <div>
-                <div v-if="scope.row.user">{{scope.row.user.username}}</div>
-              </div>
+              <div>{{scope.row.actualExercisesNum+'次'}}</div>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="提交作业">
+          <el-table-column align="center" prop label="提交次数">
             <template slot-scope="scope">
-              <div>{{scope.row.status?'是':'否'}}</div>
+              <div>{{scope.row.exercisesReplyNum+'次'}}</div>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="isReplied" label="是否回复">
+          <el-table-column align="center" prop label="评价次数">
             <template slot-scope="scope">
-              <div>{{scope.row.isReplied?'是':'否'}}</div>
+              <div>{{scope.row.exercisesMessageNum+'次'}}</div>
             </template>
           </el-table-column>
-          <el-table-column align="center" prop="isView" label="是否查看">
+          <el-table-column align="center" prop label="及时评价次数">
             <template slot-scope="scope">
-              <div>{{scope.row.isView?'是':'否'}}</div>
+              <div>{{scope.row.exercisesMessageNum+'次'}}</div>
             </template>
           </el-table-column>
           <!-- <el-table-column align="center" prop="teacherName" label="老师姓名">
@@ -124,7 +122,7 @@
           </el-table-column>-->
           <el-table-column align="center" label="操作">
             <template slot-scope="scope">
-              <div>
+              <div v-if="scope.row.actualExercisesNum >0">
                 <el-button type="text" @click="lookDetail(scope.row)">查看</el-button>
               </div>
             </template>
@@ -143,7 +141,19 @@
 </template>
 
 <script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
+import { getEmployeeOrgan } from "@/api/buildTeam";
+import { findStudentExtracurricularExercisesSituations } from "@/api/afterSchool";
+// findStudentExtracurricularExercisesSituations
+let nowTime = new Date();
+nowTime =
+  nowTime.getFullYear() +
+  "-" +
+  (nowTime.getMonth() + 1) +
+  "-" +
+  nowTime.getDate();
 export default {
   components: { pagination },
   data() {
@@ -152,9 +162,13 @@ export default {
       searchForm: {
         timer: [],
         search: null,
-        status: null
+        actualExercisesNumIsAchieve: null, // 训练次数
+        exercisesMessageNumIsAchieve: null, //评价
+        exercisesMessageTimelyNumIsAchieve: null, //及时评价
+        exercisesReplyNumIsAchieve: null // 提交次数
       },
       organList: [],
+      teacherList: [],
       rules: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -165,16 +179,191 @@ export default {
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+    // 设置默认为当前周
+  },
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
+  mounted() {
+    this.searchForm.timer = [];
+    this.searchForm.timer.push(this.getNowDateAndMonday(nowTime));
+    this.searchForm.timer.push(this.getNowDateAndSunday(nowTime));
+    getEmployeeOrgan().then(res => {
+      if (res.code == 200) {
+        this.organList = res.data;
+      }
+    });
+    // 获取分部  老师
+    this.init();
+  },
+  activated() {
+    this.init();
+  },
   methods: {
-    getList() {},
+    init() {
+      this.getList();
+    },
+    getDate(){
+      let obj = {
+        search: this.searchForm.search || null,
+        actualExercisesNumIsAchieve:
+          this.searchForm.actualExercisesNumIsAchieve || null, // 训练次数
+        exercisesMessageNumIsAchieve:
+          this.searchForm.exercisesMessageNumIsAchieve || null, //评价
+        exercisesMessageTimelyNumIsAchieve:
+          this.searchForm.exercisesMessageTimelyNumIsAchieve || null, //及时评价
+        exercisesReplyNumIsAchieve:
+          this.searchForm.exercisesReplyNumIsAchieve || null // 提交次数
+      };
+      if (this.searchForm.timer && this.searchForm.timer.length > 0) {
+        obj.monday = this.searchForm.timer[0];
+        obj.sunday = this.searchForm.timer[1];
+      } else {
+        this.$message.error("请选择时间段");
+        return false;
+      }
+      return obj
+    },
+    getList()  {
+      let obj = this.getDate()
+      if(!obj)return
+      findStudentExtracurricularExercisesSituations(obj).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows;
+          this.rules.total = res.data.total;
+        }
+      });
+    },
+
+    onReSet() {
+      this.searchForm = {
+        timer: [],
+        search: null,
+        actualExercisesNumIsAchieve: null, // 训练次数
+        exercisesMessageNumIsAchieve: null, //评价
+        exercisesMessageTimelyNumIsAchieve: null, //及时评价
+        exercisesReplyNumIsAchieve: null // 提交次数
+      };
+      this.search();
+    },
 
-    onReSet() {},
+    onExport() {
+      let url = "/api-web/export/exercisesSituations";
+      let obj = this.getDate();
+      const options = {
+        method: "get",
+        headers: {
+          Authorization: getToken()
+        },
+        url,
+        params: obj,
+        responseType: "blob"
+      };
+
+      this.$confirm("您确定导出列表?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          axios(options).then(res => {
+            let blob = new Blob([res.data], {
+              // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
+              type: "application/vnd.ms-excel;charset=utf-8"
+              // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
+            });
+            let objectUrl = URL.createObjectURL(blob);
+            let link = document.createElement("a");
+            let nowTime = new Date();
+            let ymd =
+              nowTime.getFullYear() +
+              "" +
+              (nowTime.getMonth() + 1) +
+              "" +
+              nowTime.getDate() +
+              "" +
+              nowTime.getHours() +
+              "" +
+              nowTime.getMinutes();
+            let fname = ymd + "课外训练(教学)";
+            link.href = objectUrl;
+            link.setAttribute("download", fname);
+            document.body.appendChild(link);
+            link.click();
+          });
+        })
+        .catch(() => {});
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    getNowDateAndMonday(time) {
+      let timestamp = new Date(time.replace(/-/g, "/")).getTime();
+      let serverDate = new Date(time);
+      let mondayTime =
+        timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
+
+      let mondayData = new Date(mondayTime);
+      //年
+      let mondayY = mondayData.getFullYear();
+      //月
+      let mondayM =
+        mondayData.getMonth() + 1 < 10
+          ? "0" + (mondayData.getMonth() + 1)
+          : mondayData.getMonth() + 1;
+      //日
+      let mondayD =
+        mondayData.getDate() < 10
+          ? "0" + mondayData.getDate()
+          : mondayData.getDate();
+
+      let str = mondayY + "-" + mondayM + "-" + mondayD;
+      return str;
+    },
+    getNowDateAndSunday(time) {
+      let timestamp = new Date(time.replace(/-/g, "/")).getTime();
+      let serverDate = new Date(time);
+      let sundayTiem =
+        timestamp + (7 - serverDate.getDay()) * 24 * 60 * 60 * 1000;
+      let SundayData = new Date(sundayTiem);
+      //年
+      let tomorrowY = SundayData.getFullYear(); //月
+      let tomorrowM =
+        SundayData.getMonth() + 1 < 10
+          ? "0" + (SundayData.getMonth() + 1)
+          : SundayData.getMonth() + 1;
+      //日
+      let tomorrowD =
+        SundayData.getDate() < 10
+          ? "0" + SundayData.getDate()
+          : SundayData.getDate();
+      let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
+      return str;
+    },
+    getWeekTime(val) {
+      if (val && val.length > 0) {
+        let start = this.getNowDateAndMonday(val[0]);
+        let end = this.getNowDateAndSunday(val[1]);
+        this.searchForm.timer.splice(0, 1, start);
+        this.searchForm.timer.splice(1, 1, end);
+      }
+    },
+    lookDetail(row) {
+      // this.afterSchoolVisible = true;
 
-    onExport() {},
-    search() {}
+      let rules = JSON.stringify(this.rules);
+      let searchForm = JSON.stringify(this.searchForm);
+      this.$router.push({
+        path: "/business/afterSchoolDetail",
+        query: {
+          studentId: row.studentId,
+          rules,
+          searchForm,
+          title: row.studentName,
+          extracurricularExercisesId: "yes"
+        }
+      });
+    }
   }
 };
 </script>

+ 18 - 5
src/views/afterSchoolManager/afterWorkList.vue

@@ -5,7 +5,7 @@
       <div class="squrt"></div>课外作业
     </h2>-->
     <div class="m-core">
-      <el-form :inline="true" :model="searchForm" v-if="!extracurricularExercisesId">
+      <el-form :inline="true" :model="searchForm" v-if="show">
         <el-form-item>
           <el-input
             v-model.trim="searchForm.search"
@@ -85,8 +85,16 @@
           :header-cell-style="{background:'#EDEEF0',color:'#444'}"
           :data="tableList"
         >
-          <el-table-column align="center" prop="createTime" label="布置时间" width="150"></el-table-column>
-          <el-table-column align="center" prop="expireDate" label="截止时间" width="150"></el-table-column>
+          <el-table-column align="center" prop="createTime" label="布置时间" width="150">
+            <template slot-scope="scope">
+              {{scope.row.createTime | dateForMinFormat}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="expireDate" label="截止时间" width="150">
+            <template slot-scope="scope">
+              {{scope.row.expireDate | dateForMinFormat}}
+            </template>
+          </el-table-column>
           <el-table-column align="center" prop="title" label="训练标题">
             <template slot-scope="scope">
               <div>
@@ -237,7 +245,8 @@ export default {
       afterSchoolVisible: false,
       workVisible: false,
       activeSrc: "",
-      extracurricularExercisesId: null
+      extracurricularExercisesId: null,
+      show:true
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -273,6 +282,10 @@ export default {
       //   this.searchForm.timer.push(endDate);
 
       this.extracurricularExercisesId = this.$route.query.extracurricularExercisesId;
+      if(this.extracurricularExercisesId){
+        this.show = false
+      }
+      this.searchForm.search = this.$route.query.studentId
       // console.log(this.$route.query)
       this.getList();
     },
@@ -352,7 +365,7 @@ export default {
         ? (obj.isReplied = this.searchForm.isReplied)
         : null;
       this.searchForm.isView ? (obj.isView = this.searchForm.isView) : null;
-      this.extracurricularExercisesId
+      this.extracurricularExercisesId&&this.extracurricularExercisesId !='yes'
         ? (obj.extracurricularExercisesId = this.extracurricularExercisesId)
         : null;
       this.searchForm.organIdList ? (obj.organIdList = this.searchForm.organIdList) : null;