detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="salesDetail-wrap">
  3. <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont">
  4. <template slot="subTitle">
  5. <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
  6. </template>
  7. <template slot="extra">
  8. <a-button key="4" type="primary" id="salesDetail-print-btn">快速打印</a-button>
  9. </template>
  10. </a-page-header>
  11. <!-- 基础信息 -->
  12. <a-card size="small" :bordered="false" class="salesDetail-cont">
  13. <a-collapse :activeKey="['1']">
  14. <a-collapse-panel key="1" header="基础信息">
  15. <a-descriptions size="small" :column="3" v-if="detailData">
  16. <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
  17. <a-descriptions-item label="收货地址">{{ detailData.salesBillExtEntity.shippingAddrProvinceName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCityName || '--' }}{{ detailData.salesBillExtEntity.shippingAddrCountyName || '--' }}{{ detailData.salesBillExtEntity.shippingAddr || '--' }}</a-descriptions-item>
  18. <a-descriptions-item label="收款方式">{{ detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
  19. <a-descriptions-item label="收货人">{{ detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
  20. <a-descriptions-item label="收货电话">{{ detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="备注">{{ detailData.remarks || '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="审核时间">{{ detailData.auditDate || '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="财务状态">{{ detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
  25. </a-descriptions>
  26. </a-collapse-panel>
  27. </a-collapse>
  28. </a-card>
  29. <a-card size="small" :bordered="false" class="pages-wrap">
  30. <!-- alert -->
  31. <a-alert type="info" style="margin-bottom: 15px;" v-if="detailData">
  32. <div slot="message">
  33. 总销售数量:<strong>{{ detailData.totalQty || 0 }}</strong>;已取消数量:<strong>{{ detailData.totalCancelQty || 0 }}</strong>;已下推数量:<strong>{{ detailData.totalPushedQty || 0 }}</strong>;待下推数量:<strong>{{ detailData.totalUnpushedQty || 0 }}</strong>;已发货数量:<strong>{{ detailData.totalDispatchQty || 0 }}</strong>;待发货数量:<strong>{{ detailData.totalUndispatchQty || 0 }}</strong>;<br/>
  34. 总售价:<strong>{{ detailData.totalAmount || 0 }}</strong>;总成本:<strong>{{ detailData.totalCost || 0 }}</strong>;总毛利:<strong>{{ detailData.grossProfit || 0 }}</strong>;已取消金额:<strong>{{ detailData.totalCancelAmount || 0 }}</strong>;已下推金额:<strong>{{ detailData.totalPushedAmount || 0 }}</strong>;待下推金额:<strong>{{ detailData.totalUnpushedAmount || 0 }};已发货金额:<strong>{{ detailData.totalDispatchAmount || 0 }};待发货金额:<strong>{{ detailData.totalUndispatchAmount || 0 }}</strong>;
  35. </strong></strong></div>
  36. </a-alert>
  37. <!-- 列表 -->
  38. <s-table
  39. class="sTable"
  40. ref="table"
  41. size="default"
  42. :rowKey="(record) => record.id"
  43. :columns="columns"
  44. :data="loadData"
  45. :scroll="{ y: 500 }"
  46. bordered>
  47. <!-- 产品编码 -->
  48. <template slot="productCode" slot-scope="text, record">
  49. <a-badge count="促" v-if="record.promotionFlag == 1">
  50. <div style="padding-right: 15px;">{{ text }}</div>
  51. </a-badge>
  52. <span v-else>{{ text }}</span>
  53. </template>
  54. </s-table>
  55. </a-card>
  56. </div>
  57. </template>
  58. <script>
  59. import { STable, VSelect } from '@/components'
  60. import { dispatchDetaillList, dispatchFindBySn } from '@/api/dispatch'
  61. export default {
  62. name: 'SalesDetail',
  63. components: { STable, VSelect },
  64. data () {
  65. return {
  66. disabled: false,
  67. // 表头
  68. columns: [
  69. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  70. { title: '产品编码', dataIndex: 'productCode', width: 140, scopedSlots: { customRender: 'productCode' }, align: 'center' },
  71. { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  72. { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  73. { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  74. { title: '销售数量', dataIndex: 'salesQty', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  75. { title: '本次下推数', dataIndex: 'qty', width: 200, align: 'center', customRender: function (text) { return text || '--' } }
  76. ],
  77. // 加载数据方法 必须为 Promise 对象
  78. loadData: parameter => {
  79. this.disabled = true
  80. return dispatchDetaillList(Object.assign(parameter, { dispatchBillSn: this.$route.params.sn })).then(res => {
  81. const data = res.data
  82. const no = (data.pageNo - 1) * data.pageSize
  83. for (var i = 0; i < data.list.length; i++) {
  84. data.list[i].no = no + i + 1
  85. const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
  86. const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
  87. const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
  88. const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
  89. data.list[i].productCode = productCode || '--'
  90. data.list[i].productName = productName || '--'
  91. data.list[i].productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
  92. data.list[i].productOrigUnit = productOrigUnit || '--'
  93. }
  94. this.disabled = false
  95. return data
  96. })
  97. },
  98. detailData: null // 详情数据
  99. }
  100. },
  101. methods: {
  102. // 返回
  103. handleBack () {
  104. this.$router.back()
  105. },
  106. // 详情
  107. getDetail () {
  108. dispatchFindBySn({ dispatchBillSn: this.$route.params.sn }).then(res => {
  109. if (res.status == 200) {
  110. this.detailData = res.data
  111. } else {
  112. this.detailData = null
  113. }
  114. })
  115. }
  116. },
  117. mounted () {
  118. this.getDetail()
  119. }
  120. }
  121. </script>
  122. <style lang="less">
  123. .salesDetail-wrap{
  124. .salesDetail-cont{
  125. margin-bottom: 15px;
  126. }
  127. .footer-cont{
  128. margin-top: 5px;
  129. text-align: center;
  130. }
  131. }
  132. </style>