Detail.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <a-modal
  3. :width="1000"
  4. :visible="visible"
  5. title="详情"
  6. :confirmLoading="confirmLoading"
  7. :footer="null"
  8. @cancel="handleCancel" >
  9. <a-table
  10. bordered
  11. :data-source="list"
  12. :columns="columns"
  13. tableLayout="auto"
  14. rowKey="id">
  15. <span slot="status" slot-scope="text">
  16. <badge :text="BaseTool.Object.getField(statusMap,text)" :status="DictCache.COLOR.REPAIR_FORM_STATUS[text]"/>
  17. </span>
  18. </a-table>
  19. </a-modal>
  20. </template>
  21. <script>
  22. export default {
  23. data () {
  24. return {
  25. visible: false,
  26. confirmLoading: false,
  27. list: [],
  28. statusMap: {},
  29. preparationMap: {},
  30. columns: [
  31. {
  32. title: '内容',
  33. checked: true,
  34. width: '150',
  35. dataIndex: 'name'
  36. },
  37. {
  38. title: '申请人',
  39. checked: true,
  40. width: '150',
  41. dataIndex: 'userName'
  42. },
  43. {
  44. title: '公司',
  45. checked: true,
  46. width: '200',
  47. dataIndex: 'parentPositionId',
  48. customRender: (text, record, index) => {
  49. return this.BaseTool.Object.getField(this.preparationMap, text)
  50. }
  51. },
  52. {
  53. title: '申请部门',
  54. checked: true,
  55. width: '150',
  56. dataIndex: 'deptName'
  57. },
  58. {
  59. title: '建筑物',
  60. checked: true,
  61. width: '150',
  62. dataIndex: 'positionName'
  63. },
  64. {
  65. title: '费用(元)',
  66. checked: true,
  67. width: '150',
  68. dataIndex: 'fee'
  69. },
  70. {
  71. title: '报修时间',
  72. checked: true,
  73. width: '150',
  74. dataIndex: 'applyTime'
  75. },
  76. {
  77. title: '要求完成日期',
  78. checked: true,
  79. width: '150',
  80. dataIndex: 'limitHours'
  81. },
  82. {
  83. title: '报修状态',
  84. checked: true,
  85. dataIndex: 'status',
  86. width: 150,
  87. scopedSlots: { customRender: 'status' }
  88. }
  89. ]
  90. }
  91. },
  92. created () {
  93. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PREPARATION_STATUS)
  94. this.preparationMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PREPARATION_PARENT)
  95. },
  96. methods: {
  97. base (record) {
  98. console.log(record.detailList)
  99. this.visible = true
  100. this.list = record.detailList
  101. },
  102. handleCancel (values) {
  103. this.visible = false
  104. this.confirmLoading = false
  105. }
  106. }
  107. }
  108. </script>
  109. <style>
  110. </style>