This commit is contained in:
Swift
2024-02-02 12:35:35 +03:30
parent 980763fd6e
commit b14c480f17
7 changed files with 211 additions and 8 deletions
+4 -4
View File
@@ -85,10 +85,10 @@
:key="index + Math.random() + 2"
class="ml-2 mb-2"
style="cursor: pointer"
:type="hasPermission(item.value) ? 'success' : 'primary'"
:type="hasPermission(item?.value) ? 'success' : 'primary'"
disable-transitions
@click="addPermission(item.value)"
>{{ item.name }}
@click="addPermission(item?.value)"
>{{ item.name || item.value }}
</el-tag>
</div>
</CCardBody>
@@ -223,7 +223,7 @@ export default {
})
},
getPermissionName(value) {
return this.permissions.filter(item => item.value === value)[0].name
return this.permissions.filter(item => item.value === value)[0]?.name || value
},
addPermission(val) {
if (!this.admin.permissions.includes(val)) this.admin.permissions.push(val)
+57
View File
@@ -0,0 +1,57 @@
<template>
<div>
</div>
</template>
<script>
export default {
name: 'AdminComplaintDetails',
layout: 'admin',
async asyncData({ $axios, params, query, error }) {
},
data() {
return {
}
},
computed: {
},
methods: {
}
}
</script>
<style lang="scss">
.progressBar {
.el-progress-bar__inner {
left: auto;
right: 0;
text-align: left;
}
}
.btn-upload {
background-color: cornflowerblue;
padding: .5rem 1rem;
border-radius: .5rem;
cursor: pointer;
color: white;
float: left;
}
.space {
margin: 5rem;
}
</style>
+90
View File
@@ -0,0 +1,90 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0"> شکایات </CBreadcrumb>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<CIcon name="cil-grid" />
شکایات
</slot>
</CCardHeader>
<CCardBody>
<el-table :data="filteredByType" style="width: 100%">
<el-table-column type="index" label="#"> </el-table-column>
<el-table-column prop="caption" label="کد ملی" width="">
<template slot-scope="scope">
<span class="singleLineTxt" :title="scope.row.national"> {{ scope.row.national }} </span>
</template>
</el-table-column>
<el-table-column prop="caption" label="متن" width="">
<template slot-scope="scope">
<span class="singleLineTxt" :title="scope.row.caption"> {{ scope.row.caption }} </span>
</template>
</el-table-column>
<el-table-column prop="caption" label="تاریخ ایجاد" width="">
<template slot-scope="scope">
<span> {{ $jDate(scope.row.created_at) }} </span>
</template>
</el-table-column>
<el-table-column prop="caption" label="شماره تماس" width="">
<template slot-scope="scope">
<span class="singleLineTxt" :title="scope.row.phoneNumber"> {{ scope.row.phoneNumber }} </span>
</template>
</el-table-column>
<el-table-column prop="caption" label="ایمیل" width="">
<template slot-scope="scope">
<span class="singleLineTxt" :title="scope.row.email"> {{ scope.row.email }} </span>
</template>
</el-table-column>
<el-table-column label="ویرایش" width="110" align="center">
<template slot-scope="scope">
<CButton
:key="scope.row._id + type"
color="success"
variant="outline"
:to="{ name: 'admin-complaint-details', params: { item: scope.row._id } }"
>
<i class="fal fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
name: 'AdminComplaintsList',
layout: 'admin',
async asyncData({ $axios, error }) {
},
data() {
return {
}
},
computed: {
},
methods: {
}
}
</script>
+9 -4
View File
@@ -2,9 +2,6 @@
<div class="bg-img-in">
<user-dashboard-container page-class="complaint" panel-title="ثبت شکایت" class="panelx">
<div class="row">
<div class="col-lg-6 col-sm-12 p-3">
<p>{{ config.complaint }}</p>
</div>
<div class="col-lg-6 col-sm-12 p-3">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 178.678 47.133">
@@ -151,6 +148,10 @@
<p>مشتری گرامی شما میتوانید شکایت خود را از طریق فرم زیر با ما در میان بگذارید</p>
</div>
<div class="col-lg-6 col-sm-12 p-3">
<p>{{ config.complaint }}</p>
</div>
<div class="col-lg-4 col-sm-12 mt-4">
<el-input v-model="fullName" placeholder="نام و نام خانوادگی"></el-input>
@@ -180,6 +181,8 @@
<h5 class="mb-2">انتخاب نحوه پاسخ دهی:</h5>
<el-switch
v-model="callType"
inactive-color="#03fc3d"
active-color="#0367fc"
style="display: flex; justify-content: space-evenly"
active-text="تماس تلفنی"
inactive-text="ارسال ایمیل"
@@ -218,7 +221,9 @@ export default {
},
mounted() {},
methods: {
sendForm() {}
sendForm() {
}
}
}
</script>
+28
View File
@@ -0,0 +1,28 @@
const { body, validationResult } = require('express-validator')
const Complaint = require('../models/Complaint')
const { _sr } = require('../plugins/serverResponses')
const { checkValidations } = require('../plugins/controllersHelperFunctions')
const _faSr = _sr.fa
module.exports.create = [
[
body('fullName').notEmpty().withMessage(_faSr.required.name),
body('national').notEmpty().withMessage(_faSr.required.national_code),
body('phoneNumber').notEmpty().withMessage(_faSr.required.phone_number),
body('email').notEmpty().withMessage(_faSr.required.email),
body('deviceNumber').notEmpty().withMessage(_faSr.required.field),
body('receptionCode').notEmpty().withMessage(_faSr.required.field),
body('caption').notEmpty().withMessage(_faSr.required.caption),
body('callType').notEmpty().withMessage(_faSr.required.field),
],
checkValidations(validationResult),
(req, res) => {
const
}
]
+19
View File
@@ -0,0 +1,19 @@
const mongoose = require('mongoose')
const ComplaintSchema = mongoose.Schema({
fullName: String,
national: Number,
phoneNumber: Number,
deviceNumber: String,
email: String,
receptionCode: String,
caption: String,
callType: Boolean
})
module.exports = mongoose.model('Complaint', ComplaintSchema)
+4
View File
@@ -102,5 +102,9 @@ module.exports = [
{
name: 'نظر سنجی',
value: 'surveys'
},
{
name: 'شکایت ها',
value: 'complaint'
}
]