questionnaire.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的问卷'></cus-header>
  4. <div class="tabs adf">
  5. <div class="t_pre" :class="{'active':tidx===1}" @tap="changeTab(1)">待完成</div>
  6. <div class="t_pre" :class="{'active':tidx===2}" @tap="changeTab(2)">已完成</div>
  7. </div>
  8. <template v-if="list.length">
  9. <div class="list">
  10. <div class="l_item" v-for="(item,index) in list" :key="index">
  11. <div class="li_top adfacjb">
  12. <div class="lt_l">{{item.title||''}}</div>
  13. <div class="lt_r" :class="{'dcy':item.status===0,'ycy':item.status===1}">{{item.status===0?'待完成':item.status===1?'已完成':''}}</div>
  14. </div>
  15. <div class="li_text">
  16. 所属项目:<span>{{item.enterpriseName||''}}</span>
  17. </div>
  18. <div class="li_text">
  19. 所属团队:<span>{{item.teamName||''}}</span>
  20. </div>
  21. <div class="li_bottom adfacjb">
  22. <div class="lb_l adfac">
  23. <u-icon name="clock" color="#FD4F66" size="32"></u-icon>
  24. <span v-if="item.status===0">截止时间:{{ item.endTime||''}}</span>
  25. <span v-else-if="item.status===1">完成时间:{{ item.submitTime||''}}</span>
  26. </div>
  27. <div class="lb_r">
  28. <div class="lr_btn" v-if="item.status===0" @tap="toFill(item)">立即作答</div>
  29. <div class="lr_btn" v-if="item.status===1" @tap="toRepoer(item)">查看报告</div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <template v-else>
  36. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  37. </template>
  38. </view>
  39. </template>
  40. <script>
  41. import pageEmpty from '@/components/pageEmpty/index.vue'
  42. export default {
  43. components:{ pageEmpty },
  44. data(){
  45. return {
  46. tidx:1,
  47. list:[]
  48. }
  49. },
  50. onLoad() {
  51. this.getList();
  52. },
  53. methods:{
  54. getList(){
  55. this.$api.get('/core/teammember/que/listByUser').then(res=>{
  56. if(res.data.code!==0) return this.$showToast(res.data.msg)
  57. this.list = res.data.data.filter(d=>d.status===this.tidx-1)
  58. })
  59. },
  60. changeTab(index){
  61. this.tidx = index;
  62. this.getList();
  63. },
  64. toFill(item){
  65. if(Date.parse(new Date())-Date.parse(item.endTime)>0) return this.$showToast('已过截止时间,无法作答!')
  66. uni.navigateTo({
  67. url:`/pages/questionnaireFill?teamQuestionnaireId=${item.teamQuestionnaireId}&title=${item.title}`
  68. })
  69. },
  70. toRepoer(item){
  71. },
  72. }
  73. }
  74. </script>
  75. <style scoped lang="less">
  76. .page{
  77. background: #F7F7F7;
  78. padding-bottom: 40rpx;
  79. box-sizing: border-box;
  80. .tabs{
  81. width: 100%;
  82. height: 90rpx;
  83. background: #FFFFFF;
  84. .t_pre{
  85. width: 50%;
  86. height: 90rpx;
  87. font-family: PingFang-SC, PingFang-SC;
  88. font-weight: bold;
  89. font-size: 32rpx;
  90. color: #666666;
  91. line-height: 90rpx;
  92. text-align: center;
  93. position: relative;
  94. &.active{
  95. color: #761E6A;
  96. &::after{
  97. content: '';
  98. width: 148rpx;
  99. height: 6rpx;
  100. background: #761E6A;
  101. border-radius: 9rpx;
  102. position: absolute;
  103. left: 50%;
  104. margin-left: -74rpx;
  105. bottom: 0;
  106. }
  107. }
  108. }
  109. }
  110. .list{
  111. .l_item{
  112. background: #FFFFFF;
  113. margin-top: 20rpx;
  114. width: 100%;
  115. padding: 36rpx 30rpx;
  116. box-sizing: border-box;
  117. .li_top{
  118. .lt_l{
  119. width: calc(100% - 142rpx);
  120. font-family: PingFang-SC, PingFang-SC;
  121. font-weight: bold;
  122. font-size: 30rpx;
  123. color: #252525;
  124. line-height: 40rpx;
  125. }
  126. .lt_r{
  127. width: 142rpx;
  128. font-family: PingFang-SC, PingFang-SC;
  129. font-weight: bold;
  130. font-size: 30rpx;
  131. line-height: 40rpx;
  132. text-align: right;
  133. &.dcy{
  134. color: #FD4F66;
  135. }
  136. &.ycy{
  137. color: #999999;
  138. }
  139. }
  140. }
  141. .li_text{
  142. font-family: PingFangSC, PingFang SC;
  143. font-weight: 400;
  144. font-size: 24rpx;
  145. color: #666666;
  146. line-height: 51rpx;
  147. margin-top: 15rpx;
  148. }
  149. .li_bottom{
  150. margin-top: 8rpx;
  151. padding-top: 29rpx;
  152. border-top: 1rpx solid #F0F2F8;
  153. .lb_l{
  154. background: rgba(253, 79, 102, 0.06);
  155. border-radius: 16rpx;
  156. padding: 3rpx 16rpx;
  157. span{
  158. font-family: PingFangSC, PingFang SC;
  159. font-weight: 400;
  160. font-size: 24rpx;
  161. color: #FD4F66;
  162. line-height: 51rpx;
  163. margin-left: 6rpx;
  164. }
  165. }
  166. .lb_r{
  167. .lr_btn{
  168. width: 142rpx;
  169. height: 64rpx;
  170. background: #833478;
  171. border-radius: 24rpx;
  172. font-family: PingFang-SC, PingFang-SC;
  173. font-weight: bold;
  174. font-size: 24rpx;
  175. color: #FFFFFF;
  176. line-height: 64rpx;
  177. text-align: center;
  178. letter-spacing: 2rpx;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. </style>