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:
@@ -13,6 +13,35 @@ import { ElNotification} from "element-plus";
|
|||||||
import {deleteAllocation} from "@/api/expense-manage";
|
import {deleteAllocation} from "@/api/expense-manage";
|
||||||
|
|
||||||
const router = useRouter();
|
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([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
label: '分摊名称',
|
label: '分摊名称',
|
||||||
@@ -32,18 +61,23 @@ const searchConfig = reactive([
|
|||||||
placeholder: '请选择分摊月份',
|
placeholder: '请选择分摊月份',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
type:'month',
|
type:'month',
|
||||||
valueFormat:"YYYY-MM-DD HH:mm:ss"
|
format: 'YYYY-MM',
|
||||||
|
valueFormat:"YYYY-MM"
|
||||||
},
|
},
|
||||||
colProps: {}
|
colProps: {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '生成时间',
|
label: '生成时间',
|
||||||
prop: 'generationTime',
|
prop: 'dateValue',
|
||||||
component: 'el-date-picker',
|
component: 'el-date-picker',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请选择生成时间',
|
|
||||||
clearable: true,
|
clearable: true,
|
||||||
|
type: 'daterange',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
valueFormat: 'YYYY-MM-DD',
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
shortcuts: shortcuts
|
||||||
},
|
},
|
||||||
colProps: {}
|
colProps: {}
|
||||||
},
|
},
|
||||||
@@ -147,7 +181,13 @@ const tableConfig = reactive({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const search = (val) => {
|
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()
|
tableIns.value.refresh()
|
||||||
}
|
}
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user