detail.vue 6.5 KB

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