generateList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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)" 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(item){
  73. let url = `/pagesHome/pdf?reportId=${item.reportId}`;
  74. if(item.type==2) url = `/pagesHome/pdfZyb?reportId=${item.reportId}`
  75. uni.navigateTo({ url })
  76. },
  77. sendReport(item){
  78. if(!item.fileUrl) return this.$showModal('该报告尚未生成PDF文件,请等待生成后发送。')
  79. uni.showModal({
  80. title:'发送报告',
  81. content:`是否将“${item.reportName||''}”发送给团队成员`,
  82. success: (res) => {
  83. if(res.confirm){
  84. this.$api.get(`/core/report/sendReport/${item.reportId}`).then(({data:res})=>{
  85. if(res.code!==0) return this.$showToast(res.msg)
  86. uni.navigateTo({
  87. url:'/pagesHome/sendResult?result='+res.code
  88. })
  89. })
  90. }
  91. }
  92. })
  93. },
  94. reSendReport(item){
  95. this.$api.get(`/core/report/regenerateReport/${item.reportId}`).then(({data:res})=>{
  96. if(res.code!==0) return this.$showToast(res.msg)
  97. this.$emit('reSendReport')
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .gbox{
  105. height: 100%;
  106. &-item{
  107. margin-top: 20rpx;
  108. background: #FFFFFF;
  109. border-radius: 24rpx;
  110. padding: 40rpx 24rpx 10rpx;
  111. position: relative;
  112. &-top{
  113. &-type{
  114. width: 98rpx;
  115. height: 36rpx;
  116. padding: 2rpx 13rpx;
  117. box-sizing: border-box;
  118. background: #FFF7DC;
  119. border-radius: 6rpx;
  120. font-family: PingFangSC, PingFang SC;
  121. font-weight: 400;
  122. font-size: 24rpx;
  123. color: #BA9B31;
  124. line-height: 33rpx;
  125. }
  126. &-title{
  127. width: calc(100% - 98rpx);
  128. font-family: PingFang-SC, PingFang-SC;
  129. font-weight: bold;
  130. font-size: 32rpx;
  131. color: #002846;
  132. line-height: 32rpx;
  133. text-indent: 17rpx;
  134. }
  135. }
  136. &-p{
  137. margin-top: 36rpx;
  138. &>view{
  139. font-family: PingFangSC, PingFang SC;
  140. font-weight: 400;
  141. font-size: 24rpx;
  142. color: #667E90;
  143. line-height: 24rpx;
  144. }
  145. &-left{
  146. width: 134rpx;
  147. }
  148. &-right{
  149. width: calc(100% - 134rpx);
  150. }
  151. &-progress{
  152. width: calc(100% - 134rpx);
  153. &-l{
  154. width: 410rpx;
  155. height: 12rpx;
  156. background: #F0F2F8;
  157. border-radius: 6rpx;
  158. position: relative;
  159. &-current{
  160. height: 12rpx;
  161. background: #FFDF73;
  162. border-radius: 6rpx;
  163. position: absolute;
  164. left: 0;
  165. top: 0;
  166. }
  167. }
  168. &-r{
  169. width: calc(100% - 410rpx);
  170. font-family: PingFangSC, PingFang SC;
  171. font-weight: 400;
  172. font-size: 24rpx;
  173. color: #002846;
  174. line-height: 24rpx;
  175. text-align: right;
  176. }
  177. }
  178. }
  179. &-bottom{
  180. margin-top: 30rpx;
  181. border-top: 1rpx solid #EFEFEF;
  182. padding-top: 18rpx;
  183. &-left{
  184. &>view{
  185. font-family: PingFangSC, PingFang SC;
  186. font-weight: 400;
  187. font-size: 24rpx;
  188. color: #667E90;
  189. line-height: 24rpx;
  190. }
  191. }
  192. &-right{
  193. padding: 17rpx 20rpx;
  194. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  195. border-radius: 30rpx;
  196. font-family: PingFang-SC, PingFang-SC;
  197. font-weight: bold;
  198. font-size: 24rpx;
  199. color: #FFFFFF;
  200. line-height: 26rpx;
  201. letter-spacing: 2rpx;
  202. }
  203. }
  204. }
  205. }
  206. </style>