detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 20px;color: #000;font-size: 14px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.unitSettleNo) || '--' }}</p>
  9. </template>
  10. </a-page-header>
  11. <!-- 基础信息 -->
  12. <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont" v-if="basicInfoData">
  13. <a-collapse :activeKey="['1']">
  14. <a-collapse-panel key="1" header="基础信息">
  15. <a-descriptions :column="3">
  16. <a-descriptions-item label="客户名称" v-if="basicInfoData.settleClientType&&basicInfoData.settleClientType=='CUSTOMER'">{{ basicInfoData.settleClientNameCurrent || '--' }}{{ basicInfoData.settleClientName?basicInfoData.settleClientName==basicInfoData.settleClientNameCurrent?'':'('+basicInfoData.settleClientName+')':'' }}</a-descriptions-item>
  17. <a-descriptions-item label="客户名称" v-else>{{ basicInfoData.settleClientName ||'--' }}</a-descriptions-item>
  18. <a-descriptions-item label="单位类型">{{ basicInfoData.settleClientTypeDictValue || '--' }}</a-descriptions-item>
  19. <a-descriptions-item label="结算类型">{{ basicInfoData.settleTypeDictValue || '--' }}</a-descriptions-item>
  20. <a-descriptions-item label="应结算金额">{{ (basicInfoData.settleAmount || basicInfoData.settleAmount==0) ? toThousands(basicInfoData.settleAmount) : '--' }}</a-descriptions-item>
  21. <a-descriptions-item label="折让金额">{{ (discountAmount || discountAmount==0) ? toThousands(discountAmount) : '--' }}</a-descriptions-item>
  22. <a-descriptions-item label="实结算金额">{{ (basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0) ? toThousands(basicInfoData.realSettleAmount) : '--' }}</a-descriptions-item>
  23. <a-descriptions-item label="结算时间">{{ basicInfoData.createDate || '--' }}</a-descriptions-item>
  24. <a-descriptions-item label="操作人">{{ basicInfoData.operateName || '--' }}</a-descriptions-item>
  25. <a-descriptions-item label="结算方式">{{ basicInfoData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
  26. <a-descriptions-item label="备注">{{ basicInfoData.remark || '--' }}</a-descriptions-item>
  27. </a-descriptions>
  28. </a-collapse-panel>
  29. </a-collapse>
  30. </a-card>
  31. <!-- 收款明细 -->
  32. <a-card size="small" :bordered="false" class="companyCollectionPaymentDetail-cont">
  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)) ? toThousands(basicInfoData.totalSettleAmount) : '--' }}</strong>
  38. 结算金额合计 <strong>{{ (basicInfoData&&(basicInfoData.realSettleAmount || basicInfoData.realSettleAmount==0)) ? toThousands(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-card>
  53. </a-spin>
  54. </div>
  55. </template>
  56. <script>
  57. import { commonMixin } from '@/utils/mixin'
  58. import { STable, VSelect } from '@/components'
  59. import { settleUnitDetailList, settleUnitDetail } from '@/api/settle'
  60. export default {
  61. name: 'CompanyCollectionPaymentDetail',
  62. components: { STable, VSelect },
  63. mixins: [commonMixin],
  64. data () {
  65. const _this = this
  66. return {
  67. spinning: false,
  68. // 表头
  69. columns: [
  70. { title: '序号', dataIndex: 'no', align: 'center', width: '5%' },
  71. { title: '单据号', dataIndex: 'bizNo', align: 'center', width: '30%', customRender: function (text) { return text || '--' } },
  72. { title: '类型', dataIndex: 'bizTypeDictValue', align: 'center', width: '25%', customRender: function (text) { return text || '--' } },
  73. // { title: '总款数', dataIndex: 'totalTypeNum', align: 'center', width: '10%', customRender: function (text) { return (text || text == 0)?text: '--' } },
  74. // { title: '总数量', dataIndex: 'totalNum', align: 'center', width: '10%', customRender: function (text) { return (text || text == 0)?text: '--' } },
  75. { title: '金额', dataIndex: 'totalAmount', align: 'right', width: '20%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  76. { title: '结算金额', dataIndex: 'settleAmount', align: 'right', width: '20%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
  77. ],
  78. // 加载数据方法 必须为 Promise 对象
  79. loadData: parameter => {
  80. this.disabled = true
  81. this.spinning = true
  82. return settleUnitDetailList(Object.assign(parameter, { unitSettleSn: this.$route.params.sn })).then(res => {
  83. let data
  84. if (res.status == 200) {
  85. data = res.data
  86. const no = (data.pageNo - 1) * data.pageSize
  87. for (var i = 0; i < data.list.length; i++) {
  88. data.list[i].no = no + i + 1
  89. }
  90. this.disabled = false
  91. this.total = data.count || 0
  92. }
  93. this.spinning = false
  94. return data
  95. })
  96. },
  97. total: 0, // 总条数
  98. basicInfoData: null // 基本信息
  99. }
  100. },
  101. computed: {
  102. // 折让金额
  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({ name: 'companyCollectionPaymentList' })
  115. },
  116. // 详情
  117. getDetail () {
  118. settleUnitDetail({ id: this.$route.params.id }).then(res => {
  119. if (res.status == 200) {
  120. this.basicInfoData = res.data
  121. this.$nextTick(() => {
  122. this.$refs.table.refresh(true)
  123. })
  124. } else {
  125. this.basicInfoData = null
  126. }
  127. })
  128. }
  129. },
  130. activated () {
  131. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  132. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  133. this.getDetail()
  134. }
  135. },
  136. beforeRouteEnter (to, from, next) {
  137. next(vm => {})
  138. }
  139. }
  140. </script>
  141. <style lang="less">
  142. .companyCollectionPaymentDetail-cont{
  143. margin-bottom: 6px;
  144. }
  145. </style>