Selaa lähdekoodia

教师管理,年度考核页面

11wqe1 9 kuukautta sitten
vanhempi
commit
9da6cff8b5

+ 514 - 96
src/components/pages/test/examine/conpoments/personPage.vue

@@ -1,72 +1,165 @@
 <template>
   <div>
-    <div v-if="pType==0">
-      <el-table
-        :data="tableData"
-        border
-        class="tableData"
-        style="width: 50%">
-        <el-table-column
-          prop="ordinal"
-          label="序号">
+    <div class="personPage">
+      <el-table :data="tableData" class="scoTab" style="width: 100%">
+        <el-table-column type="index" align="center" label="序号" width="180">
         </el-table-column>
-        <el-table-column
-          prop="teachername"
-          label="教师姓名">
+        <el-table-column prop="username" align="center" label="教师姓名">
         </el-table-column>
         <el-table-column
-          prop="department"
-          label="教研室">
+          prop="tea"
+          show-overflow-tooltip
+          align="center"
+          label="教研室"
+          width="180"
+        >
         </el-table-column>
-        <el-table-column
-          prop="submissions"
-          label="提交情况">
+        <el-table-column align="center" label="提交情况">
+          <template slot-scope="scope">
+            <div>是</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="schedule"
-          label="考核进度">
+        <el-table-column align="center" label="考核进度">
+          <template slot-scope="scope">
+            <div>{{ scope.row.step }}/{{ scope.row.allStep }}</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          prop="selffraction"
-          label="自评分数">
+        <el-table-column prop="evaSca" align="center" label="自评分数">
         </el-table-column>
-        <el-table-column
-          prop="nucleusfraction"
-          label="考核分数">
+        <el-table-column prop="cogSco" align="center" label="考核分数">
         </el-table-column>
-        <el-table-column
-        label="操作">
+        <el-table-column align="center" label="评分">
           <template slot-scope="scope">
-            <div class="TabBtn" @click="lookPrize">查看</div>
+            <div class="TabBtn" @click="lookScore(scope.row)">评分</div>
           </template>
         </el-table-column>
       </el-table>
     </div>
-    <div v-if="pType==1">
-      按人员班主任
-    </div>
-
-     <!-- 点击查看 -->
+    <!-- 点击评分 -->
     <el-dialog
       title=""
-      :visible.sync="diaIframe"
+      :visible.sync="diaSco"
       :append-to-body="true"
       width="95%"
       :before-close="handleClose"
       class="dialog_diy"
     >
-      <div style="height: 100%;">
-        <iframe
-          ref="viframe"
-          style="width: 100%; height: 99%; border: none"
-          :src="ifmUrl"
-        ></iframe>
+      <div class="testPersonExamine">
+        <div class="testTit">
+          <div class="teaLis">
+            <div
+              class="teal"
+              @click="cutPage(2)"
+              :class="[digType == 2 ? 'Tbor' : '']"
+            >
+              专任教师
+            </div>
+            <div
+              class="teal"
+              @click="cutPage(1)"
+              :class="[digType == 1 ? 'Tbor' : '']"
+            >
+              班主任考核
+            </div>
+          </div>
+        </div>
+        <div class="digTop">
+          <div
+            style="width: 230px;display: flex;justify-content: space-between;align-items: center;"
+          >
+            <div>教师姓名</div>
+            <div><el-button type="primary" size="mini">上一个</el-button></div>
+            <div><el-button type="primary" size="mini">下一个</el-button></div>
+          </div>
+          <div
+            style="width: 650px;display: flex;justify-content: space-between;"
+          >
+            <div>
+              <span>教研室:</span
+              ><el-tooltip
+                class="item"
+                effect="dark"
+                content="深技师"
+                placement="top"
+              >
+                <div
+                  style="width: 100px;display: flex;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
+                >
+                  深技师
+                </div>
+              </el-tooltip>
+            </div>
+            <div>审核进度:</div>
+            <div>自评分数:</div>
+            <div>考核分数:</div>
+          </div>
+        </div>
+        <div>
+          <div class="sBox_table">
+            <div class="table_title">
+              <div>一级指标</div>
+              <div>二级指标</div>
+              <div>评价方法</div>
+              <div>分值</div>
+              <div>自评</div>
+              <div>自评概述</div>
+              <div>数据来源</div>
+              <div>认定</div>
+              <div>认定概述</div>
+            </div>
+            <div
+              class="table_Content"
+              v-for="item in PageBaseData"
+              :key="item.id"
+            >
+              <div class="twoCol">
+                <div class="ColTit">{{ item.name }}</div>
+                <div class="ColCon">
+                  <div class="twoCon" v-for="k in item.children" :key="k.id">
+                    <div>{{ k.name }}</div>
+                    <div style="padding: 10px;box-sizing: border-box;">
+                      {{ k.evaMethod }}
+                    </div>
+                    <div>{{ k.score }}</div>
+                    <div>
+                      {{ k.sco1 }}
+                    </div>
+                    <div class="tArea">
+                      {{ k.selfSummary }}
+                    </div>
+                    <div>
+                      <div v-if="!k.testid.test.length">/</div>
+                      <div v-else style="padding-top: 10px;">
+                        <!-- {{ reverseString(k.testid.test) }} -->
+                        <div
+                          v-for="(item2, index) in k.testid.test"
+                          :key="item2.courseId"
+                          class="orgData"
+                        >
+                          <div @click="lookPrize(item2.courseId)">
+                            {{ item2.title }}:{{ item2.num }}份
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                    <div style="display: flex;justify-content: center;">
+                      <div class="ScoreStep">
+                        <input type="number" v-model="k.sco2" />
+                        <!-- @blur="Submit(scope.row)" -->
+                      </div>
+                    </div>
+                    <div style="display: flex;justify-content: center;">
+                      <textarea v-model.trim="k.cogSum" />
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
       </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="diaIframe = false">关 闭</el-button>
