lex-xin 4 éve
szülő
commit
2640656047

+ 9 - 1
src/api/teacher.js

@@ -464,6 +464,13 @@ const getCourseStudents = (data) => {
   })
 }
 
+const queryUserById = (params) => {
+  return axios({
+    url: '/api-auth/user/queryUserById/' + params.userId,
+    method: 'get'
+  })
+}
+
 export {
   queryMyCreatedList,
   queryWaitList,
@@ -515,5 +522,6 @@ export {
   queryDouble11Students,
   newsQuery,
   newsList,
-  getCourseStudents
+  getCourseStudents,
+  queryUserById
 }

+ 32 - 122
src/views/audition/ArrangeWork.vue

@@ -6,7 +6,7 @@
         <van-tag type="primary" plain style="background-color: #F1FCF9">课后训练</van-tag>
       </template>
     </van-cell>
-    <van-cell class="endTime" readonly is-link title-style="font-size: .16rem; color: #333333;">
+    <van-cell class="endTime" readonly is-link title-style="font-size: .16rem; color: #333333;" @click="studentStatus = true">
       <template #title>
         <span style="padding-right: .3rem">学员共<i style="font-style: normal; color: #01C1B5">{{ params.studentCount }}</i>人</span>
         <span>会员 <i style="font-style: normal; color: #FF802C">{{ params.studentMemberCount }}</i>人</span>
@@ -80,46 +80,9 @@
       :style="{ height: '180%' }"
     >
       <van-sticky>
-        <van-search
-          show-action
-          shape="round"
-          :left-icon="searchIcon"
-          @search="onSearch"
-          v-model="params.search"
-          placeholder="请输入学生名或手机号"
-        >
-          <template #action>
-            <div @click="onSearch">搜索</div>
-          </template>
-        </van-search>
+        <m-header name="学员列表" :backUrl="backUrlStudent" />
       </van-sticky>
-      <div class="paddingB80">
-        <van-cell-group v-if="dataShow">
-          <van-cell
-            v-for="(item, index) in dataList"
-            :key="index"
-            class="input-cell"
-            :center="true"
-          >
-            <template slot="icon">
-              <img class="logo" v-if="item.avatar" :src="item.avatar" alt="" />
-              <img class="logo" v-else src="@/assets/images/icon_student.png" alt="" />
-            </template>
-            <template slot="title">
-              <div class="studentName">
-                {{ item.userName }}
-              </div>
-            </template>
-            <template slot="label">
-              <span>{{ (item.phone) }}</span>
-            </template>
-          </van-cell>
-        </van-cell-group>
-        <m-empty class="empty" v-else key="data" />
-      </div>
-      <div class="button-group-popup">
-        <span class="btn">取消</span>
-      </div>
+      <student-list-model isHead :dataList="dataList" :dataSubjectList="dataSubjectList"></student-list-model>
     </van-popup>
   </div>
 </template>
@@ -130,11 +93,12 @@ import dayjs from "dayjs";
 import { addHomeWork } from '@/api/audition'
 import { getCourseStudents } from '@/api/teacher'
 import AccompanimentModal from './modal/accompanimentModal'
+import StudentListModel from './modal/studentList'
 import cleanDeep from 'clean-deep'
 import deepClone from '@/helpers/deep-clone'
 export default {
   name: "teacherList",
-  components: { MHeader, AccompanimentModal },
+  components: { MHeader, AccompanimentModal, StudentListModel },
   data() {
     let tempDate = new Date() // 默认显示T+3
     tempDate.setDate(tempDate.getDate() + 3)
@@ -147,6 +111,12 @@ export default {
           this.accompanimentStatus = false
         }
       },
+      backUrlStudent: {
+        status: true,
+        callBack: () => {
+          this.studentStatus = false
+        }
+      },
       classGroupName: query.classGroupName,
       courseId: query.courseId,
       dateSection: {
@@ -171,9 +141,9 @@ export default {
         subjectIdList: [],
         subjectList: []
       },
-      dataShow: true,
-      studentStatus: false,
       dataList: [],
+      dataSubjectList: [],
+      studentStatus: false,
     };
   },
   async mounted() {
@@ -223,11 +193,11 @@ export default {
       });
       // 默认选中第1条数据
       this.tabActive = deepClone(params.subjectIdList[0])
+      this.dataSubjectList = deepClone(params.subjectList)
       this.params = params
     })
   },
   methods: {
-
     onSelectAccompany(item, index) {
       this.accompanimentStatus = true
       this.tabActiveList = item
@@ -262,7 +232,7 @@ export default {
     onEndTime() {
       this.dateSection.status = true
     },
-    onSubmit: _throttle(function() {
+    onSubmit: _throttle(function(type) {
       if(!this.title) {
         this.$toast('请输入训练标题')
         return
@@ -290,10 +260,20 @@ export default {
           userIdList: subject.userIdList
         })
       })
-      if(notAccompanySong.length - subjectLength < 0 && notAccompanySong != 0) {
-        console.log('选择曲目')
+      if(notAccompanySong.length - subjectLength <= 0 && notAccompanySong != 0 && type[0] != 1) {
+        // console.log('选择曲目')
+        this.$dialog.confirm({
+          message: notAccompanySong.join(',') + '声部未选择云教练训练曲目,是否继续布置作业?',
+          confirmButtonColor: '#01C1B5'
+        }).then(() => {
+          // on confirm
+          this.onSubmit(1)
+        })
+        .catch(() => {
+          // on cancel
+        });
+        return
       }
-
       this.$toast.loading({
         message: '加载中...',
         duration: 10000,
@@ -408,10 +388,13 @@ export default {
   top: .15rem;
   left: 0.12rem;
 }
-
 /deep/.van-tab {
   font-size: 16px;
 }
+/deep/.van-popup--bottom {
+  border-radius: 0px 0px 0px 0px!important;
+  overflow: auto!important;
+}
 .accompanyHeader {
   font-size: .14rem;
   padding: .16rem .08rem .14rem;
@@ -433,78 +416,5 @@ export default {
   color: #666666;
 }
 
-.paddingB80 {
-  padding-bottom: 0.8rem;
-}
-.studentName {
-  font-size: 0.16rem;
-  color: #1a1a1a;
-  line-height: 0.22rem;
-}
-.studentContainer {
-  /deep/.van-cell__title {
-    font-size: 0.14rem;
-    color: @mFontColor;
-    // flex: 1 auto;
-  }
-
-  .logo {
-    width: 0.42rem;
-    height: 0.42rem;
-    margin-right: 0.12rem;
-    border-radius: 100%;
-  }
-
-  .input-cell {
-    padding: 0.2rem 0.16rem;
-
-    .van-radio {
-      justify-content: flex-end;
-    }
-  }
-
-  /deep/.van-cell__value {
-    height: 0.2rem;
-  }
-
-  /deep/.van-radio__icon .van-icon {
-    border-color: #d3d3d3;
-  }
-
-  /deep/.van-radio__icon--checked {
-    .van-icon {
-      border-color: @mColor;
-      background: @mColor;
-    }
-  }
 
-  .van-tag {
-    margin-left: 0.08rem;
-  }
-}
-.button-group-popup {
-  position: fixed;
-  bottom: 0;
-  padding: 0.2rem 0;
-  width: 100%;
-  text-align: center;
-  background-color: #ffffff;
-  .btn {
-    line-height: 0.5rem;
-    display: inline-block;
-    border: 1px solid @mColor;
-    width: 1.65rem;
-    border-radius: 0.4rem;
-    color: @mColor;
-    background: #fff;
-    font-size: 0.18rem;
-    &.primary {
-      color: #fff;
-      background: @mColor;
-    }
-  }
-  .btn + .btn {
-    margin-left: 0.1rem;
-  }
-}
 </style>

+ 240 - 0
src/views/audition/modal/studentList.vue

@@ -0,0 +1,240 @@
+<template>
+    <div class="studentList">
+        <van-sticky :offset-top="isHead ? '.46rem' : 0">
+            <van-dropdown-menu active-color="#01C1B5">
+                <van-dropdown-item v-model="value1" @change="getList" :options="option1" />
+                <van-dropdown-item v-model="value2" @change="getList" :options="option2" />
+            </van-dropdown-menu>
+            <!-- <van-search
+            show-action
+            shape="round"
+            :left-icon="searchIcon"
+            @search="onSearch"
+            v-model="search"
+            placeholder="请输入学生名或手机号"
+            >
+                <template #action>
+                    <div @click="onSearch">搜索</div>
+                </template>
+            </van-search> -->
+        </van-sticky>
+        <div class="paddingB80 studentContainer">
+            <van-cell-group v-if="dataShow">
+            <van-cell
+                v-for="(item, index) in dataListArray"
+                :key="index"
+                class="input-cell"
+                :center="true"
+            >
+                <template slot="icon">
+                    <img class="logo" v-if="item.headUrl" :src="item.headUrl" alt="" />
+                    <img class="logo" v-else src="@/assets/images/icon_student.png" alt="" />
+                </template>
+                <template slot="title">
+                    <div class="studentName">
+                        {{ item.name }}
+                        <div class='icon' v-if="item.memberRankSettingId">
+                            <img src='./icons/vip_icon.png' />
+                        </div>
+                    </div>
+                </template>
+                <template slot="label">
+                    <span>{{ (item.subjectName) }}</span>
+                </template>
+            </van-cell>
+            </van-cell-group>
+            <m-empty class="empty" v-else key="data" />
+        </div>
+        <!-- <div class="button-group-popup">
+            <span class="btn">取消</span>
+        </div> -->
+    </div>
+</template>
+
+<script>
+import MEmpty from "@/components/MEmpty"
+import deepClone from '@/helpers/deep-clone'
+export default {
+    props: {
+        isHead: {
+            type: Boolean,
+            default() {
+                return false
+            }
+        },
+        dataList: {
+            type: Array,
+            default() {
+                return []
+            }
+        },
+        dataSubjectList: {
+            type: Array,
+            default() {
+                return []
+            }
+        }
+    },
+    components: { MEmpty },
+    watch: {
+        dataList(newVal) {
+            this.dataListArray = newVal
+        }
+    },
+    data() {
+        return {
+            search: null,
+            value1: 0,
+            value2: 0,
+            option1: [
+                { text: '全部声部', value: 0 },
+            ],
+            option2: [
+                { text: '全部学员', value: 0 },
+                { text: '会员学员', value: 'b' },
+                { text: '非会员学员', value: 'c' },
+            ],
+            dataShow: true,
+            dataListArray: [],
+            allArray: [],
+            searchIcon: require("@/assets/images/search.png"),
+        }
+    },
+    mounted() {
+        this.dataListArray = this.dataList
+        console.log(this.dataList)
+        this.allArray = deepClone(this.dataList)
+        this.dataSubjectList.forEach(subject => {
+            this.option1.push({
+                text: subject.subjectName,
+                value: subject.id
+            })
+        })
+    },
+    methods: {
+        onSearch() {
+            this.getList()
+        },
+        getList() {
+            this.dataShow = true
+            let search = this.search,
+                subject = this.value1 ? this.value1 : null,
+                student = this.value2 ? this.value2 : null
+            let tempArray = []
+            let allArray = this.allArray
+            for(let i = 0; i < allArray.length; i++) {
+                if(search && allArray[i].name.indexOf(search) < 0) {
+                    break
+                }
+                if(subject && allArray[i].subjectIdList != subject) {
+                    break
+                }
+                if(student) {
+                    if(student == 'a' && !allArray[i].memberRankSettingId) {
+                        break
+                    } else if(student == 'c' && allArray[i].memberRankSettingId) {
+                        break
+                    }
+                }
+                tempArray.push(allArray[i])
+            }
+            this.dataListArray = tempArray
+            if(tempArray.length <= 0) {
+                this.dataShow = false
+            }
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+@import url("../../../assets/commonLess/variable.less");
+/deep/.van-search .van-cell {
+  padding: 5px 8px 5px 0 !important;
+}
+.paddingB80 {
+  padding-bottom: 0.8rem;
+}
+.studentName {
+  font-size: 0.16rem;
+  color: #1a1a1a;
+  line-height: 0.22rem;
+  display: flex;
+}
+.studentContainer {
+  /deep/.van-cell__title {
+    font-size: 0.14rem;
+    color: @mFontColor;
+    // flex: 1 auto;
+  }
+
+  .logo {
+    width: 0.42rem;
+    height: 0.42rem;
+    margin-right: 0.12rem;
+    border-radius: 100%;
+  }
+
+  .input-cell {
+    padding: 0.2rem 0.16rem;
+
+    .van-radio {
+      justify-content: flex-end;
+    }
+  }
+
+  /deep/.van-cell__value {
+    height: 0.2rem;
+  }
+
+  /deep/.van-radio__icon .van-icon {
+    border-color: #d3d3d3;
+  }
+
+  /deep/.van-radio__icon--checked {
+    .van-icon {
+      border-color: @mColor;
+      background: @mColor;
+    }
+  }
+
+  .icon{
+        display: flex;
+        align-items: center;
+        margin-left: .15rem;
+        img{
+            width: .4rem;
+            // margin-top: -.02rem;
+        }
+    }
+
+  .van-tag {
+    margin-left: 0.08rem;
+  }
+}
+.button-group-popup {
+  position: fixed;
+  bottom: 0;
+  padding: 0.2rem 0;
+  width: 100%;
+  text-align: center;
+  background-color: #ffffff;
+  .btn {
+    line-height: 0.5rem;
+    display: inline-block;
+    border: 1px solid @mColor;
+    width: 1.65rem;
+    border-radius: 0.4rem;
+    color: @mColor;
+    background: #fff;
+    font-size: 0.18rem;
+    &.primary {
+      color: #fff;
+      background: @mColor;
+    }
+  }
+  .btn + .btn {
+    margin-left: 0.1rem;
+  }
+}
+</style>

+ 17 - 7
src/views/visitManager/addVisit.vue

@@ -17,7 +17,7 @@
         v-model="studentName"
         readonly
         input-align="right"
-        :is-link="id || userId ? false : true"
+        :is-link="id || userId || studentId ? false : true"
         placeholder="请选择"
       >
         <template #right-icon>
@@ -199,6 +199,7 @@ import {
   queryStudentsWithTeacher,
   visitAdd,
   visitGetInfo,
+  queryUserById
 } from "@/api/teacher";
 import { queryUserInfo } from "@/api/app";
 import setLoading from "@/utils/loading";
@@ -210,11 +211,11 @@ export default {
   },
   data() {
     const query = this.$route.query;
-    // 如果有userId的时候说明是从评测详情进来的
     return {
       id: query.id,
       name: query.name,
-      userId: query.userId,
+      userId: query.userId, // 如果有userId的时候说明是从评测详情进来的
+      studentId: query.studentId, // 这个参数是从原生传过来的,单独做了处理
       inside: query.inside || 0,
       dataForm: {
         // 时间下拉框
@@ -257,6 +258,7 @@ export default {
       dataShow: true, // 是否有数据
       radioSelect: null,
       radioSelectName: null,
+      radioSelectPhone: null,
       clickStatus: false,
       dataList: [],
       searchIcon: require("@/assets/images/search.png"),
@@ -305,8 +307,14 @@ export default {
           this.$toast(res.msg);
         }
       }
-
-
+      let userId = this.userId || this.studentId
+      if(userId) {
+        await queryUserById({ userId }).then(res => {
+          let result = res.data
+          this.studentPhone = result.phone
+          this.studentName = result.username
+        })
+      }
     },
     async onSubmit() {
       let form = this.form;
@@ -377,7 +385,7 @@ export default {
       }
     },
     onCheckStudent() {
-      if (this.id || this.userId) {
+      if (this.id || this.userId || this.studentId) {
         return;
       }
       this.statusList.studentStatus = true;
@@ -418,6 +426,7 @@ export default {
     onCheckboxSelect(item) {
       this.radioSelect = item.userId;
       this.radioSelectName = item.userName;
+      this.radioSelectPhone = item.phone
     },
     onPopupCancel() {
       this.statusList.studentStatus = false;
@@ -425,6 +434,7 @@ export default {
     onPopupSubmit() {
       this.form.studentId = this.radioSelect;
       this.studentName = this.radioSelectName;
+      this.studentPhone = this.radioSelectPhone;
       this.statusList.studentStatus = false;
     },
     onCurrentConfirm(value) {
@@ -591,7 +601,7 @@ export default {
     margin-left: 0.08rem;
   }
 }
-/deep/.van-field__right-icon {
+/deep/.van-field__right-icon, .phone_section {
   display: flex;
 }
 .iconPhone {