detail - 副本.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view>
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="巡点检工单详情" @clickLeft="back">
  4. <!-- -->
  5. <template slot="float" v-if="status!==2">
  6. <view class="nav-icon-caozuo iconfont icon-caozuo" @click="setOptionShow"></view>
  7. </template>
  8. </uni-nav-bar>
  9. <!-- 进度组件 根据状态显示不同列表 -->
  10. <popupOper :optionShow="optionShow" @operate="operate" :operationList="operationList"></popupOper>
  11. <view class="page-bottom-padding" v-if="worksheetInfo">
  12. <uni-collapse ref="collapse">
  13. <!-- <uni-collapse-item :open="(worksheetInfo && worksheetInfo.status.id == '99') ? false : true" -->
  14. <uni-collapse-item :typeOpen="1" title="基本信息" open>
  15. <view class="bg">
  16. <DetailMain :detailsInfo="tourTallyDetailFn(worksheetInfo)"></DetailMain>
  17. </view>
  18. </uni-collapse-item>
  19. </uni-collapse>
  20. <!-- 巡检点设备 -->
  21. <template>
  22. <CellTip title="巡检点设备"> </CellTip>
  23. <OrderDetail v-for="(item,idx) in worksheetInfo.equiList" :key="idx" :border="true"
  24. :value1="'设备编码:'+item.equiCode" :value2="'设备型号:' + item.equiModel" :value3="'设备名称:'+item.equiName">
  25. <template slot="custSlot">
  26. <view class="" v-for="(el,idx) in item.ruleItems">
  27. <view class="list-cell">
  28. <text class="font-text">检测事项:{{el.itemName}}</text>
  29. </view>
  30. <view class="list-cell font-sm">
  31. <text>检测标准:{{el.itemStandard}}</text>
  32. <text>检测内容:{{el.itemContent}}</text>
  33. </view>
  34. <view class="list-cell font-sm">
  35. <text>状态:{{el.status === null?'未处理':el.status===1?"正常":"缺陷"}}</text>
  36. </view>
  37. </view>
  38. </template>
  39. </OrderDetail>
  40. </template>
  41. <!-- 执行信息 -->
  42. <!-- <template v-if="worksheetInfo && worksheetInfo.status.id == '99'"> -->
  43. <template>
  44. <CellTip title="执行信息"> </CellTip>
  45. <CellInfo label="报工结果" :value="statusList[worksheetInfo.workOrder.status]"></CellInfo>
  46. <CellInfo label="实际开始时间" :value="worksheetInfo.workOrder.startTime"></CellInfo>
  47. <CellInfo label="实际结束时间" :value="worksheetInfo.workOrder.endTime"></CellInfo>
  48. </template>
  49. <!-- 执行处理结果 -->
  50. <!--<template v-if="worksheetInfo && worksheetInfo.status.id == '99'">
  51. <CellTip title="执行处理结果"> </CellTip>
  52. <uni-collapse ref="collapse" v-for="item in worksheetInfo.details" :key="'zxcl'+item.id">
  53. <uni-collapse-item :open="false" :typeOpen="false" titleStyle="background-color: #ffffff">
  54. <OrderDetail slot="typeOpenShow" :value1="item.name" :value2="item.spec"
  55. :value3="'通用设备-' + item.name" :value4="item.code" :value5="item.address"
  56. :value6="'x' + (item.num || 1)">
  57. </OrderDetail>
  58. <view class="content-status" @click.stop>
  59. <view class="cell-box border-bottom" v-for="(items,indexs) in item.contentDetails"
  60. :key="indexs" @click="goDetail(items.id, items.status)">
  61. <view class="cell">
  62. {{items.content}}
  63. </view>
  64. <view class="cell">
  65. 检测内容:{{items.kpi}}
  66. </view>
  67. <view class="cell">
  68. 检测标准:{{items.paramRange}}
  69. </view>
  70. <view class="btn cell-box-right"
  71. :class="items.status.id == '1' ? 'btn-primary' : 'btn-warning'">
  72. {{items.status.name}}
  73. </view>
  74. </view>
  75. </view>
  76. </uni-collapse-item>
  77. </uni-collapse>
  78. </template> -->
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. get,
  85. postJ
  86. } from "@/utils/api.js"
  87. import {
  88. tourTallyDetailFn
  89. } from '@/utils/common.js'
  90. import DetailMain from '@/components/DetailMain.vue'
  91. import CellTip from '@/components/CellTip.vue'
  92. import CellInfo from '@/components/CellInfo.vue'
  93. import OrderDetail from '../components/OrderDetail.vue'
  94. import popupOper from '@/components/PopupOper.vue'
  95. export default {
  96. components: {
  97. DetailMain,
  98. popupOper,
  99. OrderDetail,
  100. CellTip,
  101. CellInfo
  102. },
  103. data() {
  104. return {
  105. statusList: {
  106. 0: "待接收",
  107. 1: "执行中",
  108. 3: "已完成",
  109. },
  110. pageId: "",
  111. worksheetInfo: {
  112. equiList:[],
  113. workOrder:{}
  114. },
  115. tourTallyDetailFn,
  116. optionShow: false,
  117. status: "",
  118. operationList: [{
  119. title: '执行',
  120. class: 'iconfont icon-zhuanpai',
  121. type: 1
  122. }],
  123. }
  124. },
  125. onLoad(options) {
  126. this.pageId = options.id;
  127. this.getInfo();
  128. },
  129. onShow() {
  130. this.optionShow = false;
  131. if (this.worksheetInfo) {
  132. this.getInfo();
  133. }
  134. },
  135. methods: {
  136. getInfo() {
  137. get(this.apiUrl + "/patrol/order/getDetail/" + this.pageId).then(res => {
  138. if(res?.success){
  139. this.worksheetInfo = res.data;
  140. let status = res.data.workOrder.status;
  141. this.status = status
  142. //只有已指派和暂停可以转派
  143. if (status === 0) {
  144. this.operationList = [{
  145. title: '受理',
  146. class: 'iconfont icon-zhuanpai',
  147. type: 3
  148. }, {
  149. title: '转派',
  150. class: 'iconfont icon-zhuanpai',
  151. type: 2
  152. }]
  153. } else if (status == 2) {
  154. this.operationList = []
  155. }
  156. }
  157. });
  158. },
  159. //选择对应的操作
  160. operate(type) {
  161. if (type === 2) { //转派
  162. uni.navigateTo({
  163. url: "../turn_send/turn_send?id=" + this.pageId
  164. })
  165. } else if (type === 1) { //报工
  166. uni.navigateTo({
  167. url: "../submitted_ministry/submitted_ministry?id=" + this.pageId
  168. })
  169. } else if (type === 3) {
  170. uni.navigateTo({
  171. url: "../accept/index?id=" + this.pageId
  172. })
  173. }
  174. },
  175. //点击显示弹窗
  176. setOptionShow() {
  177. this.optionShow = !this.optionShow;
  178. },
  179. goDetail(id, status) {
  180. //已报修
  181. // if (status.id == '2') {
  182. // uni.navigateTo({
  183. // url: '../defects/defects?id=' + id + "&type=details" + "&parentsId=" + this.pageId
  184. // })
  185. // }
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. @import "@/components/submitted.scss";
  192. .list-cell {
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. color: $uni-text-color-grey;
  197. padding: 5rpx 20rpx;
  198. }
  199. .font-sm {
  200. font-size: $uni-font-size-sm;
  201. }
  202. .font-text {
  203. color: $uni-text-color;
  204. }
  205. </style>