tobeReport.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="m-container">
  3. <div class="cellWrap">
  4. <div class="mcell" v-for="(item,index) in reportList" :key="index" >
  5. <div class="left">
  6. <span class="timer">{{ item.month}}</span>
  7. <span class="title">{{ item.groupName}}</span>
  8. </div>
  9. <div class="cellBtn" @click="submitReport(item)">提交报告</div>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import {getNeedPost} from '@/api/teacher'
  16. export default {
  17. data() {
  18. return {
  19. reportList:[]
  20. };
  21. },
  22. created(){
  23. let params = this.$route.query;
  24. if (params.Authorization) {
  25. localStorage.setItem("Authorization", decodeURI(params.Authorization));
  26. localStorage.setItem("userInfo", decodeURI(params.Authorization));
  27. }
  28. },
  29. mounted(){
  30. getNeedPost().then(res=>{
  31. if(res.data.code == 200){
  32. if(res.data.data.length > 0){
  33. this.reportList = res.data.data
  34. }else {
  35. this.$toast('当前没有待填写报告')
  36. }
  37. }
  38. })
  39. },
  40. methods:{
  41. submitReport(item){
  42. this.$router.push({path:'/studyReportNew',query:{id:item.id,classGroupId:item.classGroupId}})
  43. }
  44. }
  45. };
  46. </script>
  47. <style lang="less" scoped>
  48. .m-container {
  49. min-height: 100vh;
  50. background-color: #f3f4f8;
  51. .cellWrap {
  52. background-color: #fff;
  53. .mcell {
  54. display: flex;
  55. flex-direction: row;
  56. justify-content: space-between;
  57. height: 0.54rem;
  58. line-height: 0.54rem;
  59. background-color: #fff;
  60. margin-left: 0.16rem;
  61. border-bottom: 1px solid #f0f0f0;
  62. align-items: center;
  63. .left {
  64. display: flex;
  65. flex-direction: row;
  66. justify-content: flex-start;
  67. .timer {
  68. font-size: 0.14rem;
  69. color: #808080;
  70. margin-right: 0.3rem;
  71. }
  72. .title {
  73. font-size: 0.14rem;
  74. color: #1a1a1a;
  75. display: block;
  76. width: 1.45rem;
  77. white-space: nowrap;
  78. overflow: hidden;
  79. text-overflow: ellipsis;
  80. }
  81. }
  82. .cellBtn {
  83. text-align: center;
  84. width: .8rem;
  85. height: 0.24rem;
  86. line-height: .24rem;
  87. color: #fff;
  88. background: rgba(20, 146, 138, 1);
  89. border-radius: 17px;
  90. font-size: .14rem;
  91. margin-right: .16rem;
  92. }
  93. }
  94. }
  95. }
  96. </style>