From 41a80f9794a8004770e4e44afdc2479f8b7ec7b0 Mon Sep 17 00:00:00 2001 From: caojia <1301869380@qq.com> Date: Wed, 11 Nov 2026 14:31:08 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=AE=BE=E7=BD=AE=E5=BA=94?= =?UTF-8?q?=E6=94=B6=E8=B4=A6=E5=8D=95=E9=BB=98=E8=AE=A4=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bms-front/src/views/report/arProfit/index.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bms-front/src/views/report/arProfit/index.vue b/bms-front/src/views/report/arProfit/index.vue index b4138c16..aaf2ade4 100644 --- a/bms-front/src/views/report/arProfit/index.vue +++ b/bms-front/src/views/report/arProfit/index.vue @@ -187,7 +187,7 @@ const salesOptions = ref([]) const salesLoading = ref(false) let salesSearchVersion = 0 const areaRules = ref({}) -const dateRange = ref([]) +const dateRange = ref(defaultBillDateRange()) const pageNum = ref(1), pageSize = ref(10), total = ref(0), rows = ref([]), loading = ref(false) const summaries = ref([]), summaryLoaded = ref(false) const detailsVisible = ref(false), detailsLoading = ref(false), details = ref([]), detailsTotal = ref(0) @@ -211,9 +211,18 @@ const missingRates = ref([]), missingTotal = ref(0), missingPage = ref(1), missi const confirmVisible = ref(false), confirmForm = reactive({ writeoffId: null, billNo: '', rate: null, remark: '' }) const writeoffRatesVisible = ref(false), writeoffRatesLoading = ref(false), writeoffRates = ref([]) +function formatLocalDate(offset) { + const date = new Date() + date.setDate(date.getDate() + offset) + const year = date.getFullYear() + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + return `${year}-${month}-${day}` +} +function defaultBillDateRange() { return [formatLocalDate(-30), formatLocalDate(0)] } function params() { return { ...query, beginBillDate: dateRange.value?.[0], endBillDate: dateRange.value?.[1] } } function search() { pageNum.value = 1; loadRows(); loadSummary() } -function reset() { Object.assign(query, { customerId: null, salesUserId: null, billNo: '', status: '' }); dateRange.value = []; search() } +function reset() { Object.assign(query, { customerId: null, salesUserId: null, billNo: '', status: '' }); dateRange.value = defaultBillDateRange(); search() } function handleSalesInput() { salesSearchVersion++ salesOptions.value = []