detail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. <nodes :nodes="detail.nodes" @nodeClick="nodeClick" />
  50. <view style="height: 22vw;" />
  51. </My_listbox>
  52. <but ref="but" :sa_workorderid="sa_workorderid" :status="detail.status" @onUpdate="getDetail" />
  53. </view>
  54. </template>
  55. <script>
  56. import but from "./modules/but"
  57. import nodes from "./modules/nodes"
  58. export default {
  59. name: "Detail",
  60. components: { but, nodes },
  61. data() {
  62. return {
  63. detail: {
  64. team: [],
  65. nodes: [],
  66. status: "",
  67. node: null,
  68. },
  69. sa_workorderid: 0,
  70. }
  71. },
  72. onLoad(options) {
  73. this.sa_workorderid = options.id;
  74. this.getDetail(true)
  75. },
  76. methods: {
  77. getDetail(init = false) {
  78. if (!init) return;
  79. return this.$Http.basic({
  80. "id": 20230208140103,
  81. "content": {
  82. "sa_workorderid": this.sa_workorderid
  83. }
  84. }).then(res => {
  85. console.log("工单详情", res)
  86. if (this.cutoff(res.msg)) return;
  87. let detail = res.data;
  88. switch (detail.sourcetable) {
  89. case "w_eventid":
  90. detail.source = "巡检," + (detail.planno || ' --')
  91. break;
  92. case "w_event_log":
  93. detail.source = "告警," + (detail.eventname || ' --')
  94. break;
  95. default:
  96. detail.source = "现场"
  97. break;
  98. }
  99. this.detail = res.data;
  100. this.$refs.List.RefreshToComplete();
  101. this.$refs.List.setHeight();
  102. if (this.node) this.nodeClick(this.node)
  103. })
  104. },
  105. nodeClick(node) {
  106. if (this.detail.status != '进行中') {
  107. if (this.detail.status == '待开始') this.node = node;
  108. this.$refs.but.onClick(true)
  109. return
  110. } else {
  111. console.log("跳转", node)
  112. }
  113. }
  114. },
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .container {
  119. position: relative;
  120. .header {
  121. position: relative;
  122. padding: 10px;
  123. width: 355px;
  124. margin: 10px auto;
  125. background: #fff;
  126. border-radius: 4px;
  127. box-sizing: border-box;
  128. overflow: hidden;
  129. .billno {
  130. font-size: 16px;
  131. font-weight: bold;
  132. color: #004684;
  133. }
  134. .row {
  135. display: flex;
  136. font-size: 14px;
  137. margin-top: 6px;
  138. &-label {
  139. flex-shrink: 0;
  140. color: #666;
  141. }
  142. }
  143. .status {
  144. position: absolute;
  145. top: 0;
  146. right: 0;
  147. padding: 4px 8px;
  148. background: #FFEFEF;
  149. color: #F65050;
  150. font-size: 12px;
  151. border-radius: 0 0 0 4px;
  152. }
  153. }
  154. .label {
  155. margin: 15px 0 10px 10px;
  156. font-size: 13px;
  157. color: #fff;
  158. }
  159. .users {
  160. display: flex;
  161. flex-wrap: wrap;
  162. padding: 8px 6px 2px 6px;
  163. width: 355px;
  164. margin: 0 auto;
  165. background: #fff;
  166. border-radius: 4px;
  167. box-sizing: border-box;
  168. overflow: hidden;
  169. .user {
  170. padding: 2px 4px;
  171. border: 1px solid #000;
  172. color: #000;
  173. font-size: 13px;
  174. border-radius: 4px;
  175. margin-right: 6px;
  176. margin-bottom: 6px;
  177. box-sizing: border-box;
  178. }
  179. .leader {
  180. background: #2A6AF2;
  181. border: 0;
  182. color: #fff;
  183. }
  184. }
  185. }
  186. </style>