detail.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div v-if="showPage" class="shelfOrderDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="shelfOrderDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }">
  5. <template slot="subTitle" v-if="!outBizSn">
  6. <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
  7. <a style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">订单号:{{ detailData&&detailData.orderBillNo || '--' }}</a>
  8. </template>
  9. </a-page-header>
  10. <!-- 基础信息 -->
  11. <a-card size="small" :bordered="false" class="shelfOrderDetail-cont">
  12. <a-collapse :activeKey="['1']">
  13. <a-collapse-panel key="1" header="基础信息">
  14. <a-descriptions size="small" :column="3">
  15. <a-descriptions-item label="订单编号">{{ detailData&&detailData.orderBillNo || '--' }}</a-descriptions-item>
  16. <a-descriptions-item label="货架名称">{{ detailData&&detailData.shelfName || '--' }}</a-descriptions-item>
  17. <a-descriptions-item label="下单时间">{{ detailData&&detailData.orderDate || '--' }}</a-descriptions-item>
  18. <a-descriptions-item label="下单人员">{{ detailData&&detailData.orderPersonName || '--' }}</a-descriptions-item>
  19. <a-descriptions-item label="订单状态"> {{ detailData&&detailData.billStateDictValue || '--' }}</a-descriptions-item>
  20. <a-descriptions-item label="VIN" v-if="detailData&&detailData.vin">{{ detailData&&detailData.vin || '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="车型" v-if="detailData&&detailData.vehicleModel">{{ detailData&&detailData.vehicleModel || '--' }}</a-descriptions-item>
  22. </a-descriptions>
  23. </a-collapse-panel>
  24. </a-collapse>
  25. </a-card>
  26. <a-card size="small" :bordered="false" class="pages-wrap">
  27. <!-- alert -->
  28. <a-alert type="info" style="margin-bottom: 10px;">
  29. <div style="display: flex;align-items: center;justify-content: space-between;" slot="message">
  30. <div>
  31. 总款数:<strong>{{ countDetail&&(countDetail.productCategory || countDetail.productCategory==0) ? countDetail.productCategory : '--' }}</strong>;
  32. 总数量:<strong>{{ countDetail&&(countDetail.totalQty || countDetail.totalQty==0) ? countDetail.totalQty : '--' }}</strong>;
  33. 总结算金额:<strong>{{ countDetail&&(countDetail.settleAmount || countDetail.settleAmount==0) ? toThousands(countDetail.settleAmount,2) : '--' }}</strong>;
  34. </div>
  35. </div>
  36. </a-alert>
  37. <!-- 列表 -->
  38. <a-table
  39. class="sTable"
  40. ref="table"
  41. size="small"
  42. :rowKey="(record) => record.id"
  43. :columns="columns"
  44. :data-source="detailList"
  45. :pagination="false"
  46. bordered>
  47. </a-table>
  48. </a-card>
  49. </a-spin>
  50. </div>
  51. </template>
  52. <script>
  53. import { commonMixin } from '@/utils/mixin'
  54. import { STable, VSelect } from '@/components'
  55. import { orderBillQueryPage, orderBillDetailCount } from '@/api/shelf'
  56. export default {
  57. name: 'SalesDetail',
  58. components: { STable, VSelect },
  59. mixins: [commonMixin],
  60. props: {
  61. outBizSn: { // 有值则为弹框,无值则为页面
  62. type: [Number, String],
  63. default: ''
  64. }
  65. },
  66. data () {
  67. return {
  68. showPage: false,
  69. spinning: false,
  70. disabled: false,
  71. detailList: [],
  72. detailData: null, // 详情数据
  73. countDetail: null
  74. }
  75. },
  76. computed: {
  77. columns () {
  78. let _this=this
  79. const arr = [
  80. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  81. { title: '货位号', dataIndex: 'shelfPlaceCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  82. { title: '产品编码', dataIndex: 'productCode', width: '15%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
  83. { title: '产品名称', dataIndex: 'productName', width: '40%', align: 'center', customRender: function (text) { return text || '--' } },
  84. { title: '结算价', dataIndex: 'settlePrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } },
  85. { title: '下单数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  86. { title: '结算金额小计', dataIndex: 'settleAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } }
  87. ]
  88. return arr
  89. }
  90. },
  91. methods: {
  92. // 返回
  93. handleBack () {
  94. this.$router.push({ name: 'shelfOrderList' })
  95. },
  96. getDetail () {
  97. this.spinning = true
  98. orderBillQueryPage({ pageNo: 1, pageSize: 1, orderBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
  99. this.spinning = false
  100. this.detailData = res.data.list && res.data.list[0]
  101. this.detailList = this.detailData.orderBillDetailApiEntityList
  102. this.detailList.map((item, index) => {
  103. item.no = index + 1
  104. })
  105. })
  106. orderBillDetailCount({ orderBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
  107. this.countDetail = res.data || null
  108. })
  109. },
  110. pageInit () {
  111. const vm = this
  112. vm.$nextTick(() => {
  113. vm.spinning = false
  114. vm.disabled = false
  115. vm.getDetail()
  116. })
  117. }
  118. },
  119. activated () {
  120. this.showPage = true
  121. this.pageInit()
  122. },
  123. beforeRouteEnter (to, from, next) {
  124. next(vm => {})
  125. }
  126. }
  127. </script>
  128. <style lang="less">
  129. .shelfOrderDetail-wrap{
  130. .shelfOrderDetail-cont{
  131. margin-bottom: 6px;
  132. }
  133. }
  134. </style>