voucherModal.vue 9.5 KB

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