yuanyiming 1 рік тому
батько
коміт
2f51afd451

+ 7 - 2
src/components/pages/kindStudentEva/index.vue

@@ -11,10 +11,10 @@
         :key="suid+'a'"
         @updateUid="updateUid"
       ></infoA>
-      <panelA :userid="suid" :oid="oid" :org="org" :key="suid+'b'"></panelA>
+      <panelA :userid="suid" :oid="oid" :org="org" :key="suid+num"></panelA>
     </div>
     <div class="tp_right">
-      <testA :userid="suid" :oid="oid" :org="org" :cid="cid" :key="suid+'c'"></testA>
+      <testA :userid="suid" :oid="oid" @updatePanelA="updatePanelA" :org="org" :cid="cid" :key="suid+'c'"></testA>
     </div>
   </div>
 </template>
@@ -39,6 +39,7 @@ export default {
       cid: this.$route.query.cid,
       suid: this.$route.query.suid,
       role: this.$route.query.role,
+      num:0
     };
   },
   // watch: {
@@ -54,6 +55,10 @@ export default {
     updateUid(e){
       console.log('更新',e);
       this.suid = e
+    },
+    updatePanelA(e){
+      console.log('更新PanelA',e);
+      this.num=e
     }
   }
 };

+ 1 - 1
src/components/pages/kindStudentEva/panel/index.vue

@@ -8,7 +8,7 @@
           <span>{{ count }}</span
           ><span>个</span>
         </div>
-        <div>学习记录</div>
+        <div>观察记录总数</div>
       </div>
     </div>
     <div class="i_body_panel" v-for="(item, index) in typeList" :key="index">

+ 102 - 15
src/components/pages/kindStudentEva/test/component/popbox.vue

@@ -66,7 +66,7 @@
           multiple
           collapse-tags
           v-model="recordData.type"
-          placeholder="请选择教研室"
+          placeholder="请选择维度"
         >
           <el-option
             v-for="(item, index) in weiList"
@@ -154,11 +154,11 @@
       </div>
     </div>
 
-    <div
-      style="width: 500px;display: flex;justify-content: flex-end;"
-      v-if="judgeNum"
-    >
-      <div class="updateCordSty" @click="open">修改</div>
+    <div style="width: 500px;display: flex;justify-content: flex-end;">
+      <div class="updateCordSty" v-if="judgeNum == 1" @click="open">修改</div>
+      <div class="updateCordSty" v-if="judgeNum == 2" @click="addRecordOpen">
+        添加
+      </div>
     </div>
 
     <div v-if="proVisible" class="mask">
@@ -187,6 +187,9 @@ export default {
       type: Number,
       default: 0
     },
