Browse Source

学员成绩修改接口,可以查详细的成绩

zhangyujun 3 years ago
parent
commit
0ac138a663
2 changed files with 86 additions and 16 deletions
  1. 16 0
      src/api/score.js
  2. 70 16
      src/views/mocktestscore/index.vue

+ 16 - 0
src/api/score.js

@@ -6,4 +6,20 @@ export function scoreInfoList(params){
         params
 
     })
+}
+export function scoreInfoStudentlist(params){
+    return request({
+        url:"score/info/studentlist",
+        method:'get',
+        params
+    })
+}
+export function scoreInfoStudentscore(id){
+    return request({
+        url:"score/info/studentscore/"+id,
+        method:'get',
+    
+    })
+
+
 }

+ 70 - 16
src/views/mocktestscore/index.vue

@@ -39,7 +39,11 @@
           :rules="[{ required: true, message: '请选择驾校', trigger: 'blur' }]"
           label=""
         >
-          <el-select  clearable v-model="searchForm.schoolName" placeholder="驾校">
+          <el-select
+            clearable
+            v-model="searchForm.schoolName"
+            placeholder="驾校"
+          >
             <el-option
               v-for="(item, index) in schoolInfoList"
               :value="item.schoolName"
@@ -55,8 +59,8 @@
             placeholder="按昵称查询"
           ></el-input>
         </el-form-item>
-        <el-form-item label="">
-       <el-select placeholder="车子类型" clearable v-model="searchForm.type">
+        <!-- <el-form-item label="">
+          <el-select placeholder="车子类型" clearable v-model="searchForm.type">
             <el-option
               v-for="(item, index) in carTypeList"
               :value="item"
@@ -65,7 +69,7 @@
               >{{ item }}</el-option
             >
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="">
           <el-button
             class="ml20"
@@ -85,16 +89,39 @@
             <img class="w40" :src="scope.row.headImage" />
           </template>
         </el-table-column>
-        <el-table-column sortable label="科目" prop="kskm"></el-table-column>
-        <el-table-column sortable label="分数" prop="score"></el-table-column>
+        <el-table-column
+          sortable
+          label="高分"
+          prop="highScore"
+        ></el-table-column>
+        <el-table-column
+          sortable
+          label="低分"
+          prop="lowScore"
+        ></el-table-column>
+        <el-table-column
+          sortable
+          label="平均分数"
+          prop="averageScore"
+        ></el-table-column>
 
-        <el-table-column sortable label="类型" prop="type"></el-table-column>
+        <el-table-column sortable label="次数" prop="times"></el-table-column>
 
-        <!-- <el-table-column
-          sortable
-          label="消费金额"
-          prop="costCount"
-        ></el-table-column> -->
+        <el-table-column sortable label="详情" prop="costCount">
+          <template slot-scope="scope">
+            <el-link
+              @click="
+                () => {
+                  rowInfoName = scope.row.nickName
+                  rowInfoVisible = true;
+                  getRowListInfo(scope.row.userId);
+                }
+              "
+              type="primary"
+              >详情</el-link
+            >
+          </template>
+        </el-table-column>
         <!-- achievement -->
       </el-table>
     </div>
@@ -111,6 +138,20 @@
       :total="tableTotal"
     >
     </el-pagination>
+
+    <el-drawer
+      size="60%"
+      :title="rowInfoName+'(历次考试记录)'"
+      :visible.sync="rowInfoVisible"
+      direction="rtl"
+    >
+      <el-table :data="rowInfoTable">
+        <el-table-column label="时间" prop="createTime"></el-table-column>
+        <el-table-column label="类型" prop="type"></el-table-column>
+        <el-table-column label="科目" prop="kskm"></el-table-column>
+        <el-table-column label="分数" prop="score"></el-table-column>
+      </el-table>
+    </el-drawer>
   </div>
 </template>
 
@@ -118,7 +159,11 @@
 import proxyscoreApi from "@/api/proxyscore";
 import { areaInfoList } from "@/api/area";
 import { schoolInfoList } from "@/api/school";
-import { scoreInfoList } from "@/api/score";
+import {
+  scoreInfoList,
+  scoreInfoStudentlist,
+  scoreInfoStudentscore,
+} from "@/api/score";
 export default {
   data() {
     return {
@@ -129,12 +174,16 @@ export default {
         pageNum: 1,
         pageSize: 10,
         schoolName: "",
-        type:null
+        type: null,
       },
       tableData: [],
       tableTotal: 0,
       tableLoad: false,
-      carTypeList:["小车","客车","货车","摩托车"],
+      rowInfoTable: [],
+      rowInfoName:"",
+      rowInfoColumn:{},
+      rowInfoVisible: false,
+      carTypeList: ["小车", "客车", "货车", "摩托车"],
       schoolInfoList: [],
       cityList: [],
       areaList: [],
@@ -161,6 +210,11 @@ export default {
     },
   },
   methods: {
+    getRowListInfo(id) {
+      scoreInfoStudentscore(id).then((res) => {
+        this.rowInfoTable = res.rows;
+      });
+    },
     selectSchool(areaCode) {
       schoolInfoList({
         areaCode: areaCode,
@@ -174,7 +228,7 @@ export default {
     getPage() {
       //   this.$refs["table"].validate((valid) => {});
       this.tableLoad = true;
-      scoreInfoList(this.searchForm).then((res) => {
+      scoreInfoStudentlist(this.searchForm).then((res) => {
         this.tableData = res.rows;
         this.tableTotal = res.total;
         this.tableLoad = false;