wuhongyu 4 years ago
parent
commit
850d4f1697
3 changed files with 10 additions and 38 deletions
  1. 5 15
      src/layout/user/leaveRequest.vue
  2. 2 10
      src/views/index.vue
  3. 3 13
      src/views/user/index.vue

+ 5 - 15
src/layout/user/leaveRequest.vue

@@ -40,6 +40,7 @@
 </template>
 
 <script>
+import moment from 'moment';
 export default {
   name: 'leaveRequest',
   props: {
@@ -69,26 +70,15 @@ export default {
     },
     // 确认选择之后的时间
     birthdayPicker(val) {
-      let year = val.getFullYear();
-      let month = val.getMonth() + 1;
-      let day = val.getDate();
-      let Hours = val.getHours();
-      let getMinutes = val.getMinutes();
-      console.log(Hours);
-
-      let starttime = `${year}-${month}-${day}-${Hours}-${getMinutes}`;
+      let starttime = moment(val).format('YYYY-MM-DD HH:mm');
+      console.log(starttime);
 
       this.$set(this.form, `starttime`, starttime);
       this.birthdayShow = false;
     },
     birthdayPickers(val) {
-      let year = val.getFullYear();
-      let month = val.getMonth() + 1;
-      let day = val.getDate();
-      let Hours = val.getHours();
-      let getMinutes = val.getMinutes();
-      console.log(Hours);
-      let endtime = `${year}-${month}-${day}-${Hours}-${getMinutes}`;
+      let endtime = moment(val).format('YYYY-MM-DD HH:mm');
+
       this.$set(this.form, `endtime`, endtime);
       this.endbirthdayshow = false;
     },

+ 2 - 10
src/views/index.vue

@@ -8,9 +8,7 @@
         <el-col :span="24" class="main" v-if="view === 'arrange'">
           <mainData :lesson="lesson" :today="today" :arrange="arrange" @getLesson="getLesson"></mainData>
         </el-col>
-        <el-col :span="24" class="main" v-if="view === 'class'">
-          <teaClass :classList="classList" @turnto="turnto" title="查看班级"></teaClass>
-        </el-col>
+
         <el-col :span="24" class="foot">
           <footInfo></footInfo>
         </el-col>
@@ -38,7 +36,6 @@ export default {
     NavBar, //头部导航
     footInfo, //底部导航
     mainData, //课程安排主体
-    teaClass,
   },
   data: () => ({
     view: 'class',
@@ -143,7 +140,6 @@ export default {
           return 0;
         }
       });
-      console.log(appArray);
 
       this.$set(this, `arrange`, _.compact(appArray));
     },
@@ -167,11 +163,7 @@ export default {
       var res = this.originLesson.filter(item => item.date === date.date);
       this.$set(this, `lesson`, res);
     },
-    //班主任获取班级列表
-    async getClass() {
-      const res = await this.classeslist({ headteacherid: this.user.userid });
-      this.$set(this, `classList`, res.data);
-    },
+
     turnto(data) {
       this.$set(this, `classid`, data._id);
       this.searchInfo();

+ 3 - 13
src/views/user/index.vue

@@ -75,19 +75,9 @@ export default {
     async searchSite() {
       // 1:班主任,4:学生
       console.log(this.user);
-      if (this.user.type === '1') {
-        const res = await this.directorFetch(this.user.userid);
-        const arr = await this.deptFetch(res.data.department);
-        res.data.department = arr.data.name;
-        this.$set(this, `teainfo`, res.data);
-      } else if (this.user.type === '4') {
-        const res = await this.studentFetch(this.user.userid);
-        this.$set(this, `info`, res.data);
-      } else if (this.user.type === '3') {
-        const res = await this.teacherfetch(this.user.userid);
-        console.log(res.data);
-        this.$set(this, `jiaoshiinfo`, res.data);
-      }
+
+      const res = await this.studentFetch(this.user.userid);
+      this.$set(this, `info`, res.data);
     },
   },
 };