feat 财务中心
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { ElMessage, ElButton, ElRadioGroup, ElRadioButton, ElTable, ElTableColumn } from 'element-plus'
|
||||
import { ElMessage, ElButton, ElTable, ElTableColumn } from 'element-plus'
|
||||
import { FilterPanel, PaginationBar, StatusTag } from '@/components'
|
||||
import { useFinanceStore } from '@/stores/modules/finance'
|
||||
import type { Invoice, InvoiceStatus } from '@/types/business/finance'
|
||||
@@ -36,10 +36,6 @@ function onTab(value: InvoiceStatus | 'all'): void {
|
||||
void financeStore.searchInvoices()
|
||||
}
|
||||
|
||||
function onTabChange(val: string | number | boolean | undefined): void {
|
||||
onTab(val as InvoiceStatus | 'all')
|
||||
}
|
||||
|
||||
function onSearch(): void {
|
||||
financeStore.setInvoiceQuery({ ...invoiceQuery.value, keyword: keyword.value })
|
||||
void financeStore.searchInvoices()
|
||||
@@ -112,19 +108,17 @@ onMounted(() => {
|
||||
</RouterLink>
|
||||
</section>
|
||||
|
||||
<el-radio-group
|
||||
class="invoices__tabs"
|
||||
:model-value="invoiceQuery.status"
|
||||
@change="onTabChange"
|
||||
>
|
||||
<el-radio-button
|
||||
<div class="invoices__tabs">
|
||||
<el-button
|
||||
v-for="tab in STATUS_TABS"
|
||||
:key="tab.value"
|
||||
:value="tab.value"
|
||||
class="invoices__tab"
|
||||
:class="{ 'is-active': invoiceQuery.status === tab.value }"
|
||||
@click="onTab(tab.value)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<FilterPanel
|
||||
v-model:keyword="keyword"
|
||||
@@ -326,26 +320,40 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
&__tabs {
|
||||
:deep(.el-radio-button__inner) {
|
||||
height: 34px;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__tab {
|
||||
height: 34px;
|
||||
margin: 0;
|
||||
padding: 0 @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 400;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
box-shadow: none;
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
:deep(.el-radio-button + .el-radio-button) {
|
||||
margin-left: @spacing-sm;
|
||||
}
|
||||
|
||||
:deep(.el-radio-button.is-active .el-radio-button__inner) {
|
||||
&.is-active {
|
||||
border-color: @primary-color;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
box-shadow: -1px 0 0 0 @primary-color;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user