patrol.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <!-- 巡检进度页 -->
  3. <view class="m-w partol ">
  4. <view class="logo-back">
  5. </view>
  6. <view class="title-font m-w u-p-l-30 u-p-r-30">
  7. <view class=" m-w u-m-t-10">
  8. <view class="u-f-32 f-w-b">{{parobj.name}}</view>
  9. <view class="u-m-t-16 u-flex">
  10. <view class="u-m-r-14">开始时间:{{beginTime.slice(0,-3)}}</view>
  11. <view class="u-m-r-14">
  12. <u-tag :text="status[statusType].text" :color="status[statusType].color" />
  13. </view>
  14. </view>
  15. <view class="u-m-t-16">截至时间:{{endTime.slice(0,-3)}}</view>
  16. <view class="u-m-t-20">今日巡查:{{parobj.completed}}/{{parobj.total}}</view>
  17. <view class="u-m-t-20 u-flex">
  18. <view>完成进度:</view>
  19. <view style="width: 255rpx; height: 30rpx;">
  20. <u-line-progress :show-percent="false" active-color="#ffffff" :round="true"
  21. inactive-color="rgba(255, 255, 255, .3)" :percent="Math.round((parobj.completed/parobj.total)*100)">
  22. </u-line-progress>
  23. </view>
  24. <view class="u-m-l-20">{{Math.round((parobj.completed/parobj.total)*100)}}%</view>
  25. </view>
  26. </view>
  27. <scroll-view :scroll-y="true" class="cell-item u-m-t-40 u-p-l-20 u-p-r-20 ">
  28. <view @click="checkdeatal(index,parobj.id)" class="u-flex menu-list" v-for="(index,key) in parobj.rooms"
  29. :key="key">
  30. <view class="item-left-title">{{key+1}}</view>
  31. <block v-if="!index.completed">
  32. <u-image :src="imgstatus[3]" width="80" height="80"></u-image>
  33. </block>
  34. <block v-else>
  35. <u-image :src="imgstatus[index.qualified==true?1:2]" width="80" height="80"></u-image>
  36. </block>
  37. <view class="item-right-font">
  38. <view>点编号:{{index.name}}</view>
  39. <view class="u-m-t-20">设备名称:{{index.number}}</view>
  40. </view>
  41. <view class="uicon">
  42. <u-icon name="arrow-right" size="30" color="rgba(153, 153, 153, 1)"></u-icon>
  43. </view>
  44. </view>
  45. </scroll-view>
  46. </view>
  47. <view class="sumit" @click="saoma(1)">扫码巡检</view>
  48. </view>
  49. </template>
  50. <script>
  51. import dayjs from "dayjs";
  52. import backtitle from '@/static/img/partrol/back.png'
  53. import hege from '@/static/img/hege.png'
  54. import bhg from '@/static/img/bhg.png'
  55. import wks from '@/static/img/wks.png'
  56. import {
  57. patrolTaskinfo,
  58. pointDetailForMobile,
  59. getPointInfoOfScanaa
  60. } from '@/api/index.js'
  61. export default {
  62. data() {
  63. return {
  64. backtitle,
  65. imgstatus: ["", hege, bhg, wks],
  66. parobj: "",
  67. status: ["", {
  68. text: "暂未巡检",
  69. color: "#002AC5"
  70. }, {
  71. text: "进行中",
  72. color: "#CF6100"
  73. }, {
  74. text: "已结束",
  75. color: "#009C33"
  76. }, {
  77. text: "超时漏检",
  78. color: "red"
  79. },{
  80. text: "超时完成",
  81. color: "yellow"
  82. }],
  83. taskId: -1,
  84. statusType: ''
  85. }
  86. },
  87. onLoad({
  88. taskId,
  89. status
  90. }) {
  91. this.taskId = taskId
  92. this.statusType = status
  93. this.init(taskId)
  94. },
  95. methods: {
  96. saoma(id) {
  97. if(id==1){
  98. this.$store.dispatch("user/gettasklist");
  99. return false
  100. }else{
  101. return true
  102. }
  103. },
  104. checkdeatal(row, renwuid) {
  105. const {
  106. completed,
  107. id,
  108. qualified
  109. } = row
  110. if (completed) {
  111. uni.navigateTo({
  112. url: `../patroldetail/patroldetail?roomId=${id}&taskId=${renwuid}`
  113. })
  114. } else {
  115. uni.navigateTo({
  116. url: `../checkdetail/checkdetail?roomId=${id}&taskId=${renwuid}`
  117. })
  118. }
  119. },
  120. async init(id) {
  121. let {
  122. data
  123. } = await patrolTaskinfo(id)
  124. this.parobj = data
  125. }
  126. },
  127. computed: {
  128. beginTime() {
  129. return dayjs(this.parobj.beginTime).format("YYYY-MM-DD HH:mm:ss")
  130. },
  131. endTime() {
  132. return dayjs(this.parobj.endTime).format("YYYY-MM-DD HH:mm:ss")
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss">
  138. .partol {
  139. height: 100vh;
  140. background: #f0f2f5;
  141. .logo-back {
  142. width: 751rpx;
  143. height: 350rpx;
  144. position: relative;
  145. &::after {
  146. content: '';
  147. width: 140%;
  148. height: 350rpx;
  149. position: absolute;
  150. left: -20%;
  151. top: 0;
  152. border-radius: 0 0 45% 45%;
  153. background: #4a8bff !important;
  154. }
  155. }
  156. .title-font {
  157. height: 100rpx;
  158. font-size: 28rpx;
  159. font-weight: 400;
  160. color: #FFFFFF;
  161. position: absolute;
  162. top: 0;
  163. display: flex;
  164. flex-direction: column;
  165. align-items: center;
  166. .cell-item {
  167. width: 690rpx;
  168. height: calc(100vh - 347rpx);
  169. background: #FFFFFF;
  170. border-radius: 20rpx 20rpx 0px 0px;
  171. padding: 1rpx;
  172. box-sizing: border-box;
  173. }
  174. .menu-list {
  175. margin-top: 28rpx;
  176. align-items: center;
  177. padding-bottom: 30rpx;
  178. border-bottom: 1rpx solid #E6E6E6;
  179. ;
  180. .item-left-title {
  181. width: 40rpx;
  182. height: 40rpx;
  183. background: #4A8BFF;
  184. border-radius: 50%;
  185. text-align: center;
  186. line-height: 40rpx;
  187. margin-right: 40rpx;
  188. }
  189. .item-right-font {
  190. margin-left: 21rpx;
  191. font-size: 28rpx;
  192. font-family: Microsoft YaHei-3970(82674968);
  193. font-weight: 400;
  194. color: #333333;
  195. }
  196. .uicon {
  197. position: absolute;
  198. right: 23rpx;
  199. }
  200. }
  201. }
  202. view {
  203. line-height: 1;
  204. }
  205. .sumit {
  206. position: fixed;
  207. bottom: 20rpx;
  208. width: 600rpx;
  209. height: 88rpx;
  210. margin-top: 98rpx;
  211. color: white;
  212. background-color: #2a82e4;
  213. border-radius: 5px;
  214. font-size: 16px;
  215. line-height: 88rpx;
  216. text-align: center;
  217. left: 75rpx;
  218. }
  219. }
  220. </style>