123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- <template>
- <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
- <a-spin :spinning="spinning" tip="Loading...">
- <!-- 标签页 -->
- <a-tabs type="card" v-model="queryParam.bizType" @change="handleTabChange" class="financialCollectionList-tabs ">
- <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
- <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
- </a-tab-pane>
- </a-tabs>
- <!-- 搜索条件 -->
- <div ref="tableSearch" class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
- <a-row :gutter="15">
- <a-col :md="6" :sm="24">
- <a-form-item label="收款单号"><a-input id="financialCollectionList-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入收款单号" /></a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="关联单号"><a-input id="financialCollectionList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="商户名称">
- <a-input id="financialCollectionList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入商户名称" />
- </a-form-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="单据状态">
- <v-select
- v-model="queryParam.billState"
- ref="settleState"
- id="financialCollectionList-settleState"
- code="SETTLE_RECEIVE_STATUS"
- placeholder="请选择单据状态"
- allowClear
- ></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="审核时间">
- <rangeDate ref="rangeDate" @change="dateChange" />
- </a-form-item>
- </a-col>
- </template>
- <a-col :md="6" :sm="24">
- <span class="table-page-search-submitButtons">
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
- <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
- <a @click="advanced = !advanced" style="margin-left: 5px">
- {{ advanced ? '收起' : '展开' }}
- <a-icon :type="advanced ? 'up' : 'down'" />
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- alert -->
- <a-alert type="info" style="margin-bottom:10px">
- <div slot="message">
- 共
- <strong>{{ totalData&&(totalData.count || totalData.count==0) ? totalData.count : '--' }}</strong>
- 条记录,应收金额合计
- <strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? '¥'+totalData.totalAmount : '--' }}</strong>
- ,其中已收金额
- <strong>{{ totalData&&(totalData.settledAmount || totalData.settledAmount==0) ? '¥'+totalData.settledAmount : '--' }}</strong>
- ,待收金额
- <strong>{{ totalData&&(totalData.unsettleAmount || totalData.unsettleAmount==0) ? '¥'+totalData.unsettleAmount : '--' }}</strong>
- </div>
- </a-alert>
- <div v-if="$hasPermissions('B_financialCollectionPl')" style="margin-bottom: 10px">
- <a-button type="primary" id="financialCollectionList-export" :loading="loading" @click="handleCollection">批量收款</a-button>
- <span style="margin-left: 8px" v-if="$hasPermissions('B_financialCollectionPl')">
- <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
- <template v-if="selectTotalAmount">,合计¥{{ selectTotalAmount }}</template>
- </span>
- </div>
- <!-- 列表 -->
- <s-table
- class="sTable fixPagination"
- ref="table"
- :style="{ height: tableHeight+84.5+'px' }"
- size="small"
- :rowKey="record => record.id"
- :row-selection="$hasPermissions('B_financialCollectionPl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.settleState == 'SETTLED' } }) } : null"
- @rowSelection="rowSelectionFun"
- :columns="columns"
- :data="loadData"
- :scroll="{ y: tableHeight }"
- :defaultLoadData="false"
- bordered
- >
- <!-- 关联单号 -->
- <template slot="bizNo" slot-scope="text, record">
- <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.bizNo }}</span>
- </template>
- <!-- 操作 -->
- <template slot="action" slot-scope="text, record">
- <a-button
- size="small"
- type="link"
- class="button-primary"
- v-if="record.settleState == 'SETTLED' && $hasPermissions('B_financialCollectionDetail')"
- @click="handleVoucher(record)"
- id="financialCollectionList-voucher-btn">凭证</a-button>
- <a-button
- size="small"
- type="link"
- :loading="loading"
- class="button-error"
- v-if="(record.settleState == 'UNSETTLE' || record.settleState == 'PART_SETTLED')&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing')"
- @click="handleCollectionSing(record)"
- id="financialCollectionList-pay-btn">收款</a-button>
- <span v-if="!(record.settleState == 'SETTLED' && $hasPermissions('B_financialCollectionDetail')) && !((record.settleState == 'UNSETTLE' || record.settleState == 'PART_SETTLED')&&record.satelliteFlag!=1 && $hasPermissions('B_financialCollectionSing'))">--</span>
- <!-- satelliteFlag为1,是卫星仓 -->
- </template>
- </s-table>
- </a-spin>
- <!-- 详情 -->
- <detail-modal :openModal="openModal" ref="detailModal" @close="openModal = false" />
- <!-- 关联单号详情 -->
- <a-modal
- centered
- class="outboundOrderDetail-modal"
- :footer="null"
- :maskClosable="false"
- :bodyStyle="{padding:'12px'}"
- :title="curBizTitle"
- v-model="openDetailModal"
- v-if="openDetailModal&&fcBizType!='SPARE_PARTS_RETURN'"
- @cancle="handleDetailClose"
- width="80%">
- <div style="max-height: 700px;overflow-y: auto;">
- <!-- 销售单 -->
- <salesDetailModal v-if="fcBizType=='SELL'" :outBizSn="orderSn" />
- <!-- 采购退货 -->
- <pushOrderDetailModal v-if="fcBizType=='PURCHASE_RETURN'&&!$hasPermissions('M_purchaseReturn_outSnycList')" :outBizSn="orderSn" />
- <pushOrderOutSyncDetailModal v-if="fcBizType=='PURCHASE_RETURN'&&$hasPermissions('M_purchaseReturn_outSnycList')" :outBizSn="orderSn"></pushOrderOutSyncDetailModal>
- <!-- 店内调出 -->
- <storeTransferOutDetailModal v-if="fcBizType=='STORE_CALL_OUT'" :outBizSn="orderSn"></storeTransferOutDetailModal>
- <!-- 连锁调出 -->
- <chainTransferOutDetailModal v-if="fcBizType=='LINKAGE_CALL_OUT'" :outBizSn="orderSn" />
- </div>
- </a-modal>
- <!-- 散件退货 -->
- <bulkReturnGoods-detail-modal :openModal="openBulkReturnDetailModal" :itemSn="orderSn" @close="handleDetailClose" />
- </a-card>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { STable, VSelect } from '@/components'
- import detailModal from './detailModal.vue'
- import rangeDate from '@/views/common/rangeDate.vue'
- import salesDetailModal from '@/views/salesManagement/salesQuery/detail.vue'
- // 同步采购退货单详情
- import pushOrderDetailModal from '@/views/purchasingManagement/purchaseReturn/detail.vue'
- // 不同步采购退货单
- import pushOrderOutSyncDetailModal from '@/views/purchasingManagement/purchaseReturnOutSync/detail.vue'
- import chainTransferOutDetailModal from '@/views/allocationManagement/chainTransferOut/detail.vue'
- import storeTransferOutDetailModal from '@/views/allocationManagement/storeTransferOut/detail.vue'
- import bulkReturnGoodsDetailModal from '@/views/bulkManagement/bulkReturnGoods/detailModal.vue'
- import { settleReceiptQuery, queryByTypeSum, settleReceiptMoney, settleReceiptQuerySum } from '@/api/settleReceipt'
- export default {
- name: 'FinancialCollectionList',
- components: { STable, VSelect, detailModal, rangeDate, pushOrderDetailModal, pushOrderOutSyncDetailModal, salesDetailModal, chainTransferOutDetailModal, bulkReturnGoodsDetailModal, storeTransferOutDetailModal },
- mixins: [commonMixin],
- data () {
- return {
- spinning: false,
- advanced: true, // 高级搜索 展开/关闭
- disabled: false, // 查询、重置按钮是否可操作
- openModal: false, // 详情弹框
- openDetailModal: false,
- openBulkReturnDetailModal: false,
- tableHeight: 0,
- curBizType: 'ALL',
- curBizTitle: '',
- fcBizType: '',
- orderSn: null,
- // 查询参数
- queryParam: {
- bizType: 'ALL',
- settleNo: '',
- bizNo: '',
- settleClientName: '',
- billState: '',
- auditBeginDate: '',
- auditEndDate: ''
- },
- // 总计
- totalData: {
- settledAmount: 0,
- totalAmount: 0,
- unsettleAmount: 0,
- count: 0
- },
- // 表头
- columns: [
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
- { title: '收款单号', dataIndex: 'settleNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '关联单号', dataIndex: 'bizNo', scopedSlots: { customRender: 'bizNo' }, width: '16%', align: 'center' },
- { title: '商户名称', dataIndex: 'settleClientName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '应收金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
- { title: '已收金额', dataIndex: 'settledAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
- { title: '待收金额', dataIndex: 'unsettleAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
- { title: '收款类型', dataIndex: 'bizName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '收款方式', dataIndex: 'settleStyleName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '收款时间', dataIndex: 'settleTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '5%', align: 'center' }
- ],
- loading: false,
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- return settleReceiptQuery(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
- }
- this.disabled = false
- this.totalData.count = data.count || 0
- // 查询总计
- this.settleReceiptQuerySum(Object.assign(parameter, this.queryParam))
- }
- this.spinning = false
- return data
- })
- },
- tabPaneData: [],
- rowSelectionInfo: null
- }
- },
- computed: {
- selectTotalAmount () {
- let ret = 0
- if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows) {
- this.rowSelectionInfo.selectedRows.map(item => {
- ret = ret + item.unsettleAmount
- })
- }
- return ret
- }
- },
- methods: {
- handleDetailClose () {
- this.openDetailModal = false
- this.openBulkReturnDetailModal = false
- this.orderSn = null
- },
- // 查看关联单号
- handleDetail (row) {
- console.log(row)
- this.orderSn = row.bizSn
- this.fcBizType = row.bizType
- this.curBizTitle = row.bizTypeDictValue + '详情'
- if (row.bizType == 'SPARE_PARTS_RETURN') {
- this.openBulkReturnDetailModal = true
- } else {
- this.openDetailModal = true
- }
- },
- // 表格选中项
- rowSelectionFun (obj) {
- this.rowSelectionInfo = obj || null
- },
- // 时间 change
- dateChange (date) {
- this.queryParam.auditBeginDate = date[0]
- this.queryParam.auditEndDate = date[1]
- },
- // 总计
- settleReceiptQuerySum (params) {
- settleReceiptQuerySum(params).then(res => {
- if (res.status == 200) {
- this.totalData = Object.assign(this.totalData, res.data)
- }
- })
- },
- // 获取类型
- queryByTypeSum () {
- queryByTypeSum({}).then(res => {
- if (res.data && res.status == 200) {
- this.tabPaneData = res.data
- if (this.$route.query.pageParams) {
- this.queryParam.bizType = JSON.parse(this.$route.query.pageParams).bizType
- } else {
- this.queryParam.bizType = res.data[0].bizType
- }
- this.$refs.table.refresh(true)
- }
- })
- },
- // 凭证弹框
- handleVoucher (row) {
- this.$refs.detailModal.getDetail(row.id)
- this.openModal = true
- },
- // 收款
- handleCollectionSing (row) {
- const _this = this
- this.$confirm({
- title: '提示',
- content: '确认收款吗?',
- centered: true,
- closable: true,
- onOk () {
- _this.loading = true
- _this.spinning = true
- settleReceiptMoney([row.id]).then(res => {
- _this.loading = false
- if (res.status == 200) {
- _this.$message.success(res.message)
- _this.$refs.table.refresh()
- _this.$refs.table.clearSelected() // 清空表格选中项
- _this.spinning = false
- } else {
- _this.spinning = false
- }
- })
- }
- })
- },
- // 选择类型
- handleTabChange (key) {
- this.queryParam.bizType = key
- this.$refs.table.refresh(true)
- this.curBizType = key
- },
- // 批量收款
- handleCollection () {
- if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
- this.$message.warning('请在列表勾选后再进行批量操作!')
- return
- }
- const _this = this
- this.$confirm({
- title: '提示',
- content: <div><p style="margin-top:20px;">合计金额¥{ this.selectTotalAmount } </p><p>确认批量收款吗?</p></div>,
- centered: true,
- closable: true,
- onOk () {
- _this.loading = true
- _this.spinning = true
- settleReceiptMoney(_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys).then(res => {
- this.loading = false
- if (res.status == 200) {
- _this.$message.success(res.message)
- _this.$refs.table.refresh()
- _this.$refs.table.clearSelected() // 清空表格选中项
- _this.spinning = false
- } else {
- _this.spinning = false
- }
- })
- }
- })
- },
- // 重置
- resetSearchForm () {
- this.resetData()
- this.$refs.table.refresh(true)
- },
- // 重置数据
- resetData () {
- if (this.advanced) {
- this.$refs.rangeDate.resetDate()
- }
- this.queryParam = {
- bizType: this.curBizType,
- settleNo: '',
- bizNo: '',
- settleClientName: '',
- billState: '',
- auditBeginDate: '',
- auditEndDate: ''
- }
- },
- pageInit () {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- this.queryByTypeSum()
- },
- setTableH () {
- const tableSearchH = this.$refs.tableSearch.offsetHeight
- this.tableHeight = window.innerHeight - tableSearchH - 330
- }
- },
- watch: {
- advanced (newValue, oldValue) {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- },
- '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
- this.setTableH()
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
- this.resetData()
- this.pageInit()
- }
- },
- activated () {
- // 如果是新页签打开,则重置当前页面
- if (this.$store.state.app.isNewTab || this.$route.query.pageParams) {
- this.resetData()
- if (this.$route.query.pageParams) {
- this.queryParam.bizType = JSON.parse(this.$route.query.pageParams).bizType
- this.queryParam.billState = JSON.parse(this.$route.query.pageParams).billState
- }
- this.pageInit()
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {})
- }
- }
- </script>
- <style lang="less">
- .financialCollectionList-wrap{
- .financialCollectionList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
- height: 30px!important;
- }
- .financialCollectionList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
- height: 30px!important;
- }
- .financialCollectionList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
- line-height: 26px!important;
- height: 30px!important;
- }
- }
- </style>
|