info.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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.lastInspectionTime}}
  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"></view>
  50. </view>
  51. </template>
  52. </u-time-line-item>
  53. </u-time-line>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import * as API from '@/apis/pagejs/pagesInspection.js'
  59. export default {
  60. data() {
  61. return {
  62. record: {},
  63. content: [
  64. ],
  65. submitcontent:[]
  66. };
  67. },
  68. onLoad(op) {
  69. if (op.id) {
  70. this.id = op.id
  71. }
  72. this.errDetails()
  73. },
  74. methods: {
  75. errDetails() {
  76. uni.showLoading({
  77. title: "加载中",
  78. mask: true,
  79. })
  80. API.recordDetails({
  81. id: this.id,
  82. }).then((res) => {
  83. this.record = res.data.record
  84. this.content = res.data.content
  85. this.contentList=this.content.map(item=>{
  86. var obj={
  87. dataId:item.dataId,
  88. name:item.name,
  89. btn:[{
  90. name:"正常",
  91. value:"1"
  92. },{
  93. name:"异常",
  94. value:"0"
  95. }],
  96. desc:"问题描述",
  97. descP:"请简单描述发现的问题",
  98. }
  99. if(item.extended1){
  100. var extended1=JSON.parse(item.extended1)
  101. Object.keys(extended1).forEach(key1 => {
  102. obj[key1]=extended1[key1]
  103. })
  104. }
  105. return obj
  106. })
  107. if(this.record.contentJson){
  108. var contentJson=JSON.parse(this.record.contentJson)
  109. console.log(contentJson)
  110. this.submitcontent=contentJson.content
  111. }
  112. uni.hideLoading();
  113. }).catch(error => {
  114. uni.hideLoading();
  115. uni.showToast({
  116. title: error,
  117. icon: "none"
  118. })
  119. })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .jpmain {
  126. padding-bottom: 120rpx;
  127. }
  128. .list {
  129. background-color: rgba(255, 255, 255, 1);
  130. border-radius: 16rpx;
  131. margin: 20rpx;
  132. padding-bottom: 20rpx ;
  133. .item:first-child {
  134. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  135. font-size: 32rpx;
  136. padding: 20rpx 24rpx;
  137. font-weight: bold;margin-bottom: 10rpx;
  138. }
  139. .item {
  140. padding: 10rpx 24rpx;
  141. display: flex;
  142. align-items: center;
  143. .name {
  144. width: 30%;
  145. //padding-bottom: 32rpx;
  146. font-size: 32rpx;
  147. color: #777777;
  148. span {
  149. color: red
  150. }
  151. }
  152. .valueplus {
  153. display: flex;
  154. justify-content: space-between;
  155. }
  156. .valueclock {
  157. width: 100%;
  158. border-radius: 8rpx;
  159. padding: 0 16rpx;
  160. height: 64rpx;
  161. line-height: 64rpx;
  162. background-color: rgba(241, 242, 245, 1);
  163. }
  164. .value {
  165. font-size: 32rpx;
  166. display: flex;
  167. align-items: center;
  168. input::placeholder {
  169. color: #AAAAAA;
  170. }
  171. .img {
  172. width: 40rpx;
  173. height: 40rpx;
  174. }
  175. .textarea {
  176. background-color: rgba(241, 242, 245, 1);
  177. width: 100%;
  178. border-radius: 8rpx;
  179. }
  180. .typeN {
  181. font-size: 24rpx;
  182. margin-right: 8rpx;
  183. display: flex;
  184. align-items: center;
  185. border-radius: 8rpx;
  186. padding: 4rpx 8rpx;
  187. color: #fff;
  188. }
  189. .typeN1 {
  190. background-color: #1677ff;
  191. //border: 2rpx solid #1677ff;
  192. }
  193. .typeN2 {
  194. background-color: #19be6b;
  195. //border: 2rpx solid #19be6b;
  196. }
  197. }
  198. }
  199. }
  200. .listtime{
  201. background-color: rgba(255, 255, 255, 1);
  202. border-radius: 16rpx;
  203. margin: 20rpx;
  204. padding: 32rpx 24rpx;
  205. .item{
  206. color: rgba(51,51,51,1);
  207. font-size: 32rpx;
  208. font-weight: bold;
  209. margin-bottom: 18rpx;
  210. }
  211. .result0{
  212. color: #FF3D00;
  213. }
  214. .result1{
  215. color: #00B962;
  216. }
  217. .u-order-time{
  218. margin-bottom: 30rpx;
  219. }
  220. .u-order-desc{
  221. margin: 10rpx 0;
  222. }
  223. }
  224. </style>