detail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view class="container">
  3. <cu-custom id="custom"
  4. bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png"
  5. :isBack="true">
  6. <block slot="backText">返回</block>
  7. <block slot="content">
  8. 工单详情
  9. </block>
  10. </cu-custom>
  11. <My_listbox ref="List" @getlist="getDetail">
  12. <view class="header">
  13. <view class="billno">
  14. {{ detail.billno }}
  15. </view>
  16. <view class="row">
  17. <view class="row-label">来源:</view>
  18. <view class="row-value">{{ detail.source || ' --' }}</view>
  19. </view>
  20. <view class="row">
  21. <view class="row-label">设备:</view>
  22. <view class="row-value">{{ detail.devicename || ' --' }}</view>
  23. </view>
  24. <view class="row">
  25. <view class="row-label">任务时间:</view>
  26. <view class="row-value">
  27. {{ detail.begdate && detail.enddate ? detail.begdate + ' 至 ' + detail.enddate : '--' }}
  28. </view>
  29. </view>
  30. <view class="row">
  31. <view class="row-label">地址:</view>
  32. <view class="row-value">{{ detail.address || ' --' }}</view>
  33. </view>
  34. <view class="row">
  35. <view class="row-label">备注说明:</view>
  36. <view class="row-value">{{ detail.remarks || ' --' }}</view>
  37. </view>
  38. <view class="status">{{ detail.status }}</view>
  39. </view>
  40. <block v-if="detail.team.length">
  41. <view class="label">巡检人员</view>
  42. <view class="users">
  43. <view class="user" :class="item.isleader ? 'leader' : ''" v-for="item in detail.team"
  44. :key="item.userid">
  45. {{ item.name }}
  46. </view>
  47. </view>
  48. </block>
  49. <block v-if="detail.nodes.length">
  50. <view class="label">进度</view>
  51. <view class="step-box">
  52. <view class="workorder" v-for="(item, index) in detail.nodes" :key="item.sa_workorder_nodeid">
  53. <view class="workorder-title">
  54. {{ index + 1 }}.{{ item.workpresetjson.workname }}
  55. </view>
  56. <navigator url="#" class="child" v-for="(child, childIndex) in item.child"
  57. :key="child.sa_workorder_nodeid">
  58. <view class="child-title">
  59. {{ index + 1 }}-{{ childIndex + 1 }}.{{ child.workpresetjson.workname }}
  60. </view>
  61. <view class="child-result">
  62. <view class="have-not-begun tag" v-if="child.status == 0">
  63. 未开始
  64. </view>
  65. <block v-else>
  66. <view class="time">{{ child.changedate }}</view>
  67. <view class="done tag" v-if="child.status == 1">
  68. 完成
  69. </view>
  70. <view class="underway tag" v-else>
  71. 进行中
  72. </view>
  73. </block>
  74. </view>
  75. </navigator>
  76. </view>
  77. </view>
  78. </block>
  79. <view style="height: 30px;" />
  80. </My_listbox>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. name: "Detail",
  86. data() {
  87. return {
  88. detail: {
  89. team: [],
  90. nodes: []
  91. },
  92. sa_workorderid: 0,
  93. }
  94. },
  95. onLoad(options) {
  96. this.sa_workorderid = options.id;
  97. this.getDetail(true)
  98. },
  99. methods: {
  100. getDetail(init = false) {
  101. if (!init) return;
  102. this.$Http.basic({
  103. "id": 20230208140103,
  104. "content": {
  105. "sa_workorderid": this.sa_workorderid
  106. }
  107. }).then(res => {
  108. console.log("工单详情", res)
  109. if (this.cutoff(res.msg)) return;
  110. let detail = res.data;
  111. switch (detail.sourcetable) {
  112. case "w_eventid":
  113. detail.source = "巡检," + (detail.planno || ' --')
  114. break;
  115. case "w_event_log":
  116. detail.source = "告警," + (detail.eventname || ' --')
  117. break;
  118. default:
  119. detail.source = "现场"
  120. break;
  121. }
  122. this.detail = res.data;
  123. this.$refs.List.RefreshToComplete();
  124. this.$refs.List.setHeight();
  125. })
  126. }
  127. },
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. .header {
  132. position: relative;
  133. padding: 10px;
  134. width: 355px;
  135. margin: 10px auto;
  136. background: #fff;
  137. border-radius: 4px;
  138. box-sizing: border-box;
  139. overflow: hidden;
  140. .billno {
  141. font-size: 16px;
  142. font-weight: bold;
  143. color: #004684;
  144. }
  145. .row {
  146. display: flex;
  147. font-size: 14px;
  148. margin-top: 6px;
  149. &-label {
  150. flex-shrink: 0;
  151. color: #666;
  152. }
  153. }
  154. .status {
  155. position: absolute;
  156. top: 0;
  157. right: 0;
  158. padding: 4px 8px;
  159. background: #FFEFEF;
  160. color: #F65050;
  161. font-size: 12px;
  162. border-radius: 0 0 0 4px;
  163. }
  164. }
  165. .label {
  166. margin: 15px 0 10px 10px;
  167. font-size: 13px;
  168. color: #fff;
  169. }
  170. .users {
  171. display: flex;
  172. flex-wrap: wrap;
  173. padding: 8px 6px 2px 6px;
  174. width: 355px;
  175. margin: 0 auto;
  176. background: #fff;
  177. border-radius: 4px;
  178. box-sizing: border-box;
  179. overflow: hidden;
  180. .user {
  181. padding: 2px 4px;
  182. border: 1px solid #000;
  183. color: #000;
  184. font-size: 13px;
  185. border-radius: 4px;
  186. margin-right: 6px;
  187. margin-bottom: 6px;
  188. box-sizing: border-box;
  189. }
  190. .leader {
  191. background: #2A6AF2;
  192. border: 0;
  193. color: #fff;
  194. }
  195. }
  196. .step-box {
  197. width: 355px;
  198. margin: 0 auto;
  199. background: #fff;
  200. box-sizing: border-box;
  201. border-radius: 4px;
  202. padding: 10px;
  203. padding-top: 0;
  204. .workorder {
  205. width: 100%;
  206. padding-bottom: 4px;
  207. border-bottom: 1px dashed #ddd;
  208. &-title {
  209. font-size: 16px;
  210. padding-top: 10px;
  211. margin-bottom: 4px;
  212. }
  213. .child {
  214. padding: 6px;
  215. border-radius: 4px;
  216. overflow: hidden;
  217. &-title {
  218. font-size: 14px;
  219. }
  220. &-result {
  221. margin-top: 4px;
  222. display: flex;
  223. align-items: center;
  224. .have-not-begun {
  225. background: #E34D59;
  226. }
  227. .done {
  228. background: #4BA574;
  229. }
  230. .underway {
  231. background: #2151D1;
  232. }
  233. .tag {
  234. font-size: 10px;
  235. padding: 4px;
  236. border-radius: 4px;
  237. color: #fff;
  238. margin-left: 6px;
  239. }
  240. .time {
  241. font-size: 14px;
  242. color: #999;
  243. }
  244. }
  245. }
  246. }
  247. .workorder:last-child {
  248. padding-bottom: 0px;
  249. border: 0;
  250. }
  251. }
  252. </style>