qq 3 lat temu
rodzic
commit
e40a8613fb

+ 91 - 21
src/components/customer/push_err.vue

@@ -23,7 +23,6 @@
         <div class="d-f screen screen1">
           <span>班级:</span>
           <el-select
-            @change="classC"
             v-model="params.cid"
             clearable
             placeholder="请选择"
@@ -31,8 +30,34 @@
             <el-option
               :label="item.name"
               :value="item.id"
-              v-for="item in classL"
-              :key="item.name"
+              v-for="item,i in classL"
+              :key="i+'e'"
+            ></el-option>
+          </el-select>
+          <span>学校:</span>
+          <el-select
+            v-model="params.sid"
+            clearable
+            placeholder="请选择"
+          >
+            <el-option
+              :label="item.name"
+              :value="item.id"
+              v-for="item,i in school_l"
+              :key="i+'u'"
+            ></el-option>
+          </el-select>
+          <span>年级:</span>
+          <el-select
+            v-model="params.gid"
+            clearable
+            placeholder="请选择"
+          >
+            <el-option
+              :label="item.name"
+              :value="item.id"
+              v-for="item,i in grades_l"
+              :key="i+'c'"
             ></el-option>
           </el-select>
           <span>来源:</span>
@@ -41,6 +66,7 @@
             placeholder="请选择"
             v-model="source"
             @change="sourceList"
+            style="width:85px"
           >
             <el-option value="exam" label="考试"></el-option>
             <el-option value="work" label="作业"></el-option>
@@ -118,7 +144,6 @@
           <div>
             <span>班级</span>
             <el-select
-              @change="classC"
               v-model="params.cid"
               clearable
               placeholder="请选择"
@@ -127,8 +152,40 @@
               <el-option
                 :label="item.name"
                 :value="item.id"
-                v-for="item in classL"
-                :key="item.name"
+                v-for="item,i in classL"
+                :key="i+'b'"
+              ></el-option>
+            </el-select>
+          </div>
+          <div>
+            <span>学校</span>
+            <el-select
+              v-model="params.sid"
+              clearable
+              placeholder="请选择"
+              style="width: 325px"
+            >
+              <el-option
+                :label="item.name"
+                :value="item.id"
+                v-for="item,i in school_l"
+                 :key="i+'g'"
+              ></el-option>
+            </el-select>
+          </div>
+          <div>
+            <span>年级</span>
+            <el-select
+              v-model="params.gid"
+              clearable
+              placeholder="请选择"
+              style="width: 325px"
+            >
+              <el-option
+                :label="item.name"
+                :value="item.id"
+                v-for="item,i in grades_l"
+                :key="i+'y'"
               ></el-option>
             </el-select>
           </div>
@@ -194,7 +251,7 @@
 import topNav from "@/components/assembly/topnav";
 import topHead from "@/components/assembly/head";
 import foot from "@/components/assembly/foot";
-import { searchClass, classes, tasks,clsErrPost } from "@/util/api";
+import { searchClass, classes, tasks,clsErrPost,clsPushE,school_s,grades_s} from "@/util/api";
 export default {
   data() {
     return {
@@ -202,7 +259,9 @@ export default {
         page: 1,
         size: 10,
         cid: "",
-        tid: "",
+        tid: '',
+        gid:'',
+        sid:'',
       },
       source: "", //来源
       sour_list: [],
@@ -214,6 +273,8 @@ export default {
       data: [],
       s_push:[],
       remark:'',
+      school_l:[],
+      grades_l:[],
     };
   },
   created() {
@@ -235,11 +296,22 @@ export default {
               l.push(obj);
             });
             that.data = l;
-            console.log(that.data);
           }
         });
       }
     });
+    //学校
+    school_s().then(res=>{
+      if(res.errcode == 0){
+        that.school_l = res.data
+      }
+    });
+    //年级
+    grades_s().then(res=>{
+      if(res.errcode == 0){
+        that.grades_l = res.data
+      }
+    });
   },
   methods: {
     //创建错题推送
@@ -282,12 +354,6 @@ export default {
         }
       });
     },
-    classC(i) {
-      console.log(i);
-      this.params.page = 1;
-      this.params.cid = i;
-      this.getList();
-    },
     //搜索
     search() {
       this.params.page = 1;
@@ -298,10 +364,6 @@ export default {
       this.params.page = val;
       this.getList();
     },
-    //查看
-    // jump_da(title, id) {
-    //   this.$router.push({ path: "/tk_dt_fx", query: { title, id } });
-    // },
     //获取列表
     getList() {
       const load = this.$loading({
@@ -311,8 +373,15 @@ export default {
         background: "rgba(0, 0, 0, 0.7)",
       });
       var that = this;
-      var obj = JSON.parse(JSON.stringify(this.params));
-      searchClass(obj).then((res) => {
+      var obj = this.params
+      for(let key  in obj){
+        console.log(obj[key])
+        if(!obj[key]){
+          obj[key] = 0;
+        }
+  }
+  console.log(obj)
+      clsPushE(obj).then((res) => {
       if (res.errcode == 0) {
         that.tableData = res.data;
         that.total = res.total;
@@ -392,6 +461,7 @@ export default {
   color: #1fb3ff;
   right: 20px;
   cursor: pointer;
+  top: -38px;
 }
 .promotion > span {
   margin-right: 5px;

+ 4 - 2
src/components/customer/tk_yp.vue

@@ -411,7 +411,8 @@ export default {
       if (res.errcode == 0) {
          res.data.forEach((item,i) => {
            if(item.marked_amount){
-             item.bfb = (item.marked_amount/item.question_amount).toFixed(2)*100
+             item.bfb = (item.question_amount/that.tk_list.length).toFixed(2)*100
+            //  console.log(item.bfb)
            }else{
              item.bfb =0
            }
@@ -515,6 +516,7 @@ export default {
     //获取试卷列表
     getpaper() {
       var p = this.listP
+      p.size = 100;
       delete p.qno;
       var that = this;
       get("/v1/api/papers/"+this.pid+"/questions", p).then((res) => {
@@ -1103,7 +1105,7 @@ export default {
   margin-left: 10px;
 }
 .tk_cont .el-progress.el-progress--line {
-  width: 530px;
+  width: 370px;
 }
 .tk_num li {
   padding: 11px 5px;

+ 4 - 0
src/util/api.js

@@ -23,5 +23,9 @@ export const account = p => get('/v1/api/account',p)//获取用户信息
 export const searchClass = p => get('/v1/api/students',p)//学生列表
 export const collected = p => get('/v1/api/resource/collected',p)//收藏列表
 export const clsErr = p => get('/v1/api/cls-errs',p)//班级错题
+export const clsErrPost = p => post('/v1/api/cls-push-errs',p)//创建错题推送
 export const stuErr = p => get('/v1/api/stu-errs',p)//学生错题综合
 export const stuErrPer = p => get('/v1/api/stu-errs'+p,)//学生错题个人
+export const clsPushE = p => get('/v1/api/cls-push-errs',p)//错题推送列表
+export const school_s = p => get('/v1/common/schools/search',p)//学校列表
+export const grades_s = p => get('/v1/common/grades/search',p)//学校列表