-      </span>
     </el-dialog>
-</div>
+  </div>
 </template>
 
 <script>
@@ -78,77 +171,222 @@ export default {
       default: 0
     }
   },
+  watch: {
+    pType(newVal, oldVal) {
+      this.getData();
+    },
+    digType(newVal, oldVal) {
+      this.getPageBase();
+    }
+  },
   data() {
     return {
-      diaIframe:false,
-      ifmUrl: "",
-      tableData: [{
-          ordinal: '12',
-          teachername: '王小虎',
-          department: '语文',
-          submissions: '是',
-          schedule: '√',
-          selffraction: '98.5',
-          nucleusfraction: '94.2',
-          rating:'评分'
-        }, {
-          ordinal: '12',
-          teachername: '王小虎',
-          department: '语文',
-          submissions: '是',
-          schedule: '√',
-          selffraction: '98.5',
-          nucleusfraction: '94.2',
-          rating:'评分'
-        }, {
-          ordinal: '12',
-          teachername: '王小虎',
-          department: '语文',
-          submissions: '是',
-          schedule: '√',
-          selffraction: '98.5',
-          nucleusfraction: '94.2',
-          rating:'评分'
-        },{
-          ordinal: '12',
-          teachername: '王小虎',
-          department: '语文',
-          submissions: '是',
-          schedule: '√',
-          selffraction: '98.5',
-          nucleusfraction: '94.2',
-          rating:'评分'
-        }]
+      digType: 2,
+      diaSco: false,
+      PageBaseData: [],
+      digUserid: "", //用户id
+      digUserName: "",
+      digOid: "", //学校id
+      digOrg: "", //组织id
+      userid: this.$route.query.userid, //用户id
+      oid: this.$route.query.oid, //学校id
+      org: this.$route.query.org, //组织id
+      tableData: []
     };
   },
