detailModal.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <a-modal
  3. centered
  4. :footer="null"
  5. :maskClosable="false"
  6. title="结算明细"
  7. v-model="isShow"
  8. @cancle="isShow=false"
  9. width="70%">
  10. <a-spin :spinning="spinning" tip="Loading...">
  11. <a-descriptions :column="3">
  12. <a-descriptions-item label="结算时间">
  13. {{ this.settleData &&this.settleData.payDate?this.settleData.payDate:'--' }}
  14. </a-descriptions-item>
  15. <a-descriptions-item label="结算金额">
  16. {{ this.settleData &&this.settleData.settleAmount?toThousands(this.settleData.settleAmount,2):'--' }}
  17. </a-descriptions-item>
  18. <a-descriptions-item label="支付方式">
  19. {{ this.settleData&&this.settleData.payWayDictValue?this.settleData.payWayDictValue:'--' }}
  20. </a-descriptions-item>
  21. </a-descriptions>
  22. <!-- 可导入数据 -->
  23. <s-table
  24. class="sTable"
  25. ref="table"
  26. size="small"
  27. :rowKey="(record) => record.allocateSn"
  28. :columns="nowColumns"
  29. :data="loadData"
  30. :loading="loading"
  31. :defaultLoadData="true"
  32. :scroll="{ y: 600 }"
  33. bordered>
  34. </s-table>
  35. </a-spin >
  36. </a-modal>
  37. </template>
  38. <script>
  39. import { STable } from '@/components'
  40. import { queryOrderBillDetailPage } from '@/api/merchant'
  41. import { toThousands } from '@/libs/tools.js'
  42. export default {
  43. components: { STable },
  44. name: 'ChooseImportModal',
  45. props: {
  46. openModal: { // 弹框显示状态
  47. type: Boolean,
  48. default: false
  49. },
  50. settleData: {
  51. type: Object,
  52. default: () => {
  53. return {}
  54. }
  55. }
  56. },
  57. data () {
  58. return {
  59. toThousands,
  60. spinning: false,
  61. isShow: this.openModal, // 是否打开弹框
  62. nowColumns: [
  63. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  64. { title: '取货时间', dataIndex: 'outDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  65. { title: '订单编号', dataIndex: 'orderBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  66. { title: '货位号', dataIndex: 'shelfPlaceCode', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  67. { title: '产品编码', width: '15%', dataIndex: 'productCode', align: 'center', customRender: function (text) { return text || '--' } },
  68. { title: '产品名称', width: '20%', dataIndex: 'productName', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  69. { title: '结算价', width: '10%', dataIndex: 'settlePrice', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
  70. { title: '下单数量', width: '8%', dataIndex: 'totalQty', align: 'center', customRender: function (text) { return text || '--' } },
  71. { title: '合计金额', width: '10%', dataIndex: 'settleAmount', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } }
  72. ],
  73. loadData: parameter => {
  74. this.spinning = true
  75. const paramsPage = Object.assign(parameter, { settleBillSn: this.settleData && this.settleData.settleBillSn ? this.settleData.settleBillSn : '' })
  76. return queryOrderBillDetailPage(paramsPage).then(res => {
  77. let data
  78. if (res.status == 200) {
  79. data = res.data
  80. const no = (data.pageNo - 1) * data.pageSize
  81. for (let i = 0; i < data.list.length; i++) {
  82. const _item = data.list[i]
  83. _item.no = no + i + 1
  84. }
  85. }
  86. this.spinning = false
  87. return data
  88. })
  89. },
  90. loading: false
  91. }
  92. },
  93. methods: {
  94. },
  95. watch: {
  96. // 父页面传过来的弹框状态
  97. openModal (newValue, oldValue) {
  98. this.isShow = newValue
  99. },
  100. // 重定义的弹框状态
  101. isShow (newValue, oldValue) {
  102. if (!newValue) {
  103. this.$emit('close')
  104. } else {
  105. this.$nextTick(() => {
  106. this.$refs.table.refresh(true)
  107. })
  108. }
  109. },
  110. settleData (newValue, oldValue) {
  111. if (this.isShow && newValue) {
  112. }
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="less">
  118. </style>