2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 03:29:00 +00:00

fix: Set filters from route in ListView

This commit is contained in:
Faris Ansari 2019-12-11 17:54:02 +05:30
parent 185b87bc2b
commit 865bf1f60e
3 changed files with 6 additions and 5 deletions

View File

@ -31,8 +31,9 @@ module.exports = {
condition: doc => !doc.isNew(), condition: doc => !doc.isNew(),
action: customer => { action: customer => {
router.push({ router.push({
path: `/list/SalesInvoice`, name: 'ListView',
query: { params: {
doctype: 'SalesInvoice',
filters: { filters: {
customer: customer.name customer: customer.name
} }

View File

@ -46,7 +46,7 @@ export default {
Icon, Icon,
FilterDropdown FilterDropdown
}, },
mounted() { activated() {
if (typeof this.filters === 'object') { if (typeof this.filters === 'object') {
this.$refs.filterDropdown.setFilter(this.filters); this.$refs.filterDropdown.setFilter(this.filters);
} }

View File

@ -54,10 +54,10 @@ const routes = [
}, },
props: { props: {
default: route => { default: route => {
const { doctype } = route.params; const { doctype, filters } = route.params;
return { return {
doctype, doctype,
filters: route.query.filters filters
}; };
}, },
edit: route => route.query edit: route => route.query