风险测评小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

254 lines
6.0 KiB

2 days ago
2 days ago
2 days ago
  1. <template>
  2. <view class="page__view">
  3. <navbar title="报告" leftClick @leftClick="$utils.navigateBack" />
  4. <template v-if="detail">
  5. <view class="title">{{ detail.title }}</view>
  6. <view class="section">
  7. <view class="flex section-header">
  8. <view class="line"></view>
  9. <view>总概述</view>
  10. </view>
  11. <view class="section-content">
  12. <view class="summary">
  13. <view class="text">
  14. 经过本次问答信息收集的综合分析检测出风险点共<text class="highlight">{{ detail.levelAllNum - detail.level3Num }}</text>其中高风险{{ detail.level2Num }}中风险{{ detail.level1Num }}低风险{{ detail.level0Num }}
  15. </view>
  16. <view class="flex charts">
  17. <progressCircle label="高风险" :value="detail.level2Num" color="#FF0000"></progressCircle>
  18. <progressCircle label="中风险" :value="detail.level1Num" color="#FFA800"></progressCircle>
  19. <progressCircle label="低风险" :value="detail.level0Num" color="#014FA2"></progressCircle>
  20. <progressCircle label="合规" :value="detail.level3Num" color="#5AC725"></progressCircle>
  21. </view>
  22. </view>
  23. <view class="table">
  24. <!-- 全部合规 -->
  25. <template v-if="detail.level3Num === detail.levelAllNum">
  26. <image class="img-succ" :src="configList.compliance_img" mode="widthFix"></image>
  27. </template>
  28. <template v-else>
  29. <reportTableView :list="tableList"></reportTableView>
  30. </template>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="flex flex-column contact" v-if="configList.company_qrcode">
  35. <view>扫下方二维码联系我们给你1V1解决方案</view>
  36. <image class="qr" :src="configList.company_qrcode" :show-menu-by-longpress="true" mode="widthFix"></image>
  37. </view>
  38. <view>
  39. <image class="img" v-if="configList.company_info" :src="configList.company_info" mode="widthFix"></image>
  40. <view class="logo" v-if="configList.company_logo">
  41. <image class="img" :src="configList.company_logo" mode="widthFix"></image>
  42. </view>
  43. </view>
  44. </template>
  45. <view class="bottom">
  46. <button class="btn" @click="onDownload">保存&分享</button>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import progressCircle from './progressCircle.vue';
  52. import reportTableView from './reportTableView.vue';
  53. export default {
  54. components: {
  55. progressCircle,
  56. reportTableView,
  57. },
  58. data() {
  59. return {
  60. batchNo: null,
  61. detail: null,
  62. tableList: [],
  63. }
  64. },
  65. onLoad(arg) {
  66. const { batchNo } = arg
  67. this.batchNo = batchNo
  68. this.getData(batchNo)
  69. },
  70. methods: {
  71. async getData(batchNo) {
  72. try {
  73. const result = await this.$fetch('queryReportById', { batchNo })
  74. const {
  75. title,
  76. level0Num, // 低风险
  77. level1Num, // 中风险
  78. level2Num, // 高风险
  79. level3Num, // 合规
  80. levelAllNum,
  81. pageList,
  82. } = result
  83. this.tableList = pageList.reduce((arr, item) => {
  84. const { id, risk, reason, level, consequence } = item
  85. if (level == '3') {
  86. return arr
  87. }
  88. const obj = {
  89. id,
  90. reason,
  91. level,
  92. result: consequence,
  93. }
  94. const index = arr.findIndex(row => row.title === risk)
  95. if (index === -1) {
  96. arr.push({
  97. id: arr.length,
  98. title: risk,
  99. children: [obj]
  100. })
  101. } else {
  102. arr[index].children.push(obj)
  103. }
  104. return arr
  105. }, [])
  106. this.detail = {
  107. title,
  108. level0Num, // 低风险
  109. level1Num, // 中风险
  110. level2Num, // 高风险
  111. level3Num, // 合规
  112. levelAllNum,
  113. }
  114. } catch (err) {
  115. }
  116. },
  117. onDownload() {
  118. uni.navigateTo({
  119. url: `/pages_order/report/export?batchNo=${this.batchNo}`
  120. })
  121. },
  122. },
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. .title {
  127. width: 100%;
  128. padding: 42rpx 0 40rpx 0;
  129. box-sizing: border-box;
  130. text-align: center;
  131. font-size: 30rpx;
  132. font-weight: 600;
  133. color: #000000;
  134. }
  135. .section {
  136. padding: 0 12rpx;
  137. &-header {
  138. justify-content: flex-start;
  139. column-gap: 9rpx;
  140. padding: 0 17rpx;
  141. font-size: 28rpx;
  142. font-weight: 600;
  143. color: #014FA2;
  144. .line {
  145. width: 9rpx;
  146. height: 33rpx;
  147. background: #014FA2;
  148. border-radius: 6rpx;
  149. }
  150. }
  151. &-content {
  152. margin-top: 30rpx;
  153. }
  154. }
  155. .summary {
  156. .text {
  157. padding: 20rpx 10rpx;
  158. font-size: 26rpx;
  159. color: #014FA2;
  160. background: rgba($color: #014FA2, $alpha: 0.16);
  161. .highlight {
  162. color: #DB5742;
  163. }
  164. }
  165. .charts {
  166. margin-top: 54rpx;
  167. justify-content: space-between;
  168. padding: 0 42rpx;
  169. }
  170. }
  171. .table {
  172. margin-top: 49rpx;
  173. }
  174. .img-succ {
  175. width: 100%;
  176. height: auto;
  177. }
  178. .contact {
  179. margin-top: 53rpx;
  180. row-gap: 40rpx;
  181. width: 100%;
  182. padding: 30rpx 0 22rpx 0;
  183. box-sizing: border-box;
  184. font-size: 28rpx;
  185. color: #014FA2;
  186. border: 1rpx dashed #014FA2;
  187. .qr {
  188. width: 157rpx;
  189. height: auto;
  190. }
  191. }
  192. .img {
  193. width: 100%;
  194. height: auto;
  195. }
  196. .logo {
  197. width: 100%;
  198. padding: 42rpx 127rpx 46rpx 127rpx;
  199. box-sizing: border-box;
  200. }
  201. .bottom {
  202. position: sticky;
  203. left: 0;
  204. bottom: 0;
  205. width: 100%;
  206. padding: 35rpx 56rpx;
  207. padding-bottom: calc(env(safe-area-inset-bottom) + 35rpx);
  208. background: #FFFFFF;
  209. box-sizing: border-box;
  210. .btn {
  211. width: 100%;
  212. padding: 29rpx 0;
  213. font-size: 30rpx;
  214. line-height: 1.5;
  215. color: #FFFFFF;
  216. background: #014FA2;
  217. border-radius: 50rpx;
  218. }
  219. }
  220. </style>