Lines 50-56
Link Here
|
50 |
<script> |
50 |
<script> |
51 |
import flatPickr from "vue-flatpickr-component" |
51 |
import flatPickr from "vue-flatpickr-component" |
52 |
import Toolbar from "./AgreementsToolbar.vue" |
52 |
import Toolbar from "./AgreementsToolbar.vue" |
53 |
import { inject, ref } from "vue" |
53 |
import { inject, ref, reactive } from "vue" |
54 |
import { APIClient } from "../../fetch/api-client.js" |
54 |
import { APIClient } from "../../fetch/api-client.js" |
55 |
import { storeToRefs } from "pinia" |
55 |
import { storeToRefs } from "pinia" |
56 |
import { build_url } from "../../composables/datatables" |
56 |
import { build_url } from "../../composables/datatables" |
Lines 68-73
export default {
Link Here
|
68 |
|
68 |
|
69 |
const table = ref() |
69 |
const table = ref() |
70 |
|
70 |
|
|
|
71 |
const filters = reactive({ |
72 |
by_expired: false, |
73 |
max_expiration_date: "", |
74 |
by_mine: "", |
75 |
}) |
76 |
|
71 |
return { |
77 |
return { |
72 |
vendors, |
78 |
vendors, |
73 |
get_lib_from_av, |
79 |
get_lib_from_av, |
Lines 78-101
export default {
Link Here
|
78 |
setMessage, |
84 |
setMessage, |
79 |
escape_str, |
85 |
escape_str, |
80 |
agreement_table_settings, |
86 |
agreement_table_settings, |
|
|
87 |
filters, |
81 |
} |
88 |
} |
82 |
}, |
89 |
}, |
83 |
data: function () { |
90 |
data: function () { |
|
|
91 |
this.filters = { |
92 |
by_expired: this.$route.query.by_expired || false, |
93 |
max_expiration_date: this.$route.query.max_expiration_date || "", |
94 |
by_mine: this.$route.query.by_mine || false, |
95 |
} |
96 |
let filters = this.filters |
97 |
|
98 |
let logged_in_user = this.logged_in_user |
84 |
return { |
99 |
return { |
85 |
fp_config: flatpickr_defaults, |
100 |
fp_config: flatpickr_defaults, |
86 |
agreements: [], |
101 |
agreements: [], |
87 |
initialized: false, |
102 |
initialized: false, |
88 |
filters: { |
|
|
89 |
by_expired: this.$route.query.by_expired || false, |
90 |
max_expiration_date: |
91 |
this.$route.query.max_expiration_date || "", |
92 |
by_mine: this.$route.query.by_mine || false, |
93 |
}, |
94 |
before_route_entered: false, |
103 |
before_route_entered: false, |
95 |
building_table: false, |
104 |
building_table: false, |
96 |
tableOptions: { |
105 |
tableOptions: { |
97 |
columns: this.getTableColumns(), |
106 |
columns: this.getTableColumns(), |
98 |
options: { embed: "vendor" }, |
107 |
options: { embed: "user_roles,vendor" }, |
99 |
url: () => this.table_url(), |
108 |
url: () => this.table_url(), |
100 |
table_settings: this.agreement_table_settings, |
109 |
table_settings: this.agreement_table_settings, |
101 |
add_filters: true, |
110 |
add_filters: true, |
Lines 122-127
export default {
Link Here
|
122 |
0: ["show"], |
131 |
0: ["show"], |
123 |
"-1": ["edit", "delete"], |
132 |
"-1": ["edit", "delete"], |
124 |
}, |
133 |
}, |
|
|
134 |
default_filters: { |
135 |
"user_roles.user_id": function () { |
136 |
return filters.by_mine |
137 |
? logged_in_user.borrowernumber |
138 |
: "" |
139 |
}, |
140 |
}, |
125 |
}, |
141 |
}, |
126 |
} |
142 |
} |
127 |
}, |
143 |
}, |
128 |
- |
|
|