detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.settleStyleSnDictValue) || '--' }}</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 { commonMixin } from '@/utils/mixin'
  60. import { STable, VSelect } from '@/components'
  61. import { settleUnitDetailList, settleUnitDetail } from '@/api/settle'
  62. export default {
  63. name: 'CompanyCollectionPaymentDetail',
  64. components: { STable, VSelect },
  65. mixins: [commonMixin],
  66. data () {
  67. return {
  68. spinning: false,
  69. // 表头
  70. columns: [
  71. { title: '序号', dataIndex: 'no', align: 'center', width: '10%' },
  72. { title: '单据号', dataIndex: 'bizNo', align: 'center', width: '25%', customRender: function (text) { return text || '--' } },
  73. { title: '类型', dataIndex: 'bizTypeDictValue', align: 'center', width: '25%', customRender: function (text) { return text || '--' } },
  74. { title: '金额', dataIndex: 'totalAmount', align: 'center', width: '20%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  75. { title: '结算金额', dataIndex: 'settleAmount', align: 'center', width: '20%', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  76. ],
  77. // 加载数据方法 必须为 Promise 对象
  78. loadData: parameter => {
  79. this.disabled = true
  80. this.spinning = true
  81. return settleUnitDetailList(Object.assign(parameter, { unitSettleSn: this.$route.params.sn })).then(res => {
  82. let data
  83. if (res.status == 200) {
  84. data = res.data
  85. const no = (data.pageNo - 1) * data.pageSize
  86. for (var i = 0; i < data.list.length; i++) {
  87. data.list[i].no = no + i + 1
  88. }
  89. this.disabled = false
  90. this.total = data.count || 0
  91. }
  92. this.spinning = false
  93. return data
  94. })
  95. },
  96. total: 0, // 总条数
  97. basicInfoData: null // 基本信息
  98. }
  99. },
  100. computed: {
  101. discountAmount () {
  102. let val = 0
  103. if (this.basicInfoData && this.basicInfoData.discountAmount) {
  104. val = Math.abs(this.basicInfoData.discountAmount)
  105. }
  106. return val
  107. }
  108. },
  109. methods: {
  110. // 返回列表
  111. handleBack () {
  112. this.$router.push({ path: '/financialManagement/companyCollectionPayment/list' })
  113. },
  114. // 详情
  115. getDetail () {
  116. settleUnitDetail({ id: this.$route.params.id }).then(res => {
  117. if (res.status == 200) {
  118. this.basicInfoData = res.data
  119. } else {
  120. this.basicInfoData = null
  121. }
  122. })
  123. }
  124. },
  125. mounted () {
  126. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  127. this.$refs.table.refresh(true)
  128. this.getDetail()
  129. }
  130. },
  131. activated () {
  132. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  133. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  134. this.$refs.table.refresh(true)
  135. this.getDetail()
  136. }
  137. },
  138. beforeRouteEnter (to, from, next) {
  139. next(vm => {})
  140. }
  141. }
  142. </script>
  143. <style lang="less">
  144. .companyCollectionPaymentDetail-cont{
  145. margin-bottom: 10px;
  146. }
  147. </style>