-   methods: {
-        // 查看数据来源
-    lookPrize() {
-      this.diaIframe = true;
+  mounted() {
+    this.getData();
+  },
+  methods: {
+    // 切换专任,班主任
+    cutPage(e) {
+      this.digType = e;
     },
     // 关闭弹框
     handleClose(done) {
+      this.getData();
       done();
     },
-   }
+    // 获取页面数据
+    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);
+          });
+          // 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.evaSca + k.sco2 * 1;
+                e.allStep++;
+                if (!!k.sco2 * 1) {
+                  e.step++;
+                }
+              });
+            });
+          });
+
+          this.tableData = data;
+          console.log("this.tableData", this.tableData);
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    // 获取Dig弹框页面数据
+    getDigData() {
+      let params = {
+        uid: this.userid,
+        type: this.digType
+      };
+      this.ajax
+        .get(this.$store.state.api + "getTestExamineByUserId", params)
+        .then(res => {
+          console.log("getTestExamineByUserId", res);
+
+          if (res.data[0].length > 0) {
+            let val = JSON.parse(res.data[0][0].json);
+
+            this.PageBaseData.forEach(e => {
+              val.forEach(i => {
+                if (e.id == i.id) {
+                  e.name = i.name;
+                  e.children.forEach(a => {
+                    i.children.forEach(b => {
+                      if (a.id == b.id) {
+                        a.name = b.name;
+                        a.score = b.score;
+                        a.sco1 = b.sco1;
+                        a.sco2 = b.sco2;
+                        a.evaStandard = b.evaStandard;
+                        a.evaMethod = b.evaMethod;
+                        a.cogSum = b.cogSum;
+                        a.selfSummary = b.selfSummary;
+                        a.dep = b.dep;
+                        a.type = b.type;
+                        a.testid = b.testid;
+                      }
+                    });
+                  });
+                }
+              });
+            });
+            this.handleData();
+            return;
+          } else {
+            this.handleData();
+          }
+        })
+        .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]);
+          this.PageBaseData = JSON.parse(res.data[0][0].json);
+          // 先获取基础模板,然后再获取用户又没有填写过,填写过就开始循环赋值给基础模板,最后提交基础模板
+          this.getDigData();
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+
+    // 处理数据来源
+    async handleData() {
+      for (const e of this.PageBaseData) {
+        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.uid,
+          testId: val.join(",")
+        }
+      ];
+      return new Promise(resolve => {
+        this.ajax
+          .post(this.$store.state.api + "selectExamineTestName", params)
+          .then(res => {
+            resolve(res.data[0]);
+          })
+          .catch(error => {
+            console.log(error);
+          });
+      });
+    },
+    // 切换教师
+    cutPerson() {
+      this.tableData.forEach(e => {
+        if (e.userid == this.digUserid) {
+          this.digUserName = e.username;
+        }
+      });
+    },
+    // 点击评分
+    lookScore(val) {
+      this.diaSco = true;
+      this.digUserid = val.userid;
+      this.digOid = val.organizeid;
+      this.digOrg = val.org;
+      this.cutPerson();
+      this.getPageBase();
+    }
+  }
 };
 </script>
-<style>
-.el-table td, .el-table th.is-leaf {
-  text-align:center;
-}
-</style>
 <style scoped>
+.personPage >>> .el-table tr {
+  height: 70px;
+}
+.digTop {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin: 15px 0;
+}
 .TabBtn {
   cursor: pointer;
   color: #528df6;
 }
