Commit 211b1e7f by liwk

commit

1 parent 3e6327bb
...@@ -269,6 +269,10 @@ export default { ...@@ -269,6 +269,10 @@ export default {
params.sortColum = this.sortColum params.sortColum = this.sortColum
params.sort = this.sort === 'descending' ? 1 : 0 params.sort = this.sort === 'descending' ? 1 : 0
} }
Object.keys(params).map(key => {
if (!params[key]) delete params[key]
})
// console.log(params) // console.log(params)
this.getListApi(params).then(({ data }) => { this.getListApi(params).then(({ data }) => {
this.data = data[this.tableParams.listName] this.data = data[this.tableParams.listName]
......
...@@ -280,11 +280,9 @@ export default { ...@@ -280,11 +280,9 @@ export default {
}, },
watch: { watch: {
'date' (n, o) { 'date' (n, o) {
console.log(n) let [orderDateStart, orderDateEnd] = n
if (n) { this.searchObj.orderDateStart = orderDateStart ? `${orderDateStart} 00:00:00` : ''
this.searchObj.orderDateStart = `${n[0]} 00:00:00` this.searchObj.orderDateEnd = orderDateEnd ? `${orderDateEnd} 23:59:59` : ''
this.searchObj.orderDateEnd = `${n[1]} 23:59:59`
}
} }
}, },
methods: { methods: {
...@@ -299,9 +297,11 @@ export default { ...@@ -299,9 +297,11 @@ export default {
this.$refs.table.refreshTable() this.$refs.table.refreshTable()
}, },
reset () { reset () {
this.searchObj = {}
this.date = '' this.date = ''
this.search() this.searchObj = {}
this.$nextTick(() => {
this.search()
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!