瀏覽代碼

剩余学员时长修改

wolyshaw 4 年之前
父節點
當前提交
ca605bd609

+ 55 - 6
src/views/teamDetail/components/modals/course-time-detail.vue

@@ -3,7 +3,7 @@
     :data="list"
     :header-cell-style="{background:'#EDEEF0',color:'#444'}"
   >
-    <el-table-column
+    <!-- <el-table-column
       prop="type"
       label="课程类型"
       align="center"
@@ -11,12 +11,50 @@
       <template slot-scope="scope">
         {{courseType[scope.row.type]}}
       </template>
+    </el-table-column> -->
+    <el-table-column
+      prop="userId"
+      label="学生编号"
+      align="center"
+    >
+      <template slot-scope="scope">
+        <copy-text>{{scope.row.userId}}</copy-text>
+      </template>
+    </el-table-column>
+    <el-table-column
+      prop="username"
+      label="学生姓名"
+      width="120"
+      align="center"
+     >
+      <template slot-scope="scope">
+        <copy-text>{{scope.row.username}}</copy-text>
+      </template>
+    </el-table-column>
+    <el-table-column
+      prop="phone"
+      label="学生手机号"
+      width="140"
+      align="center"
+     >
+      <template slot-scope="scope">
+        <copy-text>{{scope.row.phone}}</copy-text>
+      </template>
     </el-table-column>
     <el-table-column
+      v-for="item in extra"
+      :key="item.key"
+      :label="courseType[item.key]"
+    >
+      <template slot-scope="scope">
+        {{scope.row.mapDtos[item.key]}}
+      </template>
+    </el-table-column>
+    <!-- <el-table-column
       prop="time"
       label="剩余时长(分)"
       align="center"
-    />
+    /> -->
   </el-table>
 </template>
 
@@ -28,20 +66,31 @@ export default {
   data() {
     return {
       courseType,
-      list: []
+      list: [],
+      extra: []
     }
   },
   mounted() {
     this.FetchDetail()
   },
   methods: {
+    array2object(list = []) {
+      const data = {}
+      for (const item of list) {
+        data[item.key] = item.value
+      }
+      return data
+    },
     async FetchDetail() {
       try {
         const res = await queryStudentSubTotalCourseTimes({
-          userId: this.detail.userId,
-          musicGroupId: this.detail.musicGroupId,
+          musicGroupId: this.$route.query.id,
         })
-        this.list = Object.keys(res.data).map(item => ({type: item, time: res.data[item]}))
+        this.list = res.data.map(item => ({...item, mapDtos: this.array2object(item.mapDtos)}))
+        if (res.data[0]) {
+          this.extra = res.data[0].mapDtos
+        }
+        // this.list = Object.keys(res.data).map(item => ({type: item, time: res.data[item]}))
       } catch (error) {}
     }
   }

+ 22 - 22
src/views/teamDetail/components/studentList.vue

@@ -15,17 +15,27 @@
         <span>{{studentListInfo.add}}</span>
       </statistic-item>
       <statistic-item>
-        <div class="newStudent"
-             style="margin-bottom:10px;"
-             v-permission="'studentRegistration/insertStudent'"
-             @click="addStudentVisible = true">新增学员</div>
-        <!-- <div class="newStudent"
-             style="margin-bottom:10px;"
-             v-permission="'teamDetails/studentList/QRCode/822'"
-             @click="onCreateQRCode">报名连接</div> -->
-        <div class="newStudent"
-             v-permission="'/studentSignin'"
-             @click="gotoSignin">点名总览</div>
+        <div style="display: flex;">
+          <div>
+            <div class="newStudent"
+              style="margin-bottom:10px;"
+              v-permission="'studentRegistration/insertStudent'"
+              @click="addStudentVisible = true">新增学员</div>
+          <!-- <div class="newStudent"
+              style="margin-bottom:10px;"
+              v-permission="'teamDetails/studentList/QRCode/822'"
+              @click="onCreateQRCode">报名连接</div> -->
+            <div class="newStudent"
+              v-permission="'/studentSignin'"
+              @click="gotoSignin">点名总览</div>
+          </div>
+          <div style="margin-left: 10px;">
+            <div class="newStudent"
+              style="margin-bottom:10px;"
+              v-permission="'studentManage/queryStudentSubTotalCourseTimes'"
+              @click="viewTimer">剩余时长明细</div>
+          </div>
+        </div>
       </statistic-item>
     </statistic>
 
@@ -188,11 +198,6 @@
                          label="缴费金额"
                          prop="courseFee"></el-table-column> -->
         <el-table-column align="center"
-                         prop="subTotalCourseTime"
-                         label="剩余时长(分)"
-                         width="125">
-                         </el-table-column>
-        <el-table-column align="center"
                          label="报名缴费">
           <template slot-scope="scope">
             <div>{{ scope.row.paymentStatus | studentPays}}</div>
@@ -219,9 +224,6 @@
           <template slot-scope="scope">
             <div>
               <el-button type="text"
-                         v-if="permission('studentManage/queryStudentSubTotalCourseTimes')"
-                         @click="viewTimer(scope.row)">课程时长</el-button>
-              <el-button type="text"
                          v-if="permission('studentManage/queryStudentClassGroup')&&scope.row.studentStatus != 'QUIT'"
                          @click="lookClass(scope.row)">查看班级</el-button>
 
@@ -431,10 +433,8 @@
     <el-dialog
       :visible.sync="timesVisible"
       title="查看剩余可排课时长"
-      width="500px"
     >
       <times-view
-        :detail="timerDetail"
         v-if="timesVisible"
         @close="timesVisible = false"
       />
@@ -810,7 +810,7 @@ export default {
   },
   methods: {
     viewTimer(row) {
-      this.timerDetail = row
+      // this.timerDetail = row
       this.timesVisible = true
     },
     permission (str) {