riskPiont.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="risk-container">
  3. <uni-collapse>
  4. <uni-collapse-item :title="viewData.checklistTitle">
  5. <uni-list>
  6. <uni-list-item title="名称" :rightText="viewData.checklistTitle"></uni-list-item>
  7. <uni-list-item title="类别" :rightText="viewData.checklistCatTitle"></uni-list-item>
  8. <uni-list-item title="描述" :rightText="viewData.checklistDesc"></uni-list-item>
  9. </uni-list>
  10. </uni-collapse-item>
  11. </uni-collapse>
  12. <view class="item-root" v-for="(hazard,hazardIdx) in hazardList" :key="hazardIdx">
  13. <view class="item-root-head">{{hazard.hazardTitle}}</view>
  14. <view class="hazard-wrap" v-if="hazard.riskList.length>0">
  15. <view class="item-children" v-for="(risk,riskIdx) in hazard.riskList" :key="riskIdx" >
  16. <view class="measure-wrap" v-if="risk.measureList.length>0">
  17. <view class="item-children-head">{{risk.riskPointTitle?risk.riskPointTitle:`${hazard.hazardTitle}-风险点-${riskIdx+1}`}}</view>
  18. <view class="item-grandchild-container">
  19. <view class="item-grandchild" v-for="(measure,measureIdx) in risk.measureList" :key="measureIdx">
  20. <view class="title">{{measure.measureContent}}</view>
  21. <view class="handle-bt" @click.stop="inspect(measure)">检查</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <uni-drawer ref="drawePoint" mode="left" :width="300">
  29. <riskPiontForm></riskPiontForm>
  30. </uni-drawer>
  31. </view>
  32. </template>
  33. <script>
  34. import {getChecklistByQr} from '@/api/openApi.js'
  35. import riskPiontForm from '@/components/riskPiontForm.vue'
  36. export default {
  37. components: {
  38. riskPiontForm
  39. },
  40. data() {
  41. return {
  42. hazardList:[],
  43. viewData:{
  44. author:"",
  45. checklistCatId:"",
  46. checklistCatTitle:"",
  47. checklistDesc:"",
  48. checklistId:"",
  49. checklistTitle:""
  50. }
  51. }
  52. },
  53. created() {
  54. this.init()
  55. },
  56. methods:{
  57. init(){
  58. const checklistData=uni.getStorageSync('checklistData')
  59. getChecklistByQr(checklistData.ocId,checklistData.targetId, checklistData.checklistId).then((res) => {
  60. const { code, data, msg } = res
  61. if(code===0){
  62. if(res.data){
  63. this.hazardList=res.data.hazardList
  64. this.viewData={
  65. author:res.data.author,
  66. checklistCatId:res.data.checklistCatId,
  67. checklistCatTitle:res.data.checklistCatTitle,
  68. checklistDesc:res.data.checklistDesc,
  69. checklistId:res.data.checklistId,
  70. checklistTitle:res.data.checklistTitle
  71. }
  72. }
  73. }
  74. })
  75. },
  76. inspect(){
  77. this.$refs.drawePoint.open()
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. .risk-container{
  84. &{
  85. padding: 20rpx;
  86. }
  87. .item-root{
  88. background-color: #F2F2F2;
  89. margin-top: 26rpx;
  90. }
  91. }
  92. .risk-container .item-root-head{
  93. font-size:36rpx;
  94. font-family: PingFang SC;
  95. font-weight: bold;
  96. color: #000000;
  97. }
  98. .risk-container .item-children{
  99. margin-top: 30rpx;
  100. background-color: #FFFFFF;
  101. }
  102. .risk-container .item-children .item-children-head{
  103. padding:33rpx 27rpx;
  104. font-size: 34rpx;
  105. font-family: PingFang SC;
  106. font-weight: bold;
  107. color: #000000;
  108. border-bottom: 1px solid #eaeaea;
  109. }
  110. .risk-container .item-grandchild-container{
  111. padding: 0 30rpx;
  112. }
  113. .risk-container .item-grandchild{
  114. padding:20rpx 30rpx;
  115. position: relative;
  116. border-bottom: 1px solid #ccc;
  117. }
  118. .risk-container .item-grandchild .title{
  119. width: 480rpx;
  120. white-space: nowrap;
  121. overflow: hidden;
  122. text-overflow: ellipsis;
  123. font-size: 26rpx;
  124. color: #666666;
  125. }
  126. .risk-container .item-grandchild .title.max{
  127. width: auto;
  128. }
  129. .risk-container .item-grandchild .handle-bt{
  130. width: 100rpx;
  131. height: 48rpx;
  132. background: linear-gradient(90deg, #15CD85 0%, #0ABC88 100%);
  133. box-shadow: 0px 4px 20px 0px rgba(14, 195, 134, 0.35);
  134. border-radius: 0.21rem;
  135. font-size:26rpx;
  136. font-family: PingFang SC;
  137. font-weight: 500;
  138. color: #FFFFFF;
  139. text-align: center;
  140. line-height: 48rpx;
  141. position: absolute;
  142. right:10rpx;
  143. top: 20rpx;
  144. }
  145. </style>