info.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view>
  3. <u-navbar title="巡检记录详情" title-color="#101010"></u-navbar>
  4. <view class="list">
  5. <view class="item">
  6. {{record.stationName}}
  7. </view>
  8. <view class="item ">
  9. <view class="name">
  10. 站点地址
  11. </view>
  12. <view class="value">
  13. {{record.stationAddress}}
  14. </view>
  15. </view>
  16. <view class="item ">
  17. <view class="name">
  18. 巡检人员
  19. </view>
  20. <view class="value">
  21. {{record.inspectionUserName}}
  22. </view>
  23. </view>
  24. <view class="item ">
  25. <view class="name">
  26. 巡检时间
  27. </view>
  28. <view class="value">
  29. {{record.inspectionTime}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class=" listtime">
  34. <view class="item">
  35. 巡检结果
  36. </view>
  37. <u-time-line >
  38. <u-time-line-item v-for="(item,index) in submitcontent" :key="index">
  39. <template v-slot:content >
  40. <view >
  41. <view class="u-order-title">{{index+1}}.{{item.name}}</view>
  42. <view class="u-order-desc" v-if="contentList[index].btn&&contentList[index].btn.length" >
  43. <span :class="'result'+item.result" v-for="(b,i) in contentList[index].btn" v-show="item.result==b.value">
  44. {{b.name}}
  45. </span>
  46. <span v-if="item.result==0" style="margin: 0 8rpx;">, </span>
  47. {{item.content}}
  48. </view>
  49. <view class="u-order-time" >
  50. <img class="viewImg" v-for="(item,i) in repairImageList(item.image)"
  51. @click="previewImage(i,item.image)"
  52. :key="i"
  53. :src="item" mode=""></img>
  54. </view>
  55. </view>
  56. </template>
  57. </u-time-line-item>
  58. </u-time-line>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import * as API from '@/apis/pagejs/pagesInspection.js'
  64. export default {
  65. data() {
  66. return {
  67. record: {},
  68. content: [
  69. ],
  70. submitcontent:[]
  71. };
  72. },
  73. onLoad(op) {
  74. if (op.id) {
  75. this.id = op.id
  76. }
  77. this.errDetails()
  78. },
  79. methods: {
  80. previewImage(i, name) {
  81. let imgs = name.split(',');
  82. //imgs.push(img);
  83. uni.previewImage({
  84. urls: imgs,
  85. current: i
  86. })
  87. },
  88. repairImageList(img){
  89. if(img){
  90. return img.split(',')
  91. }else{
  92. return []
  93. }
  94. },
  95. errDetails() {
  96. uni.showLoading({
  97. title: "加载中",
  98. mask: true,
  99. })
  100. API.recordDetails({
  101. id: this.id,
  102. }).then((res) => {
  103. this.record = res.data.record
  104. this.content = res.data.content
  105. this.contentList=this.content.map(item=>{
  106. var obj={
  107. dataId:item.dataId,
  108. name:item.name,
  109. btn:[{
  110. name:"正常",
  111. value:"1"
  112. },{
  113. name:"异常",
  114. value:"0"
  115. }],
  116. desc:"问题描述",
  117. descP:"请简单描述发现的问题",
  118. }
  119. if(item.extended1){
  120. var extended1=JSON.parse(item.extended1)
  121. Object.keys(extended1).forEach(key1 => {
  122. obj[key1]=extended1[key1]
  123. })
  124. }
  125. return obj
  126. })
  127. if(this.record.contentJson){
  128. var contentJson=JSON.parse(this.record.contentJson)
  129. console.log(contentJson)
  130. this.submitcontent=contentJson.content
  131. }
  132. uni.hideLoading();
  133. }).catch(error => {
  134. uni.hideLoading();
  135. uni.showToast({
  136. title: error,
  137. icon: "none"
  138. })
  139. })
  140. },
  141. }
  142. }
  143. </script>
  144. <style lang="scss">
  145. .jpmain {
  146. padding-bottom: 120rpx;
  147. }
  148. .list {
  149. background-color: rgba(255, 255, 255, 1);
  150. border-radius: 16rpx;
  151. margin: 20rpx;
  152. padding-bottom: 20rpx ;
  153. .item:first-child {
  154. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  155. font-size: 32rpx;
  156. padding: 20rpx 24rpx;
  157. font-weight: bold;margin-bottom: 10rpx;
  158. }
  159. .item {
  160. padding: 10rpx 24rpx;
  161. display: flex;
  162. align-items: center;
  163. .name {
  164. width: 30%;
  165. //padding-bottom: 32rpx;
  166. font-size: 32rpx;
  167. color: #777777;
  168. span {
  169. color: red
  170. }
  171. }
  172. .valueplus {
  173. display: flex;
  174. justify-content: space-between;
  175. }
  176. .valueclock {
  177. width: 100%;
  178. border-radius: 8rpx;
  179. padding: 0 16rpx;
  180. height: 64rpx;
  181. line-height: 64rpx;
  182. background-color: rgba(241, 242, 245, 1);
  183. }
  184. .value {
  185. font-size: 32rpx;
  186. display: flex;
  187. align-items: center;
  188. input::placeholder {
  189. color: #AAAAAA;
  190. }
  191. .img {
  192. width: 40rpx;
  193. height: 40rpx;
  194. }
  195. .textarea {
  196. background-color: rgba(241, 242, 245, 1);
  197. width: 100%;
  198. border-radius: 8rpx;
  199. }
  200. .typeN {
  201. font-size: 24rpx;
  202. margin-right: 8rpx;
  203. display: flex;
  204. align-items: center;
  205. border-radius: 8rpx;
  206. padding: 4rpx 8rpx;
  207. color: #fff;
  208. }
  209. .typeN1 {
  210. background-color: #1677ff;
  211. //border: 2rpx solid #1677ff;
  212. }
  213. .typeN2 {
  214. background-color: #19be6b;
  215. //border: 2rpx solid #19be6b;
  216. }
  217. }
  218. }
  219. }
  220. .listtime{
  221. background-color: rgba(255, 255, 255, 1);
  222. border-radius: 16rpx;
  223. margin: 20rpx;
  224. padding: 32rpx 24rpx;
  225. .item{
  226. color: rgba(51,51,51,1);
  227. font-size: 32rpx;
  228. font-weight: bold;
  229. margin-bottom: 18rpx;
  230. }
  231. .result0{
  232. color: #FF3D00;
  233. }
  234. .result1{
  235. color: #00B962;
  236. }
  237. .u-order-time{
  238. margin-bottom: 30rpx;
  239. }
  240. .u-order-desc{
  241. margin: 10rpx 0;
  242. }
  243. }
  244. .viewImg {
  245. width: 160rpx;
  246. height: 160rpx;
  247. }
  248. </style>