questionnaire.vue 4.9 KB

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