Selaa lähdekoodia

修改纬度样式

yuanyiming 1 vuosi sitten
vanhempi
commit
70cd689a0a
3 muutettua tiedostoa jossa 198 lisäystä ja 71 poistoa
  1. 10 4
      src/views/eva/components/bar.vue
  2. 89 34
      src/views/eva/studentDetail.vue
  3. 99 33
      src/views/eva/studentEvaluate.vue

+ 10 - 4
src/views/eva/components/bar.vue

@@ -1,11 +1,16 @@
 <template>
   <!-- 导航条 -->
   <div class="bar" :style="{ background: num ? '#005CCD' : '#f9f9f9', color: num ? '#fff' : 'rgba(0, 0, 0, 0.90)' }">
-    <van-icon @click="back" name="arrow-left" />
-    <div style="font-size: 16px;;">
+    <div v-if="!num" style="position: absolute;left: 10px;">
+      <van-icon @click="back" name="arrow-left" />
+    </div>
+    <div v-else style="position: absolute;left: 10px;">
+      <slot name="back"></slot>
+    </div>
+    <div style="font-size: 16px;">
       {{ tit }}
     </div>
-    <div>
+    <div style="position: absolute;right: 10px;">
       <div style="font-size: 14px;" v-if="num">
         <slot name="btn"></slot>
       </div>
