detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="inventoryReviewDetail-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="inventoryReviewDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. <!-- 操作区,位于 title 行的行尾 -->
  9. <template slot="extra">
  10. <a-button key="2" id="inventoryReviewDetail-preview-btn">打印预览</a-button>
  11. <a-button key="1" type="primary" id="inventoryReviewDetail-print-btn">快速打印</a-button>
  12. </template>
  13. </a-page-header>
  14. <!-- 内容 -->
  15. <a-page-header title="盘点单号:CG2021010100001" ></a-page-header>
  16. <!-- alert -->
  17. <a-alert type="info" showIcon style="margin-bottom:15px">
  18. <div slot="message"><strong class="red">红色代表盘盈</strong><strong class="green">绿色代表盈亏</strong></div>
  19. </a-alert>
  20. <!-- 盈亏统计 -->
  21. <a-card size="small" :bordered="false" class="inventoryReviewDetail-cont">
  22. <a-collapse :activeKey="['1']">
  23. <a-collapse-panel key="1" header="盈亏统计">
  24. <a-descriptions :column="2" bordered>
  25. <a-descriptions-item label="库存数量">2</a-descriptions-item>
  26. <a-descriptions-item label="库存成本">20</a-descriptions-item>
  27. <a-descriptions-item label="盘盈数量">¥120.36</a-descriptions-item>
  28. <a-descriptions-item label="盘盈成本">3</a-descriptions-item>
  29. <a-descriptions-item label="盘亏数量">4</a-descriptions-item>
  30. <a-descriptions-item label="盘亏成本">¥11.2</a-descriptions-item>
  31. <a-descriptions-item>
  32. <template slot="label">
  33. 盈亏总数量
  34. <a-popover>
  35. <template slot="content">
  36. 盘盈数量与盘亏数量之和
  37. </template>
  38. <a-icon type="question-circle" theme="twoTone" />
  39. </a-popover>
  40. </template>
  41. 4
  42. </a-descriptions-item>
  43. <a-descriptions-item>
  44. <template slot="label">
  45. 盈亏总成本
  46. <a-popover>
  47. <template slot="content">
  48. 盘盈成本与盘亏成本之和
  49. </template>
  50. <a-icon type="question-circle" theme="twoTone" />
  51. </a-popover>
  52. </template>
  53. 4
  54. </a-descriptions-item>
  55. </a-descriptions>
  56. </a-collapse-panel>
  57. </a-collapse>
  58. </a-card>
  59. <!-- 产品明细 -->
  60. <a-card size="small" :bordered="false" class="inventoryReviewDetail-cont">
  61. <a-collapse :activeKey="['1']">
  62. <a-collapse-panel key="1" header="产品明细">
  63. <!-- 列表 -->
  64. <s-table
  65. class="sTable"
  66. ref="table"
  67. size="default"
  68. :rowKey="(record) => record.id"
  69. :columns="columns"
  70. :data="loadData"
  71. :scroll="{ x: 1290 }"
  72. bordered>
  73. <!-- 采购数量 -->
  74. <template slot="purchaseNum" slot-scope="text, record">
  75. <span>{{ record.purchaseNum }}</span>
  76. </template>
  77. <!-- 缺货数量 -->
  78. <template slot="outOfStockNum" slot-scope="text, record">
  79. <span>{{ record.outOfStockNum }}</span>
  80. </template>
  81. </s-table>
  82. </a-collapse-panel>
  83. </a-collapse>
  84. </a-card>
  85. </div>
  86. </template>
  87. <script>
  88. import { STable, VSelect } from '@/components'
  89. export default {
  90. components: { STable, VSelect },
  91. data () {
  92. return {
  93. // 表头
  94. columns: [
  95. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  96. { title: '产品编码', dataIndex: 'productCode', width: 160, align: 'center' },
  97. { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
  98. { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' },
  99. { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  100. { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  101. { title: '库存数量', dataIndex: 'qtsy', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  102. { title: '库存成本', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  103. { title: '盘点数量', dataIndex: 'qtssy', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  104. { title: '盘点盈亏数量', dataIndex: 'qtdsy', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  105. { title: '盘点盈亏成本', dataIndex: 'prifce', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  106. ],
  107. // 加载数据方法 必须为 Promise 对象
  108. loadData: parameter => {
  109. this.disabled = true
  110. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  111. // const data = res.data
  112. // const no = (data.pageNo - 1) * data.pageSize
  113. // for (var i = 0; i < data.list.length; i++) {
  114. // data.list[i].no = no + i + 1
  115. // }
  116. // this.disabled = false
  117. // return data
  118. // })
  119. const _this = this
  120. return new Promise(function (resolve, reject) {
  121. const data = {
  122. pageNo: 1,
  123. pageSize: 10,
  124. list: [
  125. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  126. ],
  127. count: 10
  128. }
  129. const no = (data.pageNo - 1) * data.pageSize
  130. for (var i = 0; i < data.list.length; i++) {
  131. data.list[i].no = no + i + 1
  132. }
  133. _this.disabled = false
  134. resolve(data)
  135. })
  136. }
  137. }
  138. },
  139. methods: {
  140. // 返回列表
  141. handleBack () {
  142. this.$router.push({ path: '/financialManagement/inventoryReview/list' })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="less">
  148. .inventoryReviewDetail-wrap{
  149. .inventoryReviewDetail-cont{
  150. margin-bottom: 10px;
  151. }
  152. .green{
  153. color: #19be6b;
  154. }
  155. .red{
  156. color: #ed1c24;
  157. }
  158. }
  159. </style>