detail.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="companyCollectionPaymentDetail-wrap">
  3. <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="companyCollectionPaymentDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  7. <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.unitSettleNo) || '--' }}</p>
  8. </template>
  9. <!-- 操作区,位于 title 行的行尾 -->
  10. <template slot="extra">
  11. <a-button key="2" id="companyCollectionPaymentDetail-preview-btn">打印预览</a-button>
  12. <a-button key="1" type="primary" id="companyCollectionPaymentDetail-print-btn">快速打印</a-button>
  13. </template>
  14. </a-page-header>
  15. <!-- 基础信息 -->
  16. <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
  17. <a-collapse :activeKey="['1']">
  18. <a-collapse-panel key="1" header="基础信息">
  19. <a-descriptions :column="3">
  20. <a-descriptions-item label="单位名称">{{ (basicInfoData&&basicInfoData.settleClientName) || '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="单位类型">{{ (basicInfoData&&basicInfoData.settleClientTypeDictValue) || '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="结算类型">{{ (basicInfoData&&basicInfoData.settleTypeDictValue) || '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="应结算金额">{{ (basicInfoData&&basicInfoData.settleAmount) || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="折让金额">{{ discountAmount || '--' }}</a-descriptions-item>
  25. <a-descriptions-item label="实结算金额">{{ (basicInfoData&&basicInfoData.realSettleAmount) || '--' }}</a-descriptions-item>
  26. <a-descriptions-item label="结算时间">{{ (basicInfoData&&basicInfoData.createDate) || '--' }}</a-descriptions-item>
  27. <a-descriptions-item label="操作人">{{ (basicInfoData&&basicInfoData.operateName) || '--' }}</a-descriptions-item>
  28. <a-descriptions-item label="结算方式">{{ (basicInfoData&&basicInfoData.settleStyleName) || '--' }}</a-descriptions-item>
  29. </a-descriptions>
  30. </a-collapse-panel>
  31. </a-collapse>
  32. </a-card>
  33. <!-- 收款明细 -->
  34. <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
  35. <a-collapse :activeKey="['1']">
  36. <a-collapse-panel key="1" header="收款明细">
  37. <!-- alert -->
  38. <a-alert type="info" showIcon style="margin-bottom:15px">
  39. <div slot="message">共 <strong>{{ total }}</strong> 条明细,金额合计 <strong>¥{{ (basicInfoData&&basicInfoData.totalAmount) || 0 }}</strong> ,结算金额合计 <strong>¥{{ (basicInfoData&&basicInfoData.realSettleAmount) || 0 }}</strong> </div>
  40. </a-alert>
  41. <!-- 列表 -->
  42. <s-table
  43. class="sTable"
  44. ref="table"
  45. size="default"
  46. :rowKey="(record) => record.id"
  47. :columns="columns"
  48. :data="loadData"
  49. bordered>
  50. </s-table>
  51. </a-collapse-panel>
  52. </a-collapse>
  53. </a-card>
  54. </div>
  55. </template>
  56. <script>
  57. import { STable, VSelect } from '@/components'
  58. import { settleUnitDetailList, settleUnitDetail } from '@/api/settle'
  59. export default {
  60. components: { STable, VSelect },
  61. data () {
  62. return {
  63. // 表头
  64. columns: [
  65. { title: '序号', dataIndex: 'no', align: 'center' },
  66. { title: '单据号', dataIndex: 'bizNo', align: 'center', customRender: function (text) { return text || '--' } },
  67. { title: '类型', dataIndex: 'bizTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
  68. { title: '金额', dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  69. { title: '结算金额', dataIndex: 'settleAmount', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  70. ],
  71. // 加载数据方法 必须为 Promise 对象
  72. loadData: parameter => {
  73. this.disabled = true
  74. return settleUnitDetailList(Object.assign(parameter, { unitSettleSn: this.$route.params.sn })).then(res => {
  75. const data = res.data
  76. const no = (data.pageNo - 1) * data.pageSize
  77. for (var i = 0; i < data.list.length; i++) {
  78. data.list[i].no = no + i + 1
  79. }
  80. this.disabled = false
  81. this.total = data.list.length
  82. return data
  83. })
  84. },
  85. total: 0, // 总条数
  86. basicInfoData: null // 基本信息
  87. }
  88. },
  89. computed: {
  90. discountAmount () {
  91. let val = 0
  92. if (this.basicInfoData && this.basicInfoData.discountAmount) {
  93. val = Math.abs(this.basicInfoData.discountAmount)
  94. }
  95. return val
  96. }
  97. },
  98. methods: {
  99. // 返回列表
  100. handleBack () {
  101. this.$router.push({ path: '/financialManagement/companyCollectionPayment/list' })
  102. },
  103. // 详情
  104. getDetail () {
  105. settleUnitDetail({ id: this.$route.params.id }).then(res => {
  106. if (res.status == 200) {
  107. this.basicInfoData = res.data
  108. } else {
  109. this.basicInfoData = null
  110. }
  111. })
  112. }
  113. },
  114. beforeRouteEnter (to, from, next) {
  115. next(vm => {
  116. vm.getDetail()
  117. })
  118. }
  119. }
  120. </script>
  121. <style lang="less">
  122. .companyCollectionPaymentDetail-cont{
  123. margin-bottom: 15px;
  124. }
  125. </style>