View | Details | Raw Unified | Return to bug 40483
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue (-7 / +9 lines)
Lines 64-70 export default { Link Here
64
            fp_config: flatpickr_defaults,
64
            fp_config: flatpickr_defaults,
65
            vendor_count: 0,
65
            vendor_count: 0,
66
            initialized: false,
66
            initialized: false,
67
            searchTerm: null,
68
            tableOptions: {
67
            tableOptions: {
69
                columns: this.getTableColumns(),
68
                columns: this.getTableColumns(),
70
                options: {
69
                options: {
Lines 73-78 export default { Link Here
73
                url: () => this.tableURL(),
72
                url: () => this.tableURL(),
74
                table_settings: this.vendorTableSettings,
73
                table_settings: this.vendorTableSettings,
75
                add_filters: true,
74
                add_filters: true,
75
                default_filters: {},
76
                filters_options: {
76
                filters_options: {
77
                    1: [
77
                    1: [
78
                        { _id: 0, _str: this.$__("Inactive") },
78
                        { _id: 0, _str: this.$__("Inactive") },
Lines 118-125 export default { Link Here
118
    beforeRouteEnter(to, from, next) {
118
    beforeRouteEnter(to, from, next) {
119
        next(vm => {
119
        next(vm => {
120
            vm.getVendorCount().then(() => (vm.initialized = true));
120
            vm.getVendorCount().then(() => (vm.initialized = true));
121
            if (to.query.supplier) {
121
            const searchTerm = to.query.supplier;
122
                vm.searchTerm = to.query.supplier;
122
            if (searchTerm) {
123
                vm.tableOptions.default_filters = {
124
                    "-and": [
125
                        { "me.name": { like: `%${searchTerm}%` } },
126
                        { "aliases.alias": { like: `%${searchTerm}%` } },
127
                    ],
128
                };
123
            }
129
            }
124
        });
130
        });
125
    },
131
    },
Lines 183-191 export default { Link Here
183
        },
189
        },
184
        tableURL() {
190
        tableURL() {
185
            let url = "/api/v1/acquisitions/vendors";
191
            let url = "/api/v1/acquisitions/vendors";
186
            if (this.searchTerm) {
187
                url += "?name=" + this.searchTerm;
188
            }
189
            return url;
192
            return url;
190
        },
193
        },
191
        getTableColumns() {
194
        getTableColumns() {
192
- 

Return to bug 40483