123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <template>
- <a-modal
- centered
- class="collection-detail-modal"
- :footer="null"
- :maskClosable="false"
- v-model="isShow"
- :title="modalTit"
- :bodyStyle="{padding: modalTit?'25px 32px 20px':'50px 32px 15px'}"
- @cancel="handleCommonCancel"
- width="60%">
- <a-spin :spinning="spinning" tip="Loading...">
- <div class="common-main" v-if="detail">
- <div class="toolsBar">
- <a-descriptions>
- <a-descriptions-item label="销售单号">
- {{ detail.bizNo || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="备货单号">
- {{ detail.dispatchBillNo || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="发货编号">
- {{ detail.sendNo || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="客户名称">
- {{ detail.settleClientName || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="收货客户名称">
- {{ detail.receiverName || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="收款方式">
- {{ detail.settleStyleDictValue || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="产品款数">
- {{ detail.totalCategory }}
- </a-descriptions-item>
- <a-descriptions-item label="产品数量">
- {{ detail.qty }}
- </a-descriptions-item>
- <a-descriptions-item label="总售价">
- {{ detail.totalAmount }}
- </a-descriptions-item>
- <a-descriptions-item label="业务状态">
- {{ detail.billStatusDictValue || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="财务状态">
- {{ detail.settleStateDictValue || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="单据状态">
- {{ detail.voidFlagDictValue || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="收款类型">
- <span>{{ detail.keepTypeDictValue || '--' }}</span>
- <span v-if="detail.keepTypeDictValue =='仅标记收款'" @click="handleAssociated"><a-button type="link" :loading="associatedLoading" style="margin-left:10px;" class="link-bule">
- 关联收款单
- </a-button></span>
- </a-descriptions-item>
- <a-descriptions-item label="收款时间">
- {{ detail.settleTime || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="收款人">
- {{ detail.settlePersonName || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="操作时间">
- {{ detail.operateTime || '--' }}
- </a-descriptions-item>
- </a-descriptions>
- </div>
- <div v-if="detail.keepType == 'RELATION_BOOK'">
- <a-table :columns="columns" :pagination="false" :data-source="tableData" bordered>
- <!-- 收款单号 -->
- <template slot="bookNo" slot-scope="text, record">
- <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="viewDetail(record)">{{ record.bookNo }}</span>
- <span v-else>{{ record.bookNo }}</span>
- </template>
- </a-table>
- </div>
- </div>
- <div class="btn-box">
- <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
- <a-button v-if="detail&&detail.keepType =='RELATION_BOOK'" :loading="spinning" type="primary" @click="handlePlPrint()">收款打印</a-button>
- </div>
- </a-spin>
- <!-- 收款打印 -->
- <printModel ref="printModel" @cancel="canselPrintView"></printModel>
- <!-- 查看财务收款详情 -->
- <commonModal
- modalTit="财务收款详情"
- bodyPadding="10px"
- width="70%"
- :showFooter="false"
- :openModal="showDetailModal"
- @cancel="showDetailModal=false">
- <detailModal ref="detailModal"></detailModal>
- </commonModal>
- <!-- 关联收款单 -->
- <collectDetailModal
- v-drag
- ref="collectDetailModal"
- modalTit="关联收款单"
- @ok="relationSuccess"
- :openModal="showCollectDetail"
- @cancel="showCollectDetail=false"></collectDetailModal>
- </a-modal>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- import commonModal from '@/views/common/commonModal.vue'
- import printModel from '../receiptPrint/printModel.vue'
- import detailModal from '@/views/financialManagement/financialCollection/detail.vue'
- import collectDetailModal from './detailModal.vue'
- import { settleReceiptFindBySn } from '@/api/settleReceipt.js'
- import { getBatchLastProcessInstance } from '@/api/financeBook'
- export default {
- name: 'VoucherModal',
- components: { STable, VSelect, commonModal, printModel, detailModal, collectDetailModal },
- props: {
- openModal: { // 弹框显示状态
- type: Boolean,
- default: false
- },
- modalTit: { // 弹框标题
- type: String,
- default: null
- },
- cancelText: { // 取消 按钮文字
- type: String,
- default: '关闭'
- },
- isCancel: { // 是否显示 取消 按钮
- type: Boolean,
- default: true
- }
- },
- data () {
- return {
- isShow: this.openModal, // 是否打开弹框
- showTipModal: false,
- showDetailModal: false,
- disabled: false,
- spinning: false,
- detail: null,
- columns: [
- { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
- { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '财务收款事由', dataIndex: 'bookReason', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
- ],
- tableData: [],
- associatedLoading: false,
- showCollectDetail: false,
- handlePlData: null
- }
- },
- methods: {
- // 财务收款详情
- viewDetail (row) {
- this.showDetailModal = true
- this.$nextTick(() => {
- this.$refs.detailModal.pageInit(row.bookSn)
- })
- },
- getData (data) {
- this.handlePlData = data
- this.spinning = true
- settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
- this.detail = res.data || null
- if (res.data.keepType !== 'LABEL_RECEIPT') {
- this.tableData = res.data && res.data.financeBookList || []
- const no = 1
- for (var i = 0; i < this.tableData.length; i++) {
- this.tableData[i].no = no + i
- }
- }
- this.spinning = false
- })
- },
- // 获取审核信息
- getAuditInfo (auditList) {
- let auditStr = ''
- if (auditList && auditList.taskVOList) {
- const auditLists = auditList.taskVOList.filter(item => item.userType == '审批人')
- auditLists.map((a, i) => {
- auditStr = auditStr + a.userName + '(' + a.state + ')' + (i == auditLists.length - 1 ? '。' : ';')
- })
- }
- return auditStr
- },
- // 批量打印
- async handlePlPrint () {
- this.spinning = true
- const rows = []
- const bookSns = []
- this.tableData.map(item => {
- if(item.financeBookDetailList){
- rows.push(item.financeBookDetailList[0])
- const booksn = item.financeBookDetailList[0].bookSn
- if (bookSns.indexOf(booksn) < 0) {
- bookSns.push(booksn)
- }
- }
- })
- const retArr = []
- const auditInfo = await getBatchLastProcessInstance({ 'businessType': 'FINANCE_BOOK', 'businessSnList': bookSns }).then(res => res.data)
- console.log(bookSns,auditInfo)
- bookSns.map(item => {
- // 授信明细
- const rs = rows.filter(a => a.bookSn == item)
- let detailItemUseStr = ''
- rs.map(b => {
- if (b.detailItemUseList) {
- b.detailItemUseList.map((k, i) => {
- detailItemUseStr = detailItemUseStr + k.itemName + '(' + k.itemAmount + ')' + (i == b.detailItemUseList.length - 1 ? '。' : ';')
- })
- }
- })
- // 审核信息
- const auditStr = this.getAuditInfo(auditInfo[item])
- retArr.push({ audit: auditStr, detail: detailItemUseStr, subList: rs })
- })
- console.log(retArr, '------------')
- this.handlePrint(retArr, rows)
- },
- // 收款打印
- async handlePrint (row, list) {
- this.spinning = true
- this.showTipModal = true
- this.$nextTick(() => {
- // 审核信息
- this.$refs.printModel.getData(row, list)
- })
- },
- canselPrintView () {
- this.showTipModal = false
- this.spinning = false
- this.$refs.printModel.clearData()
- },
- // 取消
- handleCommonCancel () {
- this.$emit('cancel')
- this.detail = null
- this.tableData = []
- },
- // 打开关联收款单弹窗
- handleAssociated () {
- const snList = []
- snList.push(this.handlePlData.accountReceiptSn)
- this.showCollectDetail = true
- this.$nextTick(() => {
- this.$refs.collectDetailModal.setData([this.handlePlData], snList)
- })
- },
- // 关联收款成功
- relationSuccess () {
- this.handleCommonCancel()
- this.showCollectDetail = false
- }
- },
- watch: {
- // 父页面传过来的弹框状态
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
- // 重定义的弹框状态
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.$emit('cancel')
- }
- }
- }
- }
- </script>
- <style lang="less">
- .collection-detail-modal{
- .common-main{
- min-height:20vh;
- .toolsBar{
- display: flex;
- align-items: center;
- margin-bottom: 10px;
- .ant-btn{
- margin-left: 30px;
- }
- }
- }
- .btn-box{
- text-align: center;
- margin-top: 30px;
- .ant-btn{
- margin:0 10px;
- }
- }
- }
- </style>
|