feat:更新账单搜索模块
This commit is contained in:
@@ -27,7 +27,7 @@ import { useBillStore } from '@/store/bill.ts'
|
||||
const billStore = useBillStore()
|
||||
|
||||
onMounted(async () => {
|
||||
await billStore.refreshInfo()
|
||||
await billStore.refreshInfo(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ onMounted(async () => {
|
||||
|
||||
billStore.billType = 'expensive'
|
||||
billStore.billDateType = 'month'
|
||||
|
||||
await billStore.refreshInfo()
|
||||
})
|
||||
|
||||
|
||||
@@ -129,7 +129,6 @@ const billInfo = reactive({
|
||||
onMounted(async () => {
|
||||
appStore.isShowMobileBack = true
|
||||
|
||||
await billStore.initBillInfo()
|
||||
await initBillRecord()
|
||||
})
|
||||
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
<template>
|
||||
<div class="mobile-bill-view common-mobile-view">
|
||||
<div class="common-query">
|
||||
<el-form :model="billStore.billSearchForm">
|
||||
<el-form-item label="账单内容">
|
||||
<el-input v-model="billStore.billSearchForm.content"
|
||||
@input="billStore.searchInfo()"
|
||||
placeholder="请输入账单内容" clearable/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="账单类别">
|
||||
<el-input v-model="billStore.billSearchForm.category"
|
||||
@input="billStore.searchInfo()"
|
||||
placeholder="请输入账单类别" clearable/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="账单地址">
|
||||
<el-input v-model="billStore.billSearchForm.location"
|
||||
@input="billStore.searchInfo()"
|
||||
placeholder="请输入账单地址" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<bill-search />
|
||||
|
||||
<div v-if="billStore.billRecordList.length === 0">
|
||||
<el-empty description="暂无数据"/>
|
||||
</div>
|
||||
|
||||
<div v-else class="bill-search-list card-item">
|
||||
<div class="search-result-title">
|
||||
<span>收入:{{ formatAmount(getTotalAmount(billStore.billRecordList, 'income')) }}</span>
|
||||
<span>支出:{{ formatAmount(getTotalAmount(billStore.billRecordList, 'expensive')) }}</span>
|
||||
</div>
|
||||
<daily-card v-for="(item, index) in billStore.billRecordList"
|
||||
:key="index" @click="selectBillRecordClick(item)"
|
||||
:title="item.category" :content="item.content">
|
||||
@@ -53,10 +37,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BillSearch from '@/components/Bill/BillSearch.vue'
|
||||
import DailyCard from '@/components/DailyCard.vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { useBillStore } from '@/store/bill.ts'
|
||||
import { getCategoryByName } from '@/utils/home/billUtil'
|
||||
import { getCategoryByName, getTotalAmount } from '@/utils/home/billUtil'
|
||||
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
||||
import { IBillRecord } from '@/types/bill'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -13,12 +13,6 @@
|
||||
|
||||
<weather-time-card />
|
||||
|
||||
<!-- <el-carousel height="150px">-->
|
||||
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
|
||||
<!-- <h3>{{ item }}</h3>-->
|
||||
<!-- </el-carousel-item>-->
|
||||
<!-- </el-carousel>-->
|
||||
|
||||
<div class="module-list">
|
||||
<module-card icon="iconfont icon-fenlei" color="#00CED1"
|
||||
title="博客文章" sub-title="分享学习点滴"
|
||||
@@ -26,7 +20,7 @@
|
||||
|
||||
<module-card icon="iconfont icon-zhangdan" color="#FFCC00"
|
||||
title="账单记录" sub-title="收支一目了然"
|
||||
router="/bill/data"/>
|
||||
router="/bill/data" @click="initBillClick"/>
|
||||
|
||||
<module-card icon="iconfont icon-jingdian" color="#FF9966"
|
||||
title="旅行记录" sub-title="足迹遍及四方"
|
||||
@@ -72,17 +66,6 @@
|
||||
title="密码管家" sub-title="守护数字安全"
|
||||
router="/password/list"/>
|
||||
</div>
|
||||
|
||||
<!-- <div class="note-container">-->
|
||||
<!-- <div class="content">-->
|
||||
<!-- <span class="title">消息中心</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="note-list">-->
|
||||
<!-- <div class="note">-->
|
||||
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@@ -90,9 +73,15 @@
|
||||
import WeatherTimeCard from '@/components/Common/WeatherTimeCard.vue'
|
||||
import ModuleCard from '@/components/ModuleCard.vue'
|
||||
import { useAppStore } from '@/store/app'
|
||||
import { useBillStore } from '@/store/bill.ts'
|
||||
import { getAssetsImageFile } from '@/utils'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const billStore = useBillStore()
|
||||
|
||||
const initBillClick = async () => {
|
||||
await billStore.initBillInfo()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user