-
 .dialog_diy >>> .el-dialog {
   height: 95%;
   margin: 0 auto !important;
   margin-top: 20px !important;
   overflow: hidden;
+  min-width: 800px !important;
 }
 
 .dialog_diy >>> .el-dialog__header {
@@ -157,7 +395,7 @@ export default {
 }
 
 .dialog_diy >>> .el-dialog__body {
-  height: calc(100% - 124px);
+  height: calc(100% - 50px);
   box-sizing: border-box;
   padding: 0px;
 }
@@ -182,4 +420,184 @@ export default {
 .dialog_diy >>> .el-dialog__footer {
   background: #fafafa;
 }
+.ScoreStep {
+  height: 100%;
+}
+.ScoreStep > input {
+  height: 100% !important;
+  outline-style: none;
+  padding: 5px;
+  width: 100%;
+  box-sizing: border-box;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6 !important;
+}
+
+.ScoreStep >>> .el-input-number {
+  height: 100% !important;
+}
+.ScoreStep >>> .el-input {
+  height: 100% !important;
+}
+.ScoreStep >>> .el-input__inner {
+  height: 100%;
+  padding-left: 15px;
+  padding-right: 15px;
+}
+.testPersonExamine {
+  width: 100%;
+  overflow: auto;
+  min-width: calc(50px * 10);
+  height: 100%;
+  padding: 10px;
+  overflow: auto;
+  box-sizing: border-box;
+  background-color: #fff;
+}
+.tArea {
+  box-sizing: border-box;
+  padding: 5px;
+}
+.testPersonExamine > .testTit {
+  height: 100px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.teaLis {
+  display: flex;
+}
+.teal {
+  padding: 10px 20px;
+  cursor: pointer;
+}
+.Tbor {
+  border-bottom: 2px rgba(54, 129, 252, 1) solid;
+  font-weight: 600;
+}
+.testCon {
+  box-sizing: border-box;
+  padding: 20px;
+}
+
+.orgData {
+  cursor: pointer;
+  color: #528df6;
+  margin-bottom: 10px;
+}
+.sBox_table {
+  width: 100%;
+  min-width: calc(100px * 9);
+  margin: 0 auto;
+  /* min-width: 1520px; */
+  font-size: 14px;
+}
+
+.table_title {
+  width: 100%;
+  min-width: calc(100px * 9);
+  height: 50px;
+  background: #e0eafb;
+  border: 1px solid #d5d8df;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+/* 取消[type='number']的input的上下箭头 */
+input::-webkit-inner-spin-button {
+  -webkit-appearance: none !important;
+}
+
+input::-webkit-outer-spin-button {
+  -webkit-appearance: none !important;
+}
+
+input[type="number"] {
+  -moz-appearance: textfield;
+}
+.table_title > div {
+  width: calc(100% / 9);
+  min-width: 110px;
+  text-align: center;
+  height: 100%;
+  line-height: 50px;
+  border-right: 1px solid #d5d8df;
+}
+
+.table_title > div:last-child {
+  border: none;
+}
+
+.table_Content {
+  width: 100%;
+  min-width: calc(100px * 9);
+  border: 1px solid #d5d8df;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  text-align: center;
+  align-items: center;
+}
+
+.twoCol {
+  width: 100%;
+  display: flex;
+}
+
+.ColTit {
+  width: calc(100% / 9);
+  min-width: 100px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.twoCon {
+  display: flex;
+}
+.twoCon > div >>> .el-input-number {
+  height: 100% !important;
+}
+.twoCon > div >>> .el-input {
+  height: 100% !important;
+}
+.twoCon > div > input {
+  border: none;
+  width: 100%;
+  height: 100%;
+  outline-style: none;
+  text-align: center;
+}
+.twoCon {
+  display: flex;
+}
+.twoCon > div > textarea {
+  border: none;
+  width: 100%;
+  height: 100%;
+  resize: none;
+  outline-style: none;
+}
+.twoCon > div {
+  width: calc(100% / 8);
+  /* min-width: 110px; */
+  min-height: 50px;
+  /* line-height: 50px; */
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-left: 1px #ccc solid;
+  border-bottom: 1px #ccc solid;
+}
+.twoCon > div >>> .el-input__inner {
+  height: 100%;
+  border: none;
+  padding-left: 15px;
+  padding-right: 15px;
+}
+
+.ColCon {
+  flex: 1;
+}
 </style>

+ 349 - 80
src/components/pages/test/examine/conpoments/targetPage.vue

@@ -23,9 +23,13 @@
                   {{ k.dep.join(",") }}
                 </div>
                 <div>{{ k.score }}</div>
-                <div></div>
-                <div></div>
-                <div></div>
+                <div>
+                  <div v-if="allData.length">
+                    {{ k.pum }}/{{ allData.length }}
+                  </div>
+                </div>
+                <div>{{ k.sco1 }}</div>
+                <div>{{ k.sco2 }}</div>
                 <div>
                   <div v-if="!k.testid.test.length">/</div>
                   <div v-else style="padding-top: 10px;">
@@ -33,7 +37,7 @@
                       v-for="(item2, index) in k.testid.test"
                       :key="item2.courseId"
                       @click="lookPrize(item2.courseId)"
-                      class="orgData"
+                      class="orgDataCss"
                     >
                       {{ item2.title }}:{{ item2.num }}份
                     </div>
@@ -43,7 +47,12 @@
                   style="display: flex;justify-content: space-around;padding: 0 10px;box-sizing: border-box;"
                 >
                   <!-- <div class="TabBtn" @click="lookPrize">查看</div> -->
-                  <div class="TabBtn" @click="lookScore(k.id)">评分</div>
+                  <div
+                    class="TabBtn"
+                    @click="lookScore(k.id, item.name, k.name)"
+                  >
+                    评分
+                  </div>
                 </div>
               </div>
             </div>
@@ -71,9 +80,13 @@
               <div class="twoCon2" v-for="k in item.children" :key="k.id">
                 <div>{{ k.name }}</div>
                 <div>{{ k.score }}</div>
-                <div></div>
-                <div></div>
-                <div></div>
+                <div>
+                  <div v-if="allData.length">
+                    {{ k.pum }}/{{ allData.length }}
+                  </div>
+                </div>
+                <div>{{ k.sco1 }}</div>
+                <div>{{ k.sco2 }}</div>
                 <div>
                   <div v-if="!k.testid.test.length">/</div>
                   <div v-else style="padding-top: 10px;">
@@ -81,7 +94,7 @@
                       v-for="(item2, index) in k.testid.test"
                       :key="item2.courseId"
                       @click="lookPrize(item2.courseId)"
-                      class="orgData"
+                      class="orgDataCss"
                     >
                       {{ item2.title }}:{{ item2.num }}份
                     </div>
@@ -91,7 +104,12 @@
                   style="display: flex;justify-content: space-around;padding: 0 10px;box-sizing: border-box;"
                 >
                   <!-- <div class="TabBtn" @click="lookPrize">查看</div> -->
-                  <div class="TabBtn">评分</div>
+                  <div
+                    class="TabBtn"
+                    @click="lookScore(k.id, item.name, k.name)"
+                  >
+                    评分
+                  </div>
                 </div>
               </div>
             </div>
@@ -123,38 +141,93 @@
 
     <!-- 点击评分 -->
     <el-dialog
-      title=""
+      :title="evaOneName + ':' + evaTwoName"
       :visible.sync="diaScore"
       :append-to-body="true"
       width="95%"
       :before-close="handleClose"
       class="dialog_diy"
+      v-loading="evaScoDig"
     >
-      <div style="height: 100%;padding: 25px;">
+      <div
+        style="height: 100%;padding: 25px;overflow: auto; box-sizing: border-box;padding-bottom: 100px;"
+      >
         <div class="diaScoreTop">
           <div class="diaScoreLeft">
-            <div>自评平均分:</div>
-            <div>认定平均分:</div>
-            <div>存在分叉总人数:</div>
+            <div>自评平均分:{{ !evaScoDigSvg ? 0 : evaScoDigSvg }}</div>
+            <div>认定平均分:{{ !evaScoDigCog ? 0 : evaScoDigCog }}</div>
+            <div>存在分差总人数:{{ evaScoDigPerC }}</div>
           </div>
-          <div class="diaScoreRight">
+          <!-- <div class="diaScoreRight">
             <el-button size="small" type="primary">保存</el-button>
             <el-button size="small" type="primary">提交</el-button>
-          </div>
+          </div> -->
         </div>
-        <el-table :data="tableData" style="width: 100%">
-          <el-table-column type="index" label="序号" width="180">
+        <el-table class="scoTab" :data="tableData" style="width: 100%">
+          <el-table-column type="index" align="center" label="序号" width="180">
+          </el-table-column>
+          <el-table-column
+            prop="username"
+            align="center"
+            label="教师姓名"
+            width="180"
+          >
+          </el-table-column>
+          <el-table-column prop="tea" align="center" label="教研室">
           </el-table-column>
-          <el-table-column prop="name" label="教师姓名" width="180">
+          <el-table-column prop="score" align="center" label="分值">
           </el-table-column>
-          <el-table-column prop="tea" label="教研室"> </el-table-column>
-          <el-table-column prop="evaScore" label="自评分数"> </el-table-column>
-          <el-table-column prop="evaluation" label="自评概述">
+          <el-table-column prop="evaSca" align="center" label="自评分数">
+          </el-table-column>
+          <el-table-column prop="evaMed" align="center" label="自评概述">
+            <template slot-scope="scope">
+              <div v-if="!scope.row.evaMed">/</div>
+              <div v-else>
+                {{ scope.row.evaMed }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="数据来源">
+            <template slot-scope="scope">
+              <div v-if="!scope.row.orgData.length">/</div>
+              <div v-else style="padding-top: 10px;">
+                <div
+                  v-for="(item2, index) in scope.row.orgData"
+                  :key="item2.courseId"
+                  class="orgDataCss"
+                >
+                  <div>
+                    <!-- @click="lookPrize(item2.courseId)" -->
+                    {{ item2.title }}:{{ item2.num }}份
+                  </div>
+                </div>
+              </div>
+            </template>
           </el-table-column>
-          <el-table-column prop="source" label="数据来源"> </el-table-column>
-          <el-table-column prop="cognizance" label="认定分数">
+          <el-table-column width="200px" align="center" label="认定分数">
+            <template slot-scope="scope">
+              <div class="ScoreStep">
+                <input
+                  type="number"
+                  @blur="Submit(scope.row)"
+                  v-model="scope.row.cogSco"
+                />
+              </div>
+            </template>
           </el-table-column>
-          <el-table-column prop="cognizance" label="认定概述">
+          <el-table-column
+            width="200px"
+            align="center"
+            prop="cognizance"
+            label="认定概述"
+          >
+            <template slot-scope="scope">
+              <textarea
+                @blur="Submit(scope.row)"
+                class="tArea"
+                v-model.trim="scope.row.cogSummary"
+              />
+            </template>
           </el-table-column>
         </el-table>
       </div>
@@ -176,15 +249,28 @@ export default {
   },
   data() {
     return {
+      evaScoDig: false,
+      evaScoDigSvg: 0,
+      evaScoDigCog: 0,
+      evaScoDigPerC: 0,
+
       diaIframe: false, //数据来源弹框
       diaScore: false, //查看分数弹框
       ifmUrl: "", //数据来源地址
       tabLoad: false, //表格加载状态
       secondId: "", //查看评分二级id
+      // cogSco: "", // 评分弹框认定分数
+      // cogSummary: "", // 评分弹框认定概述
+
+      evaOneName: "", //评分一级指标
+      evaTwoName: "", //评分二级指标
+
       userid: this.$route.query.userid, //用户id
       oid: this.$route.query.oid, //学校id
       org: this.$route.query.org, //组织id
+      allData: [], //获取全部提交的表单
       tableJsonCon: [
+        //基础页面数据
         // {
         //   id: "q",
         //   name: "师德师风",
@@ -1153,53 +1239,13 @@ export default {
       //     ]
       //   }
       // ],
-      tableData: [
-        {
-          name: "王小虎",
-          tea: "语文",
-          evaScore: 5,
-          evaluation: "优秀",
-          source: 5,
-          cognizance: 5
-        },
-        {
-          name: "张三",
-          tea: "语文",
-          evaScore: 5,
-          evaluation: "优秀",
-          source: 5,
-          cognizance: 5
-        },
-        {
-          name: "李四",
-          tea: "语文",
-          evaScore: 5,
-          evaluation: "优秀",
-          source: 5,
-          cognizance: 5
-        },
-        {
-          name: "王五",
-          tea: "语文",
-          evaScore: 5,
-          evaluation: "优秀",
-          source: 5,
-          cognizance: 5
-        },
-        {
-          name: "金兀术",
-          tea: "语文",
-          evaScore: 5,
-          evaluation: "优秀",
-          source: 5,
-          cognizance: 5
-        }
-      ]
+      tableData: [] //弹框数据
     };
   },
   computed: {},
   watch: {
     pType(newVal, oldVal) {
+      this.allData = [];
       this.getPageBase();
     }
   },
@@ -1210,6 +1256,61 @@ export default {
   },
 
   methods: {
+    // 提交
+    Submit(val) {
+      console.log("Submit", val);
+      // if (val.cogSco != '' && val.cogSco==0) {
+
+      // }
+      // val.cogSco = !val.cogSco ? 0 : val.cogSco;
+
+      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;
+          }
+        });
+      });
+
+      // console.log("valval", val.json);
+
+      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.CopDigSco();
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    // 查看评分
+    lookScore(val, oneName, twoName) {
+      this.evaScoDig = true;
+      this.evaOneName = oneName;
+      this.evaTwoName = twoName;
+
+      this.tableData = [];
+
+      // this.cogSco = "";
+      // this.cogSummary = "";
+
+      this.secondId = val;
+      this.getSecondData();
+      this.diaScore = true;
+    },
     getSecondData() {
       let params = {
         oid: this.oid,
@@ -1221,13 +1322,92 @@ 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);
+          });
+          // console.log("selectTestExamineSecondData", data);
+
+          data.forEach(e => {
+            e.evaSca = "";
+            e.evaMed = "";
+            e.orgData = [];
+            e.cogSco = "";
+            e.cogSummary = "";
+            e.score = 0;
+
+            e.json.forEach(i => {
+              i.children.forEach(k => {
+                if (k.id == this.secondId) {
+                  e.evaSca = k.sco1;
+                  e.evaMed = k.selfSummary;
+                  e.orgData = k.testid.test;
+                  e.score = k.score;
+                  e.cogSco = k.sco2;
+                  e.cogSummary = k.cogSum;
+                }
+              });
+            });
+          });
+          // console.log("data", data);
+
+          this.tableData = data;
+          console.log("this.tableData", this.tableData);
 
-          console.log("selectTestExamineSecondData", res.data[0]);
+          // 计算评分弹框平均值等
+          this.CopDigSco();
+
+          // 获取数据来源
+          this.handleScoData();
+          this.evaScoDig = false;
         })
         .catch(error => {
           console.log(error);
         });
     },
+    // 计算评分弹框平均值等
+    CopDigSco() {
+      this.evaScoDigSvg = 0;
+      this.evaScoDigCog = 0;
+      this.evaScoDigPerC = 0;
+      this.tableData.forEach(e => {
+        this.evaScoDigSvg += e.evaSca * 1;
+        this.evaScoDigCog += e.cogSco * 1;
+        if (e.evaSca * 1 != e.cogSco * 1) {
+          this.evaScoDigPerC++;
+        }
+      });
+
+      this.evaScoDigSvg = this.evaScoDigSvg / this.tableData.length;
+      this.evaScoDigCog = this.evaScoDigCog / this.tableData.length;
+    },
+    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) {
+      let params = [
+        {
+          uid: uid,
+          testId: val.join(",")
+        }
+      ];
+      return new Promise(resolve => {
+        this.ajax
+          .post(this.$store.state.api + "selectExamineTestName", params)
+          .then(res => {
+            console.log("selectExamineTestName", res.data[0]);
+            resolve(res.data[0]);
+          })
+          .catch(error => {
+            console.log(error);
+          });
+      });
+    },
     // 获取数据计算审核进度,自评平均分,考核平均分
     getData() {
       let params = {
@@ -1240,6 +1420,45 @@ export default {
         .get(this.$store.state.api + "selectTestExamineAllData", params)
         .then(res => {
           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;
+              i.sco2 = i.sco2 / this.allData.length;
+            });
+          });
+          console.log("this.tableJsonCon", this.tableJsonCon);
+          this.tabLoad = false;
+
+          // this.tableJsonCon.forEach(e => {});
         })
         .catch(error => {
           console.log(error);
@@ -1260,11 +1479,16 @@ export default {
         .then(res => {
           // console.log("resresresres", res.data[0]);
           // console.log("selectTestExamineBase", res.data[0][0]);
+
+          // pum是判断审核进度的计数器
           this.tableJsonCon = JSON.parse(res.data[0][0].json);
+          this.tableJsonCon.forEach(e => {
+            e.children.forEach(i => {
+              i.pum = 0;
+            });
+          });
           this.handleData();
           this.getData();
-
-          this.tabLoad = false;
         })
         .catch(error => {
           console.log(error);
@@ -1307,29 +1531,74 @@ export default {
     },
     // 关闭弹框
     handleClose(done) {
-      this.page = 1;
+      this.getPageBase();
       done();
-    },
-    // 查看评分
-    lookScore(val) {
-      this.getSecondData();
-      this.secondId = val;
-      this.diaScore = true;
     }
   }
 };
 </script>
 
 <style scoped>
-.orgData {
+.orgDataCss {
   cursor: pointer;
   margin-bottom: 10px;
   color: #528df6;
 }
+/* 取消[type='number']的input的上下箭头 */
+input::-webkit-inner-spin-button {
+  -webkit-appearance: none !important;
+}
+
+input::-webkit-outer-spin-button {
+  -webkit-appearance: none !important;
+}
+
+input[type="number"] {
+  -moz-appearance: textfield;
+}
+
+.tArea {
+  box-sizing: border-box;
+  padding: 5px;
+  /* border: none; */
+  min-height: 50px;
+  width: 100%;
+  height: 100%;
+  resize: none;
+  outline-style: none;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6 !important;
+}
+.scoTab >>> .cell {
+  line-height: normal;
+}
+
+.ScoreStep {
+  height: 50px;
+}
+.ScoreStep > input {
+  height: 100% !important;
+  outline-style: none;
+  padding: 5px;
+  box-sizing: border-box;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6 !important;
+}
 
+.ScoreStep >>> .el-input-number {
+  height: 100% !important;
+}
+.ScoreStep >>> .el-input {
+  height: 100% !important;
+}
+.ScoreStep >>> .el-input__inner {
+  height: 100%;
+  padding-left: 15px;
+  padding-right: 15px;
+}
 .diaScoreTop {
   display: flex;
-  justify-content: space-between;
+  justify-content: flex-start;
   height: 60px;
 }
 

+ 10 - 7
src/components/pages/test/examine/index.vue

@@ -17,7 +17,7 @@
           班主任
         </div>
       </div>
-      <div style="margin-right: 100px;">
+      <div>
         <el-select v-model="cutTable" placeholder="请选择">
           <el-option
             v-for="item in cutTabOpts"
@@ -54,10 +54,10 @@ export default {
           value: 0,
           label: "按指标"
         },
-        {
-          value: 1,
-          label: "按人员"
-        }
+        // {
+        //   value: 1,
+        //   label: "按人员"
+        // }
       ]
     };
   },
@@ -72,15 +72,18 @@ export default {
 <style scoped>
 .testExamine {
   width: 100%;
-  min-width: calc(150px * 10);
+  /* min-width: calc(150px * 10); */
   min-height: 100%;
   padding: 10px;
+  overflow: auto;
   box-sizing: border-box;
   background-color: #fff;
 }
 .testExamine > .testTit {
-  height: 100px;
+  height: 70px;
   display: flex;
+  box-sizing: border-box;
+  padding: 0 20px;
   justify-content: space-between;
   align-items: center;
 }

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

@@ -21,9 +21,10 @@
             </div>
         </div>
         <div class="bbox_nav">
-            <span class="active">个人总览</span>
+            <span :class="{ active: cutNumber == 0}" @click="cutNumber = 0">个人总览</span>
+            <span :class="{ active: cutNumber == 1}" v-if="examineData.length" @click="cutNumber = 1">年度考核</span>
         </div>
-        <div class="bbox">
+        <div class="bbox" v-if="cutNumber==0">
             <div class="test_data_box" v-loading="isLoadingData">
                 <div class="data_box">
                     <div class="left">
@@ -319,6 +320,9 @@
                     @current-change="handleCurrentChange2"></el-pagination>
             </div>
         </div>
+        <div class="bbox" v-if="cutNumber==1">
+            <examine></examine>
+        </div>
         <el-dialog :visible.sync="dialogVisible1" size="tiny">
             <img width="100%" :src="dialogImageUrl" alt />
         </el-dialog>
@@ -389,11 +393,14 @@ import pie1 from "./data/pie1.vue";
 import randar1 from "./data/randar1.vue";
 import randar2 from "./data/randar2.vue";
 import shareBox from './shareBox/index.vue'
+import examine from './examine/index.vue'
 export default {
     name: 'test',
-    components: { EditorBar, CourseProblem, pie1, pie2, randar1, randar2, shareBox },
+    components: { EditorBar, CourseProblem, pie1, pie2, randar1, randar2, shareBox, examine },
     data() {
         return {
+            examineData: [],
+            cutNumber: 0,
             itemCount: 1,
             courseTitle: "",
             courseText: "",
@@ -514,6 +521,24 @@ export default {
         }
     },
     methods: {
+        // 获取基础页面数据
+        getPageBase() {
+            let params = {
+                typ: 2,
+                org: this.org,
+                oid: this.oid
+            };
+            // console.log(params);
+            this.ajax
+                .get(this.$store.state.api + "selectTestExamineBase", params)
+                .then(res => {
+                    console.log('selectTestExamineBase',res.data[0]);
+                    this.examineData=res.data[0]
+                })
+                .catch(error => {
+                console.log(error);
+                });
+        },
         random() {
             return Math.random().toString(36).substr(2);
         },
@@ -1276,6 +1301,7 @@ export default {
         this.selectTestType();
     },
     mounted() {
+        this.getPageBase()
         console.log(2);
         if (this.role == '1') {
             this.groupA = '0'
@@ -2084,6 +2110,8 @@ export default {
     font-size: 18px;
     color: #41506D;
     padding: 0 35px;
+    margin-right: 15px;
+    cursor: pointer;
     border-radius: 5px 5px 0 0;
 }
 

+ 1 - 1
src/components/pages/testPerson/examine/index.vue

@@ -331,7 +331,7 @@ export default {
     cutPage(e) {
       this.pType = e;
     },
-    // 获取页面ui
+    // 获取页面数据
     getData() {
       this.tabLoad = true;
       let params = {