✨ 限制应收账单毛利查询日期并调整筛选布局
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user