detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="financialCollectionAddwrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="financialCollectionAddcont" v-if="!bookSn" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack(0)"><a-icon type="left" /> 返回列表</a>
  8. </template>
  9. </a-page-header>
  10. <a-collapse :activeKey="['1']" class="financialCollectionAddcont" v-if="detailData">
  11. <a-collapse-panel key="1" header="基础信息">
  12. <a-descriptions :column="{ xs: 2, sm: 3, md: 3}">
  13. <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
  14. <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
  15. <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditDate || '--' }}</a-descriptions-item>
  16. <a-descriptions-item span="2" label="收款事由">{{ detailData&&detailData.bookReason || '--' }}</a-descriptions-item>
  17. <a-descriptions-item label="状态">{{ detailData&&detailData.statusDictValue || '--' }}</a-descriptions-item>
  18. <a-descriptions-item label="付款方类型">{{ detailData&&detailData.payerTypeDictValue || '--' }}</a-descriptions-item>
  19. <a-descriptions-item label="付款方">{{ detailData&&detailData.payerName || '--' }}</a-descriptions-item>
  20. <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.remarks||'--' }}</a-descriptions-item>
  21. <a-descriptions-item label="附件" :span="3">
  22. <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.attachmentList" :key="item.id">
  23. {{ item.fileName }}
  24. </a>
  25. </a-descriptions-item>
  26. </a-descriptions>
  27. </a-collapse-panel>
  28. </a-collapse>
  29. <!-- 财务明细 -->
  30. <a-card :bordered="false" size="small" class="financialCollectionAddcont" v-if="$route.params.sn||bookSn">
  31. <div slot="title">
  32. <div style="display: flex;justify-content: space-between;align-items: center;">
  33. <div>财务明细</div>
  34. </div>
  35. </div>
  36. <a-alert type="info" style="margin-bottom:10px" v-if="detailData">
  37. <div slot="message">
  38. 共 {{ total }} 条,
  39. 订单金额合计 {{ toThousands(detailData.orderTotalAmount ||0)}},
  40. 收款金额合计 {{ toThousands(detailData.receiptTotalAmount ||0)}},
  41. 使用授信合计 {{ toThousands(detailData.useTotalAmount||0) }},
  42. 授信还款合计 {{ toThousands(detailData.payTotalAmount||0) }},
  43. 余款抵扣合计 {{ toThousands(detailData.balanceTotalAmount||0) }}
  44. </div>
  45. </a-alert>
  46. <!-- 列表 -->
  47. <s-table
  48. class="sTable fixPagination"
  49. ref="table"
  50. size="small"
  51. :rowKey="(record) => record.id"
  52. :columns="columns"
  53. :data="loadData"
  54. :defaultLoadData="false"
  55. :showPagination="false"
  56. bordered>
  57. <template slot="expandedRowRender" slot-scope="record">
  58. <div style="padding:10px;overflow: hidden;" v-if="record.detailItemUseList.length || record.detailItemPayList.length">
  59. <a-table
  60. style="width:45%;background:#fff;float:left;border-bottom: 1px solid #eee;"
  61. :bordered="false"
  62. :pagination="false"
  63. :columns="useCol"
  64. :data-source="record.detailItemUseList">
  65. </a-table>
  66. <a-table
  67. :bordered="false"
  68. style="width:45%;background:#fff;float:left;border-bottom: 1px solid #eee;margin-left:2%;"
  69. :pagination="false"
  70. :columns="payCol"
  71. :data-source="record.detailItemPayList">
  72. </a-table>
  73. </div>
  74. <div style="padding:10px;text-align:center;" v-else>暂无数据</div>
  75. </template>
  76. <!-- 付款账户(营业执照) -->
  77. <template slot="payerAccountInfo" slot-scope="record">
  78. {{ record.payerAccountInfo || '--' }}
  79. </template>
  80. </s-table>
  81. </a-card>
  82. </a-spin>
  83. </div>
  84. </template>
  85. <script>
  86. import { commonMixin } from '@/utils/mixin'
  87. import { VSelect, STable } from '@/components'
  88. import { financeBookFindBySn, financeBookDetailQueryList } from '@/api/financeBook.js'
  89. export default {
  90. name: 'FinancialCollectionEdit',
  91. mixins: [commonMixin],
  92. components: { VSelect, STable },
  93. data () {
  94. return {
  95. spinning: false,
  96. detailData: null,
  97. openDepartUserModal: false,
  98. total: 0,
  99. bookSn: null,
  100. loadData: parameter => {
  101. const params = Object.assign(parameter, { bookSn: this.$route.params.sn || this.bookSn })
  102. return financeBookDetailQueryList(params).then(res => {
  103. let data
  104. if (res.status == 200) {
  105. data = res.data
  106. const no = 0
  107. for (var i = 0; i < data.length; i++) {
  108. data[i].no = no + i + 1
  109. // 计算使用授信和授信还款的合计
  110. data[i].useTotalAmount = this.getTotal(data[i].detailItemUseList)
  111. data[i].payTotalAmount = this.getTotal(data[i].detailItemPayList)
  112. }
  113. this.total = data.length
  114. this.disabled = false
  115. this.spinning = false
  116. }
  117. return data
  118. })
  119. },
  120. columns: [
  121. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  122. { title: '收款日期', dataIndex: 'receiptDate', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
  123. { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
  124. { title: '付款方', dataIndex: 'payerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  125. { title: '财务编码', dataIndex: 'dealerEntity.kdMidCustomerFnumber', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
  126. { title: '付款账户(营业执照)', scopedSlots: { customRender: 'payerAccountInfo' }, align: 'center', width: '8%' },
  127. { title: '订单金额', dataIndex: 'orderAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  128. { title: '收款金额', dataIndex: 'receiptAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  129. { title: '使用授信', dataIndex: 'useTotalAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  130. { title: '授信还款', dataIndex: 'payTotalAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  131. { title: '余款抵扣', dataIndex: 'balanceAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  132. { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  133. { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  134. { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  135. { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  136. { title: '说明', dataIndex: 'explainInfo', align: 'center', width: '10%', customRender: function (text) { return text || '--' } }
  137. ],
  138. useCol: [
  139. { title: '使用授信项目', dataIndex: 'itemName', width: '50%', align: 'center', customRender: function (text) { return text || '--' } },
  140. { title: '使用授信金额', dataIndex: 'itemAmount', width: '50%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
  141. ],
  142. payCol: [
  143. { title: '授信还款项目', dataIndex: 'itemName', width: '50%', align: 'center', customRender: function (text) { return text || '--' } },
  144. { title: '授信还款金额', dataIndex: 'itemAmount', width: '50%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
  145. ]
  146. }
  147. },
  148. methods: {
  149. getTotal (data) {
  150. let ret = 0
  151. data.map(item => {
  152. ret = ret + item.itemAmount
  153. })
  154. return ret.toFixed(2)
  155. },
  156. // 财务单基础详情
  157. getDetail () {
  158. this.spinning = true
  159. this.disabled = true
  160. financeBookFindBySn({ bookSn: this.$route.params.sn || this.bookSn }).then(res => {
  161. if (res.status == 200) {
  162. this.detailData = res.data
  163. this.spinning = false
  164. this.disabled = false
  165. }
  166. })
  167. this.$nextTick(()=>{
  168. this.$refs.table.refresh(true)
  169. })
  170. },
  171. // 返回
  172. handleBack (data) {
  173. this.$router.push({ name: 'financialCollectionList' })
  174. },
  175. pageInit (bookSn) {
  176. this.bookSn = bookSn
  177. if (this.$route.params.sn || this.bookSn) { // 编辑页
  178. this.getDetail()
  179. }
  180. }
  181. },
  182. mounted () {
  183. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  184. this.pageInit()
  185. }
  186. },
  187. activated () {
  188. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  189. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  190. this.pageInit()
  191. }
  192. },
  193. beforeRouteEnter (to, from, next) {
  194. next(vm => {})
  195. }
  196. }
  197. </script>
  198. <style lang="less">
  199. .financialCollectionAddwrap{
  200. position: relative;
  201. height: 100%;
  202. padding-bottom: 51px;
  203. box-sizing: border-box;
  204. .financialCollectionAddcont{
  205. margin-bottom: 10px;
  206. }
  207. .affix{
  208. .ant-affix{
  209. z-index: 101;
  210. }
  211. }
  212. }
  213. </style>