voucherModal.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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="60%">
  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 label="收款人">
  59. {{ detail.settlePersonName || '--' }}
  60. </a-descriptions-item>
  61. <a-descriptions-item label="操作时间">
  62. {{ detail.operateTime || '--' }}
  63. </a-descriptions-item>
  64. </a-descriptions>
  65. </div>
  66. <div v-if="detail.keepType == 'RELATION_BOOK'">
  67. <a-table :columns="columns" :pagination="false" :data-source="tableData" bordered>
  68. <!-- 收款单号 -->
  69. <template slot="bookNo" slot-scope="text, record">
  70. <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="viewDetail(record)">{{ record.bookNo }}</span>
  71. <span v-else>{{ record.bookNo }}</span>
  72. </template>
  73. </a-table>
  74. </div>
  75. </div>
  76. <div class="btn-box">
  77. <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
  78. <a-button :loading="spinning" type="primary" @click="handlePrint()">收款打印</a-button>
  79. </div>
  80. </a-spin>
  81. <!-- 收款打印 -->
  82. <commonModal
  83. modalTit="收款打印预览"
  84. bodyPadding="10px"
  85. width="1024px"
  86. :showFooter="false"
  87. :openModal="showTipModal"
  88. @cancel="canselPrintView">
  89. <printModel ref="printModel" @cancel="showTipModal=false"></printModel>
  90. </commonModal>
  91. <!-- 查看财务收款详情 -->
  92. <commonModal
  93. modalTit="财务收款详情"
  94. bodyPadding="10px"
  95. width="70%"
  96. :showFooter="false"
  97. :openModal="showDetailModal"
  98. @cancel="showDetailModal=false">
  99. <detailModal ref="detailModal"></detailModal>
  100. </commonModal>
  101. </a-modal>
  102. </template>
  103. <script>
  104. import { STable, VSelect } from '@/components'
  105. import commonModal from '@/views/common/commonModal.vue'
  106. import printModel from '../receiptPrint/printModel.vue'
  107. import detailModal from '@/views/financialManagement/financialCollection/detail.vue'
  108. import { settleReceiptFindBySn } from '@/api/settleReceipt.js'
  109. export default {
  110. name: 'VoucherModal',
  111. components: { STable, VSelect, commonModal, printModel, detailModal },
  112. props: {
  113. openModal: { // 弹框显示状态
  114. type: Boolean,
  115. default: false
  116. },
  117. modalTit: { // 弹框标题
  118. type: String,
  119. default: null
  120. },
  121. cancelText: { // 取消 按钮文字
  122. type: String,
  123. default: '关闭'
  124. },
  125. isCancel: { // 是否显示 取消 按钮
  126. type: Boolean,
  127. default: true
  128. }
  129. },
  130. data () {
  131. return {
  132. isShow: this.openModal, // 是否打开弹框
  133. showTipModal: false,
  134. showDetailModal: false,
  135. disabled: false,
  136. spinning: false,
  137. detail: null,
  138. columns: [
  139. { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  140. { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
  141. { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  142. { title: '财务收款事由', dataIndex: 'bookReason', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  143. { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  144. { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  145. { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  146. { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  147. { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  148. { title: '审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  149. { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
  150. ],
  151. tableData: []
  152. }
  153. },
  154. methods: {
  155. // 财务收款详情
  156. viewDetail (row) {
  157. this.showDetailModal = true
  158. this.$nextTick(() => {
  159. this.$refs.detailModal.pageInit(row.bookSn)
  160. })
  161. },
  162. getData (data) {
  163. this.spinning = true
  164. settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
  165. this.detail = res.data || null
  166. if (res.data.keepType !== 'LABEL_RECEIPT') {
  167. this.tableData = res.data ? res.data.financeBookList : []
  168. const no = 1
  169. for (var i = 0; i < this.tableData.length; i++) {
  170. this.tableData[i].no = no + i
  171. }
  172. }
  173. this.spinning = false
  174. })
  175. },
  176. // 收款打印
  177. handlePrint () {
  178. this.showTipModal = true
  179. this.$nextTick(() => {
  180. this.$refs.printModel.getData(this.detail, true)
  181. })
  182. },
  183. canselPrintView () {
  184. this.showTipModal = false
  185. this.$refs.printModel.handleCommonCancel()
  186. },
  187. // 取消
  188. handleCommonCancel () {
  189. this.$emit('cancel')
  190. this.detail = null
  191. this.tableData = []
  192. }
  193. },
  194. watch: {
  195. // 父页面传过来的弹框状态
  196. openModal (newValue, oldValue) {
  197. this.isShow = newValue
  198. },
  199. // 重定义的弹框状态
  200. isShow (newValue, oldValue) {
  201. if (!newValue) {
  202. this.$emit('cancel')
  203. }
  204. }
  205. }
  206. }
  207. </script>
  208. <style lang="less">
  209. .collection-detail-modal{
  210. .common-main{
  211. min-height:20vh;
  212. .toolsBar{
  213. display: flex;
  214. align-items: center;
  215. margin-bottom: 10px;
  216. .ant-btn{
  217. margin-left: 30px;
  218. }
  219. }
  220. }
  221. .btn-box{
  222. text-align: center;
  223. margin-top: 30px;
  224. .ant-btn{
  225. margin:0 10px;
  226. }
  227. }
  228. }
  229. </style>