details.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="lookDetail">
  3. <div class="list-item">
  4. <div class="formContent-item_title">工单信息</div>
  5. <el-form ref="form" label-width="110px">
  6. <template v-for="(item, index) in formLook">
  7. <el-col :span="!!item.span ? item.span : 12" :key="index">
  8. <el-form-item :label="item.label">
  9. <template v-if="item.slot">
  10. <template v-if="item.slot === 'inspectionStatus'">
  11. <span v-if="thisItem['inspectionStatus'] == 1">待执行</span>
  12. <span v-else-if="thisItem['inspectionStatus'] == 2">执行中</span>
  13. <span v-else-if="thisItem['inspectionStatus'] == 3">已完成</span>
  14. <span v-else-if="thisItem['inspectionStatus'] == 4">已完成(超时)</span>
  15. <span v-else-if="thisItem['inspectionStatus'] == 5">已逾期</span>
  16. <span v-else>--</span>
  17. </template>
  18. </template>
  19. <template v-else>
  20. {{ thisItem[item.prop] || '--' }}
  21. </template>
  22. </el-form-item>
  23. </el-col>
  24. </template>
  25. </el-form>
  26. </div>
  27. <div class="list-item">
  28. <div class="formContent-item_title">设备巡检信息</div>
  29. <zz-table
  30. :cols="cols"
  31. :settings="{ showIndex: true, stripe: true }"
  32. :loading="mixins_onQuery"
  33. :data="mixins_list"
  34. :pageset="mixins_pageset"
  35. @page-change="pageChange"
  36. >
  37. <template slot="picturePath" slot-scope="scope">
  38. <div v-if="!!scope.row.picturePath">
  39. <div class="imgVdio" v-for="item in scope.row.picturePath.split(',')" :key="item">
  40. <video v-if="typeVideo(item)" :src="item" @click="lookVideos(item)"></video>
  41. <el-image class="imgs" v-else :src="item" :preview-src-list="[item]"></el-image>
  42. </div>
  43. </div>
  44. </template>
  45. <template slot-scope="scope" slot="opt">
  46. <div class="opt">
  47. <el-tooltip effect="light" placement="bottom" content="详情" v-if="!!scope.row.id">
  48. <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
  49. </el-tooltip>
  50. </div>
  51. </template>
  52. </zz-table>
  53. </div>
  54. </div>
  55. </template>
  56. <script >
  57. import list from '@utils/list.js';
  58. export default {
  59. props: ['params'],
  60. mixins: [list],
  61. data() {
  62. return {
  63. formLook: [
  64. {
  65. label: '所属社区:',
  66. prop: 'communityName'
  67. },
  68. {
  69. label: '任务名称:',
  70. prop: 'inspectionName'
  71. },
  72. {
  73. label: '设备/设施类型:',
  74. prop: 'typeValue'
  75. },
  76. {
  77. label: '巡检人员:',
  78. prop: 'peopleName'
  79. },
  80. {
  81. label: '计划开始时间:',
  82. prop: 'startDate'
  83. },
  84. {
  85. label: '计划结束时间:',
  86. prop: 'endDate'
  87. },
  88. {
  89. label: '实际开始时间:',
  90. prop: 'startTime'
  91. },
  92. {
  93. label: '实际结束时间:',
  94. prop: 'endTime'
  95. },
  96. {
  97. label: '状态:',
  98. prop: 'inspectionStatus',
  99. slot: 'inspectionStatus'
  100. }
  101. ],
  102. cols: [
  103. {
  104. label: '设备编号',
  105. prop: 'no'
  106. },
  107. {
  108. label: '设备名称',
  109. prop: 'name'
  110. },
  111. {
  112. label: '地址',
  113. prop: 'address'
  114. },
  115. {
  116. label: '巡检时间',
  117. prop: 'checkTime'
  118. },
  119. {
  120. label: '巡检结果',
  121. prop: 'result'
  122. },
  123. {
  124. label: '图片/视频',
  125. prop: 'picturePath',
  126. slot: 'picturePath'
  127. },
  128. {
  129. label: '操作',
  130. prop: 'opt',
  131. slot: 'opt'
  132. }
  133. ],
  134. thisItem: {},
  135. mixins_post: 'post'
  136. };
  137. },
  138. methods: {
  139. lookDetails(row) {
  140. new Promise((resolve) => {
  141. this.$store.dispatch('addPopup', {
  142. url: '/facilityInspections/popups/itemDetails.vue',
  143. width: '500px',
  144. height: '500px',
  145. props: {
  146. data: row,
  147. callback: resolve
  148. },
  149. showConfirmButton: true,
  150. showCancelButton: true,
  151. hideStar: true,
  152. title: '巡检项详情'
  153. });
  154. }).then(() => {
  155. this.mixins_search();
  156. });
  157. },
  158. getDatali(id) {
  159. this.mixins_dataUrl = '/czc-community/inspectionRecord/findDetail';
  160. this.mixins_query = {
  161. id: id,
  162. type: this.params.data.type
  163. };
  164. this.mixins_search();
  165. },
  166. typeVideo(str) {
  167. let type = str.slice(str.lastIndexOf('.') + 1, str.length);
  168. let videoType = ['mp4'];
  169. return videoType.includes(type);
  170. },
  171. lookVideos(src) {
  172. new Promise((resolve) => {
  173. this.$store.dispatch('addPopup', {
  174. url: '/lookVideo.vue',
  175. width: '600px',
  176. height: '500px',
  177. props: {
  178. src: src,
  179. callback: resolve
  180. },
  181. showConfirmButton: true,
  182. showCancelButton: true,
  183. hideStar: true,
  184. title: '查看视频'
  185. });
  186. }).then(() => {
  187. this.mixins_search();
  188. });
  189. }
  190. },
  191. created() {
  192. this.thisItem = this.params.data;
  193. this.getDatali(this.params.data.id);
  194. }
  195. };
  196. </script>
  197. <style lang="scss" scoped>
  198. @import '@assets/css/public-style.scss';
  199. .formContent-item_title {
  200. clear: both;
  201. }
  202. .imgVdio {
  203. display: inline-block;
  204. margin-right: 10px;
  205. .imgs,
  206. video {
  207. width: 64px;
  208. cursor: pointer;
  209. }
  210. }
  211. </style>