Detail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <uni-popup ref="popup" type="top">
  3. <uni-section type="line" :title="type==='dl'?'地质灾害点详情':'水库淤堤坝详情'">
  4. <template v-slot:right>
  5. <uni-icons type="closeempty" size="24" color="#999" @click="close"></uni-icons>
  6. </template>
  7. </uni-section>
  8. <view class="detail-cont">
  9. <uni-list >
  10. <uni-list-item :rightText="viewData.groupName" title ="监管单位" ></uni-list-item>
  11. <uni-list-item :rightText="viewData.entName" title ="企业单位" ></uni-list-item>
  12. <uni-list-item :rightText="viewData.dangerTitle" title ="隐患名称"></uni-list-item>
  13. <uni-list-item :rightText="viewData.dangerTags" title ="分类标签" ></uni-list-item>
  14. <uni-list-item :rightText="formatDangerLevel(viewData.dangerLevel)" title ="经营范围"></uni-list-item>
  15. <uni-list-item :rightText="viewData.dangerLocation" title ="发现位置" v-if="viewData.dangerLocation"></uni-list-item>
  16. <view class="attach-list-item" v-if="viewData.attachList&&viewData.attachList.length>0">
  17. <view class="title">现场照片</view>
  18. <view class="attachbox">
  19. <view class="attach" v-for="(attach, index) in viewData.attachList" :key="index" @click="preview(viewData.attachList)">
  20. <image :src="attach.attachUrl"></image>
  21. </view>
  22. </view>
  23. </view>
  24. <uni-list-item :note="viewData.dangerDesc" title ="隐患描述" v-if="viewData.dangerDesc"></uni-list-item>
  25. <uni-list-item :note="viewData.submitRemark" title ="登记说明" v-if="viewData.submitRemark"></uni-list-item>
  26. <uni-list-item :rightText="viewData.dangerDeadLine" title ="整改期限" v-if="viewData.dangerDeadLine"></uni-list-item>
  27. <uni-list-item :rightText="viewData.rectifyTime" title ="整改时间" v-if="viewData.rectifyTime"></uni-list-item>
  28. <uni-list-item :note="viewData.dangerReason" title ="原因分析" v-if="viewData.dangerReason"></uni-list-item>
  29. <uni-list-item :rightText="viewData.rectifyMeasure" title ="整改措施" v-if="viewData.rectifyMeasure"></uni-list-item>
  30. <uni-list-item :rightText="formatRectifyCat(viewData.rectifyCat)" title ="整改方式" v-if="viewData.rectifyCat"></uni-list-item>
  31. <uni-list-item :note="viewData.rectifyRemark" title ="整改说明" v-if="viewData.rectifyRemark"></uni-list-item>
  32. <uni-list-item :rightText="viewData.acceptTime" title ="验收时间" v-if="viewData.acceptTime"></uni-list-item>
  33. <uni-list-item :note="viewData.acceptRemark" title ="验收说明" v-if="viewData.acceptRemark"></uni-list-item>
  34. <uni-list-item title ="责任单位" v-if="viewData.supervisorList">
  35. <template v-slot:footer>
  36. <view class="supervisorList">
  37. <view class="supervisor" v-for="(supervisor,idx) in viewData.supervisorList">
  38. <view class="icon-item group">
  39. <image class="icon" src="/static/images/admin_icon.png" mode="widthFix"></image>
  40. <text class="word">{{supervisor.supervisorGroupName}}</text>
  41. </view>
  42. <view class="icon-item">
  43. <uni-icons type="person-filled" size="15" color="#999"></uni-icons>
  44. <text class="word">{{supervisor.supervisorName}}</text>
  45. </view>
  46. <view class="icon-item">
  47. <uni-icons type="phone-filled" size="15" color="#999"></uni-icons>
  48. <text class="word">{{supervisor.supervisorPhone}}</text>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. </uni-list-item>
  54. </uni-list>
  55. </view>
  56. </uni-popup>
  57. </template>
  58. <script>
  59. import dangerApi from '@/api/danger.js'
  60. export default{
  61. name:"DisasteDetail",
  62. props:{
  63. type:{
  64. type:[String,Number],
  65. default:'dl'
  66. }
  67. },
  68. data(){
  69. return{
  70. viewData:{
  71. entId: undefined,
  72. dangerId: 0,
  73. dangerCatId: 1,
  74. dangerCatTitle: '',
  75. dangerTitle: '',
  76. dangerTags:'',
  77. dangerCode: '',
  78. dangerLocation: '',
  79. dangerLevel: 2,
  80. dangerDesc: '',
  81. submitTime: '',
  82. submitRemark: '',
  83. dangerDeadLine: '',
  84. rectifyTime: '',
  85. dangerReason: '',
  86. rectifyCat: 1,
  87. rectifyRemark: '',
  88. acceptTime: '',
  89. acceptRemark: '',
  90. finishTime: '',
  91. status: 0,
  92. attachList: [],
  93. supervisorList:[]
  94. }
  95. }
  96. },
  97. methods:{
  98. formatDangerLevel(val){
  99. let dangerLevelOptions=['末知','重大','较大','一般','较小'];
  100. return dangerLevelOptions[val]
  101. },
  102. formatRectifyCat(val){
  103. let dangerLevelOptions=['自行整改','外协整改'];
  104. return dangerLevelOptions[val]
  105. },
  106. show(item){
  107. this.$refs.popup.open('bottom')
  108. dangerApi.getById(item.dangerId).then((res)=>{
  109. this.viewData={...res.data}
  110. })
  111. },
  112. preview(urls=[]){
  113. if(urls.length>0){
  114. urls=urls.map(item=>item.attachUrl);
  115. uni.previewImage({
  116. urls
  117. })
  118. }
  119. },
  120. close(){
  121. this.$refs.popup.close()
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .detail-cont{
  128. &{
  129. max-height: 80vh;
  130. overflow-y: auto;
  131. }
  132. .attach-list-item{
  133. padding: 13px 20rpx;
  134. .title{
  135. font-size: 14px;
  136. color: #3b4144;
  137. overflow: hidden;
  138. line-height: 1;
  139. padding-bottom: 20rpx;
  140. }
  141. .attachbox{
  142. display: flex;
  143. flex-wrap: wrap;
  144. .attach{
  145. padding: 20rpx;
  146. image{
  147. display: block;
  148. width: 100rpx;
  149. height: 100rpx;
  150. box-shadow: rgba(0,0,0,0.6);
  151. border: 1rpx solid #ccc;
  152. border-radius: 10px;
  153. overflow: hidden;
  154. }
  155. }
  156. }
  157. }
  158. .supervisorList{
  159. width: calc(100% - 70px);
  160. .supervisor{
  161. display: flex;
  162. align-items: center;
  163. justify-content: flex-end;
  164. flex-wrap: wrap;
  165. margin-bottom: 6rpx;
  166. border-bottom: 1px dashed #ccc;
  167. background-color: #f5f5f5;
  168. .icon-item{
  169. display: flex;
  170. align-items: center;
  171. width: 50%;
  172. .word{
  173. margin-left: 8rpx;
  174. font-size: 24rpx;
  175. }
  176. &.group{
  177. width: 100%;
  178. }
  179. image{
  180. display: block;
  181. width: 30rpx;
  182. height: 30rpx;
  183. flex-shrink: 0;
  184. }
  185. }
  186. }
  187. }
  188. }
  189. </style>