historyRepairDetail.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view>
  3. <!-- 备品备件弹窗 -->
  4. <u-popup :show="popShow" @close="close" mode="center" class="u-popup">
  5. <view class="bpbj">
  6. <view class="title">
  7. {{ title }}
  8. </view>
  9. <view class="detail-content">
  10. <Step>
  11. <StepItem v-for="(item, index) in repairInfoLogList" :key="index" :active="index == 0" :hideContent="Boolean(item.content)">
  12. <template v-slot:header>
  13. <view class="step-title">
  14. <view class="s1">{{ typeOptions[item.type] }}</view>
  15. <view class="s2">
  16. {{ item.createTime }}
  17. </view>
  18. </view>
  19. </template>
  20. <template v-slot:content v-if="item.content">
  21. <view class="list-xs" v-if="item.type == 'CREATE'">
  22. <view class="list-xs-item">
  23. <view class="label">报修人</view>
  24. <view class="value">
  25. {{ logs[item.id] ? logs[item.id].content.requestUserName : '' }}
  26. </view>
  27. </view>
  28. <view class="list-xs-item">
  29. <view class="label">故障描述</view>
  30. <view class="value">
  31. {{ logs[item.id] ? logs[item.id].content.remark : '' }}
  32. </view>
  33. </view>
  34. </view>
  35. <view class="list-xs" v-else-if="item.type == 'SPARE_PARTS_APPLY'">
  36. <view class="list-xs-item">
  37. <view class="label">申领清单</view>
  38. <view class="value bjsymx" @click="handlbjsymx('备件明细', item.content.infoList)">备件使用明细</view>
  39. </view>
  40. </view>
  41. <view class="list-xs" v-else-if="item.type == 'ACCEPTANCE_CHEK'">
  42. <view class="list-xs-item">
  43. <view class="label">验收人</view>
  44. <view class="value">
  45. {{ logs[item.id] ? logs[item.id].content.userName : '' }}
  46. </view>
  47. </view>
  48. <view class="list-xs-item">
  49. <view class="label">验收结果</view>
  50. <view class="value">
  51. {{ logs[item.id] ? (logs[item.id].content.orderStatus == 4 ? '通过' : '驳回') : '' }}
  52. </view>
  53. </view>
  54. </view>
  55. <view class="list-xs" v-else-if="item.type == 'WORK_REPORT'">
  56. <view class="list-xs-item">
  57. <view class="label">处理说明</view>
  58. <view class="value">
  59. {{ logs[item.id] ? logs[item.id].content.reason : '' }}
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. </StepItem>
  65. </Step>
  66. <PopSparePart ref="PopSparePart" :workOrderCode="workOrderCode" :noRequest="true"></PopSparePart>
  67. </view>
  68. <view class="close" @click="close">
  69. <u-button text="关闭"></u-button>
  70. </view>
  71. </view>
  72. </u-popup>
  73. </view>
  74. </template>
  75. <script>
  76. import Step from '@/components/Step/Step.vue'
  77. import StepItem from '@/components/Step/StepItem.vue'
  78. import PopSparePart from './PopSparePart.vue'
  79. export default {
  80. components: {
  81. Step,
  82. StepItem,
  83. PopSparePart
  84. },
  85. data() {
  86. return {
  87. repairInfoLogList: [],
  88. logs: [],
  89. workOrderCode: '',
  90. popShow: false,
  91. workOrderId: '',
  92. InfoList: [],
  93. title: '',
  94. typeOptions: {
  95. CREATE: '生成工单',
  96. SPARE_PARTS_APPLY: '备品备件申请',
  97. ACCEPTANCE_CHEK: '验收',
  98. WORK_REPORT: '报工'
  99. }
  100. }
  101. },
  102. methods: {
  103. // 备件使用明细
  104. handlbjsymx(title, list) {
  105. console.log(list)
  106. this.$refs.PopSparePart.open(title, list)
  107. },
  108. open(value, data) {
  109. console.log(list)
  110. this.popShow = true
  111. this.title = value
  112. let list = JSON.parse(JSON.stringify(data))
  113. this.repairInfoLogList = list.reverse()
  114. this.repairInfoLogList.forEach(item => {
  115. this.logs[item.id] = {
  116. id: item.id,
  117. content: item.content,
  118. createTime: item.createTime,
  119. type: item.type,
  120. remark: item.remark,
  121. requestUserName: item.requestUserName
  122. }
  123. if (item.type === 'SPARE_PARTS_APPLY') {
  124. this.logs[item.id].content.infoList =
  125. this.logs[item.id].content && this.logs[item.id].content.infoList && this.logs[item.id].content.infoList.length > 0
  126. ? this.logs[item.id].content.infoList.map(item => {
  127. return {
  128. ...JSON.parse(item.sparePartsList),
  129. sparePartsId: item.sparePartsId
  130. }
  131. })
  132. : []
  133. }
  134. })
  135. },
  136. close() {
  137. this.popShow = false
  138. this.$emit('close')
  139. }
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. .nodata {
  145. text-align: center;
  146. padding: 30rpx 0;
  147. }
  148. .popShow {
  149. height: 100%;
  150. width: 100%;
  151. overflow: hidden;
  152. position: fixed;
  153. }
  154. .bpbj {
  155. width: 600rpx;
  156. .title {
  157. margin-bottom: 7px;
  158. background-color: #333333;
  159. text-align: center;
  160. color: #fff;
  161. padding: 10rpx 0;
  162. }
  163. .detail-content {
  164. border: 1rpx solid rgba(242, 242, 242, 1);
  165. max-height: 60vh;
  166. overflow: auto;
  167. .col {
  168. font-size: 28rpx;
  169. border-bottom: 1rpx solid rgba(242, 242, 242, 1);
  170. display: flex;
  171. padding: 10rpx;
  172. flex-wrap: wrap;
  173. align-items: center;
  174. justify-content: space-between;
  175. background-color: rgba(242, 242, 242, 0.372549019607843);
  176. .tt {
  177. width: 100%;
  178. }
  179. }
  180. .plus {
  181. width: 40rpx;
  182. height: 40rpx;
  183. line-height: 38rpx;
  184. text-align: center;
  185. background-color: $j-primary-border-green;
  186. color: #fff;
  187. margin: 16rpx 0 0 16rpx;
  188. }
  189. }
  190. /deep/.u-number-box {
  191. .u-number-box__minus,
  192. .u-number-box__plus,
  193. .u-number-box__input {
  194. font-size: 30rpx;
  195. height: 1.6em !important;
  196. }
  197. .u-number-box__input {
  198. width: 2em !important;
  199. }
  200. .u-number-box__minus,
  201. .u-number-box__plus {
  202. background-color: $j-primary-border-green !important;
  203. .u-icon__icon {
  204. color: #fff !important;
  205. }
  206. }
  207. }
  208. }
  209. </style>