detailModal.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <a-modal
  3. centered
  4. class="financialPaymentDetail-modal"
  5. :footer="null"
  6. :maskClosable="false"
  7. title="详情"
  8. v-model="isShow"
  9. @cancel="isShow=false"
  10. width="70%">
  11. <!-- 详情 -->
  12. <div class="mainContent">
  13. <a-spin :spinning="spinning" tip="Loading...">
  14. <a-collapse :activeKey="['1']">
  15. <a-collapse-panel key="1" header="基础信息">
  16. <a-descriptions :column="3">
  17. <a-descriptions-item label="销售单号">{{ (detailsData&&detailsData.salesBillNo) || '--' }}</a-descriptions-item>
  18. </a-descriptions>
  19. </a-collapse-panel>
  20. </a-collapse>
  21. <a-alert type="info" style="margin: 10px 0" v-if="detailsData">
  22. <div slot="message">
  23. 缺货总款数 <strong>{{ (detailsData.totalCategory || detailsData.totalCategory==0) ? detailsData.totalCategory : '--' }}</strong> ,
  24. 缺货总数量 <strong>{{ (detailsData.totalQty || detailsData.totalQty==0) ? detailsData.totalQty : '--' }}</strong>
  25. ,缺货总售价<strong>{{ (detailsData.totalAmount || detailsData.totalAmount==0) ? toThousands(detailsData.totalAmount,2) : '--' }}</strong>
  26. </div>
  27. </a-alert>
  28. <!-- 列表 -->
  29. <s-table
  30. class="sTable"
  31. ref="table"
  32. size="small"
  33. :rowKey="(record) => record.id"
  34. :columns="columns"
  35. :data="loadData"
  36. :defaultLoadData="false"
  37. bordered>
  38. </s-table>
  39. </a-spin>
  40. </div>
  41. </a-modal>
  42. </template>
  43. <script>
  44. import { commonMixin } from '@/utils/mixin'
  45. import { salesOosQueryDetailList } from '@/api/reportData.js'
  46. import { STable } from '@/components'
  47. export default {
  48. name: 'FinancialPaymentDetailModal',
  49. mixins: [commonMixin],
  50. components: { STable },
  51. props: {
  52. openModal: { // 弹框显示状态
  53. type: Boolean,
  54. default: false
  55. }
  56. },
  57. data () {
  58. const _this = this
  59. return {
  60. isShow: this.openModal, // 是否打开弹框
  61. spinning: false,
  62. columns: [
  63. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  64. { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  65. { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  66. // { title: '仓库', dataIndex: 'warehouseName', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  67. { title: '原厂编码', dataIndex: 'origCode', width: '13%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
  68. { title: '缺货数量', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  69. { title: '缺货金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  70. { title: '单位', dataIndex: 'unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
  71. ],
  72. detailsData: null,
  73. loadData: parameter => {
  74. this.spinning = true
  75. const params = Object.assign(parameter, this.queryParam, { salesOosBillSn: this.detailsData.salesOosBillSn })
  76. return salesOosQueryDetailList(params).then(res => {
  77. let data
  78. if (res.status == 200) {
  79. data = res.data
  80. const no = (data.pageNo - 1) * data.pageSize
  81. for (var i = 0; i < data.list.length; i++) {
  82. data.list[i].no = no + i + 1
  83. }
  84. }
  85. this.spinning = false
  86. return data
  87. })
  88. }
  89. }
  90. },
  91. methods: {
  92. // 获取详情
  93. getDetail (obj) {
  94. this.detailsData = obj
  95. this.$nextTick(() => {
  96. this.$refs.table.refresh()
  97. })
  98. }
  99. },
  100. watch: {
  101. // 父页面传过来的弹框状态
  102. openModal (newValue, oldValue) {
  103. this.isShow = newValue
  104. },
  105. // 重定义的弹框状态
  106. isShow (newValue, oldValue) {
  107. if (!newValue) {
  108. this.$emit('close')
  109. this.detailsData = null
  110. }
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="less">
  116. .financialPaymentDetail-modal{
  117. .ant-modal-body {
  118. padding: 40px 40px 24px;
  119. }
  120. .btn-cont {
  121. text-align: center;
  122. margin: 35px 0 10px;
  123. }
  124. .printBox{
  125. width:100%;
  126. text-align:right;
  127. margin-bottom:10px;
  128. }
  129. }
  130. </style>