detail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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)) ? toThousands(basicInfoData.settleAmount) : '--' }}</a-descriptions-item>
  20. <a-descriptions-item label="折让金额">{{ (discountAmount || discountAmount==0) ? toThousands(discountAmount) : '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="实结算金额">{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? toThousands(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-item label="备注">{{ (basicInfoData&&basicInfoData.remark) || '--' }}</a-descriptions-item>
  26. </a-descriptions>
  27. </a-collapse-panel>
  28. </a-collapse>
  29. </a-card>
  30. <!-- 收款明细 -->
  31. <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
  32. <a-collapse :activeKey="['1']">
  33. <a-collapse-panel key="1" header="收款明细">
  34. <!-- alert -->
  35. <a-alert type="info" style="margin-bottom:10px">
  36. <div slot="message">
  37. 共 <strong>{{ total }}</strong> 条明细,
  38. 金额合计 <strong>{{ (basicInfoData&&(basicInfoData.totalSettleAmount || basicInfoData.totalSettleAmount==0)) ? toThousands(basicInfoData.totalSettleAmount) : '--' }}</strong> ,
  39. 结算金额合计 <strong>{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? toThousands(basicInfoData.realSettleAmount) : '--' }}</strong>
  40. </div>
  41. </a-alert>
  42. <!-- 列表 -->
  43. <s-table
  44. class="sTable"
  45. ref="table"
  46. size="small"
  47. :rowKey="(record) => record.id"
  48. :columns="columns"
  49. :data="loadData"
  50. :defaultLoadData="false"
  51. bordered>
  52. </s-table>
  53. </a-collapse-panel>
  54. </a-collapse>
  55. </a-card>
  56. </a-spin>
  57. </div>
  58. </template>
  59. <script>
  60. import { commonMixin } from '@/utils/mixin'
  61. import { STable, VSelect } from '@/components'
  62. import { settleUnitDetailList, settleUnitDetail } from '@/api/settle'
  63. export default {
  64. name: 'CompanyCollectionPaymentDetail',
  65. components: { STable, VSelect },
  66. mixins: [commonMixin],
  67. data () {
  68. const _this = this
  69. return {
  70. spinning: false,
  71. // 表头
  72. columns: [
  73. { title: '序号', dataIndex: 'no', align: 'center', width: '10%' },
  74. { title: '单据号', dataIndex: 'bizNo', align: 'center', width: '25%', customRender: function (text) { return text || '--' } },
  75. { title: '类型', dataIndex: 'bizTypeDictValue', align: 'center', width: '25%', customRender: function (text) { return text || '--' } },
  76. { title: '金额', dataIndex: 'totalAmount', align: 'right', width: '20%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  77. { title: '结算金额', dataIndex: 'settleAmount', align: 'right', width: '20%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
  78. ],
  79. // 加载数据方法 必须为 Promise 对象
  80. loadData: parameter => {
  81. this.disabled = true
  82. this.spinning = true
  83. return settleUnitDetailList(Object.assign(parameter, { unitSettleSn: this.$route.params.sn })).then(res => {
  84. let data
  85. if (res.status == 200) {
  86. data = res.data
  87. const no = (data.pageNo - 1) * data.pageSize
  88. for (var i = 0; i < data.list.length; i++) {
  89. data.list[i].no = no + i + 1
  90. }
  91. this.disabled = false
  92. this.total = data.count || 0
  93. }
  94. this.spinning = false
  95. return data
  96. })
  97. },
  98. total: 0, // 总条数
  99. basicInfoData: null // 基本信息
  100. }
  101. },
  102. computed: {
  103. discountAmount () {
  104. let val = 0
  105. if (this.basicInfoData && this.basicInfoData.discountAmount) {
  106. val = Math.abs(this.basicInfoData.discountAmount)
  107. }
  108. return val
  109. }
  110. },
  111. methods: {
  112. // 返回列表
  113. handleBack () {
  114. this.$router.push({ path: '/financialManagement/companyCollectionPayment/list' })
  115. },
  116. // 详情
  117. getDetail () {
  118. settleUnitDetail({ id: this.$route.params.id }).then(res => {
  119. if (res.status == 200) {
  120. this.basicInfoData = res.data
  121. } else {
  122. this.basicInfoData = null
  123. }
  124. })
  125. }
  126. },
  127. mounted () {
  128. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  129. this.$refs.table.refresh(true)
  130. this.getDetail()
  131. }
  132. },
  133. activated () {
  134. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  135. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  136. this.$refs.table.refresh(true)
  137. this.getDetail()
  138. }
  139. },
  140. beforeRouteEnter (to, from, next) {
  141. next(vm => {})
  142. }
  143. }
  144. </script>
  145. <style lang="less">
  146. .companyCollectionPaymentDetail-cont{
  147. margin-bottom: 10px;
  148. }
  149. </style>