1、调整配载、总单
2、新增收付款模块
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<basic-container class="bill-ledger-page">
|
||||
<bill-ledger-search
|
||||
:query="query"
|
||||
:counts="counts"
|
||||
:loading="loading"
|
||||
@search="handleSearch"
|
||||
@reset="resetSearch"
|
||||
/>
|
||||
<bill-ledger-table
|
||||
:rows="rows"
|
||||
:loading="loading"
|
||||
:page="page"
|
||||
@add="openCreate"
|
||||
@edit="openEdit"
|
||||
@delete="handleDelete"
|
||||
@page-change="handlePageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as api from '@/api/payment/billLedger';
|
||||
import BillLedgerSearch from './components/bill-ledger-search.vue';
|
||||
import BillLedgerTable from './components/bill-ledger-table.vue';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
billNo: '',
|
||||
issueDateRange: [],
|
||||
issuerName: '',
|
||||
receiverName: '',
|
||||
billType: '',
|
||||
maturityStatus: '',
|
||||
expiryShortcut: 'all',
|
||||
});
|
||||
|
||||
export default {
|
||||
name: 'BillLedger',
|
||||
components: { BillLedgerSearch, BillLedgerTable },
|
||||
data() {
|
||||
return {
|
||||
query: emptyQuery(),
|
||||
counts: { all: 0, within30: 0, within90: 0, over90: 0 },
|
||||
rows: [],
|
||||
loading: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
unwrapData(response) {
|
||||
const body = response?.data || response || {};
|
||||
return body?.data || body;
|
||||
},
|
||||
requestParams() {
|
||||
const { issueDateRange, ...params } = this.query;
|
||||
return {
|
||||
...params,
|
||||
issueStartDate: issueDateRange?.[0] || '',
|
||||
issueEndDate: issueDateRange?.[1] || '',
|
||||
};
|
||||
},
|
||||
async loadData() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const [listResponse, countResponse] = await Promise.all([
|
||||
api.getList(this.page.current, this.page.size, this.requestParams()),
|
||||
api.getExpiryCounts(),
|
||||
]);
|
||||
const data = this.unwrapData(listResponse);
|
||||
this.rows = data.records || [];
|
||||
this.page.total = Number(data.total || 0);
|
||||
this.counts = { ...this.counts, ...(this.unwrapData(countResponse) || {}) };
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
handleSearch() {
|
||||
this.page.current = 1;
|
||||
this.loadData();
|
||||
},
|
||||
resetSearch() {
|
||||
this.query = emptyQuery();
|
||||
this.handleSearch();
|
||||
},
|
||||
openCreate() {
|
||||
this.$router.push({ path: '/payment/bill-ledger/form', query: { mode: 'add' } });
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$router.push({
|
||||
path: '/payment/bill-ledger/form',
|
||||
query: { mode: 'edit', id: row.id },
|
||||
});
|
||||
},
|
||||
async handleDelete(row) {
|
||||
await this.$confirm('确认删除该汇票台账?', '提示', { type: 'warning' });
|
||||
await api.remove(row.id);
|
||||
this.$message.success('删除成功');
|
||||
if (this.rows.length === 1 && this.page.current > 1) this.page.current -= 1;
|
||||
this.loadData();
|
||||
},
|
||||
handlePageChange(current) {
|
||||
this.page.current = current;
|
||||
this.loadData();
|
||||
},
|
||||
handleSizeChange(size) {
|
||||
this.page.current = 1;
|
||||
this.page.size = size;
|
||||
this.loadData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user