voucherModal.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <a-modal
  3. centered
  4. class="collection-detail-modal"
  5. :footer="null"
  6. :maskClosable="false"
  7. v-model="isShow"
  8. :title="modalTit"
  9. :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
  10. @cancel="handleCommonCancel"
  11. width="80%">
  12. <a-spin :spinning="spinning" tip="Loading...">
  13. <div class="common-main" v-if="detail">
  14. <div class="toolsBar">
  15. <a-descriptions>
  16. <a-descriptions-item label="销售单号">
  17. {{ detail.bizNo || '--' }}
  18. </a-descriptions-item>
  19. <a-descriptions-item label="备货单号">
  20. {{ detail.dispatchBillNo || '--' }}
  21. </a-descriptions-item>
  22. <a-descriptions-item label="发货编号">
  23. {{ detail.sendNo || '--' }}
  24. </a-descriptions-item>
  25. <a-descriptions-item label="客户名称">
  26. {{ detail.settleClientName || '--' }}
  27. </a-descriptions-item>
  28. <a-descriptions-item label="收货客户名称">
  29. {{ detail.receiverName || '--' }}
  30. </a-descriptions-item>
  31. <a-descriptions-item label="收款方式">
  32. {{ detail.settleStyleDictValue || '--' }}
  33. </a-descriptions-item>
  34. <a-descriptions-item label="产品款数">
  35. {{ detail.totalCategory }}
  36. </a-descriptions-item>
  37. <a-descriptions-item label="产品数量">
  38. {{ detail.qty }}
  39. </a-descriptions-item>
  40. <a-descriptions-item label="总售价">
  41. {{ detail.totalAmount }}
  42. </a-descriptions-item>
  43. <a-descriptions-item label="业务状态">
  44. {{ detail.billStatusDictValue || '--' }}
  45. </a-descriptions-item>
  46. <a-descriptions-item label="财务状态">
  47. {{ detail.settleStateDictValue || '--' }}
  48. </a-descriptions-item>
  49. <a-descriptions-item label="单据状态">
  50. {{ detail.voidFlagDictValue || '--' }}
  51. </a-descriptions-item>
  52. <a-descriptions-item label="收款类型">
  53. {{ detail.keepTypeDictValue || '--' }}
  54. </a-descriptions-item>
  55. <a-descriptions-item label="收款时间">
  56. {{ detail.settleTime || '--' }}
  57. </a-descriptions-item>
  58. <a-descriptions-item v-if="detail.keepType != 'RELATION_BOOK'" label="收款人">
  59. {{ detail.settlePersonName || '--' }}
  60. </a-descriptions-item>
  61. </a-descriptions>
  62. </div>
  63. <div v-if="detail.keepType == 'RELATION_BOOK'">
  64. <a-table :columns="columns" :pagination="false" :data-source="tableData" bordered>
  65. <!-- 收款单号 -->
  66. <template slot="bookNo" slot-scope="text, record">
  67. <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="viewDetail(record)">{{ record.bookNo }}</span>
  68. <span v-else>{{ record.bookNo }}</span>
  69. </template>
  70. </a-table>
  71. </div>
  72. </div>
  73. <div class="btn-box">
  74. <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
  75. <a-button :loading="spinning" type="primary" @click="handlePrint()">收款打印</a-button>
  76. </div>
  77. </a-spin>
  78. <!-- 收款打印 -->
  79. <commonModal
  80. modalTit="收款打印预览"
  81. bodyPadding="10px"
  82. width="1024px"
  83. :showFooter="false"
  84. :openModal="showTipModal"
  85. @cancel="showTipModal=false">
  86. <printModel ref="printModel" @cancel="showTipModal=false"></printModel>
  87. </commonModal>
  88. <!-- 查看财务收款详情 -->
  89. <commonModal
  90. modalTit="财务收款详情"
  91. bodyPadding="10px"
  92. width="70%"
  93. :showFooter="false"
  94. :openModal="showDetailModal"
  95. @cancel="showDetailModal=false">
  96. <detailModal ref="detailModal"></detailModal>
  97. </commonModal>
  98. </a-modal>
  99. </template>
  100. <script>
  101. import { STable, VSelect } from '@/components'
  102. import commonModal from '@/views/common/commonModal.vue'
  103. import printModel from '../receiptPrint/printModel.vue'
  104. import detailModal from '@/views/financialManagement/financialCollection/detail.vue'
  105. import { settleReceiptFindBySn } from '@/api/settleReceipt.js'
  106. export default {
  107. name: 'VoucherModal',
  108. components: { STable, VSelect, commonModal, printModel, detailModal },
  109. props: {
  110. openModal: { // 弹框显示状态
  111. type: Boolean,
  112. default: false
  113. },
  114. modalTit: { // 弹框标题
  115. type: String,
  116. default: null
  117. },
  118. cancelText: { // 取消 按钮文字
  119. type: String,
  120. default: '关闭'
  121. },
  122. isCancel: { // 是否显示 取消 按钮
  123. type: Boolean,
  124. default: true
  125. }
  126. },
  127. data () {
  128. return {
  129. isShow: this.openModal, // 是否打开弹框
  130. showTipModal: false,
  131. showDetailModal: false,
  132. disabled: false,
  133. spinning: false,
  134. detail: null,
  135. columns: [
  136. { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  137. { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
  138. { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  139. { title: '财务收款事由', dataIndex: 'bookReason', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  140. { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  141. { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  142. { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  143. { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  144. { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  145. { title: '审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  146. { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
  147. ],
  148. tableData: []
  149. }
  150. },
  151. methods: {
  152. // 财务收款详情
  153. viewDetail (row) {
  154. this.showDetailModal = true
  155. this.$nextTick(() => {
  156. this.$refs.detailModal.pageInit(row.bookSn)
  157. })
  158. },
  159. getData (data) {
  160. this.spinning = true
  161. settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
  162. this.detail = res.data || null
  163. if (res.data.keepType !== 'LABEL_RECEIPT') {
  164. this.tableData = res.data ? res.data.financeBookList : []
  165. const no = 1
  166. for (var i = 0; i < this.tableData.length; i++) {
  167. this.tableData[i].no = no + i
  168. }
  169. }
  170. this.spinning = false
  171. })
  172. },
  173. // 收款打印
  174. handlePrint () {
  175. this.showTipModal = true
  176. this.$nextTick(() => {
  177. this.$refs.printModel.getData(this.detail, true)
  178. })
  179. },
  180. // 取消
  181. handleCommonCancel () {
  182. this.$emit('cancel')
  183. this.detail = null
  184. this.tableData = []
  185. }
  186. },
  187. watch: {
  188. // 父页面传过来的弹框状态
  189. openModal (newValue, oldValue) {
  190. this.isShow = newValue
  191. },
  192. // 重定义的弹框状态
  193. isShow (newValue, oldValue) {
  194. if (!newValue) {
  195. this.$emit('cancel')
  196. }
  197. }
  198. }
  199. }
  200. </script>
  201. <style lang="less">
  202. .collection-detail-modal{
  203. .common-main{
  204. min-height:20vh;
  205. .toolsBar{
  206. display: flex;
  207. align-items: center;
  208. margin-bottom: 10px;
  209. .ant-btn{
  210. margin-left: 30px;
  211. }
  212. }
  213. }
  214. .btn-box{
  215. text-align: center;
  216. margin-top: 30px;
  217. .ant-btn{
  218. margin:0 10px;
  219. }
  220. }
  221. }
  222. </style>