| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const { receiptPaymentDate, ...rest } = searchForm; |
| | | receiptPaymentHistoryListPage({ ...rest, ...page }).then((res) => { |
| | | const { receiptPaymentDate, receiptPaymentDateStart, receiptPaymentDateEnd, ...rest } = searchForm; |
| | | // 构建请求参数,只包含有效的日期字段 |
| | | const params = { ...rest, ...page }; |
| | | // 只有当日期字段有值时才添加到参数中 |
| | | if (receiptPaymentDateStart) { |
| | | params.receiptPaymentDateStart = receiptPaymentDateStart; |
| | | } |
| | | if (receiptPaymentDateEnd) { |
| | | params.receiptPaymentDateEnd = receiptPaymentDateEnd; |
| | | } |
| | | receiptPaymentHistoryListPage(params).then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.records; |
| | | page.total = res.total; |
| | | }); |
| | | }).catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeMainTable1 = (param) => { |
| | |
| | | }; |
| | | |
| | | const changeDateRange = (date) => { |
| | | if (date) { |
| | | if (date && date.length === 2) { |
| | | searchForm.receiptPaymentDateStart = dayjs(date[0]).format( |
| | | "YYYY-MM-DD 00:00:00" |
| | | ); |
| | | searchForm.receiptPaymentDateEnd = dayjs(date[1]).format( |
| | | "YYYY-MM-DD 23:59:59" |
| | | ); |
| | | getList(); |
| | | } else { |
| | | // 日期为空时,删除日期字段 |
| | | delete searchForm.receiptPaymentDateStart; |
| | | delete searchForm.receiptPaymentDateEnd; |
| | | } |
| | | getList(); |
| | | }; |
| | | |
| | | const clearRange = () => { |
| | | searchForm.receiptPaymentDate = []; |
| | | searchForm.receiptPaymentDateStart = undefined; |
| | | searchForm.receiptPaymentDateEnd = undefined; |
| | | searchForm.receiptPaymentDate = null; |
| | | // 直接删除字段,而不是设置为 undefined |
| | | delete searchForm.receiptPaymentDateStart; |
| | | delete searchForm.receiptPaymentDateEnd; |
| | | getList(); |
| | | }; |
| | | |