Lines 3-9
Link Here
|
3 |
<div v-else id="vendors_list"> |
3 |
<div v-else id="vendors_list"> |
4 |
<Toolbar> |
4 |
<Toolbar> |
5 |
<ToolbarButton |
5 |
<ToolbarButton |
6 |
:to="{ name: 'VendorList' }" |
6 |
:to="{ name: 'VendorFormAdd' }" |
7 |
icon="plus" |
7 |
icon="plus" |
8 |
:title="$__('New vendor')" |
8 |
:title="$__('New vendor')" |
9 |
/> |
9 |
/> |
Lines 28-37
Link Here
|
28 |
import flatPickr from "vue-flatpickr-component" |
28 |
import flatPickr from "vue-flatpickr-component" |
29 |
import Toolbar from "../Toolbar.vue" |
29 |
import Toolbar from "../Toolbar.vue" |
30 |
import ToolbarButton from "../ToolbarButton.vue" |
30 |
import ToolbarButton from "../ToolbarButton.vue" |
31 |
import { inject, ref, reactive } from "vue" |
31 |
import { inject, ref } from "vue" |
32 |
import { APIClient } from "../../fetch/api-client.js" |
32 |
import { APIClient } from "../../fetch/api-client.js" |
33 |
import { storeToRefs } from "pinia" |
33 |
import { storeToRefs } from "pinia" |
34 |
import { build_url } from "../../composables/datatables" |
|
|
35 |
import KohaTable from "../KohaTable.vue" |
34 |
import KohaTable from "../KohaTable.vue" |
36 |
|
35 |
|
37 |
export default { |
36 |
export default { |
Lines 45-55
export default {
Link Here
|
45 |
|
44 |
|
46 |
const table = ref() |
45 |
const table = ref() |
47 |
|
46 |
|
48 |
// const filters = reactive({ |
|
|
49 |
// by_expired: false, |
50 |
// max_expiration_date: "", |
51 |
// by_mine: false, |
52 |
// }) |
53 |
return { |
47 |
return { |
54 |
vendors, |
48 |
vendors, |
55 |
get_lib_from_av, |
49 |
get_lib_from_av, |
Lines 58-64
export default {
Link Here
|
58 |
setConfirmationDialog, |
52 |
setConfirmationDialog, |
59 |
setMessage, |
53 |
setMessage, |
60 |
escape_str, |
54 |
escape_str, |
61 |
// filters, |
|
|
62 |
} |
55 |
} |
63 |
}, |
56 |
}, |
64 |
data() { |
57 |
data() { |
Lines 69-75
export default {
Link Here
|
69 |
tableOptions: { |
62 |
tableOptions: { |
70 |
columns: this.getTableColumns(), |
63 |
columns: this.getTableColumns(), |
71 |
options: { embed: "aliases,baskets,subscriptions" }, |
64 |
options: { embed: "aliases,baskets,subscriptions" }, |
72 |
url: () => this.table_url(), |
65 |
url: () => this.tableURL(), |
73 |
add_filters: true, |
66 |
add_filters: true, |
74 |
filters_options: { |
67 |
filters_options: { |
75 |
1: [ |
68 |
1: [ |
Lines 104-122
export default {
Link Here
|
104 |
error => {} |
97 |
error => {} |
105 |
) |
98 |
) |
106 |
}, |
99 |
}, |
107 |
doShow: function ({ id }, dt, event) { |
100 |
doShow({ id }, dt, event) { |
108 |
event.preventDefault() |
101 |
event.preventDefault() |
109 |
this.$router.push({ |
102 |
this.$router.push({ |
110 |
name: "VendorShow", |
103 |
name: "VendorShow", |
111 |
params: { vendor_id: id }, |
104 |
params: { vendor_id: id }, |
112 |
}) |
105 |
}) |
113 |
}, |
106 |
}, |
114 |
doEdit: function ({ id }, dt, event) { |
107 |
doEdit({ id }, dt, event) { |
115 |
this.$router.push({ |
108 |
this.$router.push({ |
116 |
name: "Home", |
109 |
name: "VendorFormAddEdit", |
|
|
110 |
params: { vendor_id: id }, |
117 |
}) |
111 |
}) |
118 |
}, |
112 |
}, |
119 |
doDelete: function (vendor, dt, event) { |
113 |
doDelete(vendor, dt, event) { |
120 |
this.setConfirmationDialog( |
114 |
this.setConfirmationDialog( |
121 |
{ |
115 |
{ |
122 |
title: this.$__( |
116 |
title: this.$__( |
Lines 143-157
export default {
Link Here
|
143 |
} |
137 |
} |
144 |
) |
138 |
) |
145 |
}, |
139 |
}, |
146 |
doSelect: function (vendor, dt, event) { |
140 |
doSelect(vendor, dt, event) { |
147 |
this.$emit("select-vendor", vendor.id) |
141 |
this.$emit("select-vendor", vendor.id) |
148 |
this.$emit("close") |
142 |
this.$emit("close") |
149 |
}, |
143 |
}, |
150 |
table_url: function () { |
144 |
tableURL() { |
151 |
let url = "/api/v1/acquisitions/vendors" |
145 |
let url = "/api/v1/acquisitions/vendors" |
152 |
return url |
146 |
return url |
153 |
}, |
147 |
}, |
154 |
getTableColumns: function () { |
148 |
getTableColumns() { |
155 |
const escape_str = this.escape_str |
149 |
const escape_str = this.escape_str |
156 |
const get_lib_from_av = this.get_lib_from_av |
150 |
const get_lib_from_av = this.get_lib_from_av |
157 |
|
151 |
|
Lines 161-167
export default {
Link Here
|
161 |
data: "me.name:me.id", |
155 |
data: "me.name:me.id", |
162 |
searchable: true, |
156 |
searchable: true, |
163 |
orderable: true, |
157 |
orderable: true, |
164 |
render: function (data, type, row, meta) { |
158 |
render(data, type, row, meta) { |
165 |
return ( |
159 |
return ( |
166 |
'<a href="/cgi-bin/koha/vendors/' + |
160 |
'<a href="/cgi-bin/koha/vendors/' + |
167 |
row.id + |
161 |
row.id + |
Lines 176-182
export default {
Link Here
|
176 |
data: "active", |
170 |
data: "active", |
177 |
searchable: true, |
171 |
searchable: true, |
178 |
orderable: true, |
172 |
orderable: true, |
179 |
render: function (data, type, row, meta) { |
173 |
render(data, type, row, meta) { |
180 |
return escape_str( |
174 |
return escape_str( |
181 |
row.active ? __("Active") : __("Inactive") |
175 |
row.active ? __("Active") : __("Inactive") |
182 |
) |
176 |
) |
Lines 202-208
export default {
Link Here
|
202 |
data: "baskets", |
196 |
data: "baskets", |
203 |
searchable: false, |
197 |
searchable: false, |
204 |
orderable: true, |
198 |
orderable: true, |
205 |
render: function (data, type, row, meta) { |
199 |
render(data, type, row, meta) { |
206 |
return row.baskets.length |
200 |
return row.baskets.length |
207 |
? '<a href="/cgi-bin/koha/vendors/' + |
201 |
? '<a href="/cgi-bin/koha/vendors/' + |
208 |
row.id + |
202 |
row.id + |
Lines 219-225
export default {
Link Here
|
219 |
data: "subscriptions", |
213 |
data: "subscriptions", |
220 |
searchable: false, |
214 |
searchable: false, |
221 |
orderable: true, |
215 |
orderable: true, |
222 |
render: function (data, type, row, meta) { |
216 |
render(data, type, row, meta) { |
223 |
return row.subscriptions.length |
217 |
return row.subscriptions.length |
224 |
? '<a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=' + |
218 |
? '<a href="/cgi-bin/koha/serials/serials-search.pl?bookseller_filter=' + |
225 |
row.name + |
219 |
row.name + |