DetailYY.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-popconfirm v-if="model.status==1" title="是否要提交到仓库?" @confirm="updateStore()">
  7. <a-button type="primary">提交仓库</a-button>
  8. </a-popconfirm>
  9. <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
  10. </span>
  11. </a-col>
  12. </a-row>
  13. <detail-list title="" :col="3">
  14. <detail-list-item term="单号">{{ model.outNo }}</detail-list-item>
  15. <detail-list-item term="类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
  16. <detail-list-item term="仓库">{{ model.storeName }}</detail-list-item>
  17. <detail-list-item term="状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="statusMap[model.status]"/></detail-list-item>
  18. <detail-list-item term="是否出库"><badge :text="BaseTool.Object.getField(yesNoMap,model.isOut)" :status="statusMap[model.status]"/></detail-list-item>
  19. <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  20. <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
  21. <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
  22. </detail-list>
  23. <detail-list title="" :col="1">
  24. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  25. </detail-list>
  26. <title-divider title="备件明细" width="90px"></title-divider>
  27. <a-table
  28. bordered
  29. :data-source="data"
  30. :columns="columns"
  31. tableLayout="auto"
  32. rowKey="cbatch">
  33. </a-table>
  34. <history ref="history" :audit="false" :ok="handleCancel"></history>
  35. </a-card>
  36. </template>
  37. <script>
  38. import { updateStore, fetchOutStoreForm } from '@/api/store/outstoreform'
  39. import DetailList from '@/components/tools/DetailList'
  40. import History from '@/views/activiti/History'
  41. const DetailListItem = DetailList.Item
  42. export default {
  43. name: 'OutStoreFormDetail',
  44. components: {
  45. DetailList,
  46. History,
  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. yesNoMap: {},
  59. model: {
  60. 'outNo': null,
  61. 'type': null,
  62. 'pickId': null,
  63. 'storeId': null,
  64. 'storeName': null,
  65. 'pickNo': null,
  66. 'totalPrice': null,
  67. 'remark': null,
  68. 'createdUserId': null,
  69. 'updateUserId': null,
  70. 'updateTime': null,
  71. 'createdUserName': null,
  72. 'updateUserName': null
  73. },
  74. // 表头
  75. columns: [
  76. {
  77. title: '序号',
  78. dataIndex: 'index',
  79. customRender: (text, record, index) => {
  80. return index + 1
  81. }
  82. },
  83. {
  84. title: '备件名称',
  85. dataIndex: 'spareName'
  86. },
  87. {
  88. title: '编号',
  89. dataIndex: 'no'
  90. },
  91. {
  92. title: '规格',
  93. dataIndex: 'ggxh'
  94. },
  95. {
  96. title: '仓库',
  97. dataIndex: 'storeName'
  98. },
  99. {
  100. title: '批次',
  101. dataIndex: 'cbatch'
  102. },
  103. {
  104. title: '申请数量',
  105. dataIndex: 'num',
  106. width: 150
  107. },
  108. {
  109. title: '实际数量',
  110. dataIndex: 'realNum',
  111. width: 150
  112. }
  113. ],
  114. data: []
  115. }
  116. },
  117. created () {
  118. // 下拉框map
  119. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_TYPE)
  120. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_STATUS)
  121. this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  122. },
  123. methods: {
  124. base (record) {
  125. this.visible = true
  126. this.modalTitle = '详情'
  127. this.model = record
  128. this.data = record.detailList
  129. const modal = this.$refs.history
  130. modal.base(record, null)
  131. },
  132. handleCancel () {
  133. this.visible = false
  134. this.confirmLoading = false
  135. this.$emit('ok')
  136. },
  137. handleOk () {
  138. fetchOutStoreForm({ id: this.model.id }).then(res => {
  139. this.model = res.data
  140. })
  141. },
  142. updateStore () {
  143. updateStore({ id: this.model.id }).then(res => {
  144. this.$message.info('成功')
  145. this.handleOk()
  146. })
  147. }
  148. }
  149. }
  150. </script>