detailModal.vue 4.5 KB

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