+    sUserId: {
+      type: String,
+    },
     recordDataCopy: {
       type: Object,
       default: () => {
@@ -229,18 +232,83 @@ export default {
     previewImg(url) {
       this.$hevueImgPreview(url);
     },
+    addRecordOpen() {
+      if (!this.recordData.type.length) {
+        this.$message({
+          message: "请选择纬度",
+          type: "warning"
+        });
+        return;
+      }
+      // console.log(this.recordData.recordDates);
+      if (!this.recordData.recordDate) {
+        this.$message({
+          message: "请选择时间",
+          type: "warning"
+        });
+        return;
+      }
+      // return
+      this.$confirm("是否添加新纪录?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消"
+      })
+        .then(() => {
+          this.addRecord();
+        })
+        .catch(() => {});
+    },
+    // 添加新纪录
+    addRecord() {
+      let params = [
+        {
+          uid: this.sUserId,
+          tid: this.$route.query.userid,
+          contact: this.recordData.contact.join(","),
+          type: this.recordData.type.join(","),
+          timing: this.recordData.recordDate,
+          place: this.recordData.place,
+          observeCon: this.recordData.recordTit,
+          recordCon: this.recordData.recordContent,
+          imgList: this.recordData.recordImg.join(","),
+          term: this.recordData.term,
+          pid: 1
+        }
+      ];
+
+      console.log("添加新纪录", params);
+
+      this.ajax
+        .post(this.$store.state.api + "insertRecord", params)
+        .then(res => {
+          console.log(res);
+          this.$emit("closePop");
+          this.$emit("getData");
+          this.$message({
+            type: "success",
+            message: "添加成功"
+          });
+        });
+    },
     // 确认修改记录提示?
     open() {
       // console.log(this.recordData);
 
       if (!this.recordData.type.length) {
         this.$message({
-          type: "success",
           message: "请选择纬度",
           type: "warning"
         });
         return;
       }
+      // console.log(this.recordData.recordDates);
+      if (!this.recordData.recordDate) {
+        this.$message({
+          message: "请选择时间",
+          type: "warning"
+        });
+        return;
+      }
       // return
       this.$confirm("是否修改?", "提示", {
         confirmButtonText: "确定",
@@ -248,10 +316,7 @@ export default {
       })
         .then(() => {
           this.updateCord();
-          this.$message({
-            type: "success",
-            message: "已修改"
-          });
+          
         })
         .catch(() => {
           this.$message({
@@ -284,17 +349,39 @@ export default {
         .post(this.$store.state.api + "updateRecordData", params)
         .then(res => {
           console.log(res);
+         
           this.$emit("closePop");
           this.$emit("getData");
+          this.$message({
+            type: "success",
+            message: "修改成功"
+          });
         });
       // updateRecordData
     },
 
     // 删除图片
     delImg(e) {
-      console.log("删除图片", e);
-      const iii = this.recordData.recordImg.indexOf(e);
-      this.recordData.recordImg.splice(iii, 1);
+      // console.log("删除图片", e);
+      this.$confirm("是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消"
+      })
+        .then(() => {
+          const iii = this.recordData.recordImg.indexOf(e);
+          this.recordData.recordImg.splice(iii, 1);
+          // this.$message({
+          //   type: "success",
+          //   message: "已修改"
+          // });
+        })
+        .catch(() => {
+          // this.$message({
+          //   type: "info",
+          //   message: "已取消修改"
+          // });
+        });
+
       // this.recordData.recordImg = this.recordData.recordImg.
     },
     addImg(e) {
@@ -487,7 +574,7 @@ export default {
   justify-content: flex-end;
   /* justify-content: space-between; */
 }
-/deep/ .el-input__inner {
+.cellBlock >>> .el-input__inner {
   width: 400px;
 }
 .imgBlock {

+ 82 - 7
src/components/pages/kindStudentEva/test/diary.vue

@@ -55,7 +55,10 @@
             </div>
           </div>
         </div>
-        <div class="wordBtn" @click="judgeExport">导出Excel</div>
+        <div style="display: flex;">
+          <div class="wordBtn" @click="addRecord">添加记录</div>
+          <div class="wordBtn" @click="judgeExport">导出Excel</div>
+        </div>
       </div>
 
       <div class="selectSty">
@@ -174,7 +177,7 @@
     <!-- v-if="isPop" -->
 
     <el-dialog
-      :title="judgeNum ? '修改' : '查看'"
+      :title="judgeNum==1 ? '修改' :judgeNum==2?'添加': '查看'"
       :visible.sync="isPop"
       :append-to-body="true"
       width="700px"
@@ -187,6 +190,7 @@
         ref="refPop"
         :judgeNum="judgeNum"
         :recordDataCopy="recordData"
+        :sUserId="userid"
         :termList="termList"
         :weiList="weiList"
         :studentList="studentList"
@@ -194,6 +198,20 @@
         @getData="getData"
       ></popbox>
     </el-dialog>
+
+    <!-- <el-dialog
+      title="添加"
+      :visible.sync="AddIsPop"
+      :append-to-body="true"
+      width="700px"
+      :destroy-on-close="true"
+      :close-on-click-modal="true"
+      :before-close="closePop"
+      class="dialog_diy"
+    >
+    添加新纪录
+     
+    </el-dialog> -->
   </div>
 </template>
 
@@ -226,6 +244,8 @@ export default {
       isLoading: true,
       classid: "",
 
+      // 学生详情信息
+      info:{},
       // 默认选择项
       // VeidooValue:{},
       // 默认选择项
@@ -247,15 +267,27 @@ export default {
 
       // 组件信息数据
       isPop: false,
+      // 添加记录弹窗
+      AddIsPop:false,
+      // 查看,修改弹窗数据
       recordData: {},
-      recordDataCopy: {},
+      // recordDataCopy: {},
+      // 维度数据
       weiList: [],
+      // 班级学生数据(包括多个班)
       studentList: [],
+      // 判断显示查看,修改
       judgeNum: 0,
+
       ftypeId: "",
       stypeId: "",
     };
   },
+  watch: {
+    total(newVal, oldVal) {
+      this.$emit("updatePanelA", newVal);
+    }
+  },
   methods: {
     // 大分类点击
     clickFtypeId(e) {
@@ -276,6 +308,7 @@ export default {
     },
     closePop() {
       this.isPop = false;
+      this.AddIsPop=false;
     },
 
     // 切换页
@@ -372,7 +405,7 @@ export default {
           this.isLoading = false;
           this.tableData = res.data[0];
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          // console.log(" 获取筛选数据", res.data[0]);
+          console.log(" 获取筛选数据", res.data[0]);
         })
         .catch((err) => {
           this.isLoading = false;
@@ -384,9 +417,47 @@ export default {
       this.multipleSelection = val;
       // console.log(this.multipleSelection);
     },
+    // 获取学生详情,为了添加记录用
+    // getStuDetail(){
+    //   let params = {
+    //     uid: this.userid
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "selectSDetail", params)
+    //     .then(res => {
+    //       this.info = res.data[0][0];
+    //       console.log("this.info ", this.info);
+    //       // 用于存储归类后的数据的对象
+    //     })
+    //     .catch(err => {
+    //       console.error(err);
+    //     });
+    // },
+    // 添加新纪录
+    addRecord(){
+      this.judgeNum=2
+      this.recordData={
+        classId:this.info.classid,
+        className:this.info.cname,
+        contact:[],
+        place:'',
+        recordContent:'',
+        recordDate:'',
+        recordImg:[],
+        recordTit:'',
+        semName:'',
+        studentName:this.info.username,
+        term:'',
+        tname:'',
+        type:''
+      }
+
+      // this.AddIsPop = true;
+      this.isPop = true;
+    },
     // 修改与查看记录
     updateCred(e, t) {
-      console.log("eeeeeeeeeeee", e);
+      // console.log("eeeeeeeeeeee", e);
       this.judgeNum = t;
       if (!Array.isArray(e.type)) {
         if (!e.type) {
@@ -410,7 +481,7 @@ export default {
         }
       }
       this.recordData = e;
-      console.log(this.recordData);
+      console.log('recordData',this.recordData);
       this.$forceUpdate();
       this.isPop = true;
     },
@@ -439,7 +510,8 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectStudentDetail", data2)
         .then(res => {
-          // console.log(res);
+          console.log('学生详情',res.data[0][0]);
+          this.info=res.data[0][0]
           this.classid = res.data[0][0].classid;
           this.getClassStudent();
 
@@ -571,6 +643,8 @@ export default {
     this.getWeiList();
     this.getStudentDetail();
 
+    // 获取学生详情,为了添加记录用
+    // this.getStuDetail()
     this.getYear();
     this.getVeidooType();
   },
@@ -717,6 +791,7 @@ export default {
   display: flex;
   justify-content: center;
   align-items: center;
+  margin-left: 15px;
 }
 .twoType {
   position: absolute;

+ 4 - 0
src/components/pages/kindStudentEva/test/index.vue

@@ -39,6 +39,7 @@
         :userid="userid"
         :org="org"
         :cid="cid"
+        @updatePanelA="updatePanelA"
       ></Diary>
       <Score
         ref="score"
@@ -90,6 +91,9 @@ export default {
     checkType(type) {
       this.type = type;
     },
+    updatePanelA(e){
+      this.$emit("updatePanelA",e);
+    },
     backClaBtn() {
       this.$router.push(
         `/studentEva?userid=${this.userid}&oid=${this.oid}&org=${this.org}&cid=${this.cid}&role=${this.role}`

+ 18 - 8
src/components/pages/kindStudentEva/test/score.vue

@@ -426,12 +426,14 @@ td {
 }
 .sBox_table {
   width: 100%;
+  min-width: calc(150px * 7);
   margin: 0 auto;
-  min-width: 1520px;
+  /* min-width: 1520px; */
   font-size: 14px;
 }
 .table_title {
   width: 100%;
+  min-width: calc(150px * 7);
   height: 50px;
   background: #e0eafb;
   border: 1px solid #d5d8df;
@@ -443,6 +445,7 @@ td {
 
 .table_title > div {
   width: calc(100% / 7);
+  min-width: 150px;
   text-align: center;
   height: 100%;
   line-height: 50px;
@@ -455,11 +458,12 @@ td {
 
 .table_detail {
   width: 100%;
+  min-width: calc(100% / 7);
   height: 100%;
   display: flex;
   flex-direction: column;
   flex-wrap: nowrap;
-  align-items: center;
+  align-items: flex-start;
 }
 
 .table_detail > .table_ftype {
@@ -468,12 +472,15 @@ td {
   flex-wrap: nowrap;
   align-items: center;
   width: 100%;
+  min-width: calc(100% / 7);
   height: 100%;
 }
 
 .table_ftype > .ftype_name {
   width: calc(100% / 7);
-  min-width: calc(100% / 7);
+  min-width: 150px;
+  /* width: calc(100% / 7);
+  min-width: calc(100% / 7); */
   height: 100%;
   min-height: 80px;
   line-height: 80px;
@@ -493,7 +500,7 @@ td {
   flex-wrap: nowrap;
   align-items: center;
   width: calc(100% / 7);
-  min-width: calc(100% / 7);
+  min-width: 150px;
   text-align: center;
   height: 100%;
   min-height: 80px;
@@ -503,6 +510,7 @@ td {
 
 .table_stype > .stype_name {
   width: 100%;
+  min-width: 150px;
   height: calc(100% / 2);
   min-height: 50px;
   line-height: 50px;
@@ -515,7 +523,7 @@ td {
 }
 
 .table_score {
-  width: 100%;
+  width: calc(100% / 7 * 5);
   display: flex;
   flex-direction: column;
   flex-wrap: nowrap;
@@ -535,6 +543,7 @@ td {
 
 .stype_score > div {
   width: calc(100% / 3);
+  min-width: 150px;
   height: 100%;
   border-bottom: 1px solid #d5d8df;
   border-right: 1px solid #d5d8df;
@@ -549,14 +558,15 @@ td {
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
-  width: 100%;
+  max-width: 100%;
+  min-width: 150px;
   height: 100%;
   text-align: center;
   justify-content: center;
 }
 .star_box > .star {
-  width: 25px;
-  height: 25px;
+  width: 19px;
+  height: 19px;
   display: block;
   background-image: url("../../../../assets/icon/studentEva/star-no.png");
   background-size: 100% 100%;