details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <div class="lookDetail">
  3. <div class="left">
  4. <div class="list-item">
  5. <div class="formContent-item_title">工单信息</div>
  6. <el-form ref="form" label-width="110px">
  7. <template v-for="(item, index) in formLook">
  8. <el-col :span="!!item.span ? item.span : 12" :key="index">
  9. <el-form-item :label="item.label">
  10. <template v-if="item.slot">
  11. <template v-if="item.slot === 'orderType'">
  12. <span v-if="thisItem['orderType'] == 1">业主报修</span>
  13. <span v-else-if="thisItem['orderType'] == 2">内部报修</span>
  14. <span v-else>--</span>
  15. </template>
  16. <template v-if="item.slot === 'repairFile' && !!thisItem['repairFile']">
  17. <div class="imgVdio" v-for="item in thisItem['repairFile'].split(',')" :key="item">
  18. <video v-if="typeVideo(item)" :src="item" @click="lookVideos(item)"></video>
  19. <el-image class="imgs" v-else :src="item" :preview-src-list="[item]"></el-image>
  20. </div>
  21. </template>
  22. </template>
  23. <template v-else>{{ thisItem[item.prop] || '--' }}</template>
  24. </el-form-item>
  25. </el-col>
  26. </template>
  27. </el-form>
  28. </div>
  29. <div class="list-item">
  30. <div class="formContent-item_title">处理信息</div>
  31. <el-form ref="form" label-width="110px">
  32. <template v-for="(item, index) in formLook2">
  33. <el-col :span="!!item.span ? item.span : 12" :key="index">
  34. <el-form-item :label="item.label">
  35. <template v-if="item.slot">
  36. <template v-if="item.slot === 'urgencyDegree'">
  37. <span v-if="thisItem['urgencyDegree'] == 2" class="redText">紧急</span>
  38. <span v-else-if="thisItem['urgencyDegree'] == 1">普通</span>
  39. <span v-else>--</span>
  40. </template>
  41. <template v-if="item.slot === 'handleResult'">
  42. <span v-if="thisItem['handleResult'] == 2" class="redText">无法处理</span>
  43. <span v-else-if="thisItem['handleResult'] == 1" class="greenText">成功处理</span>
  44. <span v-else>--</span>
  45. </template>
  46. <template v-if="item.slot === 'handleFile' && !!thisItem['handleFile']">
  47. <div class="imgVdio" v-for="item in thisItem['handleFile'].split(',')" :key="item">
  48. <video v-if="typeVideo(item)" :src="item" @click="lookVideos(item)"></video>
  49. <el-image class="imgs" v-else :src="item" :preview-src-list="[item]"></el-image>
  50. </div>
  51. </template>
  52. </template>
  53. <template v-else>{{ thisItem[item.prop] || '--' }}</template>
  54. </el-form-item>
  55. </el-col>
  56. </template>
  57. </el-form>
  58. </div>
  59. </div>
  60. <div class="right">
  61. <div class="list-item">
  62. <div class="formContent-item_title">工单进度追踪</div>
  63. <template v-for="(item, index) in thisItem['progressList']">
  64. <div class="steps" :key="index">
  65. <div class="steps-left">
  66. <img src="@assets/img/point_yiwancheng@2x.png" alt />
  67. <div class="steps-left-line" v-if="index !== thisItem['progressList'].length - 1"></div>
  68. </div>
  69. <div class="steps-right">
  70. <div class="steps-right-title">
  71. <span>{{ item.createDate }}</span>
  72. <span class="status" v-if="index === thisItem['progressList'].length - 1">{{
  73. thisItem.orderStatus | filterWorkStatus
  74. }}</span>
  75. </div>
  76. <div class="steps-right-content" v-if="item.type == 1">
  77. <span>报修人:</span>
  78. <span>{{ thisItem['repairName'] }}</span>
  79. </div>
  80. <template v-else>
  81. <div class="steps-right-content">
  82. <span>处理人:</span>
  83. <span>{{ item.name }}</span>
  84. </div>
  85. <div class="steps-right-content" v-if="!!item.operation">
  86. <span>操作:</span>
  87. <span>{{ item.operation }}</span>
  88. </div>
  89. </template>
  90. </div>
  91. </div>
  92. </template>
  93. <!-- <div v-if="thisItem.orderStatus == 5">待评价</div> -->
  94. <div v-if="thisItem.orderStatus == 6" class="grate">
  95. <div class="grate-rate">
  96. <div style="margin-top: 3px">评价星级:</div>
  97. <div>
  98. <i
  99. class="el-icon-star-on"
  100. style="color: #ffca3b; font-size: 26px; margin-right: 5px"
  101. v-for="(item, index) in thisItem.evaluation"
  102. :key="index"
  103. ></i>
  104. </div>
  105. </div>
  106. <div class="grate-rate">评价内容: {{ thisItem.evaluationContent }}</div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. export default {
  114. props: ['params'],
  115. data() {
  116. return {
  117. formLook: [
  118. {
  119. label: '所属社区:',
  120. prop: 'communityName'
  121. },
  122. {
  123. label: '地址:',
  124. prop: 'address'
  125. },
  126. {
  127. label: '报修人:',
  128. prop: 'repairName'
  129. },
  130. {
  131. label: '手机号:',
  132. prop: 'repairPhone'
  133. },
  134. {
  135. label: '报修时间:',
  136. prop: 'createDate'
  137. },
  138. {
  139. label: '工单类型:',
  140. prop: 'orderType',
  141. slot: 'orderType'
  142. },
  143. {
  144. label: '报修内容:',
  145. prop: 'repairContent',
  146. span: 24
  147. },
  148. {
  149. label: '图片/视频:',
  150. prop: 'repairFile',
  151. slot: 'repairFile',
  152. span: 24
  153. }
  154. ],
  155. formLook2: [
  156. {
  157. label: '维修人员:',
  158. prop: 'handleName'
  159. },
  160. {
  161. label: '紧急程度:',
  162. prop: 'urgencyDegree',
  163. slot: 'urgencyDegree'
  164. },
  165. {
  166. label: '预期完成时间:',
  167. prop: 'expectCompletionTime'
  168. },
  169. {
  170. label: '实际完成时间:',
  171. prop: 'completionTime'
  172. },
  173. {
  174. label: '处理结果:',
  175. prop: 'handleResult',
  176. slot: 'handleResult',
  177. span: 24
  178. },
  179. {
  180. label: '图片/视频:',
  181. prop: 'handleFile',
  182. slot: 'handleFile',
  183. span: 24
  184. }
  185. ],
  186. thisItem: {},
  187. thisActive: 0
  188. };
  189. },
  190. methods: {
  191. getDatali(id) {
  192. this.$http
  193. .get('/sc-community/workOrder/find/' + id)
  194. .then(({ data, msg, status }) => {
  195. if (status == 0) {
  196. this.thisItem = data;
  197. this.thisActive = !!data.progressList.length ? Number(data.progressList.length) - 1 : 0;
  198. }
  199. })
  200. .catch(() => {});
  201. },
  202. typeVideo(str) {
  203. let type = str.slice(str.lastIndexOf('.') + 1, str.length);
  204. let videoType = ['mp4'];
  205. return videoType.includes(type);
  206. },
  207. lookVideos(src) {
  208. new Promise((resolve) => {
  209. this.$store.dispatch('addPopup', {
  210. url: '/lookVideo.vue',
  211. width: '600px',
  212. height: '500px',
  213. props: {
  214. src: src,
  215. callback: resolve
  216. },
  217. showConfirmButton: true,
  218. showCancelButton: true,
  219. hideStar: true,
  220. title: '查看视频'
  221. });
  222. }).then(() => {
  223. this.mixins_search();
  224. });
  225. }
  226. },
  227. created() {
  228. this.getDatali(this.params.id);
  229. }
  230. };
  231. </script>
  232. <style lang="scss" scoped>
  233. @import '@assets/css/public-style.scss';
  234. .lookDetail {
  235. /deep/ .el-form-item__label,
  236. /deep/.el-form-item__content {
  237. font-size: 12px;
  238. }
  239. /deep/ .el-step__title.is-finish,
  240. /deep/ .el-step__title.is-process,
  241. /deep/ .el-step__description.is-finish {
  242. font-weight: 500 !important;
  243. color: #424656 !important;
  244. }
  245. display: flex;
  246. justify-content: space-between;
  247. .formContent-item_title {
  248. clear: both;
  249. }
  250. .left {
  251. width: 600px;
  252. }
  253. .right {
  254. width: calc(100% - 620px);
  255. }
  256. .list-item {
  257. clear: inherit;
  258. }
  259. }
  260. .imgVdio {
  261. width: 80px;
  262. height: 60px;
  263. display: inline-block;
  264. margin-right: 10px;
  265. video,
  266. img {
  267. width: 100%;
  268. height: 100%;
  269. cursor: pointer;
  270. }
  271. }
  272. .steps {
  273. display: flex;
  274. img {
  275. width: 20px;
  276. vertical-align: -webkit-baseline-middle;
  277. }
  278. .steps-left {
  279. margin-right: 10px;
  280. .steps-left-line {
  281. width: 2px;
  282. height: calc(100% - 40px);
  283. margin: 10px auto;
  284. background-color: $mainBgColor;
  285. }
  286. }
  287. .steps-right {
  288. width: 100%;
  289. line-height: 30px;
  290. // margin-bottom: 10px;
  291. .steps-right-title {
  292. font-weight: 600;
  293. display: flex;
  294. justify-content: space-between;
  295. .status {
  296. color: $mainBgColor;
  297. font-weight: 400;
  298. }
  299. }
  300. .steps-right-content {
  301. font-size: 12px;
  302. color: #303133;
  303. display: flex;
  304. span:first-child {
  305. margin-right: 10px;
  306. }
  307. }
  308. }
  309. }
  310. .grate {
  311. margin-left: 30px;
  312. .grate-rate {
  313. display: -webkit-box;
  314. align-items: center;
  315. font-size: 12px;
  316. color: #303133;
  317. margin-bottom: 10px;
  318. }
  319. }
  320. </style>