@@ -57,7 +62,8 @@ export default {
   box-sizing: border-box;
   padding: 0 10px;
   // justify-content: center;
-  justify-content: space-between;
+  // justify-content: space-between;
+  justify-content: center;
   align-items: center;
   position: fixed;
   top: 0;

+ 89 - 34
src/views/eva/studentDetail.vue

@@ -8,7 +8,10 @@
     <div class="top">
       <div class="UserInfo" style="flex: 1;">
         <div class="sInfo">
-          <div class="userName">{{ studentInfo.name }}</div>
+          <van-dropdown-menu>
+            <van-dropdown-item @change="handleUpdateStudent" v-model="studentInfo.userid" :options="stuDetailList" />
+          </van-dropdown-menu>
+          <!-- <div class="userName">{{ studentInfo.userid }}</div> -->
         </div>
         <div class="cla">{{ studentInfo.cname }}</div>
         <!-- <div class="shade"></div> -->
@@ -168,7 +171,7 @@ export default {
 
       termId: '',
 
-      activeItem: null,
+      // activeItem: null,
       // 这个是本学期总条数,单独写一个是因为他不因为观察记录的选择而改变
       conList: [],
       // 筛选项
@@ -181,8 +184,10 @@ export default {
       // 请求筛选条件
       fil: [],
 
-      // 班级学生列表
+      // 班级学生列表,左右切换用
       stuList: [],
+      stuDetailList: [],
+
       // 学生id
       stuId: '',
       classId: '',
@@ -216,7 +221,7 @@ export default {
 
       selectStudentDetail(data).then(res => {
         this.studentInfo = res[0][0]
-        // console.log('获取学生信息', this.studentInfo)
+        console.log('获取学生信息', this.studentInfo)
       })
 
       // 获取所有学生记录总条数
@@ -246,12 +251,12 @@ export default {
       // console.log('获取筛选项22222222', data3)
       selectSTEType(data3).then(res => {
         // this.filtrate = res[0]
-        var ftype = res[0] //公共父级分类
-        var stype = res[1] //公共子级分类
-        var sctype = res[2] //该学校子级分类
-        var fctype = res[3] //该学校父级分类
-        var fotype = res[4] //组织父级分类
-        var sotype = res[5] //组织子级分类
+        var ftype = res[0] // 公共父级分类
+        var stype = res[1] // 公共子级分类
+        var sctype = res[2] // 该学校子级分类
+        var fctype = res[3] // 该学校父级分类
+        var fotype = res[4] // 组织父级分类
+        var sotype = res[5] // 组织子级分类
         var allfType = []
         var allsType = []
         if (fotype.length == 0 && sotype.length == 0) {
@@ -304,6 +309,13 @@ export default {
         res[0].forEach(e => {
           this.stuList.push(e.id)
         })
+        console.log('学生列表', res[0])
+        res[0].forEach(e => {
+          let a = { value: '', text: '' }
+          a.value = e.id
+          a.text = e.name
+          this.stuDetailList.push(a)
+        })
         // console.log('获取班学生列表', this.stuList)
         // 查询学生在数组中的位置
         this.num = this.stuList.indexOf(this.stuId)
@@ -338,7 +350,7 @@ export default {
     upStu() {
       this.filtrateData = ''
       // 判断学生在数组中的位置,获取班学生列表有初始值
-      this.activeItem = null
+      // this.activeItem = null
       // 刷新学期
       this.termData.splice(0, 1, this.termId)
 
@@ -359,7 +371,7 @@ export default {
     nextStu() {
       this.filtrateData = ''
 
-      this.activeItem = null
+      // this.activeItem = null
       // 刷新学期
       this.termData.splice(0, 1, this.termId)
 
@@ -410,32 +422,32 @@ export default {
       })
     },
     // 筛选按钮
-    addFil(e, index) {
-      // 同一个点击第二次时取消选择
-      if (this.activeItem === index) {
-        this.activeItem = null
-        e = ''
-      } else {
-        this.activeItem = index
-      }
+    // addFil(e, index) {
+    //   // 同一个点击第二次时取消选择
+    //   if (this.activeItem === index) {
+    //     this.activeItem = null
+    //     e = ''
+    //   } else {
+    //     this.activeItem = index
+    //   }
 
-      const data4 = {
-        uid: this.stuId,
-        trm: this.termData[0],
-        txt: e
-      }
-      // console.log(data4)
-      selectRecord(data4).then(res => {
-        // console.log('获取所有学生记录', res)
-        this.TermRecord = res[0]
-      })
-    },
+    //   const data4 = {
+    //     uid: this.stuId,
+    //     trm: this.termData[0],
+    //     txt: e
+    //   }
+    //   // console.log(data4)
+    //   selectRecord(data4).then(res => {
+    //     // console.log('获取所有学生记录', res)
+    //     this.TermRecord = res[0]
+    //   })
+    // },
     // 父组件调用子组件方法,选择学期后关闭select框
     fuClick1() {
       this.isSelectShow = false
-      this.selectCordS()
+      // this.selectCordS()
       this.$refs.claSel.close()
-      this.$refs.weiSel.close()
+      // this.$refs.weiSel.close()
     },
 
     // 子组件调用父组件方法显示遮罩层
@@ -450,6 +462,29 @@ export default {
       // 获取学期记录总条数
       this.selectCordS()
     },
+    handleUpdateStudent() {
+      console.log('切换学生')
+      this.filtrateData = ''
+
+      // this.activeItem = null
+      // 刷新学期
+      this.termData.splice(0, 1, this.termId)
+
+      // this.num = this.num + 1
+      // if (this.num <= this.stuList.length - 1) {
+      this.stuId = this.studentInfo.userid
+      // console.log(this.stuId)
+      localStorage.setItem('userId', this.studentInfo.userid)
+
+      this.getTermRecord()
+
+      selectStudentDetail({ uid: this.stuId }).then(res => {
+        this.studentInfo = res[0][0]
+        // console.log(this.studentInfo)
+      })
+      // }
+      this.selectCordS()
+    },
     // 获取所有学生记录
     getTermRecord() {
       const data4 = {
@@ -558,6 +593,8 @@ export default {
 /deep/.van-dropdown-menu__bar {
   box-shadow: none;
   padding-right: 20px;
+  background: none;
+  height: 1rem;
   // margin-left: 30px !important;
 }
 
@@ -567,13 +604,27 @@ export default {
 
 /deep/ .van-ellipsis {
   font-size: 14px;
+  color: black;
 }
 
 /deep/ .van-cell__title,
 .van-cell__value {
   font-weight: normal;
 }
-
+// .van-ellipsis {
+// }
+/deep/ .van-dropdown-item__option--active .van-dropdown-item__icon {
+  color: #3b84fc;
+}
+/deep/ .van-dropdown-item__option--active {
+  color: #3b84fc;
+}
+/deep/ .van-dropdown-menu__title {
+  padding-left: 0;
+}
+/deep/ .van-dropdown-menu__title--active {
+  color: #3b84fc;
+}
 .goods-card {
   margin: 0;
   background-color: #fff;
@@ -694,6 +745,10 @@ export default {
       justify-content: space-between;
       .sInfo {
         display: flex;
+        /deep/.van-ellipsis {
+          color: #fff;
+          font-size: 18px;
+        }
         .userName {
           width: 120px;
           text-overflow: ellipsis;

+ 99 - 33
src/views/eva/studentEvaluate.vue

@@ -2,6 +2,9 @@
   <!-- 学生评价 -->
   <div class="studentEvaluate" @click="col">
     <bar :tit="'学生评价'" :num="1">
+      <template v-slot:back>
+        <van-icon @click="SaveBack" name="arrow-left" />
+      </template>
       <template v-slot:btn>
         <div v-if="!shareShow" style="font-size: 16px;font-weight: normal;" @click="save">发布</div>
         <div v-else style="font-size: 16px;font-weight: normal;" @click="amend">修改</div>
@@ -81,14 +84,11 @@
           </van-popup>
         </div>
         <img class="rl" src="../../assets/images/eva/rl.png" alt="" />
-        <div
-          v-show="tim"
-          style="position: absolute;bottom: 0;transform: translate(0,100%); left: 40px; color: red;font-size: 10px;"
-        >
+        <!-- <div v-show="tim" style="position: absolute;bottom: 0; color: red;font-size: 10px;">
           请设置时间
-        </div>
+        </div> -->
       </div>
-      <div v-show="tim" style="height: 10px;"></div>
+      <!-- <div v-show="tim" style="height: 10px;"></div> -->
 
       <div class="claName" style="position: relative;">
         <div class="tit">地点</div>
@@ -145,8 +145,10 @@
     <!-- 按钮 -->
     <div class="submitBtn">
       <!-- <div class="btn" @click="isShowMask = true">删除</div> -->
-      <div class="btn" v-if="shareShow" @click="repPop">重复添加</div>
-      <div class="btn" v-if="shareShow" @click="repetitionSave">添加新纪录</div>
+      <!-- <div class="btn" v-if="shareShow" @click="repPop">重复添加</div>
+      <div class="btn" v-if="shareShow" @click="repetitionSave">添加新纪录</div> -->
+      <div class="btn" @click="repPop">重复添加</div>
+      <div class="btn" @click="repetitionSave">添加新纪录</div>
       <div class="btn" v-if="!shareShow" @click="save">发布并返回</div>
       <div class="btn" v-else @click="amend">修改并返回</div>
     </div>
@@ -165,7 +167,7 @@
 
     <pop v-show="repShowMask">
       <template v-slot:tit>提示</template>
-      <template v-slot:con>确定重复添加吗</template>
+      <template v-slot:con>确定添加新纪录</template>
       <template v-slot:btn1>
         <div class="btn" style="color: rgba(136,136,136,1);" @click="repShowMask = false">取消</div>
       </template>
@@ -173,6 +175,17 @@
         <div class="btn" style="color: rgba(251,67,25,1);" @click="repAddRecord">确认</div>
       </template>
     </pop>
+
+    <pop v-show="backShowMask">
+      <template v-slot:tit>提示</template>
+      <template v-slot:con>是否放弃当前编辑内容?</template>
+      <template v-slot:btn1>
+        <div class="btn" style="color: rgba(136,136,136,1);" @click="backShowMask = false">取消</div>
+      </template>
+      <template v-slot:btn2>
+        <div class="btn" style="color: rgba(251,67,25,1);" @click="confirmBack">确认</div>
+      </template>
+    </pop>
   </div>
 </template>
 
@@ -217,6 +230,8 @@ export default {
 
       // 重复添加弹出框判断
       repShowMask: false,
+      // 返回页面时进行提示
+      backShowMask: false,
       // 学生信息
       stuName: {},
       // 关联选项
@@ -260,7 +275,7 @@ export default {
 
       // 时间,学期未选择,提示选择红字警报
       wei: false,
-      tim: false,
+      // tim: false,
       term: false
     }
   },
@@ -393,10 +408,10 @@ export default {
         this.wei = true
         isOk = 1
       }
-      if (this.visitTime === '') {
-        this.tim = true
-        isOk = 1
-      }
+      // if (this.visitTime === '') {
+      //   this.tim = true
+      //   isOk = 1
+      // }
       if (isOk === 1) return
 
       this.isShowMask = true
@@ -415,14 +430,15 @@ export default {
         this.wei = true
         isOk = 1
       }
-      if (this.visitTime === '') {
-        this.tim = true
-        isOk = 1
-      }
+      // if (this.visitTime === '') {
+      //   this.tim = true
+      //   isOk = 1
+      // }
       if (isOk === 1) return
 
       this.repShowMask = true
     },
+    // 获取记录地点
     getRecordPlace() {
       const data = {
         org: this.$store.state.user.userinfo.org,
@@ -471,9 +487,11 @@ export default {
         // this.weiList = allsType
       })
     },
+    // 显示地点选择框
     selectPlace() {
       this.placeShow = true
     },
+    // 选择地点点击事件
     cho(i) {
       // console.log('i', i)
       this.place = i.name
@@ -487,19 +505,59 @@ export default {
         this.wei = true
         isOk = 1
       }
-      if (this.visitTime === '') {
-        this.tim = true
-        isOk = 1
-      }
+      // if (this.visitTime === '') {
+      //   this.tim = true
+      //   isOk = 1
+      // }
       if (isOk === 1) return
 
       this.isShowMask = true
     },
     // 添加新纪录
     repAddRecord() {
-      this.uploadRecord()
+      const data = [
+        {
+          // uid: localStorage.getItem('userId'),
+          uid: this.studentInfo.userid,
+          tid: this.$store.state.user.userinfo.userid,
+          contact: this.selectSData.join(','),
+          type: this.selectWData.join(','),
+          timing: this.visitTime,
+          place: this.place,
+          observeCon: this.observeCon,
+          recordCon: this.recordCon,
+          imgList: this.imgList.join(','),
+          term: this.termData[0],
+          pid: this.placeId
+        }
+      ]
+      // return console.log(data)
+      this.isShowMask = false
+
+      // return console.log(data)
+
+      insertRecord(data).then(res => {
+        // console.log(res)
+        if (res === 1) {
+          this.$toast({
+            message: '添加新纪录成功',
+            type: 'success'
+          })
+          this.selectSData = []
+          this.selectWData = []
+          this.getPresentDate()
+          this.place = ''
+          this.observeCon = ''
+          this.recordCon = ''
+          this.imgList = ''
+          this.repShowMask = false
+          setTimeout(() => {
+            this.$router.replace('/studentDetail')
+          }, 1000)
+        }
+      })
     },
-    // 上传评价
+    // 上传评价与添加新纪录
     uploadRecord() {
       // 添加新纪录,关联人不能包含自己,要将自己删除
       // this.selectSData.indexOf()
@@ -644,7 +702,14 @@ export default {
 
       console.log(year, month, day, hours, minutes)
       this.visitTime = `${year}-${month}-${day} ${hours}:${minutes}`
-      console.log(this.visitTime)
+      // console.log(this.visitTime)
+    },
+    SaveBack() {
+      // console.log('好好好')
+      this.backShowMask = true
+    },
+    confirmBack() {
+      this.$router.go(-1)
     },
 
     onConfirm() {
@@ -703,19 +768,20 @@ export default {
       } else {
         this.term = false
       }
-    },
-    visitTime(val) {
-      // console.log('val', val)
-      if (val === '') {
-        this.tim = true
-      } else {
-        this.tim = false
-      }
     }
+    // visitTime(val) {
+    //   // console.log('val', val)
+    //   if (val === '') {
+    //     this.tim = true
+    //   } else {
+    //     this.tim = false
+    //   }
+    // }
   },
 
   created() {
     this.getRecordPlace()
+    this.getPresentDate()
     // 是否显示分享和继续记录按钮。添加按钮进来不显示
     this.shareShow = this.$route.query.shareShow * 1
     // console.log(this.shareShow)