DetailCheckJobReport.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <a-modal
  3. :title="modalTitle"
  4. :width="1200"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. @cancel="handleCancel"
  8. >
  9. <title-divider title="明细列表" width="90px"></title-divider>
  10. <a-table
  11. bordered
  12. :data-source="data"
  13. :columns="columns"
  14. :scroll="{x: 1000, y: BaseTool.Constant.scrollY}"
  15. tableLayout="auto"
  16. rowKey="id"
  17. >
  18. <span slot="action" slot-scope="record">
  19. <template>
  20. <a @click="handleView(record)">查看</a>
  21. </template>
  22. </span>
  23. <span slot="status" slot-scope="text">
  24. <badge
  25. :text="BaseTool.Object.getField(statusMap,text)"
  26. :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[text]" />
  27. </span>
  28. </a-table>
  29. <template slot="footer">
  30. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  31. </template>
  32. <detail :check-type="2" ref="detailModal"/>
  33. </a-modal>
  34. </template>
  35. <script>
  36. import DetailList from '@/components/tools/DetailList'
  37. import Detail from '@/views/check/checkjob/modules/Detail'
  38. import { fetchCheckJob } from '@/api/check/checkjob'
  39. const DetailListItem = DetailList.Item
  40. export default {
  41. name: 'DetailRepairReport',
  42. components: {
  43. DetailList,
  44. DetailListItem,
  45. Detail
  46. },
  47. data () {
  48. return {
  49. confirmLoading: false,
  50. mdl: {},
  51. modalTitle: null,
  52. visible: false,
  53. // 下拉框map
  54. typeMap: {},
  55. statusMap: {},
  56. model: {},
  57. // 查询参数
  58. queryParam: {
  59. filter: this.filter,
  60. searchType: this.searchType
  61. },
  62. // 表头
  63. columns: [
  64. {
  65. title: '序号',
  66. dataIndex: 'index',
  67. checked: true,
  68. width: '70px',
  69. customRender: (text, record, index) => {
  70. return `${index + 1}`
  71. }
  72. },
  73. {
  74. title: '设备新号',
  75. dataIndex: 'sbNo',
  76. checked: true,
  77. width: '150px'
  78. },
  79. {
  80. title: '设备名称',
  81. dataIndex: 'sbName',
  82. checked: true,
  83. width: '200px'
  84. },
  85. {
  86. title: '设备部位',
  87. dataIndex: 'partName',
  88. checked: true,
  89. width: '150px'
  90. },
  91. {
  92. title: '维护等级',
  93. dataIndex: 'standardLevel',
  94. width: '100px',
  95. checked: true,
  96. customRender: (text, record, index) => {
  97. return this.BaseTool.Table.getMapText(this.standardLevelMap, text)
  98. }
  99. },
  100. {
  101. title: '任务要求',
  102. dataIndex: 'requirement',
  103. checked: true,
  104. width: '200px'
  105. },
  106. {
  107. title: '计划周期',
  108. dataIndex: 'period',
  109. checked: true,
  110. width: '150px',
  111. customRender: (text, record, index) => {
  112. return text + this.BaseTool.Table.getMapText(this.periodTypeMap, record.periodType)
  113. }
  114. },
  115. /* {
  116. title: '计划名称',
  117. dataIndex: 'planName',
  118. checked: true
  119. }, */
  120. {
  121. title: '负责人',
  122. dataIndex: 'checkUserName',
  123. checked: true,
  124. width: '150px'
  125. },
  126. // {
  127. // title: '负责部件',
  128. // dataIndex: 'partName',
  129. // checked: true
  130. // },
  131. /* {
  132. title: '截至日期',
  133. dataIndex: 'endTime',
  134. checked: true,
  135. width: '200px'
  136. }, */
  137. {
  138. title: '标准工时',
  139. dataIndex: 'standardHours',
  140. checked: true,
  141. width: '200px'
  142. },
  143. {
  144. title: '实际工时',
  145. dataIndex: 'realHours',
  146. checked: true,
  147. width: '200px'
  148. },
  149. {
  150. title: '实际结束时间',
  151. dataIndex: 'actualEndTime',
  152. checked: true,
  153. width: '200px'
  154. },
  155. {
  156. title: '执行日期',
  157. dataIndex: 'startTime',
  158. checked: true,
  159. width: '200px'
  160. },
  161. {
  162. title: '实际执行日期',
  163. dataIndex: 'actualStartTime',
  164. checked: true,
  165. width: '200px',
  166. customRender: (text, record, index) => {
  167. return (text == null ? '暂无' : this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN))
  168. }
  169. },
  170. {
  171. title: '任务状态',
  172. dataIndex: 'status',
  173. width: '100px',
  174. checked: true,
  175. fixed: 'right',
  176. scopedSlots: { customRender: 'status' }
  177. },
  178. {
  179. title: '操作',
  180. key: 'action',
  181. width: '100px',
  182. fixed: 'right',
  183. align: 'center',
  184. scopedSlots: { customRender: 'action' },
  185. checked: true
  186. }
  187. ],
  188. // 下拉框map
  189. levelMap: {},
  190. standardLevelMap: {},
  191. sbStatusMap: {},
  192. periodTypeMap: {},
  193. data: []
  194. }
  195. },
  196. created () {
  197. // 下拉框map
  198. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
  199. this.sbStatusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  200. this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
  201. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  202. this.standardLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
  203. },
  204. methods: {
  205. base (record) {
  206. this.visible = true
  207. this.modalTitle = '详情'
  208. this.model = record
  209. this.data = record.detailList
  210. },
  211. handleCancel () {
  212. this.visible = false
  213. this.confirmLoading = false
  214. },
  215. handleView (record) {
  216. fetchCheckJob({ id: record.id }).then(res => {
  217. const modal = this.$refs.detailModal
  218. modal.base(res.data)
  219. })
  220. }
  221. }
  222. }
  223. </script>