maintain_course.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view class="">
  3. <!-- 步骤条 -->
  4. <Step>
  5. <StepItem
  6. v-for="(item, index) in repairInfoLogList"
  7. :key="index"
  8. :active="index == 0"
  9. :hideContent="Boolean(item.content)"
  10. >
  11. <template v-slot:header>
  12. <view class="step-title">
  13. <view class="s1">
  14. {{
  15. item.type &&
  16. item.type.desc + (item.createNum ? `第${item.createNum}次` : '')
  17. }}
  18. </view>
  19. <view class="s2">
  20. {{ item.createTime }}
  21. </view>
  22. </view>
  23. </template>
  24. <template v-slot:content v-if="item.content">
  25. <!-- 转派 -->
  26. <view class="list-xs" v-if="item.type.desc == '转派'">
  27. <view class="list-xs-item">
  28. <view class="label"> 转派人 </view>
  29. <view class="value">
  30. {{ item.content.reassignName }}
  31. </view>
  32. </view>
  33. <view class="list-xs-item">
  34. <view class="label"> 接收人 </view>
  35. <view class="value">
  36. {{ item.content.executorName }}
  37. </view>
  38. </view>
  39. <view class="list-xs-item">
  40. <view class="label"> 转派原因 </view>
  41. <view class="value">
  42. {{ item.content.reassignExplain }}
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 默认 -->
  47. <view class="list-xs" v-else>
  48. <template v-for="(itm, index1) in Object.entries(item.content)">
  49. <view
  50. class="img-wrap"
  51. v-if="itm[0] == 'workOrderImgList' && itm[1]"
  52. >
  53. <image
  54. class="img"
  55. @click="clickImg(itm[1].split(','), el)"
  56. :src="apiUrl + el"
  57. v-for="(el, index2) in itm[1].split(',')"
  58. :key="index2"
  59. ></image>
  60. </view>
  61. <view class="list-xs-item" v-else-if="itm[0] == 'workOrderId'">
  62. <view class="label"> </view>
  63. <view class="value bj" @click="handlbjsymx('备件使用明细')">
  64. {{ dictProcess[itm[0]] }}
  65. </view>
  66. </view>
  67. <view
  68. class="list-xs-item"
  69. v-else-if="
  70. [
  71. 'examineResult',
  72. 'acceptanceResult',
  73. 'approvalResult'
  74. ].includes(itm[0])
  75. "
  76. >
  77. <view class="label">
  78. {{ dictProcess[itm[0]] }}
  79. </view>
  80. <view class="value">
  81. {{ itm[1] ? '通过' : '未通过' }}
  82. </view>
  83. </view>
  84. <view class="list-xs-item" v-else-if="itm[0] == 'sparePartsCode'">
  85. <view class="label">
  86. {{ dictProcess[itm[0]] }}
  87. </view>
  88. <view class="value">
  89. {{ itm[1] }}
  90. <span
  91. class="list-xs-item-btn"
  92. @click="handlbjsymx('备件明细', itm[1])"
  93. >备件明细</span
  94. >
  95. </view>
  96. </view>
  97. <view
  98. class="list-xs-item"
  99. v-else-if="
  100. [
  101. 'approvalUserName',
  102. 'applyUserName',
  103. 'stockOutCode',
  104. 'executorName',
  105. 'repairReportExplain',
  106. 'userName',
  107. 'acceptanceInstructions',
  108. 'createUserName',
  109. 'planCode',
  110. 'planName',
  111. 'examinePlanUserName',
  112. 'examineExplain',
  113. 'workOrderCode',
  114. 'maintenanceContent',
  115. 'plannedTime',
  116. 'workOrderExecutorName'
  117. ].includes(itm[0])
  118. "
  119. >
  120. <view class="label">
  121. {{ dictProcess[itm[0]] }}
  122. </view>
  123. <view class="value">
  124. {{ itm[1] }}
  125. </view>
  126. </view>
  127. </template>
  128. </view>
  129. </template>
  130. </StepItem>
  131. </Step>
  132. <PopSparePart
  133. ref="PopSparePart"
  134. :workOrderCode="workOrderCode"
  135. :sparePartsJson="sparePartsJson"
  136. :noRequest="true"
  137. ></PopSparePart>
  138. </view>
  139. </template>
  140. <script>
  141. import Step from '@/components/Step/Step.vue'
  142. import StepItem from '@/components/Step/StepItem.vue'
  143. import PopSparePart from '../components/PopSparePart.vue'
  144. export default {
  145. props: {
  146. repairInfoLogList: {
  147. type: Array,
  148. default () {
  149. return []
  150. }
  151. },
  152. planEquiList: {
  153. type: Array,
  154. default () {
  155. return []
  156. }
  157. },
  158. workOrderCode: {
  159. type: String,
  160. default () {
  161. return ''
  162. }
  163. }
  164. },
  165. components: {
  166. Step,
  167. StepItem,
  168. PopSparePart
  169. },
  170. computed: {
  171. // 报工备品备件
  172. sparePartsJson () {
  173. if (this.planEquiList && this.planEquiList.length > 0) {
  174. return JSON.parse(this.planEquiList[0].sparePartsJson || '[]')
  175. } else {
  176. return []
  177. }
  178. }
  179. },
  180. data () {
  181. return {
  182. // 维修历程映射
  183. dictProcess: {
  184. executorName: '执行人',
  185. repairReportExplain: '处理说明',
  186. workOrderId: '备件使用明细',
  187. userName: '验收人',
  188. acceptanceResult: '验收结果',
  189. acceptanceInstructions: '验收说明',
  190. createUserName: '创建人',
  191. planCode: '计划单号',
  192. planName: '计划名称',
  193. examinePlanUserName: '审核人',
  194. examineResult: '审核结果',
  195. examineExplain: '审核说明',
  196. workOrderCode: '工单编号',
  197. maintenanceContent: '维修方案',
  198. plannedTime: '执行完成时间',
  199. workOrderExecutorName: '执行人',
  200. reassignName: '转派人',
  201. reassignExplain: '转派原因',
  202. stockOutCode: '出库单号',
  203. approvalUserName: '审核人',
  204. approvalResult: '审核结果',
  205. applyUserName: '申请人',
  206. sparePartsCode: '申领单号'
  207. }
  208. }
  209. },
  210. methods: {
  211. // 备件使用明细
  212. handlbjsymx (value, code) {
  213. // if(value==='使用'){
  214. // }
  215. this.$refs.PopSparePart.open(value, code)
  216. },
  217. // 查看图片
  218. clickImg (urls, indexUrl) {
  219. urls = urls.map(n => {
  220. return this.apiUrl + n
  221. })
  222. wx.previewImage({
  223. urls: urls, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  224. current: this.apiUrl + indexUrl, // 当前显示图片的http链接,默认是第一个
  225. success: function (res) {},
  226. fail: function (res) {},
  227. complete: function (res) {}
  228. })
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. .step-title {
  235. display: flex;
  236. justify-content: space-between;
  237. .s1 {
  238. }
  239. }
  240. .list-xs {
  241. .list-xs-item {
  242. color: #7f7f7f;
  243. display: flex;
  244. .label {
  245. font-size: 28rpx;
  246. width: 120rpx;
  247. text-align: right;
  248. margin-right: 20rpx;
  249. }
  250. .value {
  251. font-size: 28rpx;
  252. &.bj {
  253. padding: 10rpx 0;
  254. color: #4f7f00;
  255. }
  256. }
  257. & + .list-xs-item {
  258. margin-top: 10rpx;
  259. .list-xs-item-btn {
  260. color: #47975a;
  261. margin-left: 30rpx;
  262. }
  263. }
  264. }
  265. .img-wrap {
  266. padding-left: 140rpx;
  267. margin-top: 20rpx;
  268. display: flex;
  269. flex-wrap: wrap;
  270. margin-left: -20rpx;
  271. .img {
  272. width: 160rpx;
  273. height: 120rpx;
  274. margin-left: 20rpx;
  275. margin-bottom: 20rpx;
  276. }
  277. }
  278. }
  279. </style>