voucherModal.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. </a-modal>
  105. </template>
  106. <script>
  107. import { STable, VSelect } from '@/components'
  108. import commonModal from '@/views/common/commonModal.vue'
  109. import printModel from '../receiptPrint/printModel.vue'
  110. import detailModal from '@/views/financialManagement/financialCollection/detail.vue'
  111. import { settleReceiptFindBySn, settleReceiptBookBatch } from '@/api/settleReceipt.js'
  112. export default {
  113. name: 'VoucherModal',
  114. components: { STable, VSelect, commonModal, printModel, detailModal },
  115. props: {
  116. openModal: { // 弹框显示状态
  117. type: Boolean,
  118. default: false
  119. },
  120. modalTit: { // 弹框标题
  121. type: String,
  122. default: null
  123. },
  124. cancelText: { // 取消 按钮文字
  125. type: String,
  126. default: '关闭'
  127. },
  128. isCancel: { // 是否显示 取消 按钮
  129. type: Boolean,
  130. default: true
  131. }
  132. },
  133. data () {
  134. return {
  135. isShow: this.openModal, // 是否打开弹框
  136. showTipModal: false,
  137. showDetailModal: false,
  138. disabled: false,
  139. spinning: false,
  140. detail: null,
  141. columns: [
  142. { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  143. { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
  144. { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  145. { title: '财务收款事由', dataIndex: 'bookReason', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  146. { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  147. { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  148. { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  149. { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  150. { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  151. { title: '审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  152. { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
  153. ],
  154. tableData: [],
  155. associatedLoading: false
  156. }
  157. },
  158. methods: {
  159. // 财务收款详情
  160. viewDetail (row) {
  161. this.showDetailModal = true
  162. this.$nextTick(() => {
  163. this.$refs.detailModal.pageInit(row.bookSn)
  164. })
  165. },
  166. getData (data) {
  167. this.spinning = true
  168. settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
  169. this.detail = res.data || null
  170. if (res.data.keepType !== 'LABEL_RECEIPT') {
  171. this.tableData = res.data && res.data.financeBookList || []
  172. const no = 1
  173. for (var i = 0; i < this.tableData.length; i++) {
  174. this.tableData[i].no = no + i
  175. }
  176. }
  177. this.spinning = false
  178. })
  179. },
  180. // 收款打印
  181. handlePrint () {
  182. this.showTipModal = true
  183. this.$nextTick(() => {
  184. this.$refs.printModel.getData(this.detail, true)
  185. })
  186. },
  187. canselPrintView () {
  188. this.showTipModal = false
  189. this.$refs.printModel.handleCommonCancel()
  190. },
  191. // 取消
  192. handleCommonCancel () {
  193. this.$emit('cancel')
  194. this.detail = null
  195. this.tableData = []
  196. },
  197. // 关联收款单
  198. handleAssociated () {
  199. const snList = []; const bookSnList = []
  200. snList.push(this.detail.accountReceiptSn)
  201. bookSnList.push(this.detail.bookSn)
  202. const ajax_data = {
  203. snList: snList,
  204. bookSnList: bookSnList
  205. }
  206. this.associatedLoading = true
  207. settleReceiptBookBatch(ajax_data).then(res => {
  208. if (res.status == 200) {
  209. this.$message.success(res.message)
  210. setTimeout(() => {
  211. this.handleCommonCancel()
  212. }, 800)
  213. }
  214. this.associatedLoading = false
  215. })
  216. }
  217. },
  218. watch: {
  219. // 父页面传过来的弹框状态
  220. openModal (newValue, oldValue) {
  221. this.isShow = newValue
  222. },
  223. // 重定义的弹框状态
  224. isShow (newValue, oldValue) {
  225. if (!newValue) {
  226. this.$emit('cancel')
  227. }
  228. }
  229. }
  230. }
  231. </script>
  232. <style lang="less">
  233. .collection-detail-modal{
  234. .common-main{
  235. min-height:20vh;
  236. .toolsBar{
  237. display: flex;
  238. align-items: center;
  239. margin-bottom: 10px;
  240. .ant-btn{
  241. margin-left: 30px;
  242. }
  243. }
  244. }
  245. .btn-box{
  246. text-align: center;
  247. margin-top: 30px;
  248. .ant-btn{
  249. margin:0 10px;
  250. }
  251. }
  252. }
  253. </style>