✨ 限制应收账单毛利查询日期并调整筛选布局

This commit is contained in:
caojia
2026-11-17 16:51:53 +08:00
parent e2deccc65a
commit 8d45439931
3 changed files with 101 additions and 63 deletions
+1 -25
View File
@@ -264,6 +264,7 @@
import { listProfitAreaRules, listProfitCustomerOptions, listProfitOrders, listProfitSummary } from '@/api/report/profit'
// 提成功能暂停使用:import { deleteProfitCommissionRate, listProfitCommissionRates, saveProfitCommissionRate } from '@/api/report/profit'
import { parseTime } from '@/utils/bms'
import { defaultDateRange, maxEndDate } from '@/utils/reportDateRange'
import { ElMessage } from 'element-plus'
import { exportAsync } from '@/utils/excelExport'
// 提成功能暂停使用:import { ElMessageBox } from 'element-plus'
@@ -347,31 +348,6 @@ function createRateForm(row = {}) {
}
*/
function formatLocalDate(date) {
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 maxEndDate(start) {
const [year, month, day] = start.split('-').map(Number)
const lastDayOfNextMonth = new Date(year, month + 1, 0).getDate()
const limit = new Date(year, month, Math.min(day, lastDayOfNextMonth))
limit.setDate(limit.getDate() - 1)
return formatLocalDate(limit)
}
function defaultDateRange() {
const end = new Date()
const start = new Date(end.getFullYear(), end.getMonth(), end.getDate())
const endText = formatLocalDate(end)
start.setDate(start.getDate() - 31)
while (maxEndDate(formatLocalDate(start)) < endText) start.setDate(start.getDate() + 1)
return [formatLocalDate(start), endText]
}
function buildQuery(paged = true) {
const params = { ...query }
if (arBillStatus.value) params.arBillStatus = arBillStatus.value