questionnaire.vue 5.1 KB

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