Merge pull request 'fix : 修复费用分摊时间搜索' (#346) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/346
This commit is contained in:
2024-06-16 13:08:13 +00:00

View File

@@ -13,6 +13,35 @@ import { ElNotification} from "element-plus";
import {deleteAllocation} from "@/api/expense-manage";
const router = useRouter();
const shortcuts = [
{
text: '上周',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
},
},
{
text: '上月',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
return [start, end]
},
},
{
text: '三月前',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
return [start, end]
},
},
]
const searchConfig = reactive([
{
label: '分摊名称',
@@ -32,18 +61,23 @@ const searchConfig = reactive([
placeholder: '请选择分摊月份',
clearable: true,
type:'month',
valueFormat:"YYYY-MM-DD HH:mm:ss"
format: 'YYYY-MM',
valueFormat:"YYYY-MM"
},
colProps: {}
},
{
label: '生成时间',
prop: 'generationTime',
prop: 'dateValue',
component: 'el-date-picker',
props: {
placeholder: '请选择生成时间',
clearable: true,
type: 'daterange',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
shortcuts: shortcuts
},
colProps: {}
},
@@ -147,7 +181,13 @@ const tableConfig = reactive({
})
const search = (val) => {
tableConfig.params = {...val}
let obj = {...val}
if (obj.dateValue) {
obj.startGenerationTime = obj.dateValue[0]
obj.endGenerationTime = obj.dateValue[1]
delete obj.dateValue
}
tableConfig.params = obj
tableIns.value.refresh()
}
const handleAdd = () => {