|
@@ -1,17 +1,191 @@
|
|
|
<template>
|
|
|
- <div class="dashboard-container">
|
|
|
-
|
|
|
+ <div class="dashboard-container app-container">
|
|
|
+ <div class="title">金额统计</div>
|
|
|
+ <div class="filter-container">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="selectDate"
|
|
|
+ style="margin-right: 20px"
|
|
|
+ size="small"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ />
|
|
|
|
|
|
+ <el-button
|
|
|
+ v-permission="['collectionPayment:collectionpayment:list']"
|
|
|
+ class="filter-item"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="handleFilter"
|
|
|
+ >查找</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
|
|
|
+ <!-- 查询结果 -->
|
|
|
+ <el-table
|
|
|
+ v-loading="listLoading"
|
|
|
+ :data="list"
|
|
|
+ :summary-method="getSummaries"
|
|
|
+ size="small"
|
|
|
+ element-loading-text="正在查询中。。。"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ highlight-current-row
|
|
|
+ show-summary
|
|
|
+ >
|
|
|
+ <el-table-column align="center" label="日期" prop="receiptPaymentDate">
|
|
|
+ <template slot-scope="scope"> {{ scope.row.statciDate }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="收入金额" prop="revenueAmount" />
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="支出金额"
|
|
|
+ prop="expenditureAmount"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="listQuery.page"
|
|
|
+ :limit.sync="listQuery.limit"
|
|
|
+ @pagination="getList" />
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
+import { dayjs, EventBus } from 'base-core-lib'
|
|
|
+import { listStatistics } from '@/api/MaritimeAdministration'
|
|
|
|
|
|
-</script>
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import store from '@/store'
|
|
|
+export default {
|
|
|
+ name: 'CollectionPayment',
|
|
|
+ components: { Pagination },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isAllowExport: true,
|
|
|
+ countryList: [],
|
|
|
+ modification: [],
|
|
|
+ selectDate: [],
|
|
|
+ date: {
|
|
|
+ year: dayjs().format('YYYY'),
|
|
|
+ month: dayjs().format('MM')
|
|
|
+ },
|
|
|
|
|
|
-<style lang="scss">
|
|
|
-
|
|
|
-</style>
|
|
|
+ list: null,
|
|
|
+ total: 0,
|
|
|
+ listLoading: true,
|
|
|
+ listQuery: {
|
|
|
+ page: 1,
|
|
|
+ limit: 20,
|
|
|
+ type: {
|
|
|
+ startDate: '',
|
|
|
+ endDate: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.selectDate = this.getNowTime()
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
|
|
|
+ methods: {
|
|
|
+ getNowTime() {
|
|
|
+ const start = new Date(new Date().getTime())
|
|
|
+ .toISOString()
|
|
|
+ .replace('T', ' ')
|
|
|
+ .split('.')[0] // 默认开始时间7天前
|
|
|
+ const end = new Date(new Date().getTime())
|
|
|
+ .toISOString()
|
|
|
+ .replace('T', ' ')
|
|
|
+ .split('.')[0] // 默认结束时间1天前
|
|
|
+ // const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7)
|
|
|
+ // .toISOString()
|
|
|
+ // .replace('T', ' ')
|
|
|
+ // .split('.')[0] // 默认开始时间7天前
|
|
|
+ // const end = new Date(new Date().getTime() - 3600 * 1000 * 24)
|
|
|
+ // .toISOString()
|
|
|
+ // .replace('T', ' ')
|
|
|
+ // .split('.')[0]// 默认结束时间1天前
|
|
|
+ console.log([start, end])
|
|
|
+ return [start, end]
|
|
|
+ },
|
|
|
+ formatDate(numb, format) {
|
|
|
+ const old = numb - 1
|
|
|
+ const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60)
|
|
|
+ const time = new Date(1900, 0, old, 0, 0, t)
|
|
|
+ const year = time.getFullYear()
|
|
|
+ const month = time.getMonth() + 1
|
|
|
+ const date = time.getDate()
|
|
|
+ return (
|
|
|
+ year +
|
|
|
+ format +
|
|
|
+ (month < 10 ? '0' + month : month) +
|
|
|
+ format +
|
|
|
+ (date < 10 ? '0' + date : date) +
|
|
|
+ ' 00:00:00'
|
|
|
+ )
|
|
|
+ },
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计'
|
|
|
+ return
|
|
|
+ } else if (index == 5 || index == 6) {
|
|
|
+ const values = data.map((item) => Number(item[column.property]))
|
|
|
+ if (!values.every((value) => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr)
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr
|
|
|
+ } else {
|
|
|
+ return prev
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ sums[index] += ''
|
|
|
+ } else {
|
|
|
+ sums[index] = '--'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // sums[index] = "--";
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
+ return sums
|
|
|
+ },
|
|
|
+ handleFilter() {
|
|
|
+ this.listQuery.page = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ this.listQuery.type.startDate = dayjs(this.selectDate[0]).format(
|
|
|
+ 'YYYY-MM-DD'
|
|
|
+ )
|
|
|
+ this.listQuery.type.endDate = dayjs(this.selectDate[1]).format(
|
|
|
+ 'YYYY-MM-DD'
|
|
|
+ )
|
|
|
+ listStatistics(this.listQuery)
|
|
|
+ .then((response) => {
|
|
|
+ this.list = response.data.data.items
|
|
|
+ this.total = response.data.data.total
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.list = []
|
|
|
+ this.total = 0
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.title{
|
|
|
+ font-size: 30px;
|
|
|
+ margin-bottom: 40px;
|
|
|
+}
|
|
|
+</style>
|