|
Lines 57-62
export default {
Link Here
|
| 57 |
const AVStore = inject("AVStore") |
57 |
const AVStore = inject("AVStore") |
| 58 |
const { get_lib_from_av, map_av_dt_filter } = AVStore |
58 |
const { get_lib_from_av, map_av_dt_filter } = AVStore |
| 59 |
|
59 |
|
|
|
60 |
const { setWarning, setMessage } = inject("mainStore") |
| 61 |
|
| 60 |
const table_id = "agreement_list" |
62 |
const table_id = "agreement_list" |
| 61 |
useDataTable(table_id) |
63 |
useDataTable(table_id) |
| 62 |
|
64 |
|
|
Lines 66-71
export default {
Link Here
|
| 66 |
map_av_dt_filter, |
68 |
map_av_dt_filter, |
| 67 |
table_id, |
69 |
table_id, |
| 68 |
logged_in_user, |
70 |
logged_in_user, |
|
|
71 |
setWarning, |
| 72 |
setMessage, |
| 69 |
} |
73 |
} |
| 70 |
}, |
74 |
}, |
| 71 |
data: function () { |
75 |
data: function () { |
|
Lines 121-134
export default {
Link Here
|
| 121 |
) |
125 |
) |
| 122 |
}, |
126 |
}, |
| 123 |
delete_agreement: function (agreement_id) { |
127 |
delete_agreement: function (agreement_id) { |
| 124 |
this.$router.push( |
128 |
this.setWarning(this.$__("Are you sure you want to remove this agreement?"), () => { |
| 125 |
"/cgi-bin/koha/erm/agreements/delete/" + agreement_id |
129 |
const client = APIClient.erm |
| 126 |
) |
130 |
client.agreements.delete(agreement_id).then( |
|
|
131 |
success => { |
| 132 |
this.setMessage(this.$__("Agreement deleted")) |
| 133 |
this.refresh_table() |
| 134 |
}, |
| 135 |
error => {} |
| 136 |
) |
| 137 |
}) |
| 127 |
}, |
138 |
}, |
| 128 |
select_agreement: function (agreement_id) { |
139 |
select_agreement: function (agreement_id) { |
| 129 |
this.$emit("select-agreement", agreement_id) |
140 |
this.$emit("select-agreement", agreement_id) |
| 130 |
this.$emit("close") |
141 |
this.$emit("close") |
| 131 |
}, |
142 |
}, |
|
|
143 |
refresh_table: function(){ |
| 144 |
$("#" + this.table_id) |
| 145 |
.DataTable() |
| 146 |
.ajax.url(this.datatable_url) |
| 147 |
.draw() |
| 148 |
}, |
| 132 |
filter_table: async function () { |
149 |
filter_table: async function () { |
| 133 |
if (this.before_route_entered) { |
150 |
if (this.before_route_entered) { |
| 134 |
let new_route = build_url( |
151 |
let new_route = build_url( |
|
Lines 143-152
export default {
Link Here
|
| 143 |
.toISOString() |
160 |
.toISOString() |
| 144 |
.substring(0, 10) |
161 |
.substring(0, 10) |
| 145 |
} |
162 |
} |
| 146 |
$("#" + this.table_id) |
163 |
this.refresh_table() |
| 147 |
.DataTable() |
|
|
| 148 |
.ajax.url(this.datatable_url) |
| 149 |
.draw() |
| 150 |
}, |
164 |
}, |
| 151 |
table_url: function () {}, |
165 |
table_url: function () {}, |
| 152 |
build_datatable: function () { |
166 |
build_datatable: function () { |