11wqe1 преди 8 месеца
родител
ревизия
68b9c76e59

+ 118 - 0
src/components/pages/test/aggregate/index.vue

@@ -0,0 +1,118 @@
+<template>
+  <div class="aggregate">
+    <el-table
+      :data="tableData"
+      border
+      style="width: 100%"
+      v-loading="tabLoading"
+    >
+      <el-table-column fixed align="center" type="index" width="50">
+      </el-table-column>
+
+      <el-table-column
+        fixed
+        align="center"
+        prop="username"
+        label="教师姓名"
+        width="150"
+      >
+      </el-table-column>
+      <el-table-column fixed align="center" label="教研室" width="130">
+        <template slot-scope="scope">
+          <div class="TabBtn" v-if="!scope.row.tea">/</div>
+          <div class="TabBtn" v-else>{{ scope.row.tea }}</div>
+        </template>
+      </el-table-column>
+
+      <div v-for="item in titList" :key="item.id">
+        <el-table-column align="center" :label="item.name">
+          <div  v-for="e in allFrom" :key="e.courseId">
+            <el-table-column
+              v-if="e.typeid == item.id"
+              align="center"
+              :prop="e.courseId"
+              :label="e.title"
+              width="130"
+            >
+              <template slot-scope="scope">
+                <!-- <el-button size="small" @click="lookPrize(e.courseId)">点</el-button> -->
+                {{ scope.row.works.indexOf(e.courseId) == -1 ? "○" : "●" }}
+              </template>
+            </el-table-column>
+          </div>
+        </el-table-column>
+      </div>
+    </el-table>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      userid: this.$route.query.userid,
+      oid: this.$route.query.oid,
+      org: this.$route.query.org,
+      tableData: [],
+      titList: [],
+      allFrom: [],
+      tabLoading: false
+    };
+  },
+
+  mounted() {
+    this.getData();
+  },
+
+  methods: {
+    getData() {
+      this.tabLoading = true;
+
+      let params = {
+        oid: this.oid,
+        org: this.org
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTestWorksAggregate", params)
+        .then(res => {
+          let data = res.data[0]; //所有老师
+          this.titList = res.data[1]; // 所有分类
+          this.allFrom = res.data[2]; //所有表单
+          let data3 = res.data[3]; //所有老师填写表单
+          data.forEach(e => {
+            e.works = [];
+            data3.forEach(k => {
+              if (e.userid == k.userid) {
+                e.works.push(k.courseid);
+              }
+            });
+          });
+          this.tableData = data;
+          this.tabLoading = false;
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    // 查看数据来源
+    lookPrize(val) {
+      this.$router.push(
+        "/checkToTest?cid=" +
+          val +
+          "&oid=" +
+          this.oid +
+          "&org=" +
+          this.org +
+          "&type=" +
+          2 +
+          "&role=" +
+          this.role
+      );
+      // this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/
+      // checkToTest?cid=${val}&oid=${this.oid}&org=${this.org}&type=2&role=0`;
+    }
+  }
+};
+</script>
+
+<style scoped></style>

+ 185 - 57
src/components/pages/test/examine/conpoments/personPage.vue

@@ -1,19 +1,30 @@
 <template>
   <div>
     <div class="personPage">
-      <!-- <div style="width: 100%;display: flex;justify-content: flex-end;">
+      <!-- <div
+        style="width: 100%;display: flex;justify-content: flex-end;align-items: center;"
+      >
         <el-select v-model="teas" multiple placeholder="请选择">
           <el-option
-            v-for="item in TeaOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
+            v-for="item in TeaList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
           >
           </el-option>
         </el-select>
-        <div><el-button type="primary" size="mini">提醒</el-button></div>
+        <div style="margin-left: 10px;">
+          <el-button type="primary" @click="remindExamine" size="mini"
+            >提醒</el-button
+          >
+        </div>
       </div> -->
-      <el-table :data="tableData" class="scoTab" style="width: 100%">
+      <el-table
+        :data="tableData"
+        class="scoTab"
+        v-loading="tabLoading"
+        style="width: 100%"
+      >
         <el-table-column type="index" align="center" label="序号" width="180">
         </el-table-column>
         <el-table-column prop="username" align="center" label="教师姓名">
@@ -21,24 +32,51 @@
         <el-table-column
           prop="tea"
           show-overflow-tooltip
+          :filters="TeachingOptions"
+          :filter-method="filterTea"
           align="center"
           label="教研室"
           width="180"
         >
         </el-table-column>
-        <el-table-column align="center" label="考核进度">
+        <el-table-column
+          :filters="[
+            { text: '已完成', value: '已完成' },
+            { text: '未完成', value: '未完成' }
+          ]"
+          :filter-method="filterExa"
+          :filter-multiple="false"
+          prop="state"
+          align="center"
+          label="考核进度"
+        >
           <template slot-scope="scope">
             <div v-if="scope.row.step == scope.row.allStep">√</div>
             <div v-else>{{ scope.row.step }}/{{ scope.row.allStep }}</div>
           </template>
         </el-table-column>
-        <el-table-column prop="evaSca" align="center" label="自评分数">
+        <el-table-column
+          prop="evaSca"
+          :sortable="true"
+          :sort-method="sortEvaMethod"
+          align="center"
+          label="自评分数"
+        >
         </el-table-column>
-        <el-table-column prop="cogSco" align="center" label="考核分数">
+        <el-table-column
+          prop="cogSco"
+          :sortable="true"
+          :sort-method="sortCogMethod"
+          align="center"
+          label="考核分数"
+        >
         </el-table-column>
-        <el-table-column align="center" label="评分">
+        <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-            <div class="TabBtn" @click="lookScore(scope.row)">评分</div>
+            <div style="display: flex;justify-content: center;">
+              <div class="TabBtn" @click="lookScore(scope.row)">评分</div>
+              <div class="TabBtn" @click="withdraw(scope.row.id)">撤回</div>
+            </div>
           </template>
         </el-table-column>
       </el-table>
@@ -171,6 +209,10 @@
                       <div style="display: flex;justify-content: center;">
                         <div v-if="tableData.length > 0" class="ScoreStep">
                           <input
+                            :style="{
+                              color: k.sco1 == k.sco2 ? '#000' : 'red'
+                            }"
+                            :readonly="txtLoading"
                             @blur="
                               saveTab(
                                 k.sco2 > k.score ? (k.sco2 = k.score) : ''
@@ -179,11 +221,11 @@
                             type="number"
                             v-model="k.sco2"
                           />
-                          <!-- @blur="Submit(scope.row)" -->
                         </div>
                       </div>
                       <div style="display: flex;justify-content: center;">
                         <textarea
+                          :readonly="txtLoading"
                           v-if="tableData.length > 0"
                           @blur="saveTab()"
                           v-model.trim="k.cogSum"
@@ -205,7 +247,7 @@
       :visible.sync="diaIframe"
       :append-to-body="true"
       width="95%"
-      :before-close="handleClose"
+      :before-close="handleClose2"
       class="dialog_diy"
     >
       <div style="height: 100%;">
@@ -247,34 +289,15 @@ export default {
       computedScoData: 0,
       computedStepData: 0,
       computedCogSCoData: 0,
-
+      TeaList: [],
+      tabLoading: false,
       userid: this.$route.query.userid, //用户id
       oid: this.$route.query.oid, //学校id
       org: this.$route.query.org, //组织id
       tableData: [],
-      TeaOptions: [
-        {
-          value: "选项1",
-          label: "黄金糕"
-        },
-        {
-          value: "选项2",
-          label: "双皮奶"
-        },
-        {
-          value: "选项3",
-          label: "蚵仔煎"
-        },
-        {
-          value: "选项4",
-          label: "龙须面"
-        },
-        {
-          value: "选项5",
-          label: "北京烤鸭"
-        }
-      ],
-      teas: []
+      teas: [],
+      TeachingOptions: [],
+      txtLoading: false
     };
   },
   watch: {
@@ -333,10 +356,12 @@ export default {
   },
   mounted() {
     this.getData();
+    this.getTeaList();
   },
   methods: {
     // 获取页面数据
     getData() {
+      this.tabLoading = true;
       let params = {
         oid: this.oid,
         org: this.org,
@@ -371,16 +396,25 @@ export default {
           });
 
           data.forEach(e => {
+            if (e.step == e.allStep) {
+              e.state = "已完成";
+            } else {
+              e.state = "未完成";
+            }
+            if (!e.tea) {
+              e.tea = "";
+            }
             e.evaSca = e.evaSca.toFixed(2);
             e.cogSco = e.cogSco.toFixed(2);
           });
           this.tableData = data;
+          this.tabLoading = false;
         })
         .catch(error => {
+          this.tabLoading = false;
           console.log(error);
         });
     },
-
     // 点击评分
     lookScore(val) {
       this.digLoading = true;
@@ -398,24 +432,110 @@ export default {
       this.cutPerson();
       this.getPageBase();
     },
-    // getTeaList() {
-    // let params = {
-    //     oid: this.oid,
-    // };
-    // this.ajax
-    //     .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
-    //     .then((res) => {
-    //         this.TeachingOptions = res.data[0];
-    //         console.log('this.TeachingOptions',this.TeachingOptions);
-    //     })
-    //     .catch((err) => {
-    //         this.isLoading = false;
-    //         console.error(err);
-    //     });
-    // },
+    // 获取教研室
+    getTeaList() {
+      let params = {
+        oid: this.oid
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
+        .then(res => {
+          // return console.log("this.TeachingOptions", res.data[0]);
+          let data = res.data[0];
+          let dataCopy = [];
+
+          data.forEach(e => {
+            let a = {};
+            a.value = e.name;
+            a.text = e.name;
+            dataCopy.push(a);
+          });
+          data.forEach(e => {
+            let a = {};
+            a.id = e.id;
+            a.name = e.name;
+            this.TeaList.push(a);
+          });
+
+          this.TeachingOptions = dataCopy;
+          // console.log("this.TeachingOptions", this.TeachingOptions);
+        })
+        .catch(err => {
+          console.error(err);
+        });
+    },
+    // 撤回
+    withdraw(id) {
+      let params = [
+        {
+          tid: id
+        }
+      ];
+
+      this.$confirm("确认撤回?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: " info"
+      })
+        .then(() => {
+          this.ajax
+            .post(this.$store.state.api + "updateExamineState", params)
+            .then(res => {
+              this.getData();
+            })
+            .catch(error => {
+              console.log(error);
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消撤回"
+          });
+        });
+    },
+    // 提醒
+    remindExamine() {
+      let params = {
+        oid: this.oid,
+        org: this.org,
+        tea: this.teas.join(","),
+        ptype: this.pType
+      };
+      return console.log(params);
+
+      this.ajax
+        .get(this.$store.state.api + "selectExamineTeaRemind", params)
+        .then(res => {})
+        .catch(err => {
+          console.error(err);
+        });
+    },
+    // 按照数字大小排序 方法-
+    sortCogMethod(before, after) {
+      return Number(before.cogSco) - Number(after.cogSco);
+    },
+    sortEvaMethod(before, after) {
+      return Number(before.evaSca) - Number(after.evaSca);
+    },
+    // 教研室筛选
+    filterTea(value, row, column) {
+      console.log(value, row, column);
+      const property = column["property"];
+      return row[property].includes(value);
+    },
+    // 是否完成筛选
+    filterExa(value, row, column) {
+      console.log(value, row, column);
+      const property = column["property"];
+      return row[property] == value;
+    },
     // ----------------
+
     // 保存修改
     saveTab() {
+      this.txtLoading = true;
+
       let PageBaseDataCopy = JSON.parse(JSON.stringify(this.PageBaseData));
 
       for (const e of PageBaseDataCopy) {
@@ -452,7 +572,7 @@ export default {
         return this.$message.error("暂无人员提交");
       // this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${val}&oid=${this.oid}&org=${this.org}&type=2&role=0&peopleId=${this.userid}`;
 
-      this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${cid}&oid=${this.oid}&org=${this.oid}&type=2&role=0&peopleId=${this.digUserid}`;
+      this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${cid}&oid=${this.oid}&org=${this.org}&type=2&role=0&peopleId=${this.digUserid}`;
       // this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/test?userid=${this.userid}&oid=45facc0a-1211-11ec-80ad-005056b86db5&org=&role=0`;
       this.diaIframe = true;
     },
@@ -615,6 +735,7 @@ export default {
             this.DigSelfSco = 0;
             this.twoTarget = 0;
           }
+          this.txtLoading = false;
           this.digLoading = false;
         })
         .catch(error => {
@@ -645,12 +766,18 @@ export default {
         }
       });
     },
-    // 关闭弹框
+    // 评分关闭弹框
     handleClose(done) {
       this.getData();
       done();
     },
+    // 数据来源关闭弹框
+    handleClose2(done) {
+      this.digLoading = true;
 
+      this.getPageBase();
+      done();
+    },
     // 处理数据来源
     async handleData() {
       for (const e of this.PageBaseData) {
@@ -665,7 +792,7 @@ export default {
     computedTest(val) {
       let params = [
         {
-          uid: this.uid,
+          uid: this.digUserid,
           testId: val.join(",")
         }
       ];
@@ -702,6 +829,7 @@ export default {
 .TabBtn {
   cursor: pointer;
   color: #528df6;
+  margin: 0 10px;
 }
 .dialog_diy >>> .el-dialog {
   height: 95%;

+ 103 - 24
src/components/pages/test/examine/conpoments/targetPage.vue

@@ -124,7 +124,7 @@
       :visible.sync="diaIframe"
       :append-to-body="true"
       width="95%"
-      :before-close="handleClose"
+      :before-close="handleClose2"
       class="dialog_diy"
     >
       <div style="height: 100%;">
@@ -177,13 +177,21 @@
           <el-table-column
             :show-overflow-tooltip="true"
             prop="tea"
+            :filters="TeachingOptions"
+            :filter-method="filterTea"
             align="center"
             label="教研室"
           >
           </el-table-column>
           <el-table-column prop="score" align="center" label="分值">
           </el-table-column>
-          <el-table-column prop="evaSca" align="center" label="自评分数">
+          <el-table-column
+            :sortable="true"
+            :sort-method="sortEvaMethod"
+            prop="evaSca"
+            align="center"
+            label="自评分数"
+          >
           </el-table-column>
           <el-table-column
             prop="evaMed"
@@ -218,11 +226,19 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column width="200px" align="center" label="认定分数">
+          <el-table-column
+            :sortable="true"
+            :sort-method="sortCogMethod"
+            prop="cogSco"
+            width="200px"
+            align="center"
+            label="认定分数"
+          >
             <template slot-scope="scope">
               <div class="ScoreStep">
                 <input
                   type="number"
+                  :readonly="TxtDig"
                   v-if="scope.row.judge == 1"
                   style=" color :#A7AAB2;"
                   @blur="Submit(scope.row)"
@@ -250,6 +266,7 @@
               <textarea
                 @blur="Submit2(scope.row)"
                 class="tArea"
+                :readonly="TxtDig"
                 v-model.trim="scope.row.cogSummary"
               />
             </template>
@@ -275,6 +292,7 @@ export default {
       evaScoDigSvg: 0,
       evaScoDigCog: 0,
       evaScoDigPerC: 0,
+      TxtDig: false,
 
       diaIframe: false, //数据来源弹框
       diaScore: false, //查看分数弹框
@@ -1309,7 +1327,8 @@ export default {
       //     ]
       //   }
       // ],
-      tableData: [] //弹框数据
+      tableData: [], //弹框数据
+      TeachingOptions: []
     };
   },
   computed: {},
@@ -1321,11 +1340,39 @@ export default {
   },
   mounted() {
     this.getPageBase();
+    this.getTeaList();
     // console.log(JSON.stringify(this.TeaTabJson));
     // console.log(JSON.stringify(this.tableJsonCon));
   },
 
   methods: {
+    // 获取教研室
+    getTeaList() {
+      let params = {
+        oid: this.oid
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
+        .then(res => {
+          // return console.log("this.TeachingOptions", res.data[0]);
+          let data = res.data[0];
+          let dataCopy = [];
+
+          data.forEach(e => {
+            let a = {};
+            a.value = e.name;
+            a.text = e.name;
+            dataCopy.push(a);
+          });
+
+          this.TeachingOptions = dataCopy;
+          // console.log("this.TeachingOptions", this.TeachingOptions);
+        })
+        .catch(err => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
     // 获取基础页面数据
     getPageBase() {
       this.tabLoad = true;
@@ -1442,6 +1489,20 @@ export default {
       this.diaIframe = true;
     },
     // ----------------------------首页操作与弹框操作分界线
+
+    // 按照数字大小排序 方法-
+    sortCogMethod(before, after) {
+      return Number(before.cogSco) - Number(after.cogSco);
+    },
+    sortEvaMethod(before, after) {
+      return Number(before.evaSca) - Number(after.evaSca);
+    },
+    // 教研室筛选
+    filterTea(value, row, column) {
+      console.log(value, row, column);
+      const property = column["property"];
+      return row[property].includes(value);
+    },
     // 查看评分
     lookScore(val, oneName, twoName) {
       this.evaScoDig = true;
@@ -1479,6 +1540,9 @@ export default {
             e.cogSummary = ""; //认定概述
             e.score = 0; //分值
             e.judge = 0; //是否填充为默认分数 1:默认等于自评分
+            if (!e.tea) {
+              e.tea = "";
+            }
             e.json.forEach(i => {
               i.children.forEach(k => {
                 if (k.id == this.secondId) {
@@ -1506,6 +1570,7 @@ export default {
           // 获取数据来源
           this.handleScoData();
           this.evaScoDig = false;
+          this.TxtDig = false;
         })
         .catch(error => {
           console.log(error);
@@ -1583,6 +1648,8 @@ export default {
       //   }
       // });
       //#endregion
+      this.TxtDig = true;
+
       if (val.cogSco > val.score) {
         val.cogSco = val.score;
       }
@@ -1616,6 +1683,8 @@ export default {
 
     // 概述提交
     Submit2(val) {
+      this.TxtDig = true;
+
       val.json.forEach(e => {
         e.children.forEach(i => {
           if (i.id == this.secondId) {
@@ -1651,18 +1720,7 @@ export default {
       })
         .then(() => {
           this.evaScoDig = true;
-          let promiseChain = Promise.resolve(); // 初始空Promise
-
-          for (const e of this.tableData) {
-            if (e.judge == 1) {
-              promiseChain = promiseChain.then(() => this.Submit3(e)); // 链式调用Promise
-            }
-          }
-
-          promiseChain.then(() => {
-            this.getSecondData(); // 循环结束后执行getSecondData函数
-            this.$message.success("已保存");
-          });
+          this.handleAllSubmit();
         })
         .catch(() => {
           this.handleData();
@@ -1673,7 +1731,17 @@ export default {
           });
         });
     },
-    Submit3(val) {
+    // 处理一键保存
+    async handleAllSubmit() {
+      for (const e of this.tableData) {
+        if (e.judge == 1) {
+          await this.computedAllSubmit(e);
+        }
+      }
+      this.getSecondData(); // 循环结束后执行getSecondData函数
+      this.$message.success("已保存");
+    },
+    computedAllSubmit(val) {
       if (val.cogSco > val.score) {
         val.cogSco = val.score;
       }
@@ -1695,18 +1763,29 @@ export default {
         }
       ];
       // return console.log(params);
-      this.ajax
-        .post(this.$store.state.api + "updateExamineCogData", params)
-        .then(res => {})
-        .catch(error => {
-          console.log(error);
-        });
+
+      return new Promise(resolve => {
+        this.ajax
+          .post(this.$store.state.api + "updateExamineCogData", params)
+          .then(res => {
+            resolve(res);
+          })
+          .catch(error => {
+            console.log(error);
+          });
+      });
     },
 
-    // 关闭弹框
+    // 关闭评分弹框
     handleClose(done) {
       this.getPageBase();
       done();
+    },
+    // 关闭数据来源弹框
+    handleClose2(done) {
+      this.evaScoDig = true;
+      this.getSecondData();
+      done();
     }
   }
 };

+ 10 - 3
src/components/pages/test/index.vue

@@ -25,7 +25,7 @@
             <span :class="{ active: cutNumber == 1}" v-if="examineData.length" @click="cutNumber = 1">年度考核</span>
         </div>
         <div class="bbox" v-if="cutNumber==0">
-            <div class="test_data_box" v-loading="isLoadingData">
+            <div v-if="!oidArray.includes(oid)" class="test_data_box" v-loading="isLoadingData">
                 <div class="data_box">
                     <div class="left">
                         <div class="title">表单状态总览</div>
@@ -80,6 +80,7 @@
             </div>
             <div class="search_nav">
                 <div class="right">
+                    <span :class="{ active: stype == 3 }" v-show="orgArray2.includes(org) || oidArray.includes(oid)" @click="checkDataType(3)">数据汇总</span>
                     <span :class="{ active: stype == 1 }" @click="checkDataType(1)">按问卷查看</span>
                     <span :class="{ active: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
                 </div>
@@ -123,6 +124,7 @@
                 </div>
             </div>
             <div class="pb_content_body" style="height: 100%;width: 100%;">
+                <aggregate v-if="stype == 3"></aggregate>
                 <div class="student_table" v-loading="isLoading" v-if="stype == 1 && stype2 == 1">
                     <div class="course_box">
                         <div class="test_box" v-for="(item, index) in course" :key="index">
@@ -394,9 +396,10 @@ import randar1 from "./data/randar1.vue";
 import randar2 from "./data/randar2.vue";
 import shareBox from './shareBox/index.vue'
 import examine from './examine/index.vue'
+import aggregate from './aggregate/index'
 export default {
     name: 'test',
-    components: { EditorBar, CourseProblem, pie1, pie2, randar1, randar2, shareBox, examine },
+    components: { EditorBar, CourseProblem, pie1, pie2, randar1, randar2, shareBox, examine, aggregate },
     data() {
         return {
             examineData: [],
@@ -421,7 +424,8 @@ export default {
             org: this.$route.query.org,
             role: this.$route.query.role,
             orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
-            oidArray: [],
+            orgArray2: ["0fec3a8a-ad04-11ed-b13d-005056b86db5"],
+            oidArray: ["d67940a5-510c-40ea-9c9a-2631ab03013a"],
             Juri: "",
             groupList: [],
             JuriList: [],
@@ -1303,6 +1307,9 @@ export default {
     mounted() {
         this.getPageBase()
         console.log(2);
+        if (this.orgArray2.includes(this.org) || this.oidArray.includes(this.oid)) {
+            this.stype = 3
+        }
         if (this.role == '1') {
             this.groupA = '0'
         }