Files
luos/resources/assets/js/home/modal/ModalCancelCase.vue

95 lines
2.1 KiB
Vue
Raw Normal View History

2020-12-10 15:19:14 +00:00
<template>
<div>
<b-modal
ref="modal-cancel-case"
hide-footer
:title="$t('ID_CANCEL_CASE')"
size="md"
>
<p>
You are tying to cancel the current case. Please be aware this action
cannot be undone
</p>
<div class="form-group">
<textarea
class="form-control"
name="comments"
ref="comment"
cols="80"
rows="5"
></textarea>
</div>
<div class="row">
<div class="col-md-12 ml-auto">
<input type="checkbox" class="" ref="send" />
<label class="form-check-label" for="sendEmail">
Send email to participants</label
>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" @click="cancelCase">
{{ $t("ID_CANCEL_CASE") }}
</button>
<button
type="button"
class="btn btn-secondary"
data-dismiss="modal"
@click="cancel"
>
{{ $t("ID_CANCEL") }}
</button>
</div>
</b-modal>
</div>
</template>
<script>
import api from "./../../api/index";
export default {
name: "ModalCancelCase",
components: {},
props: {
2021-05-13 14:45:40 +00:00
dataCase: Object,
2020-12-10 15:19:14 +00:00
},
mounted() {},
data() {
return {
filter: "",
categories: [],
categoriesFiltered: [],
TRANSLATIONS: window.config.TRANSLATIONS,
};
},
methods: {
classBtn(cls) {
return "btn v-btn-request " + cls;
},
show() {
this.$refs["modal-cancel-case"].show();
},
cancel() {
this.$refs["modal-cancel-case"].hide();
},
cancelCase() {
let that = this;
api.cases
2021-05-13 14:45:40 +00:00
.cancel(_.extend({}, this.dataCase, {
2020-12-10 15:19:14 +00:00
COMMENT: this.$refs["comment"].value,
SEND: this.$refs["send"].checked ? 1 : 0,
2021-05-13 14:45:40 +00:00
}))
2020-12-10 15:19:14 +00:00
.then((response) => {
2021-06-01 19:58:39 +00:00
if (response.status === 200) {
2020-12-10 15:19:14 +00:00
that.$refs["modal-cancel-case"].hide();
that.$parent.$parent.page = "todo";
}
});
},
},
};
</script>
<style>
</style>