details.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 class="imgVdio" v-for="item in scope.row.picturePath.split(',')" :key="item">
  39. <video v-if="typeVideo(item)" :src="item" @click="lookVideos(item)"></video>
  40. <el-image class="imgs" v-else :src="item" :preview-src-list="[item]"></el-image>
  41. </div>
  42. </template>
  43. <template slot-scope="scope" slot="opt">
  44. <div class="opt">
  45. <el-tooltip effect="light" placement="bottom" content="详情">
  46. <i class="zoniot_font zoniot-icon-xiangqing" @click="lookDetails(scope.row)"></i>
  47. </el-tooltip>
  48. </div>
  49. </template>
  50. </zz-table>
  51. </div>
  52. </div>
  53. </template>
  54. <script >
  55. import list from '@utils/list.js';
  56. export default {
  57. props: ['params'],
  58. mixins: [list],
  59. data() {
  60. return {
  61. formLook: [
  62. {
  63. label: '所属社区:',
  64. prop: 'communityName'
  65. },
  66. {
  67. label: '任务名称:',
  68. prop: 'inspectionName'
  69. },
  70. {
  71. label: '设备/设施类型:',
  72. prop: 'typeValue'
  73. },
  74. {
  75. label: '巡检人员:',
  76. prop: 'peopleName'
  77. },
  78. {
  79. label: '计划开始时间:',
  80. prop: 'startDate'
  81. },
  82. {
  83. label: '计划结束时间:',
  84. prop: 'endDate'
  85. },
  86. {
  87. label: '实际开始时间:',
  88. prop: 'startTime'
  89. },
  90. {
  91. label: '实际结束时间:',
  92. prop: 'endTime'
  93. },
  94. {
  95. label: '状态:',
  96. prop: 'inspectionStatus',
  97. slot: 'inspectionStatus'
  98. }
  99. ],
  100. cols: [
  101. {
  102. label: '设备编号',
  103. prop: 'no'
  104. },
  105. {
  106. label: '设备名称',
  107. prop: 'name'
  108. },
  109. {
  110. label: '地址',
  111. prop: 'address'
  112. },
  113. {
  114. label: '巡检时间',
  115. prop: 'checkTime'
  116. },
  117. {
  118. label: '巡检结果',
  119. prop: 'result'
  120. },
  121. {
  122. label: '图片/视频',
  123. prop: 'picturePath'
  124. }
  125. ],
  126. thisItem: {},
  127. mixins_post: 'post'
  128. };
  129. },
  130. methods: {
  131. getDatali(id) {
  132. this.mixins_dataUrl = '/sc-community/inspectionRecord/findDetail';
  133. this.mixins_query = {
  134. id: id,
  135. type: this.thisItem.type
  136. };
  137. this.mixins_search();
  138. },
  139. typeVideo(str) {
  140. let type = str.slice(str.lastIndexOf('.') + 1, str.length);
  141. let videoType = ['mp4'];
  142. return videoType.includes(type);
  143. },
  144. lookVideos(src) {
  145. new Promise((resolve) => {
  146. this.$store.dispatch('addPopup', {
  147. url: '/lookVideo.vue',
  148. width: '600px',
  149. height: '500px',
  150. props: {
  151. src: src,
  152. callback: resolve
  153. },
  154. showConfirmButton: true,
  155. showCancelButton: true,
  156. hideStar: true,
  157. title: '查看视频'
  158. });
  159. }).then(() => {
  160. this.mixins_search();
  161. });
  162. }
  163. },
  164. created() {
  165. this.thisItem = this.params.data;
  166. this.getDatali(this.params.data.id);
  167. }
  168. };
  169. </script>
  170. <style lang="scss" scoped>
  171. @import '@assets/css/public-style.scss';
  172. .formContent-item_title {
  173. clear: both;
  174. }
  175. </style>