Detail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <a-modal
  3. :title="modalTitle"
  4. :width="850"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. @cancel="handleCancel"
  8. >
  9. <detail-list title="" :col="2">
  10. <detail-list-item term="入库单号">{{ model.inNo }}</detail-list-item>
  11. <detail-list-item term="入库类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
  12. <detail-list-item term="采购/发运单号">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
  13. <detail-list-item term="仓库">{{ model.storeName }}</detail-list-item>
  14. <detail-list-item term="总价">{{ model.totalPrice }}</detail-list-item>
  15. <detail-list-item term="状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="statusMap[model.status]"/></detail-list-item>
  16. <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  17. <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
  18. <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
  19. </detail-list>
  20. <detail-list title="" :col="1">
  21. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  22. </detail-list>
  23. <a-tabs type="card" default-active-key="1">
  24. <a-tab-pane key="1" tab="入库详情">
  25. <a-table
  26. bordered
  27. :data-source="data"
  28. :columns="columns"
  29. tableLayout="auto"
  30. rowKey="id"
  31. >
  32. </a-table>
  33. </a-tab-pane>
  34. </a-tabs>
  35. <template slot="footer">
  36. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  37. </template>
  38. </a-modal>
  39. </template>
  40. <script>
  41. import DetailList from '@/components/tools/DetailList'
  42. const DetailListItem = DetailList.Item
  43. export default {
  44. name: 'InStoreFormDetail',
  45. components: {
  46. DetailList,
  47. DetailListItem
  48. },
  49. data () {
  50. return {
  51. confirmLoading: false,
  52. mdl: {},
  53. modalTitle: null,
  54. visible: false,
  55. // 下拉框map
  56. typeMap: {},
  57. statusMap: {},
  58. model: {
  59. 'inNo': null,
  60. 'type': null,
  61. 'storeId': null,
  62. 'storeName': null,
  63. 'totalPrice': null,
  64. 'remark': null,
  65. 'createdUserId': null,
  66. 'updateUserId': null,
  67. 'updateTime': null,
  68. 'createdUserName': null,
  69. 'updateUserName': null
  70. },
  71. // 表头
  72. columns: [
  73. {
  74. title: '序号',
  75. dataIndex: 'index',
  76. customRender: (text, record, index) => {
  77. return index + 1
  78. }
  79. },
  80. // {
  81. // title: '入库仓库',
  82. // dataIndex: 'storeId',
  83. // customRender: (text, record, index) => {
  84. // return record.storeName
  85. // }
  86. // },
  87. {
  88. title: '备件名称',
  89. dataIndex: 'spareId',
  90. customRender: (text, record, index) => {
  91. return record.spareName
  92. }
  93. },
  94. {
  95. title: '编号',
  96. dataIndex: 'no'
  97. },
  98. {
  99. title: '备件规格',
  100. dataIndex: 'ggxh'
  101. },
  102. {
  103. title: '原厂编号',
  104. dataIndex: 'initNo'
  105. },
  106. {
  107. title: '数量',
  108. dataIndex: 'num'
  109. },
  110. {
  111. title: '单价',
  112. dataIndex: 'price',
  113. customRender: (text, record, index) => {
  114. return this.BaseTool.Amount.formatter(text)
  115. }
  116. },
  117. {
  118. title: '总价',
  119. dataIndex: 'totalPrice',
  120. customRender: (text, record, index) => {
  121. return this.BaseTool.Amount.formatter(text)
  122. }
  123. }
  124. ],
  125. data: []
  126. }
  127. },
  128. created () {
  129. // 下拉框map
  130. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.IN_STORE_FORM_TYPE)
  131. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.IN_STORE_FORM_STATUS)
  132. },
  133. methods: {
  134. base (record) {
  135. this.visible = true
  136. this.modalTitle = '详情'
  137. this.model = record
  138. this.data = record.detailList
  139. },
  140. handleCancel () {
  141. this.visible = false
  142. this.confirmLoading = false
  143. }
  144. }
  145. }
  146. </script>