DetailCheckJobReport.vue 5.7 KB

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