detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div class="warehouseAllocationDetail-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" class="warehouseAllocationDetail-back">
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. <!-- 操作区,位于 title 行的行尾 -->
  9. <template slot="extra">
  10. <a-button key="2" id="warehouseAllocationDetail-preview-btn">打印预览</a-button>
  11. <a-button key="1" type="primary" id="warehouseAllocationDetail-print-btn">快速打印</a-button>
  12. <a-button key="3" type="danger" @click="handleExport" :loading="exportLoading" id="warehouseAllocationDetail-export-btn">导出</a-button>
  13. </template>
  14. </a-page-header>
  15. <!-- 基础信息 -->
  16. <a-card :bordered="false" class="warehouseAllocationDetail-cont">
  17. <a-collapse :activeKey="['1']">
  18. <a-collapse-panel key="1" header="基础信息">
  19. <a-descriptions :column="3">
  20. <a-descriptions-item label="调出仓库">箭冠营销中心</a-descriptions-item>
  21. <a-descriptions-item label="调入仓库">箭冠营销中心</a-descriptions-item>
  22. <a-descriptions-item label="调拨单号">箭冠营销中心</a-descriptions-item>
  23. <a-descriptions-item label="关联单号">箭冠营销中心</a-descriptions-item>
  24. <a-descriptions-item label="审核状态">箭冠营销中心</a-descriptions-item>
  25. <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
  26. <a-descriptions-item label="备注">箭冠营销中心</a-descriptions-item>
  27. </a-descriptions>
  28. </a-collapse-panel>
  29. </a-collapse>
  30. </a-card>
  31. <!-- 详情 -->
  32. <a-card :bordered="false" class="warehouseAllocationDetail-cont">
  33. <a-collapse :activeKey="['1']">
  34. <a-collapse-panel key="1" header="详情">
  35. <!-- 总计 -->
  36. <a-alert type="info" showIcon style="margin-bottom:15px">
  37. <div slot="message">总款数: <strong>6</strong> ,总数量: <strong>6</strong> ,总成本:¥<strong>6.33</strong></div>
  38. </a-alert>
  39. <!-- 列表 -->
  40. <s-table
  41. class="sTable"
  42. ref="table"
  43. size="default"
  44. :rowKey="(record) => record.id"
  45. :columns="columns"
  46. :data="loadData"
  47. bordered>
  48. <!-- 采购数量 -->
  49. <template slot="purchaseNum" slot-scope="text, record">
  50. <span>{{record.purchaseNum}}</span>
  51. </template>
  52. <!-- 缺货数量 -->
  53. <template slot="outOfStockNum" slot-scope="text, record">
  54. <span>{{record.outOfStockNum}}</span>
  55. </template>
  56. </s-table>
  57. </a-collapse-panel>
  58. </a-collapse>
  59. </a-card>
  60. </div>
  61. </template>
  62. <script>
  63. import { STable, VSelect } from '@/components'
  64. export default{
  65. components: { STable, VSelect },
  66. data(){
  67. return{
  68. exportLoading: false, // 导出loading
  69. // 表头
  70. columns: [
  71. { title: '序号', dataIndex: 'no', align: 'center' },
  72. { title: '产品编码', dataIndex: 'creatDate', align: 'center' },
  73. { title: '产品名称', dataIndex: 'custName', align: 'center' },
  74. { title: '原厂编码', dataIndex: 'totalP', align: 'center' },
  75. { title: '类别', dataIndex: 'tostalP', align: 'center' },
  76. { title: '数量', scopedSlots: { customRender: 'outOfStockNum' }, align: 'center' },
  77. { title: '单位', dataIndex: 'mementPay', align: 'center' },
  78. { title: '成本小计', dataIndex: 'totalNums', align: 'center' },
  79. { title: '调出仓位', dataIndex: 'shDate', align: 'center' },
  80. { title: '调入仓位', dataIndex: 'shDsate', align: 'center' },
  81. ],
  82. // 加载数据方法 必须为 Promise 对象
  83. loadData: parameter => {
  84. this.disabled = true
  85. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  86. // const data = res.data
  87. // const no = (data.pageNo - 1) * data.pageSize
  88. // for (var i = 0; i < data.list.length; i++) {
  89. // data.list[i].no = no + i + 1
  90. // }
  91. // this.disabled = false
  92. // return data
  93. // })
  94. const _this = this
  95. return new Promise(function(resolve, reject){
  96. const data = {
  97. pageNo: 1,
  98. pageSize: 10,
  99. list: [
  100. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  101. ],
  102. count: 10
  103. }
  104. const no = (data.pageNo - 1) * data.pageSize
  105. for (var i = 0; i < data.list.length; i++) {
  106. data.list[i].no = no + i + 1
  107. }
  108. _this.disabled = false
  109. resolve(data)
  110. })
  111. },
  112. }
  113. },
  114. methods: {
  115. // 返回列表
  116. handleBack(){
  117. this.$router.push({ path: '/inventoryManagement/warehouseAllocation/list'})
  118. },
  119. // 导出
  120. handleExport () {
  121. const params = this.queryParam
  122. if (this.oldTime && this.oldTime.length > 0) {
  123. params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
  124. params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
  125. } else {
  126. params.beginOldExpiryDate = ''
  127. params.endOldExpirydDate = ''
  128. }
  129. if (this.newTime && this.newTime.length > 0) {
  130. params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
  131. params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
  132. } else {
  133. params.beginDate = ''
  134. params.endDate = ''
  135. }
  136. this.exportLoading = true
  137. customerBundleExportDelay(params).then(res => {
  138. this.exportLoading = false
  139. this.download(res)
  140. })
  141. },
  142. download (data) {
  143. if (!data) { return }
  144. const url = window.URL.createObjectURL(new Blob([data]))
  145. const link = document.createElement('a')
  146. link.style.display = 'none'
  147. link.href = url
  148. const a = moment().format('YYYYMMDDHHmmss')
  149. const fname = '仓库调拨' + a
  150. link.setAttribute('download', fname + '.xlsx')
  151. document.body.appendChild(link)
  152. link.click()
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="less">
  158. .warehouseAllocationDetail-cont, .warehouseAllocationDetail-back{
  159. margin-bottom: 15px;
  160. }
  161. </style>