DetailOutStoreReport.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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: 'outNo',
  76. checked: true,
  77. width: '150px'
  78. },
  79. {
  80. title: '备件规格',
  81. dataIndex: 'ggxh',
  82. checked: true,
  83. width: '200px'
  84. },
  85. {
  86. title: '原厂编号',
  87. dataIndex: 'initNo',
  88. checked: true,
  89. width: '150px'
  90. },
  91. {
  92. title: '备件名称',
  93. dataIndex: 'spareId',
  94. width: '100px',
  95. checked: true,
  96. customRender: (text, record, index) => {
  97. return record.spareName
  98. }
  99. },
  100. {
  101. title: '出库数量',
  102. dataIndex: 'num',
  103. checked: true,
  104. width: '200px'
  105. },
  106. {
  107. title: '出库单价',
  108. dataIndex: 'price',
  109. checked: true,
  110. width: '150px',
  111. customRender: (text, record, index) => {
  112. return this.BaseTool.Amount.formatter(text)
  113. }
  114. },
  115. {
  116. title: '出库总价',
  117. dataIndex: 'totalPrice',
  118. checked: true,
  119. width: '150px',
  120. customRender: (text, record, index) => {
  121. return this.BaseTool.Amount.formatter(text)
  122. }
  123. },
  124. {
  125. title: '出库日期',
  126. dataIndex: 'createdTime',
  127. checked: true,
  128. width: '200px'
  129. }
  130. ],
  131. // 下拉框map
  132. levelMap: {},
  133. standardLevelMap: {},
  134. sbStatusMap: {},
  135. periodTypeMap: {},
  136. data: []
  137. }
  138. },
  139. created () {
  140. // 下拉框map
  141. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
  142. this.sbStatusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  143. this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
  144. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  145. this.standardLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
  146. },
  147. methods: {
  148. base (record) {
  149. this.visible = true
  150. this.modalTitle = '详情'
  151. this.model = record
  152. this.data = record.outDetailList
  153. },
  154. handleCancel () {
  155. this.visible = false
  156. this.confirmLoading = false
  157. },
  158. handleView (record) {
  159. fetchCheckJob({ id: record.id }).then(res => {
  160. const modal = this.$refs.detailModal
  161. modal.base(res.data)
  162. })
  163. }
  164. }
  165. }
  166. </script>