11wqe1 9 mesiacov pred
rodič
commit
e5f4ea93a4

+ 213 - 184
src/components/pages/test/examine/conpoments/personPage.vue

@@ -1,6 +1,18 @@
 <template>
   <div>
     <div class="personPage">
+      <!-- <div style="width: 100%;display: flex;justify-content: flex-end;">
+        <el-select v-model="teas" multiple placeholder="请选择">
+          <el-option
+            v-for="item in TeaOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <div><el-button type="primary" size="mini">提醒</el-button></div>
+      </div> -->
       <el-table :data="tableData" class="scoTab" style="width: 100%">
         <el-table-column type="index" align="center" label="序号" width="180">
         </el-table-column>
@@ -14,14 +26,10 @@
           width="180"
         >
         </el-table-column>
-        <!-- <el-table-column align="center" label="提交情况">
-          <template slot-scope="scope">
-            <div>是</div>
-          </template>
-        </el-table-column> -->
         <el-table-column align="center" label="考核进度">
           <template slot-scope="scope">
-            <div>{{ scope.row.step }}/{{ scope.row.allStep }}</div>
+            <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="自评分数">
@@ -34,16 +42,6 @@
           </template>
         </el-table-column>
       </el-table>
-
-      <el-pagination
-        @current-change="handleCurrentChange"
-        :page-size="20"
-        background
-        :current-page="page"
-        layout="prev, pager, next"
-        :total="total"
-      >
-      </el-pagination>
     </div>
     <!-- 点击评分 -->
     <el-dialog
@@ -79,6 +77,7 @@
           >
             <div class="digUsernameCss">{{ digUsername }}</div>
             <div
+              v-if="tableData.length > 0"
               style="display: flex;justify-content: space-between;width: 150px;"
             >
               <div>
@@ -170,7 +169,7 @@
                         </div>
                       </div>
                       <div style="display: flex;justify-content: center;">
