checkdetail.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view class="u-flex f-d-c m-w">
  3. <view class="m-w u-m-t-30 u-p-l-20 u-p-r-20 " v-if="conten != null">
  4. <!-- 基本信息 -->
  5. <view @click="lintext(conten.name)" class="u-flex u-row-between border-bottom u-p-b-20 u-p-t-20">
  6. <view style="font-weight: bold;color: #333333;" class=" u-f-28">点位名称</view>
  7. <view class="u-line-1 u-text-right u-f-28" style="width: 342rpx;color: #808080;">{{conten.name}}
  8. </view>
  9. </view>
  10. <view @click="lintext(conten.number)" class="u-flex u-row-between border-bottom u-p-b-20 u-p-t-20">
  11. <view style="font-weight: bold;color: #333333;" class=" u-f-28">房间编号</view>
  12. <view class="u-line-1 u-text-right u-f-28" style="width: 342rpx;color: #808080;">{{conten.number}}
  13. </view>
  14. </view>
  15. <view @click="lintext()" class="u-flex u-row-between border-bottom u-p-b-20 u-p-t-20">
  16. <view style="font-weight: bold;color: #333333;" class=" u-f-28">房间位置</view>
  17. <view class="u-line-1 u-text-right u-f-28" style="width: 342rpx;color: #808080;">
  18. {{conten.buildingName + conten.floorName}}
  19. </view>
  20. </view>
  21. <view @click="lintext(conten.routeName)" class="u-flex u-row-between border-bottom u-p-b-20 u-p-t-20">
  22. <view style="font-weight: bold;color: #333333;" class=" u-f-28">巡检路线</view>
  23. <view class="u-line-1 u-text-right u-f-28" style="width: 342rpx;color: #808080;">{{conten.routeName}}
  24. </view>
  25. </view>
  26. <!-- 巡检项目头 -->
  27. <view class="collect_tit u-flex u-row-left u-col-center">
  28. <view class="tit">
  29. 巡检项目
  30. </view>
  31. <image :src="icon1"></image>
  32. <span>设备:{{conten.devices.length + 1}}件</span>
  33. <image :src="icon2"></image>
  34. <span>项目:{{checkItemCount}}个</span>
  35. </view>
  36. <block>
  37. <!--自带项目巡检-设备名 -->
  38. <label class="sel_point u-flex u-row-between" @click="sel_show1">
  39. <view class="sel_tit u-flex u-row-left u-m-l-26">
  40. <span>{{conten.name}}自带项目</span>
  41. <!-- <sup class="sup">*</sup> -->
  42. </view>
  43. <view class="triangle u-m-r-26" :style="tri_style1">
  44. </view>
  45. </label>
  46. <!-- 检查项 -->
  47. <block class="scan_itm1" v-if="itm1_show" >
  48. <view v-for="(iam,i) in conten.checkItems" :key="i">
  49. <view @click="lintext(iam.name)" class="u-flex u-row-between border-bottom u-p-b-34 u-p-t-34">
  50. <view class="item-name">{{show_itemType(iam.itemType)}}</view>
  51. <view class="u-line-1 item-config u-text-right" style="width: 342rpx;">{{iam.name}}</view>
  52. </view>
  53. </view>
  54. </block>
  55. </block>
  56. <block v-for="(item,i) in conten.devices" :key="item.id">
  57. <!-- 设备巡检-设备名 -->
  58. <label class="sel_point u-flex u-row-between" @click="sel_show(i)">
  59. <view class="sel_tit u-flex u-row-left u-m-l-26">
  60. <span>{{item.name}}</span>
  61. <!-- <sup class="sup">*</sup> -->
  62. </view>
  63. <view class="triangle u-m-r-26" :style="sel_style[i].tri_style">
  64. </view>
  65. </label>
  66. <!-- 检查项 -->
  67. <block class="scan_itm1" v-if="sel_style[i].it_show">
  68. <view v-for="ite in item.checkItems" :key="ite.id">
  69. <view @click="lintext(ite.name)" class="u-flex u-row-between border-bottom u-p-b-34 u-p-t-34">
  70. <view class="item-name">{{show_itemType(ite.itemType)}}</view>
  71. <view class="u-line-1 item-config u-text-right" style="width: 342rpx;">{{ite.name}}</view>
  72. </view>
  73. </view>
  74. </block>
  75. </block>
  76. </view>
  77. <u-top-tips ref="chektost"></u-top-tips>
  78. </view>
  79. </template>
  80. <script>
  81. import icon1 from '@/static/img/devi.png'
  82. import icon2 from '@/static/img/proj.png'
  83. import {
  84. pointDetailForMobile,
  85. pointDetail
  86. } from '@/api/index.js'
  87. export default {
  88. data() {
  89. return {
  90. icon1: icon1,
  91. icon2: icon2,
  92. tri_style1: '', //自带项目三角形样式变化
  93. itm1_show: true,//自带项目三角形样式变化
  94. sel_style:[],
  95. conten: undefined,
  96. checkItemCount:0
  97. }
  98. },
  99. onLoad(option) {
  100. if(option.routeId) {
  101. this.pointdetail(option.id, option.routeId)
  102. } else {
  103. this.unstartPointdetail(option.roomId, option.taskId)
  104. }
  105. },
  106. methods: {
  107. //自带项目三角样式变化
  108. sel_show1() {
  109. this.itm1_show = !this.itm1_show;
  110. if (!this.itm1_show) {
  111. this.tri_style1 =
  112. 'margin-top: 0rpx;margin-bottom:10rpx;border-top-color:transparent;border-bottom-color: #808080;';
  113. } else {
  114. this.tri_style1 =
  115. 'margin-top: 10rpx;margin-bottom:0rpx;border-top-color:#808080;border-bottom-color: transparent;';
  116. }
  117. },
  118. //设备三角形样式变化
  119. sel_show(index) {
  120. this.sel_style[index].it_show = !this.sel_style[index].it_show
  121. if (!this.sel_style[index].it_show) {
  122. this.sel_style[index].tri_style =
  123. 'margin-top: 0rpx;margin-bottom:10rpx;border-top-color:transparent;border-bottom-color: #808080;';
  124. } else {
  125. this.sel_style[index].tri_style =
  126. 'margin-top: 10rpx;margin-bottom:0rpx;border-top-color:#808080;border-bottom-color: transparent;';
  127. }
  128. },
  129. show_itemType(type) {
  130. switch (type) {
  131. case 1:
  132. return "选择项"
  133. break;
  134. case 2:
  135. return "数字项"
  136. break;
  137. case 3:
  138. return "文本项"
  139. break;
  140. default:
  141. return "拍照项"
  142. break;
  143. }
  144. },
  145. //巡检路线跳转过来-房间详情
  146. pointdetail(id, routeId) {
  147. pointDetailForMobile({
  148. id,
  149. routeId
  150. })
  151. .then(({
  152. data
  153. }) => {
  154. this.conten = data
  155. //计算设备数量以及生成虚拟选择下拉样式变更表
  156. data.devices.forEach(i => {
  157. this.checkItemCount += i.checkItems.length
  158. let obj = {}
  159. obj.tri_style = 'margin-top: 10rpx;margin-bottom:0rpx;border-top-color:#808080;border-bottom-color: transparent;'
  160. obj.it_show = true
  161. this.sel_style.push(obj)
  162. })
  163. this.checkItemCount += data.checkItems.length
  164. })
  165. },
  166. //未巡检房间跳转过来-房间详情
  167. unstartPointdetail(roomId, taskId) {
  168. pointDetail({
  169. roomId,
  170. taskId
  171. })
  172. .then(({
  173. data
  174. }) => {
  175. this.conten = data
  176. //计算设备数量以及生成虚拟选择下拉样式变更表
  177. data.devices.forEach(i => {
  178. this.checkItemCount += i.checkItems.length
  179. let obj = {}
  180. obj.tri_style = 'margin-top: 10rpx;margin-bottom:0rpx;border-top-color:#808080;border-bottom-color: transparent;'
  181. obj.it_show = true
  182. this.sel_style.push(obj)
  183. })
  184. this.checkItemCount += data.checkItems.length
  185. })
  186. },
  187. lintext(text) {
  188. this.$refs.chektost.show({
  189. title: text,
  190. type: 'primary',
  191. duration: '2300'
  192. })
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss">
  198. page {
  199. width: 100%;
  200. height: 100%;
  201. background: #FFFFFF
  202. }
  203. .item-name {
  204. font-size: 28rpx;
  205. font-family: Microsoft YaHei-3970(82674968);
  206. font-weight: 400;
  207. color: #333333;
  208. box-sizing: border-box;
  209. }
  210. .item-config {
  211. font-size: 28rpx;
  212. font-family: Microsoft YaHei-3970(82674968);
  213. font-weight: 400;
  214. color: #808080;
  215. box-sizing: border-box;
  216. }
  217. .border-bottom {
  218. border-bottom: 3rpx solid #d7d1d1;
  219. }
  220. .collect_tit {
  221. width: 710rpx;
  222. height: 104rpx;
  223. .tit {
  224. width: 128rpx;
  225. height: 33rpx;
  226. margin-left: 30rpx;
  227. font-size: 32rpx;
  228. font-weight: bold;
  229. color: #010101;
  230. }
  231. image {
  232. max-width: 24rpx;
  233. max-height: 24rpx;
  234. margin-left: 42rpx;
  235. margin-top: 12rpx;
  236. }
  237. span {
  238. height: 24rpx;
  239. margin-left: 10rpx;
  240. font-size: 24rpx;
  241. font-family: Microsoft YaHei-3970(82674968);
  242. font-weight: 400;
  243. color: #808080;
  244. }
  245. }
  246. .sel_point {
  247. width: 710rpx;
  248. height: 70rpx;
  249. background: #EBF8FF;
  250. .sup {
  251. color: red;
  252. }
  253. .triangle {
  254. margin-top: 10rpx;
  255. display: inline-block;
  256. /* Base Style */
  257. border: solid 10rpx transparent;
  258. border-top-color: #808080;
  259. }
  260. }
  261. </style>