Browse Source

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table into beta

SanHQin 9 months ago
parent
commit
a1b1301ba5

+ 21 - 0
src/components/pages/test/check/index.vue

@@ -846,6 +846,7 @@ export default {
       role: this.$route.query.role,
       cid: this.$route.query.cid,
       isN: this.$route.query.isN,
+      peopleId: this.$route.query.peopleId,
       screenWidth: window.innerWidth,
       isDesktop: false,
       title: "",
@@ -2016,12 +2017,32 @@ export default {
           });
       });
 		},
+    getUserInfo() {
+      let params = {
+        uid: this.peopleId,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectTestUser", params)
+        .then((res) => {
+          console.log('111111111111111111111',res.data[0][0]);
+          // 用于存储归类后的数据的对象
+          this.checkDataType(2)
+          this.courseName = res.data[0][0].name
+          this.searchCourse()
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
   },
   beforeDestroy() {
     document.getElementsByTagName('html')[0].style.overflow = '';
     window.removeEventListener("resize", this.checkScreenSize);
   },
   mounted() {
+    if(this.peopleId){
+      this.getUserInfo();
+    }
     this.checkScreenSize();
     window.addEventListener("resize", this.checkScreenSize);
     document.getElementsByTagName('html')[0].scrollTop = 0

+ 22 - 4
src/components/pages/test/examine/conpoments/targetPage.vue

@@ -736,7 +736,6 @@ export default {
         //         test: []
         //       }
         //     },
-
         //     {
         //       id: "4e",
         //       sco1: "", //自评分
@@ -1198,17 +1197,36 @@ export default {
   computed: {},
   watch: {
     pType(newVal, oldVal) {
-      this.getData();
+      this.getPageBase();
     }
   },
   mounted() {
-    this.getData();
+    this.getPageBase();
     // console.log(JSON.stringify(this.TeaTabJson));
     // console.log(JSON.stringify(this.tableJsonCon));
   },
 
   methods: {
+    // 获取数据计算审核进度,自评平均分,考核平均分
     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 => {
+          console.log("selectTestExamineAllData", res.data[0]);
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+
+    // 获取基础页面数据
+    getPageBase() {
       this.tabLoad = true;
       let params = {
         typ: this.pType,
@@ -1241,7 +1259,7 @@ export default {
     computedTest(val) {
       let params = [
         {
-          uid: '',
+          uid: "",
           testId: val.join(",")
         }
       ];

+ 71 - 26
src/components/pages/testPerson/examine/index.vue

@@ -49,7 +49,7 @@
           <div>认定</div>
           <div>认定概述</div>
         </div>
-        <div class="table_Content" v-for="item in tableJsonCon" :key="item.id">
+        <div class="table_Content" v-for="item in PageBaseData" :key="item.id">
           <div class="twoCol">
             <div class="ColTit">{{ item.name }}</div>
             <div class="ColCon">
@@ -67,7 +67,9 @@
                     :max="k.score"
                   ></el-input-number>
                 </div>
-                <div><textarea v-model.trim="k.selfSummary" /></div>
+                <div class="tArea">
+                  <textarea v-model.trim="k.selfSummary" />
+                </div>
                 <div>
                   <div v-if="!k.testid.test.length">/</div>
                   <div v-else style="padding-top: 10px;">
@@ -108,7 +110,7 @@
           <div>认定</div>
           <div>认定概述</div>
         </div>
-        <div class="table_Content2" v-for="item in tableJsonCon" :key="item.id">
+        <div class="table_Content2" v-for="item in PageBaseData" :key="item.id">
           <div class="twoCol">
             <div class="ColTit">{{ item.name }}</div>
             <div class="ColCon">
@@ -124,7 +126,9 @@
                     :max="k.score"
                   ></el-input-number>
                 </div>
-                <div><textarea v-model.trim="k.selfSummary" /></div>
+                <div class="tArea">
+                  <textarea v-model.trim="k.selfSummary" />
+                </div>
                 <div>
                   <div v-if="!k.testid.test.length">/</div>
                   <div v-else style="padding-top: 10px;">
@@ -179,7 +183,10 @@ export default {
         type: 1,
         rjson: ""
       },
+      // 页面填写数据
       tableJsonCon: [],
+      // 页面基础ui
+      PageBaseData: [],
       tabLoad: false, //表格加载状态
       userid: this.$route.query.userid, //用户id
       oid: this.$route.query.oid, //学校id
@@ -190,12 +197,12 @@ export default {
   },
   watch: {
     pType(newVal, oldVal) {
-      this.getData();
+      this.getPageBase();
     }
   },
   computed: {},
   mounted() {
-    this.getData();
+    this.getPageBase();
     // console.log(JSON.stringify(this.TeaTabJson));
   },
   methods: {
@@ -209,7 +216,7 @@ export default {
         return;
       }
 
-      for (const e of this.tableJsonCon) {
+      for (const e of this.PageBaseData) {
         for (const k of e.children) {
           if (k.testid.test.length > 0) {
             k.testid.test = k.testid.test.map(item => item.courseId);
@@ -229,7 +236,7 @@ export default {
               oid: this.oid,
               org: this.org,
               type: this.pType,
-              json: JSON.stringify(this.tableJsonCon),
+              json: JSON.stringify(this.PageBaseData),
               ttype: 2
             }
           ];
@@ -253,7 +260,7 @@ export default {
     },
     // 保存
     saveTab() {
-      for (const e of this.tableJsonCon) {
+      for (const e of this.PageBaseData) {
         for (const k of e.children) {
           if (k.testid.test.length > 0) {
             k.testid.test = k.testid.test.map(item => item.courseId);
@@ -272,13 +279,14 @@ export default {
               oid: this.oid,
               org: this.org,
               type: this.pType,
-              json: JSON.stringify(this.tableJsonCon),
+              json: JSON.stringify(this.PageBaseData),
               ttype: 1
             }
           ];
           this.ajax
             .post(this.$store.state.api + "addTestExamineWorks", params)
             .then(res => {
+              console.log('addTestExamineWorks',res);
               this.getData();
               // console.log();
               // console.log("resresresres", res.data[0]);
@@ -314,15 +322,45 @@ export default {
 
           if (res.data[0].length > 0) {
             this.allData = res.data[0][0];
-            this.tableJsonCon = JSON.parse(res.data[0][0].json);
+            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 (this.tabLoad = false);
           } else {
-            this.allData.type = 1;
-            this.allData.rjson = "";
-            this.getPageBase();
-            this.tabLoad = false;
+            this.handleData();
+            this.tabLoad = false
           }
+          //  else {
+          //   this.allData.type = 1;
+          //   this.allData.rjson = "";
+          //   this.getPageBase();
+          //   this.tabLoad = false;
+          // }
         })
         .catch(error => {
           console.log(error);
@@ -339,16 +377,21 @@ export default {
         .get(this.$store.state.api + "selectTestExamineBase", params)
         .then(res => {
           // console.log("resresresres", res.data[0]);
+          this.allData = res.data[0][0];
+
           console.log("selectTestExamineBase", res.data[0][0]);
-          this.tableJsonCon = JSON.parse(res.data[0][0].json);
-          this.handleData();
+          this.PageBaseData = JSON.parse(res.data[0][0].json);
+          // 先获取基础模板,然后再获取用户又没有填写过,填写过就开始循环赋值给基础模板,最后提交基础模板
+          this.getData();
+
+          // this.handleData();
         })
         .catch(error => {
           console.log(error);
         });
     },
     async handleData() {
-      for (const e of this.tableJsonCon) {
+      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);
@@ -376,8 +419,8 @@ export default {
     },
     // 查看数据来源
     lookPrize(val) {
-      return;
-      this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${val}&oid=${this.oid}&org=${this.org}&type=2&role=0`;
+      // return;
+      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/#/test?userid=${this.userid}&oid=45facc0a-1211-11ec-80ad-005056b86db5&org=&role=0`;
       this.diaIframe = true;
     },
@@ -398,7 +441,10 @@ export default {
   box-sizing: border-box;
   background-color: #fff;
 }
-
+.tArea {
+  box-sizing: border-box;
+  padding: 5px;
+}
 .testPersonExamine > .testTit {
   height: 100px;
   display: flex;
@@ -550,12 +596,11 @@ export default {
 .twoCon {
   display: flex;
 }
-.twoCon > div > .el-input-number {
-  height: 100%;
+.twoCon > div >>> .el-input-number {
+  height: 100% !important;
 }
-.twoCon > div > .el-input{
-  height: 100%;
-
+.twoCon > div >>> .el-input {
+  height: 100% !important;
 }
 .twoCon > div > input {
   border: none;

+ 19 - 1
src/components/pages/testPerson/test/test.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="i_body_box">
         <div class="check_nav">
-            <div class="nav all" v-show="true" :class="{ active: type == '1' }" @click="checkType('1')">
+            <div class="nav all" v-show="this.ExamineBase.length > 0" :class="{ active: type == '1' }" @click="checkType('1')">
                 年度考核
             </div>
             <div class="nav all" :class="{ active: type == '' }" @click="checkType('')">
@@ -132,6 +132,7 @@ export default {
     data() {
         return {
             type: "",
+            ExamineBase: [],
             typeArray: [],
             typeArrayCheck: [],
             worksArray: [],
@@ -268,6 +269,22 @@ export default {
         }
     },
     methods: {
+        getPageBase() {
+            let params = {
+                typ: 1,
+                org: this.org,
+                oid: this.oid
+            };
+            this.ajax
+                .get(this.$store.state.api + "selectTestExamineBase", params)
+                .then(res => {
+                    this.ExamineBase = res.data[0]
+                    // console.log("selectTestExamineBase", res.data);
+                })
+                .catch(error => {
+                    console.log(error);
+                });
+        },
         isDeadlinePassed(deadline) {
             let _line = new Date(deadline)
             const currentDate = new Date();
@@ -621,6 +638,7 @@ export default {
     },
     mounted() {
         this.selectTestType(1);
+        this.getPageBase()
     },
     activated(){
         console.log('testperson',1111111111111111111111);