detail.vue 9.5 KB

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