-                        <div class="ScoreStep">
+                        <div v-if="tableData.length > 0" class="ScoreStep">
                           <input
                             @blur="
                               saveTab(
@@ -184,7 +183,11 @@
                         </div>
                       </div>
                       <div style="display: flex;justify-content: center;">
-                        <textarea @blur="saveTab()" v-model.trim="k.cogSum" />
+                        <textarea
+                          v-if="tableData.length > 0"
+                          @blur="saveTab()"
+                          v-model.trim="k.cogSum"
+                        />
                       </div>
                     </div>
                   </div>
@@ -196,6 +199,7 @@
       </div>
     </el-dialog>
 
+    <!-- 查看数据来源 -->
     <el-dialog
       title=""
       :visible.sync="diaIframe"
@@ -211,9 +215,6 @@
           :src="ifmUrl"
         ></iframe>
       </div>
-      <!-- <span slot="footer" class="dialog-footer">
-        <el-button @click="diaIframe = false">关 闭</el-button>
-      </span> -->
     </el-dialog>
   </div>
 </template>
@@ -236,14 +237,10 @@ export default {
       ifmUrl: false,
       PageBaseData: [],
       digUserid: "", //用户id
-      digOid: "", //学校id
-      digOrg: "", //组织id
       digTid: "", //表单id
       cutTeaNum: 0, //第几位教师
       disTeaClass: "", //教研室
       digLoading: false,
-      total: 0,
-      page: 1,
       DigSelfSco: 0,
       digUsername: "",
       twoTarget: 0,
@@ -254,16 +251,38 @@ export default {
       userid: this.$route.query.userid, //用户id
       oid: this.$route.query.oid, //学校id
       org: this.$route.query.org, //组织id
-      tableData: []
+      tableData: [],
+      TeaOptions: [
+        {
+          value: "选项1",
+          label: "黄金糕"
+        },
+        {
+          value: "选项2",
+          label: "双皮奶"
+        },
+        {
+          value: "选项3",
+          label: "蚵仔煎"
+        },
+        {
+          value: "选项4",
+          label: "龙须面"
+        },
+        {
+          value: "选项5",
+          label: "北京烤鸭"
+        }
+      ],
+      teas: []
     };
   },
   watch: {
     pType(newVal, oldVal) {
-      this.page = 1;
       this.getData();
     },
     digType(newVal, oldVal) {
-      this.getPageBase();
+      this.getDataDig();
     }
   },
   computed: {
@@ -316,6 +335,52 @@ export default {
     this.getData();
   },
   methods: {
+    // 获取页面数据
+    getData() {
+      let params = {
+        oid: this.oid,
+        org: this.org,
+        type: this.pType
+      };
+      // console.log(params);
+      this.ajax
+        .get(this.$store.state.api + "selectTestExamineSecondData", params)
+        .then(res => {
+          let data = res.data[0];
+
+          data.forEach(e => {
+            e.json = JSON.parse(e.json);
+          });
+
+          data.forEach(e => {
+            e.evaSca = 0;
+            e.cogSco = 0;
+            e.step = 0;
+            e.allStep = 0;
+
+            e.json.forEach(i => {
+              i.children.forEach(k => {
+                e.evaSca = e.evaSca + k.sco1 * 1;
+                e.cogSco = e.cogSco + k.sco2 * 1;
+                e.allStep++;
+                if (!!k.sco2 * 1) {
+                  e.step++;
+                }
+              });
+            });
+          });
+
+          data.forEach(e => {
+            e.evaSca = e.evaSca.toFixed(2);
+            e.cogSco = e.cogSco.toFixed(2);
+          });
+          this.tableData = data;
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+
     // 点击评分
     lookScore(val) {
       this.digLoading = true;
@@ -329,12 +394,27 @@ export default {
       this.digTid = val.id;
       this.diaSco = true;
       this.digUserid = val.userid;
-      this.digOid = val.organizeid;
-      this.digOrg = val.org;
       this.disTeaClass = val.tea;
       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);
+    //     });
+    // },
+    // ----------------
+    // 保存修改
     saveTab() {
       let PageBaseDataCopy = JSON.parse(JSON.stringify(this.PageBaseData));
 
@@ -359,33 +439,31 @@ export default {
         .then(res => {
           // console.log("updateExamineCogData", res);
           // this.CopDigSco();
+          this.getDigData();
         })
         .catch(error => {
           console.log(error);
         });
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-      this.page = val;
-      this.getData();
-    },
     // 查看数据来源
     lookUserPrize(cid) {
       // return console.log(val);
+      if (this.tableData.length <= 0)
+        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.digOid}&org=${this.digOrg}&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.oid}&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;
     },
-    // 切换专任,班主任
+    // 弹框方法切换专任,班主任
     cutPage(e) {
       this.digType = e;
       this.digLoading = true;
 
-      this.getDataDig();
+      // this.getDataDig();
     },
-    // 点击弹框内数据切换页面数据
+    // 弹框内班主任与专任教师切换,刷新tableData数据
     getDataDig() {
       let params = {
         oid: this.oid,
@@ -397,115 +475,109 @@ export default {
         .get(this.$store.state.api + "selectTestExamineSecondData", params)
         .then(res => {
           let data = res.data[0];
-
-          data.forEach(e => {
-            e.json = JSON.parse(e.json);
-          });
-          // return console.log("selectTestExamineSecondData", data);
-
-          data.forEach(e => {
-            e.evaSca = 0;
-            e.cogSco = 0;
-            e.step = 0;
-            e.allStep = 0;
-
-            e.json.forEach(i => {
-              i.children.forEach(k => {
-                e.evaSca = e.evaSca + k.sco1 * 1;
-                e.cogSco = e.cogSco + k.sco2 * 1;
-                e.allStep++;
-                if (!!k.sco2 * 1) {
-                  e.step++;
-                }
-              });
-            });
-          });
-
           this.tableData = data;
-          // 这一步是为了获取弹窗表单第一个人
-          if (this.tableData.length > 0) {
-            this.DigSelfSco = 0;
-            this.twoTarget = 0;
 
-            this.digTid = this.tableData[0].id;
-            this.diaSco = true;
-            this.digUserid = this.tableData[0].userid;
-            this.digOid = this.tableData[0].organizeid;
-            this.digOrg = this.tableData[0].org;
-            this.disTeaClass = this.tableData[0].tea;
+          // 这一步是为了获取弹窗表单第一个人,如果为空的话就清空数据
+          if (this.tableData.length > 0) {
+            this.DigSelfSco = 0; //弹框自评分
+            this.twoTarget = 0; //二级指标个数
+            this.digTid = this.tableData[0].id; //表单id
+            // this.diaSco = true;
+            this.digUserid = this.tableData[0].userid; //弹框tableData数组中第一个数据userid
+            this.disTeaClass = this.tableData[0].tea; //弹框tableData数组中第一个数据教研室
+            // 判断所处数组第几位,方便后面上下切换
             this.cutPerson();
+            // 获取基础模版,重新开始渲染数据
             this.getPageBase();
           } else {
-            this.DigSelfSco = 0;
-            this.twoTarget = 0;
-            this.digTid = "";
-            // this.diaSco = true;
-            this.digUserid = "";
-            this.digOid = "";
-            this.digOrg = "";
-            this.disTeaClass = "";
+            // 切换后tableData里没有数据的话将,自评分什么的清空
+            this.getPageBase2();
           }
+
           // console.log("this.tableData", this.tableData);
         })
         .catch(error => {
           console.log(error);
         });
     },
-    // 关闭弹框
-    handleClose(done) {
-      this.getData();
-      done();
+    // 弹框切换上一个教师
+    upTea() {
+      if (this.cutTeaNum <= 0) return this.$message.error("已经是第一个了");
+      this.digLoading = true;
+
+      this.cutTeaNum--;
+      this.digUsername = this.tableData[this.cutTeaNum].username;
+      this.disTeaClass = this.tableData[this.cutTeaNum].tea;
+      this.digUserid = this.tableData[this.cutTeaNum].userid;
+      this.digTid = this.tableData[this.cutTeaNum].id;
+
+      this.getPageBase();
     },
-    // 获取页面数据
-    getData() {
+    // 弹框切换下一个教师
+    nextTea() {
+      // console.log("this.tableData", this.tableData);
+      if (this.cutTeaNum + 1 >= this.tableData.length)
+        return this.$message.error("已经是最后一个了");
+      this.digLoading = true;
+
+      this.cutTeaNum++;
+      this.digUsername = this.tableData[this.cutTeaNum].username;
+      this.disTeaClass = this.tableData[this.cutTeaNum].tea;
+      this.digUserid = this.tableData[this.cutTeaNum].userid;
+      this.digTid = this.tableData[this.cutTeaNum].id;
+
+      this.getPageBase();
+    },
+    // 弹框专任与班主任切换数据为空时,将表单清空
+    getPageBase2() {
       let params = {
-        oid: this.oid,
+        typ: this.digType,
         org: this.org,
-        type: this.pType,
-        page: this.page
+        oid: this.oid
       };
-      // console.log(params);
       this.ajax
-        .get(this.$store.state.api + "selectTestExaminePersonData", params)
+        .get(this.$store.state.api + "selectTestExamineBase", params)
         .then(res => {
-          let data = res.data[0];
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-
-          data.forEach(e => {
-            e.json = JSON.parse(e.json);
-          });
-          // return console.log("selectTestExamineSecondData", data);
-
-          data.forEach(e => {
-            e.evaSca = 0;
-            e.cogSco = 0;
-            e.step = 0;
-            e.allStep = 0;
+          // console.log("selectTestExamineBase", res.data[0][0]);
+          this.DigSelfSco = 0;
+          this.twoTarget = 0;
+          this.digTid = "";
+          this.digUserid = "";
+          this.disTeaClass = "";
+          this.digUsername = "暂无提交";
 
-            e.json.forEach(i => {
-              i.children.forEach(k => {
-                e.evaSca = e.evaSca + k.sco1 * 1;
-                e.cogSco = e.cogSco + k.sco2 * 1;
-                e.allStep++;
-                if (!!k.sco2 * 1) {
-                  e.step++;
-                }
-              });
-            });
-          });
+          this.PageBaseData = JSON.parse(res.data[0][0].json);
+          // 处理数据来源
+          this.handleData();
+          this.digLoading = false;
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    // 弹框获取页面基础ui信息
+    getPageBase() {
+      let params = {
+        typ: this.digType,
+        org: this.org,
+        oid: this.oid
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTestExamineBase", params)
+        .then(res => {
+          // console.log("selectTestExamineBase", res.data[0][0]);
 
-          data.forEach(e => {
-            e.evaSca = e.evaSca.toFixed(2);
-            e.cogSco = e.cogSco.toFixed(2);
-          });
-          this.tableData = data;
-          console.log("this.tableData", this.tableData);
+          this.PageBaseData = JSON.parse(res.data[0][0].json);
+          // 处理数据来源
+          this.handleData();
+          // 先获取基础模板,然后再获取用户又没有填写过,填写过就开始循环赋值给基础模板,最后提交基础模板
+          this.getDigData();
         })
         .catch(error => {
           console.log(error);
         });
     },
-    // 获取Dig弹框页面数据
+    // 弹框获取页面渲染数据
     getDigData() {
       let params = {
         uid: this.digUserid,
@@ -536,12 +608,12 @@ export default {
               });
             });
 
+            // 弹框计算自评分数,与二级指标个数
             this.getTwoRigData();
-
-            this.handleData();
           } else {
-            this.getTwoRigData();
-            this.handleData();
+            // 清空自评分数,与二级指标个数
+            this.DigSelfSco = 0;
+            this.twoTarget = 0;
           }
           this.digLoading = false;
         })
@@ -549,6 +621,7 @@ export default {
           console.log(error);
         });
     },
+    // 弹框计算自评分数,与二级指标个数
     getTwoRigData() {
       this.DigSelfSco = 0;
       this.twoTarget = 0;
@@ -562,25 +635,20 @@ export default {
       });
       this.DigSelfSco = this.DigSelfSco.toFixed(2);
     },
-    // 获取页面基础ui信息
-    getPageBase() {
-      let params = {
-        typ: this.digType,
-        org: this.org,
-        oid: this.oid
-      };
-      this.ajax
-        .get(this.$store.state.api + "selectTestExamineBase", params)
-        .then(res => {
-          console.log("selectTestExamineBase", res.data[0][0]);
 
-          this.PageBaseData = JSON.parse(res.data[0][0].json);
-          // 先获取基础模板,然后再获取用户又没有填写过,填写过就开始循环赋值给基础模板,最后提交基础模板
-          this.getDigData();
-        })
-        .catch(error => {
-          console.log(error);
-        });
+    // 获取用户列表位置,以及用户名称
+    cutPerson() {
+      this.tableData.forEach((e, index) => {
+        if (e.userid == this.digUserid) {
+          this.cutTeaNum = index;
+          this.digUsername = e.username;
+        }
+      });
+    },
+    // 关闭弹框
+    handleClose(done) {
+      this.getData();
+      done();
     },
 
     // 处理数据来源
@@ -611,45 +679,6 @@ export default {
             console.log(error);
           });
       });
-    },
-    // 切换教师
-    upTea() {
-      if (this.cutTeaNum <= 0) return this.$message.error("已经是第一个了");
-      this.digLoading = true;
-
-      this.cutTeaNum--;
-      this.digUsername = this.tableData[this.cutTeaNum].username;
-      this.disTeaClass = this.tableData[this.cutTeaNum].tea;
-      this.digUserid = this.tableData[this.cutTeaNum].userid;
-      this.digOid = this.tableData[this.cutTeaNum].organizeid;
-      this.digOrg = this.tableData[this.cutTeaNum].org;
-      this.digTid = this.tableData[this.cutTeaNum].id;
-
-      this.getPageBase();
-    },
-    nextTea() {
-      // console.log("this.tableData", this.tableData);
-      if (this.cutTeaNum + 1 >= this.tableData.length)
-        return this.$message.error("已经是最后一个了");
-      this.digLoading = true;
-
-      this.cutTeaNum++;
-      this.digUsername = this.tableData[this.cutTeaNum].username;
-      this.disTeaClass = this.tableData[this.cutTeaNum].tea;
-      this.digUserid = this.tableData[this.cutTeaNum].userid;
-      this.digOid = this.tableData[this.cutTeaNum].organizeid;
-      this.digOrg = this.tableData[this.cutTeaNum].org;
-      this.digTid = this.tableData[this.cutTeaNum].id;
-
-      this.getPageBase();
-    },
-    cutPerson() {
-      this.tableData.forEach((e, index) => {
-        if (e.userid == this.digUserid) {
-          this.cutTeaNum = index;
-          this.digUsername = e.username;
-        }
-      });
     }
   }
 };

+ 247 - 201
src/components/pages/test/examine/conpoments/targetPage.vue

@@ -118,7 +118,7 @@
       </div>
     </div>
 
-    <!-- 点击查看 -->
+    <!-- 点击查看数据来源 -->
     <el-dialog
       title=""
       :visible.sync="diaIframe"
@@ -158,10 +158,11 @@
             <div>认定平均分:{{ !evaScoDigCog ? 0 : evaScoDigCog }}</div>
             <div>存在分差总人数:{{ evaScoDigPerC }}</div>
           </div>
-          <!-- <div class="diaScoreRight">
-            <el-button size="small" type="primary">保存</el-button>
-            <el-button size="small" type="primary">提交</el-button>
-          </div> -->
+          <div class="diaScoreRight">
+            <el-button size="small" @click="allSubmit" type="primary"
+              >保存</el-button
+            >
+          </div>
         </div>
         <el-table class="scoTab" :data="tableData" style="width: 100%">
           <el-table-column type="index" align="center" label="序号" width="180">
@@ -173,7 +174,12 @@
             width="180"
           >
           </el-table-column>
-          <el-table-column prop="tea" align="center" label="教研室">
+          <el-table-column
+            :show-overflow-tooltip="true"
+            prop="tea"
+            align="center"
+            label="教研室"
+          >
           </el-table-column>
           <el-table-column prop="score" align="center" label="分值">
           </el-table-column>
@@ -187,7 +193,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="数据来源">
+          <el-table-column width="300px" align="center" label="数据来源">
             <template slot-scope="scope">
               <div v-if="!scope.row.orgData.length">/</div>
               <div v-else style="padding-top: 10px;">
@@ -242,9 +248,6 @@
           </el-table-column>
         </el-table>
       </div>
-      <!-- <span slot="footer" class="dialog-footer">
-        <el-button @click="diaScore = false">关 闭</el-button>
-      </span> -->
     </el-dialog>
   </div>
 </template>
@@ -1315,86 +1318,122 @@ export default {
   },
 
   methods: {
-    // 分数提交
-    Submit(val) {
-      console.log("Submit", val);
-      this.tableData.forEach(e => {
-        if (e.id == val.id) {
-          e.judge = 0;
-        }
-      });
+    // 获取基础页面数据
+    getPageBase() {
+      this.tabLoad = true;
+      let params = {
+        typ: this.pType,
+        org: this.org,
+        oid: this.oid
+      };
+      // console.log(params);
+      this.ajax
+        .get(this.$store.state.api + "selectTestExamineBase", params)
+        .then(res => {
+          this.tableJsonCon = JSON.parse(res.data[0][0].json);
 
-      // return console.log(this.tableData);
+          this.handleData();
+          this.getData();
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    // 获取首页数据计算审核进度,自评平均分,考核平均分
+    getData() {
+      let params = {
+        oid: this.oid,
+        org: this.org,
+        type: this.pType
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTestExamineAllData", params)
+        .then(res => {
+          // pum是判断审核进度的计数器
+          this.tableJsonCon.forEach(e => {
+            e.children.forEach(i => {
+              i.pum = 0;
+            });
+          });
 
-      if (val.cogSco > val.score) {
-        val.cogSco = val.score;
-      }
+          if (!res.data[0].length) return (this.tabLoad = false);
 
-      val.json.forEach(e => {
-        e.children.forEach(i => {
-          if (i.id == this.secondId) {
-            i.sco2 = val.cogSco;
-            i.cogSum = val.cogSummary;
-          }
-        });
-      });
+          this.allData = res.data[0];
+          let data = res.data[0];
+          // 转json
+          data.forEach(e => {
+            e.json = JSON.parse(e.json);
+          });
+          // console.log("data", data);
 
-      // console.log("valval", val.json);
+          this.tableJsonCon.forEach(a => {
+            data.forEach(b => {
+              b.json.forEach(c => {
+                if (a.id == c.id) {
+                  a.children.forEach((d, index) => {
+                    if (d.id == c.children[index].id) {
+                      // console.log('c.children[index].sco1',c.children[index].sco1);
+                      d.sco1 = d.sco1 * 1 + c.children[index].sco1 * 1;
+                      d.sco2 = d.sco2 * 1 + c.children[index].sco2 * 1;
+                      if (!!c.children[index].sco2 * 1) {
+                        d.pum++;
+                      }
+                    }
+                  });
+                }
+              });
+            });
+          });
 
-      let params = [
-        {
-          uid: this.userid,
-          tid: val.id,
-          json: JSON.stringify(val.json)
-        }
-      ];
-      // return console.log(params);
-      this.ajax
-        .post(this.$store.state.api + "updateExamineCogData", params)
-        .then(res => {
-          // console.log("updateExamineCogData", res);
-          this.getSecondData()
-          // this.CopDigSco();
-          
+          this.tableJsonCon.forEach(e => {
+            e.children.forEach(i => {
+              i.sco1 = (i.sco1 / this.allData.length).toFixed(2);
+              i.sco2 = (i.sco2 / this.allData.length).toFixed(2);
+            });
+          });
+          this.tabLoad = false;
         })
         .catch(error => {
           console.log(error);
         });
     },
-
-    // 概述提交
-    Submit2(val) {
-      // val.cogSco = !val.cogSco ? 0 : val.cogSco;
-
-      val.json.forEach(e => {
-        e.children.forEach(i => {
-          if (i.id == this.secondId) {
-            i.cogSum = val.cogSummary;
+    async handleData() {
+      for (const e of this.tableJsonCon) {
+        for (const k of e.children) {
+          if (k.testid.test.length > 0) {
+            k.testid.test = await this.computedTest(k.testid.test);
           }
-        });
-      });
-
+        }
+      }
+    },
+    computedTest(val) {
       let params = [
         {
-          uid: this.userid,
-          tid: val.id,
-          json: JSON.stringify(val.json)
+          uid: "",
+          testId: val.join(",")
         }
       ];
-      // return console.log(params);
-      this.ajax
-        .post(this.$store.state.api + "updateExamineCogData", params)
-        .then(res => {
-          // console.log("updateExamineCogData", res);
-          // 计算评分弹框平均值等
-          // this.CopDigSco();
-          this.getSecondData()
+      return new Promise(resolve => {
+        this.ajax
+          .post(this.$store.state.api + "selectExamineTestName", params)
+          .then(res => {
+            // console.log("resresresres", res.data[0]);
+            // console.log(res.data[0]);
+            resolve(res.data[0]);
+          })
+          .catch(error => {
+            console.log(error);
+          });
+      });
+    },
 
-        })
-        .catch(error => {
-          console.log(error);
-        });
+    // 查看数据来源
+    lookPrize(val) {
+      this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${val}&oid=${this.oid}&org=${this.org}&type=2&role=0`;
+      // 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;
     },
+    // ----------------------------首页操作与弹框操作分界线
     // 查看评分
     lookScore(val, oneName, twoName) {
       this.evaScoDig = true;
@@ -1403,20 +1442,18 @@ export default {
 
       this.tableData = [];
 
-      // this.cogSco = "";
-      // this.cogSummary = "";
-
       this.secondId = val;
       this.getSecondData();
       this.diaScore = true;
     },
+
+    // 弹框获取这个学校所有的提交表单
     getSecondData() {
       let params = {
         oid: this.oid,
         org: this.org,
         type: this.pType
       };
-      // console.log(params);
       this.ajax
         .get(this.$store.state.api + "selectTestExamineSecondData", params)
         .then(res => {
@@ -1427,13 +1464,13 @@ export default {
           // console.log("selectTestExamineSecondData", data);
 
           data.forEach(e => {
-            e.evaSca = "";
-            e.evaMed = "";
-            e.orgData = [];
-            e.cogSco = "";
-            e.cogSummary = "";
-            e.score = 0;
-            e.judge = 0;
+            e.evaSca = ""; //自评分数
+            e.evaMed = ""; //自评概述
+            e.orgData = []; //数据来源
+            e.cogSco = ""; //认定分数
+            e.cogSummary = ""; //认定概述
+            e.score = 0; //分值
+            e.judge = 0; //是否填充为默认分数 1:默认等于自评分
             e.json.forEach(i => {
               i.children.forEach(k => {
                 if (k.id == this.secondId) {
@@ -1441,9 +1478,7 @@ export default {
                   e.evaMed = k.selfSummary;
                   e.orgData = k.testid.test;
                   e.score = k.score;
-                  // e.cogSco = k.sco2;
                   e.cogSummary = k.cogSum;
-                  // console.log("k.sco2", typeof k.sco2);
                   if (!!k.sco2) {
                     e.cogSco = k.sco2;
                   } else {
@@ -1454,10 +1489,8 @@ export default {
               });
             });
           });
-          // console.log("data", data);
 
           this.tableData = data;
-          // console.log("this.tableData", this.tableData);
 
           // 计算评分弹框平均值等
           this.CopDigSco();
@@ -1470,11 +1503,11 @@ export default {
           console.log(error);
         });
     },
-    // 计算评分弹框平均值等
+    // 弹框计算评分弹框平均值等
     CopDigSco() {
-      this.evaScoDigSvg = 0;
-      this.evaScoDigCog = 0;
-      this.evaScoDigPerC = 0;
+      this.evaScoDigSvg = 0; //自评平均
+      this.evaScoDigCog = 0; //认定平均
+      this.evaScoDigPerC = 0; //存在分差人数
       this.tableData.forEach(e => {
         this.evaScoDigSvg += e.evaSca * 1;
         this.evaScoDigCog += e.cogSco * 1;
@@ -1490,13 +1523,13 @@ export default {
         2
       );
     },
+
+    // 弹框中处理数据来源
     async handleScoData() {
       for (const e of this.tableData) {
-        // for (const k of e.children) {
         if (e.orgData.length > 0) {
           e.orgData = await this.computedScoTest(e.orgData, e.userid);
         }
-        // }
       }
     },
     computedScoTest(val, uid) {
@@ -1518,69 +1551,8 @@ export default {
           });
       });
     },
-    // 获取数据计算审核进度,自评平均分,考核平均分
-    getData() {
-      let params = {
-        oid: this.oid,
-        org: this.org,
-        type: this.pType
-      };
-      // console.log(params);
-      this.ajax
-        .get(this.$store.state.api + "selectTestExamineAllData", params)
-        .then(res => {
-          // pum是判断审核进度的计数器
-          this.tableJsonCon.forEach(e => {
-            e.children.forEach(i => {
-              i.pum = 0;
-            });
-          });
-          // console.log("selectTestExamineAllData", res.data[0]);
-          if (!res.data[0].length) return (this.tabLoad = false);
-
-          this.allData = res.data[0];
-          let data = res.data[0];
-          // 转json
-          data.forEach(e => {
-            e.json = JSON.parse(e.json);
-          });
-          // console.log("data", data);
 
-          this.tableJsonCon.forEach(a => {
-            data.forEach(b => {
-              b.json.forEach(c => {
-                if (a.id == c.id) {
-                  a.children.forEach((d, index) => {
-                    if (d.id == c.children[index].id) {
-                      // console.log('c.children[index].sco1',c.children[index].sco1);
-                      d.sco1 = d.sco1 * 1 + c.children[index].sco1 * 1;
-                      d.sco2 = d.sco2 * 1 + c.children[index].sco2 * 1;
-                      if (!!c.children[index].sco2 * 1) {
-                        d.pum++;
-                      }
-                    }
-                  });
-                }
-              });
-            });
-          });
-
-          this.tableJsonCon.forEach(e => {
-            e.children.forEach(i => {
-              i.sco1 = (i.sco1 / this.allData.length).toFixed(2);
-              i.sco2 = (i.sco2 / this.allData.length).toFixed(2);
-            });
-          });
-          // console.log("this.tableJsonCon", this.tableJsonCon);
-          this.tabLoad = false;
-
-          // this.tableJsonCon.forEach(e => {});
-        })
-        .catch(error => {
-          console.log(error);
-        });
-    },
-    // 查看数据来源
+    // 弹框查看数据来源
     lookUserPrize(val, cid) {
       // return console.log(val);
       // 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}`;
@@ -1589,65 +1561,140 @@ export default {
       // 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;
     },
-    // 获取基础页面数据
-    getPageBase() {
-      this.tabLoad = true;
-      let params = {
-        typ: this.pType,
-        org: this.org,
-        oid: this.oid
-      };
-      // console.log(params);
+
+    //分数提交与概述提交不一个函数是因为:
+    // 认定分数默认等于自评分数,管理员点击到评分才会提交默认分数,点击概述则不会提交分数
+
+    // 分数提交
+    Submit(val) {
+      //#region
+      // 修改了将页面上的分数也改变颜色,(方式改变,无用了)
+      // this.tableData.forEach(e => {
+      //   if (e.id == val.id) {
+      //     e.judge = 0;
+      //   }
+      // });
+      //#endregion
+      if (val.cogSco > val.score) {
+        val.cogSco = val.score;
+      }
+
+      val.json.forEach(e => {
+        e.children.forEach(i => {
+          if (i.id == this.secondId) {
+            i.sco2 = val.cogSco;
+            i.cogSum = val.cogSummary;
+          }
+        });
+      });
+
+      let params = [
+        {
+          uid: this.userid,
+          tid: val.id,
+          json: JSON.stringify(val.json)
+        }
+      ];
+      // return console.log(params);
       this.ajax
-        .get(this.$store.state.api + "selectTestExamineBase", params)
+        .post(this.$store.state.api + "updateExamineCogData", params)
         .then(res => {
-          // console.log("resresresres", res.data[0]);
-          // console.log("selectTestExamineBase", res.data[0][0]);
+          this.getSecondData();
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
 
-          this.tableJsonCon = JSON.parse(res.data[0][0].json);
+    // 概述提交
+    Submit2(val) {
+      val.json.forEach(e => {
+        e.children.forEach(i => {
+          if (i.id == this.secondId) {
+            i.cogSum = val.cogSummary;
+          }
+        });
+      });
 
-          this.handleData();
-          this.getData();
+      let params = [
+        {
+          uid: this.userid, //修改人id
+          tid: val.id,
+          json: JSON.stringify(val.json)
+        }
+      ];
+      // return console.log(params);
+      this.ajax
+        .post(this.$store.state.api + "updateExamineCogData", params)
+        .then(res => {
+          this.getSecondData();
         })
         .catch(error => {
           console.log(error);
         });
     },
-    async handleData() {
-      for (const e of this.tableJsonCon) {
-        for (const k of e.children) {
-          if (k.testid.test.length > 0) {
-            k.testid.test = await this.computedTest(k.testid.test);
+
+    // 一键保存:将默认分数什么一键提交
+    async allSubmit() {
+      this.$confirm("确认保存?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: " info"
+      })
+        .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("已保存");
+          });
+        })
+        .catch(() => {
+          this.handleData();
+
+          this.$message({
+            type: "info",
+            message: "已取消保存"
+          });
+        });
     },
-    computedTest(val) {
+    Submit3(val) {
+      if (val.cogSco > val.score) {
+        val.cogSco = val.score;
+      }
+
+      val.json.forEach(e => {
+        e.children.forEach(i => {
+          if (i.id == this.secondId) {
+            i.sco2 = val.cogSco;
+            i.cogSum = val.cogSummary;
+          }
+        });
+      });
+
       let params = [
         {
-          uid: "",
-          testId: val.join(",")
+          uid: this.userid,
+          tid: val.id,
+          json: JSON.stringify(val.json)
         }
       ];
-      return new Promise(resolve => {
-        this.ajax
-          .post(this.$store.state.api + "selectExamineTestName", params)
-          .then(res => {
-            // console.log("resresresres", res.data[0]);
-            // console.log(res.data[0]);
-            resolve(res.data[0]);
-          })
-          .catch(error => {
-            console.log(error);
-          });
-      });
-    },
-    // 查看数据来源
-    lookPrize(val) {
-      this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${val}&oid=${this.oid}&org=${this.org}&type=2&role=0`;
-      // 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;
+      // return console.log(params);
+      this.ajax
+        .post(this.$store.state.api + "updateExamineCogData", params)
+        .then(res => {})
+        .catch(error => {
+          console.log(error);
+        });
     },
+
     // 关闭弹框
     handleClose(done) {
       this.getPageBase();
@@ -1718,7 +1765,7 @@ input[type="number"] {
 }
 .diaScoreTop {
   display: flex;
-  justify-content: flex-start;
+  justify-content: space-between;
   height: 60px;
 }
 
@@ -1839,7 +1886,6 @@ input[type="number"] {
   justify-content: center;
   align-items: center;
   border-bottom: 1px #ccc solid;
-
 }
 .twoCon {
   display: flex;