|
@@ -1,123 +0,0 @@
|
|
|
-<template>
|
|
|
|
|
- <view class="app-content">
|
|
|
|
|
- <view class="app-tabs">
|
|
|
|
|
- <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" :height="100" @change="changeIncome" itemWidth="50%"/>
|
|
|
|
|
- </view>
|
|
|
|
|
- <div class="list-by_box" v-if="!$util.isEmpty(list.data)">
|
|
|
|
|
- <t-table :headerBackgroundColor="'#F0F2F6'">
|
|
|
|
|
- <t-tr header>
|
|
|
|
|
- <t-th v-for="(item, index) in columns" :key="index" :align="item.align">
|
|
|
|
|
- {{ item.name }}
|
|
|
|
|
- </t-th>
|
|
|
|
|
- </t-tr>
|
|
|
|
|
- <t-tr v-for="(item, index) in list.data" :key="index">
|
|
|
|
|
- <t-td v-for="(column, colIndex) in columns" :key="colIndex" :align="column.align" :color="column.color" >
|
|
|
|
|
- <view>
|
|
|
|
|
- {{ item[column.dataIndex] || "" }}
|
|
|
|
|
- </view>
|
|
|
|
|
- </t-td>
|
|
|
|
|
- </t-tr>
|
|
|
|
|
- </t-table>
|
|
|
|
|
- </div>
|
|
|
|
|
- <block v-else>
|
|
|
|
|
- <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
|
|
- </block>
|
|
|
|
|
- </view>
|
|
|
|
|
-</template>
|
|
|
|
|
-
|
|
|
|
|
-<script>
|
|
|
|
|
-import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
|
|
-import AppTabs from "@/components/plugin/tabs";
|
|
|
|
|
-import { list } from "@/mixins";
|
|
|
|
|
-import { capitaList } from '@/api/store'
|
|
|
|
|
-export default {
|
|
|
|
|
- name: "income", //收支记录
|
|
|
|
|
- components: {
|
|
|
|
|
- AppWrapperEmpty,
|
|
|
|
|
- AppTabs
|
|
|
|
|
- },
|
|
|
|
|
- mixins: [list],
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- columns: [
|
|
|
|
|
- {name: "事项",dataIndex: "event",color: "info",align: "center"},
|
|
|
|
|
- {name: "金额",dataIndex: "amount",color: "info",align: "center"},
|
|
|
|
|
- {name: "累计",dataIndex: "totalIncome",color: "info",align: "center"},
|
|
|
|
|
- {name: "时间",dataIndex: "addTime",color: "info",align: "center"}
|
|
|
|
|
- ],
|
|
|
|
|
- tabIndex: 0,
|
|
|
|
|
- tabs: [
|
|
|
|
|
- {
|
|
|
|
|
- name: "收入",
|
|
|
|
|
- key:1
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "支出",
|
|
|
|
|
- key:0
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- init() {
|
|
|
|
|
- this.getList();
|
|
|
|
|
- },
|
|
|
|
|
- changeIncome(e){
|
|
|
|
|
- if (this.tabIndex == e.index) {
|
|
|
|
|
- return false;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.tabIndex = e.index;
|
|
|
|
|
- this.columns = [
|
|
|
|
|
- {name: "事项",dataIndex: "event",color: "info",align: "center"},
|
|
|
|
|
- {name: "金额",dataIndex: "amount",color: "info",align: "center"},
|
|
|
|
|
- {name: "累计",dataIndex: this.tabIndex==0?"totalIncome":"totalExpend",color: "info",align: "center"},
|
|
|
|
|
- {name: "时间",dataIndex: "addTime",color: "info",align: "center"}
|
|
|
|
|
- ]
|
|
|
|
|
- this.resetList();
|
|
|
|
|
- this.getList();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- getList(){
|
|
|
|
|
- return capitaList({
|
|
|
|
|
- page: this.list.page,
|
|
|
|
|
- io: this.tabs[this.tabIndex].key
|
|
|
|
|
- }).then(res=>{
|
|
|
|
|
- this.completes(res);
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- onPullDownRefresh() {
|
|
|
|
|
- this.resetList();
|
|
|
|
|
- this.getList().then(res => {
|
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- onReachBottom() {
|
|
|
|
|
- if (!this.list.finished) {
|
|
|
|
|
- this.getList().then(res => {
|
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
-.list-by_box {
|
|
|
|
|
- padding-top: 100upx;
|
|
|
|
|
-}
|
|
|
|
|
-.app-tabs {
|
|
|
|
|
- position: fixed;
|
|
|
|
|
- /* 手机mobile屏幕小于1000px */
|
|
|
|
|
- @media screen and (max-width: 1100px) {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- }
|
|
|
|
|
- /* 收银台cashier屏幕大于1000px */
|
|
|
|
|
- @media screen and (min-width:1100px) {
|
|
|
|
|
- width: 40%;
|
|
|
|
|
- }
|
|
|
|
|
- z-index: 9;
|
|
|
|
|
- }
|
|
|
|
|
-</style>
|
|
|