Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit a642ea6

Browse files
committed
feat(finance-management): 账单明细添加日期筛选
1 parent 1b4a329 commit a642ea6

File tree

2 files changed

+58
-28
lines changed

2 files changed

+58
-28
lines changed

services/finance-management/backend/src/main/java/com/fit2cloud/controller/request/PageBillDetailedRequest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,31 @@
1010
public class PageBillDetailedRequest {
1111
@Schema(title = "月份", description = "月份")
1212
private String month;
13+
14+
@Schema(title = "日期", description = "日期")
15+
@Query(field = "deductionDate", compareType = QueryUtil.CompareType.EQ)
16+
private String deductionDate;
17+
1318
@Query(field = "cloudAccountId", compareType = QueryUtil.CompareType.IN)
1419
@Schema(title = "云账号名称")
1520
private String cloudAccountName;
21+
1622
@Query(field = "cloudAccountId", compareType = QueryUtil.CompareType.EQ)
1723
@Schema(title = "云账号id")
1824
private String cloudAccountId;
25+
1926
@Schema(title = "企业项目名称")
2027
@Query(field = "projectName.keyword", compareType = QueryUtil.CompareType.WILDCARD)
2128
private String projectName;
29+
2230
@Schema(title = "产品名称")
2331
@Query(field = "productName.keyword", compareType = QueryUtil.CompareType.WILDCARD)
2432
private String productName;
33+
2534
@Schema(title = "资源名称")
2635
@Query(field = "resourceName.keyword", compareType = QueryUtil.CompareType.WILDCARD)
2736
private String resourceName;
37+
2838
@Schema(title = "排序")
2939
private OrderRequest order;
3040
}

services/finance-management/frontend/src/views/bill_detailed/index.vue

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,35 @@
1515
row-key="id"
1616
>
1717
<template #toolbar>
18+
<el-select style="width: 90px" v-model="activeDate">
19+
<el-option label="账期" value="billingCycle"></el-option>
20+
<el-option label="日期" value="deductionDate"></el-option
21+
></el-select>
1822
<el-date-picker
23+
v-if="activeDate === 'billingCycle'"
24+
:key="'billingCycle'"
1925
:editable="false"
2026
v-model="viewMonth"
2127
type="month"
22-
placeholder="请选择月份"
28+
placeholder="请选择账期"
2329
format="YYYY-MM"
2430
:clearable="false"
2531
:disabled-date="disabledDate"
2632
value-format="YYYY-MM"
2733
>
28-
<template #default="cell">
29-
<div class="cell" :class="{ current: cell.isCurrent }">
30-
<span class="text">{{ cell.text }}</span>
31-
</div>
32-
</template>
34+
</el-date-picker>
35+
<el-date-picker
36+
v-else
37+
:editable="false"
38+
:key="'deductionDate'"
39+
v-model="viewDeductionDate"
40+
type="date"
41+
placeholder="请选择日期"
42+
format="YYYY-MM-DD"
43+
:clearable="false"
44+
:disabled-date="disabledDate"
45+
value-format="YYYY-MM-DD"
46+
>
3347
</el-date-picker>
3448
</template>
3549
<el-table-column type="selection" />
@@ -242,7 +256,7 @@
242256
</layout-content>
243257
</template>
244258
<script setup lang="ts">
245-
import { ref, watch, onMounted } from "vue";
259+
import { ref, watch, onMounted, computed } from "vue";
246260
import {
247261
PaginationConfig,
248262
TableConfig,
@@ -263,6 +277,7 @@ const currentMonth =
263277
? "0" + (new Date().getMonth() + 1).toString()
264278
: (new Date().getMonth() + 1).toString());
265279
const viewMonth = ref<string>(currentMonth);
280+
const viewDeductionDate = ref<string>();
266281
/**
267282
* 日志选择框禁用大于当前月份的时间
268283
* @param time 时间
@@ -273,29 +288,43 @@ const disabledDate = (time: Date) => {
273288
274289
const cloudAccountList = ref<Array<CloudAccount>>([]);
275290
291+
const activeDate = ref<"billingCycle" | "deductionDate">("billingCycle");
292+
276293
/**
277294
* 表格对象
278295
*/
279296
const table = ref<any>();
280297
281298
const clearCondition = () => {
282299
viewMonth.value = "";
300+
viewDeductionDate.value = "";
283301
};
284302
303+
const otherSearchQuery = computed(() => {
304+
const query: any = {};
305+
if (viewMonth.value) {
306+
query["month"] = {
307+
value: viewMonth.value,
308+
label: "账期",
309+
valueLabel: viewMonth.value,
310+
field: "month",
311+
};
312+
}
313+
if (viewDeductionDate.value) {
314+
query["deductionDate"] = {
315+
value: viewDeductionDate.value,
316+
label: "日期",
317+
valueLabel: viewDeductionDate.value,
318+
field: "deductionDate",
319+
};
320+
}
321+
return query;
322+
});
285323
onMounted(() => {
286324
/**
287325
* 组件挂载查询数据
288326
*/
289-
search(
290-
table.value?.getTableSearch({
291-
month: {
292-
value: viewMonth.value,
293-
label: "月份",
294-
valueLabel: viewMonth.value,
295-
field: "month",
296-
},
297-
})
298-
);
327+
search(table.value?.getTableSearch(otherSearchQuery.value));
299328
cloudAccountApi.listAll().then((ok) => {
300329
cloudAccountList.value = ok.data;
301330
});
@@ -304,18 +333,9 @@ onMounted(() => {
304333
/**
305334
* 月份发生改变的时候查询数据
306335
*/
307-
watch(viewMonth, () => {
336+
watch(otherSearchQuery, () => {
308337
const tabSearch: TableSearch = table.value?.getTableSearch(
309-
viewMonth.value
310-
? {
311-
month: {
312-
value: viewMonth.value,
313-
label: "月份",
314-
valueLabel: viewMonth.value,
315-
field: "month",
316-
},
317-
}
318-
: undefined
338+
otherSearchQuery.value
319339
);
320340
search(tabSearch);
321341
});

0 commit comments

Comments
 (0)