Interface SAV
This commit is contained in:
@@ -12,8 +12,9 @@ const sendBtn = ref()
|
|||||||
const sidePanel = ref()
|
const sidePanel = ref()
|
||||||
const standardMessage = ref([])
|
const standardMessage = ref([])
|
||||||
|
|
||||||
const replyOption = ref({private_message: null, notification: 'Réponse envoyée'})
|
const replyOption = ref({private_message: null, notification: 'Réponse envoyée', sms: false, email: true})
|
||||||
const quill = ref(null)
|
const quill = ref(null)
|
||||||
|
const attachedDoc = ref(null)
|
||||||
|
|
||||||
const sendReply = async () => {
|
const sendReply = async () => {
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ const sendReply = async () => {
|
|||||||
|
|
||||||
await moveToBottom("body-modal-to-scroll")
|
await moveToBottom("body-modal-to-scroll")
|
||||||
|
|
||||||
const newMessage = await TicketApi.saveMessage(storeTicket.idTicket, quill.value, replyOption.value)
|
const newMessage = await TicketApi.saveMessage(storeTicket.idTicket, quill.value, attachedDoc.value, replyOption.value)
|
||||||
|
|
||||||
if (newMessage.result === 'OK') {
|
if (newMessage.result === 'OK') {
|
||||||
|
|
||||||
@@ -89,10 +90,35 @@ const setQuillContent = (val) => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="my-2">
|
<div class="my-4 row d-flex">
|
||||||
<a href="#" @click="openPanel()" class="btn btn-outline-secondary me-2"><i
|
|
||||||
class="fa-solid fa-comment-dots"></i> Messages type</a>
|
<div class="col-auto align-self-center">
|
||||||
<a href="javascript:void(0);" class="btn btn-outline-primary me-2"><i class="fa-solid fa-paperclip"></i></a>
|
<a href="#" @click="openPanel()" class="btn btn-outline-secondary me-2"><i
|
||||||
|
class="fa-solid fa-comment-dots"></i> Messages type</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto align-self-center">
|
||||||
|
<input type="file" id="attached_doc" name="attached_doc" class="form-control"
|
||||||
|
style="display: inline !important;width: auto!important;" ref="attachedDoc">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<a href="#" @click="attachedDoc.click()" class="btn btn-outline-primary me-2"><i class="fa-solid fa-paperclip"></i></a>
|
||||||
|
{{attachedDoc.files[0].name}}
|
||||||
|
<input type="file" id="attached_doc" name="attached_doc" class="invisible" ref="attachedDoc" multiple>
|
||||||
|
-->
|
||||||
|
<div class="col-auto align-self-center">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" name="sendSms" value="yes" id="sendSms" v-model="replyOption.sms">
|
||||||
|
<label class="form-check-label" for="sendSms">SMS</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto align-self-center">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" name="sendEmail" value="yes" id="sendEmail" v-model="replyOption.email">
|
||||||
|
<label class="form-check-label" for="sendEmail">Email</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<QuillEditor theme="snow" v-model:content="quill" contentType="html" placeholder="Entrer votre réponse"/>
|
<QuillEditor theme="snow" v-model:content="quill" contentType="html" placeholder="Entrer votre réponse"/>
|
||||||
@@ -102,6 +128,7 @@ const setQuillContent = (val) => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
|
|
||||||
return response.json();
|
return response.json();
|
||||||
},
|
},
|
||||||
async saveMessage(id, quill, replyOption) {
|
async saveMessage(id, quill, attachedDoc, replyOption) {
|
||||||
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=saveMessage'
|
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=saveMessage'
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
console.log(apiUrl)
|
console.log(apiUrl)
|
||||||
@@ -54,6 +54,13 @@ export default {
|
|||||||
const postData = new FormData();
|
const postData = new FormData();
|
||||||
postData.append("id_business", id);
|
postData.append("id_business", id);
|
||||||
postData.append("quill", quill);
|
postData.append("quill", quill);
|
||||||
|
|
||||||
|
if (attachedDoc !== null) {
|
||||||
|
for (const file of attachedDoc.files) {
|
||||||
|
postData.append('attached_doc', file, file.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
postData.append("data", JSON.stringify(replyOption));
|
postData.append("data", JSON.stringify(replyOption));
|
||||||
|
|
||||||
const response = await fetch(apiUrl, {
|
const response = await fetch(apiUrl, {
|
||||||
|
|||||||
Reference in New Issue
Block a user