generateList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="gbox">
  3. <u-list @scrolltolower="scrolltolower" height="100%">
  4. <u-list-item v-for="(item, index) in list" :key="index">
  5. <view class="gbox-item">
  6. <view class="gbox-item-top adf">
  7. <view class="gbox-item-top-type">{{typeCfg[item.type]||'基础版'}}</view>
  8. <view class="gbox-item-top-title">{{item.reportName||''}}</view>
  9. </view>
  10. <view class="gbox-item-p adf">
  11. <view class="gbox-item-p-left">团队名称:</view>
  12. <view class="gbox-item-p-right">{{item.teamName||''}}</view>
  13. </view>
  14. <view class="gbox-item-p adf">
  15. <view class="gbox-item-p-left">报告状态:</view>
  16. <view class="gbox-item-p-right" :style="{'color':stateColor[item.state]}">{{stateDict[item.state]}}</view>
  17. </view>
  18. <!-- <view class="gbox-item-p adfac">
  19. <view class="gbox-item-p-left">报告进度:</view>
  20. <view class="gbox-item-p-progress adfacjb">
  21. <view class="gbox-item-p-progress-l">
  22. <view class="gbox-item-p-progress-l-current" :style="{'width':(80)+'%'}"></view>
  23. </view>
  24. <view class="gbox-item-p-progress-r">{{80}}%</view>
  25. </view>
  26. </view> -->
  27. <view class="gbox-item-bottom adfacjb">
  28. <view class="gbox-item-bottom-left adfac">
  29. <view class="gbox-item-bottom-left-text">创建时间:</view>
  30. <view class="gbox-item-bottom-left-time">{{item.createDate||''}}</view>
  31. </view>
  32. <view class="gbox-item-bottom-right" @click="reviewPdf(item.type)" v-if="item.state==1">预览</view>
  33. <view class="gbox-item-bottom-right" @click="sendReport(item)" v-if="item.state!=-1">发送报告</view>
  34. <view class="gbox-item-bottom-right" @click="reSendReport(item)" v-else>重新生成</view>
  35. </view>
  36. </view>
  37. </u-list-item>
  38. </u-list>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. props:{
  44. list:{
  45. typeof:Array,
  46. default:[]
  47. }
  48. },
  49. data(){
  50. return {
  51. typeCfg:{
  52. 1:'基础版',
  53. 2:'专业版',
  54. 3:'专家版'
  55. },
  56. stateDict:{
  57. '0':'生成中',
  58. '1':'生成成功',
  59. '-1':'生成失败'
  60. },
  61. stateColor:{
  62. '0':'#FFD750',
  63. '1':'#33A7A7',
  64. '-1':'#F4657A'
  65. }
  66. }
  67. },
  68. methods:{
  69. scrolltolower(){
  70. this.$emit('scrolltolower')
  71. },
  72. reviewPdf(type){
  73. let url = '/pagesHome/pdf';
  74. if(type==2) url = '/pagesHome/pdfZyb'
  75. uni.navigateTo({ url })
  76. },
  77. sendReport(item){
  78. if(!item.fileUrl) return this.$showModal('该报告尚未生成PDF文件,请等待生成后发送。')
  79. this.$api.get(`/core/report/sendReport/${item.reportId}`).then(({data:res})=>{
  80. uni.navigateTo({
  81. url:'/pagesHome/reportResult?result='+res.code+'&info='+encodeURIComponent(JSON.stringify(item))
  82. })
  83. })
  84. },
  85. reSendReport(item){
  86. this.$api.get(`/core/report/regenerateReport/${item.reportId}`).then(({data:res})=>{
  87. if(res.code!==0) return this.$showToast(res.msg)
  88. this.$emit('reSendReport')
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style scoped lang="scss">
  95. .gbox{
  96. height: 100%;
  97. &-item{
  98. margin-top: 20rpx;
  99. background: #FFFFFF;
  100. border-radius: 24rpx;
  101. padding: 40rpx 24rpx 10rpx;
  102. position: relative;
  103. &-top{
  104. &-type{
  105. width: 98rpx;
  106. height: 36rpx;
  107. padding: 2rpx 13rpx;
  108. box-sizing: border-box;
  109. background: #FFF7DC;
  110. border-radius: 6rpx;
  111. font-family: PingFangSC, PingFang SC;
  112. font-weight: 400;
  113. font-size: 24rpx;
  114. color: #BA9B31;
  115. line-height: 33rpx;
  116. }
  117. &-title{
  118. width: calc(100% - 98rpx);
  119. font-family: PingFang-SC, PingFang-SC;
  120. font-weight: bold;
  121. font-size: 32rpx;
  122. color: #002846;
  123. line-height: 32rpx;
  124. text-indent: 17rpx;
  125. }
  126. }
  127. &-p{
  128. margin-top: 36rpx;
  129. &>view{
  130. font-family: PingFangSC, PingFang SC;
  131. font-weight: 400;
  132. font-size: 24rpx;
  133. color: #667E90;
  134. line-height: 24rpx;
  135. }
  136. &-left{
  137. width: 134rpx;
  138. }
  139. &-right{
  140. width: calc(100% - 134rpx);
  141. }
  142. &-progress{
  143. width: calc(100% - 134rpx);
  144. &-l{
  145. width: 410rpx;
  146. height: 12rpx;
  147. background: #F0F2F8;
  148. border-radius: 6rpx;
  149. position: relative;
  150. &-current{
  151. height: 12rpx;
  152. background: #FFDF73;
  153. border-radius: 6rpx;
  154. position: absolute;
  155. left: 0;
  156. top: 0;
  157. }
  158. }
  159. &-r{
  160. width: calc(100% - 410rpx);
  161. font-family: PingFangSC, PingFang SC;
  162. font-weight: 400;
  163. font-size: 24rpx;
  164. color: #002846;
  165. line-height: 24rpx;
  166. text-align: right;
  167. }
  168. }
  169. }
  170. &-bottom{
  171. margin-top: 30rpx;
  172. border-top: 1rpx solid #EFEFEF;
  173. padding-top: 18rpx;
  174. &-left{
  175. &>view{
  176. font-family: PingFangSC, PingFang SC;
  177. font-weight: 400;
  178. font-size: 24rpx;
  179. color: #667E90;
  180. line-height: 24rpx;
  181. }
  182. }
  183. &-right{
  184. padding: 17rpx 20rpx;
  185. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  186. border-radius: 30rpx;
  187. font-family: PingFang-SC, PingFang-SC;
  188. font-weight: bold;
  189. font-size: 24rpx;
  190. color: #FFFFFF;
  191. line-height: 26rpx;
  192. letter-spacing: 2rpx;
  193. }
  194. }
  195. }
  196. }
  197. </style>