This commit is contained in:
Swift
2024-02-25 01:32:03 +03:30
parent 994e7f8d97
commit 0867b7ab89
2 changed files with 40 additions and 12 deletions
+32 -8
View File
@@ -1,5 +1,9 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">شکایت</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{ name: 'admin-complaint' }">برگشت به صفحه قبل</CButton>
</CustomSubHeader>
<div class="m-3">
<div class="row ui-box p-3">
<h4>شکایت</h4>
@@ -49,15 +53,33 @@
</div>
</div>
</div>
<hr class="mt-3"/>
<div v-if="hasPermission('apply')" >
<hr class="mt-3" />
<div v-if="hasPermission('apply')">
<div class="d-flex mt-3" style="align-items: center">
<h5 style="text-wrap: nowrap; margin-left: 10px;">نام و نام خانوادگی: </h5>
<p>{{ complaint?.user?.first_name + " " + complaint?.user?.last_name }}</p>
</div>
<div class="d-flex mt-3" style="align-items: center">
<h5 style="text-wrap: nowrap; margin-left: 10px;">توضیح :</h5>
<el-input v-model="desc" type="textarea" rows="3"></el-input>
</div>
<div class="d-flex mt-3" style="align-items: center">
<h5>پیگیری شده :</h5>
<el-checkbox v-model="complete" class="p-2"></el-checkbox>
</div>
<div class="d-flex mt-3" style="align-items: center; justify-self: center;">
<el-button class="p-2 w-20 m-auto" type="primary" @click="applyComplaint">تایید</el-button>
<div class="d-flex mt-3" style="align-items: center; justify-self: center">
<el-button class="p-2 w-20 m-auto" type="primary" @click="applyComplaint">تایید</el-button>
</div>
</div>
<div v-else>
<div v-if="complaint?.user" class="d-flex mt-3" style="align-items: center">
<h5 style="text-wrap: nowrap; margin-left: 10px;">نام و نام خانوادگی: </h5>
<p>{{ complaint.user?.first_name + " " + complaint.user?.last_name }}</p>
</div>
<div v-if="complaint?.desc" class="d-flex mt-3" style="align-items: center">
<h5 style="text-wrap: nowrap; margin-left: 10px;">توضیح: </h5>
<p>{{ complaint.desc }}</p>
</div>
</div>
</div>
</div>
@@ -74,7 +96,8 @@ export default {
data() {
return {
complaint: null,
complete: false
complete: false,
desc:''
}
},
@@ -83,6 +106,8 @@ export default {
this.$axios.get(`/api/admin/complaint/${this.$route.params.item}`).then(res => {
this.complaint = res.data
this.complete = res.data.complete
this.desc = res.data.desc
})
},
methods: {
@@ -91,7 +116,7 @@ export default {
else return false
},
applyComplaint() {
this.$axios.put(`/api/admin/complaint/${this.$route.params.item}`, { complete: this.complete }).then(res => {
this.$axios.put(`/api/admin/complaint/${this.$route.params.item}`, { complete: this.complete, desc: this.desc }).then(res => {
this.complaint = res.data
this.complete = res.data.complete
this.$router.push('/admin/complaint')
@@ -126,8 +151,7 @@ export default {
background-color: white;
border-radius: 10px;
}
.w-20{
.w-20 {
width: 20%;
}
</style>