From ab1c06e631e32901f7eba5ad8bdafe95e0821f60 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Tue, 10 Mar 2026 16:47:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=B5=81=E6=B0=B4=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=9F=A5=E8=AF=A2=E9=A1=B5=E9=9D=A2=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/detail/DetailQuery.vue | 116 +++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue b/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue index ea435f1..20846fe 100644 --- a/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue +++ b/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue @@ -25,6 +25,36 @@ import { getBankStatementDetail } from "@/api/ccdiProjectBankStatement"; +const createDefaultQueryParams = (projectId) => ({ + projectId, + pageNum: 1, + pageSize: 10, + tabType: "all", + transactionStartTime: "", + transactionEndTime: "", + counterpartyName: "", + counterpartyNameEmpty: false, + userMemo: "", + userMemoEmpty: false, + ourSubjects: [], + ourBanks: [], + ourAccounts: [], + amountMin: "", + amountMax: "", + counterpartyAccount: "", + counterpartyAccountEmpty: false, + transactionType: "", + transactionTypeEmpty: false, + orderBy: "trxDate", + orderDirection: "desc", +}); + +const createEmptyOptionData = () => ({ + ourSubjectOptions: [], + ourBankOptions: [], + ourAccountOptions: [], +}); + export default { name: "DetailQuery", props: { @@ -41,9 +71,91 @@ export default { }), }, }, + data() { + return { + loading: false, + optionsLoading: false, + activeTab: "all", + dateRange: [], + list: [], + total: 0, + queryParams: createDefaultQueryParams(this.projectId), + optionData: createEmptyOptionData(), + }; + }, + created() { + this.getList(); + this.getOptions(); + }, + watch: { + projectId() { + this.syncProjectId(); + this.getOptions(); + this.getList(); + }, + }, methods: { - getList() {}, - getOptions() {}, + async getList() { + this.syncProjectId(); + if (!this.queryParams.projectId) { + this.list = []; + this.total = 0; + return; + } + + this.loading = true; + try { + const res = await listBankStatement(this.queryParams); + this.list = res.rows || []; + this.total = res.total || 0; + } catch (error) { + this.list = []; + this.total = 0; + console.error("加载流水明细失败", error); + } finally { + this.loading = false; + } + }, + async getOptions() { + this.syncProjectId(); + if (!this.queryParams.projectId) { + this.optionData = createEmptyOptionData(); + return; + } + + this.optionsLoading = true; + try { + const res = await getBankStatementOptions(this.queryParams.projectId); + const data = res.data || {}; + this.optionData = { + ourSubjectOptions: data.ourSubjectOptions || [], + ourBankOptions: data.ourBankOptions || [], + ourAccountOptions: data.ourAccountOptions || [], + }; + } catch (error) { + this.optionData = createEmptyOptionData(); + console.error("加载流水筛选项失败", error); + } finally { + this.optionsLoading = false; + } + }, + syncProjectId() { + this.queryParams.projectId = this.projectId; + this.queryParams.tabType = this.activeTab; + }, + handleQuery() { + this.queryParams.pageNum = 1; + this.queryParams.tabType = this.activeTab; + this.getList(); + }, + resetQuery() { + this.activeTab = "all"; + this.dateRange = []; + this.queryParams = createDefaultQueryParams(this.projectId); + this.syncProjectId(); + this.getOptions(); + this.getList(); + }, handleExport() { void listBankStatement; void getBankStatementOptions;