questionnaire.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.updateDate||''}}</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. uni.redirectTo({
  72. url:'/pages/report'
  73. })
  74. },
  75. }
  76. }
  77. </script>
  78. <style scoped lang="less">
  79. .page{
  80. background: #F7F7F7;
  81. padding-bottom: 40rpx;
  82. box-sizing: border-box;
  83. .tabs{
  84. width: 100%;
  85. height: 90rpx;
  86. background: #FFFFFF;
  87. .t_pre{
  88. width: 50%;
  89. height: 90rpx;
  90. font-family: PingFang-SC, PingFang-SC;
  91. font-weight: bold;
  92. font-size: 32rpx;
  93. color: #666666;
  94. line-height: 90rpx;
  95. text-align: center;
  96. position: relative;
  97. &.active{
  98. color: #761E6A;
  99. &::after{
  100. content: '';
  101. width: 148rpx;
  102. height: 6rpx;
  103. background: #761E6A;
  104. border-radius: 9rpx;
  105. position: absolute;
  106. left: 50%;
  107. margin-left: -74rpx;
  108. bottom: 0;
  109. }
  110. }
  111. }
  112. }
  113. .list{
  114. .l_item{
  115. background: #FFFFFF;
  116. margin-top: 20rpx;
  117. width: 100%;
  118. padding: 36rpx 30rpx;
  119. box-sizing: border-box;
  120. .li_top{
  121. .lt_l{
  122. width: calc(100% - 142rpx);
  123. font-family: PingFang-SC, PingFang-SC;
  124. font-weight: bold;
  125. font-size: 30rpx;
  126. color: #252525;
  127. line-height: 40rpx;
  128. }
  129. .lt_r{
  130. width: 142rpx;
  131. font-family: PingFang-SC, PingFang-SC;
  132. font-weight: bold;
  133. font-size: 30rpx;
  134. line-height: 40rpx;
  135. text-align: right;
  136. &.dcy{
  137. color: #FD4F66;
  138. }
  139. &.ycy{
  140. color: #999999;
  141. }
  142. }
  143. }
  144. .li_text{
  145. font-family: PingFangSC, PingFang SC;
  146. font-weight: 400;
  147. font-size: 24rpx;
  148. color: #666666;
  149. line-height: 51rpx;
  150. margin-top: 15rpx;
  151. }
  152. .li_bottom{
  153. margin-top: 8rpx;
  154. padding-top: 29rpx;
  155. border-top: 1rpx solid #F0F2F8;
  156. .lb_l{
  157. background: rgba(253, 79, 102, 0.06);
  158. border-radius: 16rpx;
  159. padding: 3rpx 16rpx;
  160. span{
  161. font-family: PingFangSC, PingFang SC;
  162. font-weight: 400;
  163. font-size: 24rpx;
  164. color: #FD4F66;
  165. line-height: 51rpx;
  166. margin-left: 6rpx;
  167. }
  168. }
  169. .lb_r{
  170. .lr_btn{
  171. width: 142rpx;
  172. height: 64rpx;
  173. background: #833478;
  174. border-radius: 24rpx;
  175. font-family: PingFang-SC, PingFang-SC;
  176. font-weight: bold;
  177. font-size: 24rpx;
  178. color: #FFFFFF;
  179. line-height: 64rpx;
  180. text-align: center;
  181. letter-spacing: 2rpx;
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>