123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- <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="isShow=false"
- width="80%">
- <a-spin :spinning="spinning" tip="Loading...">
- <div class="common-main">
- <div class="toolsBar">
- <div v-if="handlePlData.length">{{ handlePlData[0].settleClientName }},共 {{ handlePlData && handlePlData.length }} 个备货单,合计 {{ toThousands(totalAmount) }},已选择 {{ chooseData.length }} 个收款单</div>
- <a-button type="primary" class="button-primary" @click="handleCommonOk">{{ okText }}</a-button>
- </div>
- <div>
- <a-table :columns="columns" :scroll="{ y: 400 }" :pagination="false" :data-source="chooseData" 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>
-
- <template slot="action" slot-scope="text, record">
- <a-button
- size="small"
- type="link"
- class="button-error"
- @click="handleDel(record)"
- >
- 删除
- </a-button>
- </template>
- </a-table>
- </div>
- </div>
- <a-divider>请选择收款单</a-divider>
- <div class="common-main">
-
- <div ref="tableSearch" class="table-page-search-wrapper">
- <a-form layout="inline">
- <a-row :gutter="15">
- <a-col :md="5" :sm="24">
- <a-form-item label="收款单号">
- <a-input v-model.trim="queryParam.bookNo" allowClear placeholder="请输入收款单号"/>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="24">
- <a-form-item label="财务收款事由">
- <a-input v-model.trim="queryParam.bookReason" allowClear placeholder="请输入财务收款事由"/>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="24">
- <a-form-item label="申请人">
- <employee style="width: 100%;" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="24">
- <a-form-item label="申请时间">
- <rangeDate ref="rangeApply" :value="applyDate" @change="dateApplyChange" />
- </a-form-item>
- </a-col>
- <a-col :md="4" :sm="24">
- <span class="table-page-search-submitButtons">
- <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
- <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
-
- <s-table
- class="sTable"
- ref="table"
- size="small"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ y: 400 }"
- :pageSize="10"
- 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>
-
- <template slot="action" slot-scope="text, record">
- <a-button
- size="small"
- type="link"
- class="button-warning"
- v-if="!record.checked"
- @click="handleChoose(record)"
- >选择</a-button>
- <span style="color:green;" v-else>已选</span>
- </template>
- </s-table>
- </div>
- </a-spin>
-
- <commonModal
- modalTit="财务收款详情"
- bodyPadding="10px"
- width="70%"
- :showFooter="false"
- :openModal="showDetailModal"
- @cancel="showDetailModal=false">
- <detailModal ref="detailModal"></detailModal>
- </commonModal>
- </a-modal>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { STable, VSelect } from '@/components'
- import { financeBookQueryPage } from '@/api/financeBook.js'
- import rangeDate from '@/views/common/rangeDate.vue'
- import commonModal from '@/views/common/commonModal.vue'
- import detailModal from '@/views/financialManagement/financialCollection/detail.vue'
- import employee from '../../expenseManagement/expenseReimbursement/employee.js'
- import { settleReceiptBookBatch } from '@/api/settleReceipt'
- export default {
- name: 'GlDetailModal',
- mixins: [commonMixin],
- components: { STable, VSelect, employee, commonModal, detailModal, rangeDate },
- props: {
- openModal: {
- type: Boolean,
- default: false
- },
- modalTit: {
- type: String,
- default: null
- },
- okText: {
- type: String,
- default: '确定收款'
- },
- cancelText: {
- type: String,
- default: '取消'
- },
- isCancel: {
- type: Boolean,
- default: true
- }
- },
- data () {
- return {
- isShow: this.openModal,
- disabled: false,
- spinning: false,
- showDetailModal: false,
- handlePlData: [],
- applyDate: [],
- queryParam: {
- bookNo: '',
- bookReason: '',
- applyPersonSn: undefined,
- status: 'AUDIT_PASS',
- auditBeginDate: undefined,
- auditEndDate: undefined
- },
- chooseData: [],
- 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: 'payerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
- { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
- { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
- { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
- { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(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 || '--' } },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
- ],
- orginData: [],
-
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- return financeBookQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
- let data
- if (res.status == 200) {
- data = res.data
- const no = (data.pageNo - 1) * data.pageSize
- for (var i = 0; i < data.list.length; i++) {
- data.list[i].no = no + i + 1
- const index = this.chooseData.findIndex(item => data.list[i].bookSn == item.bookSn)
- data.list[i].checked = index >= 0
- }
- this.disabled = false
- }
- this.spinning = false
- this.orginData = data.list
- return data
- })
- },
- snList: []
- }
- },
- computed: {
- totalAmount () {
- let ret = 0
- this.handlePlData.map(item => {
- ret = ret + item.totalAmount
- })
- return ret.toFixed(2)
- }
- },
- methods: {
-
- viewDetail (row) {
- this.showDetailModal = true
- this.$nextTick(() => {
- this.$refs.detailModal.pageInit(row.bookSn)
- })
- },
- setData (data, snList) {
- this.handlePlData = data
- this.snList = snList
- },
- dateApplyChange (date) {
- this.queryParam.auditBeginDate = date[0]
- this.queryParam.auditEndDate = date[1]
- },
-
- handleDel (row) {
- const i = this.chooseData.findIndex(item => row.bookSn == item.bookSn)
- const oi = this.orginData.findIndex(item => row.bookSn == item.bookSn)
- this.chooseData.splice(i, 1)
- if (oi >= 0) {
- this.orginData[oi].checked = false
- }
- },
-
- handleChoose (row) {
- row.checked = true
- this.chooseData.push(row)
- },
-
-
- handleCommonOk () {
- const snList = this.snList
- const bookSnList = []
- this.chooseData.map(item => {
- bookSnList.push(item.bookSn)
- })
- if (bookSnList.length) {
- this.spinning = true
- settleReceiptBookBatch({
- bookSnList: bookSnList,
- snList: snList
- }).then(res => {
- this.spinning = false
- if (res.status == 200) {
- this.$emit('ok')
- this.$message.info(res.message)
- }
- })
- } else {
- this.$message.info('请选择关联的财务收款单')
- }
- },
-
- handleCommonCancel () {
- this.$emit('cancel')
- this.chooseData = []
- },
-
- resetSearchForm () {
- this.queryParam = {
- bookNo: '',
- bookReason: '',
- applyPersonSn: undefined,
- status: 'AUDIT_PASS'
- }
- this.orginData = []
- this.$nextTick(() => {
- this.$refs.rangeApply.resetDate()
- this.$refs.table.refresh(true)
- })
- }
- },
- watch: {
-
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
-
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.handleCommonCancel()
- } else {
- this.resetSearchForm()
- }
- }
- }
- }
- </script>
- <style lang="less">
- .collection-detail-modal{
- .common-main{
- .toolsBar{
- display: flex;
- align-items: center;
- margin-bottom: 10px;
- .ant-btn{
- margin-left: 30px;
- }
- }
- }
- }
- </style>
|