Add complaint
This commit is contained in:
@@ -83,6 +83,8 @@
|
|||||||
@update:show="val => setDropdownState('adminS_CustomerM_Dropdown', val)"
|
@update:show="val => setDropdownState('adminS_CustomerM_Dropdown', val)"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<CSidebarNavItem
|
<CSidebarNavItem
|
||||||
v-if="hasPermission('customers')"
|
v-if="hasPermission('customers')"
|
||||||
name="لیست مشتریان"
|
name="لیست مشتریان"
|
||||||
@@ -106,6 +108,15 @@
|
|||||||
font-icon="fal fa-plus"
|
font-icon="fal fa-plus"
|
||||||
exact
|
exact
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<CSidebarNavItem
|
||||||
|
v-if="hasPermission('complaint')"
|
||||||
|
name="لیست شکایات "
|
||||||
|
:to="{ name: 'admin-complaint' }"
|
||||||
|
font-icon="fal fa-list"
|
||||||
|
:exact="false"
|
||||||
|
:badge="newComplaintReports ? { text: newComplaintReports, color: 'danger' } : null"
|
||||||
|
/>
|
||||||
</CSidebarNavDropdown>
|
</CSidebarNavDropdown>
|
||||||
|
|
||||||
<CSidebarNavDropdown
|
<CSidebarNavDropdown
|
||||||
@@ -305,7 +316,8 @@ export default {
|
|||||||
newPieceRequests: state => state.admin.newPieceRequests,
|
newPieceRequests: state => state.admin.newPieceRequests,
|
||||||
newOldPieceRequests: state => state.admin.newOldPieceRequests,
|
newOldPieceRequests: state => state.admin.newOldPieceRequests,
|
||||||
newBufferRequests: state => state.admin.newBufferRequests,
|
newBufferRequests: state => state.admin.newBufferRequests,
|
||||||
newGuaranteeReports: state => state.admin.newGuaranteeReports
|
newGuaranteeReports: state => state.admin.newGuaranteeReports,
|
||||||
|
newComplaintReports: state => state.admin.newComplaintReports
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted(){
|
beforeMount(){
|
||||||
|
|
||||||
this.$axios.get('/api/admin/complaint').then(res=>{
|
this.$axios.get('/api/admin/complaint').then(res=>{
|
||||||
this.complaint = res.data
|
this.complaint = res.data
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ const PieceRequest = require('../../models/PieceRequest')
|
|||||||
const OldPieceRequest = require('../../models/OldPieceRequest')
|
const OldPieceRequest = require('../../models/OldPieceRequest')
|
||||||
const BufferRequest = require('../../models/BufferRequest')
|
const BufferRequest = require('../../models/BufferRequest')
|
||||||
const GuaranteeReport = require('../../models/GuaranteeReport')
|
const GuaranteeReport = require('../../models/GuaranteeReport')
|
||||||
|
const Complaint = require('../../models/Complaint')
|
||||||
|
|
||||||
|
|
||||||
module.exports.getAllNotifs = async socket => {
|
module.exports.getAllNotifs = async socket => {
|
||||||
try {
|
try {
|
||||||
@@ -32,7 +34,9 @@ module.exports.getAllNotifs = async socket => {
|
|||||||
BufferRequest.find({ status: 'sent' }),
|
BufferRequest.find({ status: 'sent' }),
|
||||||
|
|
||||||
// newGuaranteeReports
|
// newGuaranteeReports
|
||||||
GuaranteeReport.find({ status: 'sent', seen: false })
|
GuaranteeReport.find({ status: 'sent', seen: false }),
|
||||||
|
|
||||||
|
Complaint.find({ read: false })
|
||||||
])
|
])
|
||||||
|
|
||||||
const unreadCuMsgs = allData[0]
|
const unreadCuMsgs = allData[0]
|
||||||
@@ -43,6 +47,8 @@ module.exports.getAllNotifs = async socket => {
|
|||||||
const newOldPieceRequests = allData[5]
|
const newOldPieceRequests = allData[5]
|
||||||
const newBufferRequests = allData[6]
|
const newBufferRequests = allData[6]
|
||||||
const newGuaranteeReports = allData[7]
|
const newGuaranteeReports = allData[7]
|
||||||
|
const complaint = allData[8]
|
||||||
|
|
||||||
|
|
||||||
socket.emit(`admin:allNotifs`, {
|
socket.emit(`admin:allNotifs`, {
|
||||||
unreadCuMsgs: unreadCuMsgs.length,
|
unreadCuMsgs: unreadCuMsgs.length,
|
||||||
@@ -52,7 +58,8 @@ module.exports.getAllNotifs = async socket => {
|
|||||||
newPieceRequests: newPieceRequests.length,
|
newPieceRequests: newPieceRequests.length,
|
||||||
newOldPieceRequests: newOldPieceRequests.length,
|
newOldPieceRequests: newOldPieceRequests.length,
|
||||||
newBufferRequests: newBufferRequests.length,
|
newBufferRequests: newBufferRequests.length,
|
||||||
newGuaranteeReports: newGuaranteeReports.length
|
newGuaranteeReports: newGuaranteeReports.length,
|
||||||
|
newComplaintReports:complaint.length
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ module.exports.gets = [
|
|||||||
|
|
||||||
module.exports.get = [
|
module.exports.get = [
|
||||||
async(req, res)=>{
|
async(req, res)=>{
|
||||||
const complaint = await Complaint.findById(req.params.id)
|
const complaint = await Complaint.findByIdAndUpdate(
|
||||||
|
req.params.id,
|
||||||
|
{read: true}
|
||||||
|
)
|
||||||
|
|
||||||
res.status(200).json(complaint)
|
res.status(200).json(complaint)
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ const ComplaintSchema = mongoose.Schema({
|
|||||||
email: String,
|
email: String,
|
||||||
receptionCode: String,
|
receptionCode: String,
|
||||||
caption: String,
|
caption: String,
|
||||||
callType: Boolean
|
callType: Boolean,
|
||||||
|
read: { type: Boolean, default: false },
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const state = () => ({
|
|||||||
newOldPieceRequests: 0,
|
newOldPieceRequests: 0,
|
||||||
newBufferRequests: 0,
|
newBufferRequests: 0,
|
||||||
newGuaranteeReports: 0,
|
newGuaranteeReports: 0,
|
||||||
|
newComplaintReports: 0,
|
||||||
verityProducts: [],
|
verityProducts: [],
|
||||||
panatechProducts: [],
|
panatechProducts: [],
|
||||||
iranProvinces: [],
|
iranProvinces: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user