somewhere

This commit is contained in:
Swift
2023-08-17 13:05:51 +03:30
parent 30c7eb0e7b
commit 53843207cc
429 changed files with 117489 additions and 1 deletions
@@ -0,0 +1,400 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" @click="$router.go(-1)">برگشت به صفحه قبل</CButton>
</CustomSubHeader>
<CRow>
<CCol v-if="!representation.archived && representation.status !== 'rejected'" lg="12">
<CCard>
<CCardBody>
<CRow>
<CCol v-if="!representation.archived" lg="6">
<h6>تغییر وضعیت فرم</h6>
<el-divider></el-divider>
<CButtonGroup>
<!-- <CButton :color="filterType === 'registered' ? 'primary' : 'light'">
ثبت شده
</CButton>
<CButton di :color="filterType === 'ongoing' ? 'primary' : 'light'">
در دست اقدام
</CButton> -->
<CButton
:color="representation.status === 'verification' ? 'warning' : 'light'"
@click="updateStatus('verification')"
>
بررسی مدارک
</CButton>
<CButton
:color="representation.status === 'accepted' ? 'success' : 'light'"
@click="updateStatus('accepted')"
>
تایید شده
</CButton>
<CButton
:color="representation.status === 'rejected' ? 'danger' : 'light'"
@click="updateStatus('rejected')"
>
رد شده
</CButton>
</CButtonGroup>
</CCol>
<CCol v-if="representation.status !== 'rejected'" lg="6">
<h6>تغییر وضعیت آپلود مدارک</h6>
<el-divider></el-divider>
<CButtonGroup>
<CButton :color="representation.upload ? 'primary' : 'light'" @click="updateStatus('uploadOn')">
دسترسی آپلود
</CButton>
<CButton :color="!representation.upload ? 'primary' : 'light'" @click="updateStatus('uploadOff')">
عدم دسترسی آپلود
</CButton>
</CButtonGroup>
</CCol>
</CRow>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h6>مشخصات فردی متقاضی:</h6>
<el-divider></el-divider>
<nuxt-link :to="{ name: 'admin-customers-customer', params: { customer: representation.user_id } }"
>مشاهده اکانت متقاضی</nuxt-link
>
<el-divider></el-divider>
<CForm>
<CInput label="نام مشتری" horizontal disabled :value="representation.full_name" />
<CInput label="کد ملی" horizontal disabled :value="representation.national_code" />
<CInput label="شماره شناسنامه" horizontal disabled :value="representation.id_number" />
<CInput label="محل صدور" horizontal disabled :value="representation.place_of_issue" />
<CInput label="تاریخ تولد" horizontal disabled :value="representation.birth_date" />
<CInput label="نام پدر" horizontal disabled :value="representation.fathers_name" />
<CInput label="میزان تحصیلات" horizontal disabled :value="representation.education_level" />
<CInput label="وضعیت نظام وظیفه" horizontal disabled :value="representation.military_status" />
<CTextarea
label="گواهینامه های تخصصی اخذ شده"
horizontal
disabled
rows="5"
:value="representation.certificates"
/>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h6>اطلاعات تماس:</h6>
<el-divider></el-divider>
<CForm>
<CInput label="استان" horizontal disabled :value="representation.province_name" />
<CInput label="شهر" horizontal disabled :value="representation.city_name" />
<CInput label="نام شرکت/تعمیرگاه" horizontal disabled :value="representation.store_name" />
<CInput label="کد پستی" horizontal disabled :value="representation.postal_code" />
<CInput label="تلفن همراه" horizontal disabled :value="representation.mobile_number" />
<CInput label="تلفن شرکت/تعمیرگاه" horizontal disabled :value="representation.tel_number" />
<CInput label="فکس شرکت/تعمیرگاه" horizontal disabled :value="representation.fax_number" />
<CInput label="کد اقتصادی" horizontal disabled :value="representation.economic_code" />
<CInput label="ایمیل" horizontal disabled :value="representation.email" />
<CTextarea label="آدرس" horizontal disabled rows="5" :value="representation.address" />
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h6>مشخصات مکان نماینده:</h6>
<el-divider></el-divider>
<CForm>
<CInput label="جواز کسب" horizontal disabled :value="business_license" />
<CInput label="نوع مالکیت" horizontal disabled :value="ownership_type" />
<CInput label="متراژ کل (متر)" horizontal disabled :value="representation.total_area" />
<CInput label="متراژ محل تعمیرات (متر)" horizontal disabled :value="representation.repair_area" />
<CInput label="متراژ انبار (متر)" horizontal disabled :value="representation.stock_area" />
<CInput
label="طبقه محل مراجعه مشتریان"
horizontal
disabled
:value="representation.customer_reference_floor"
/>
<CInput label="موقعیت مکانی" horizontal disabled :value="place_location" />
<CInput label="موقعیت جغرافیایی" horizontal disabled :value="geo_location" />
<CInput label="تعداد و ابعاد تابلو" horizontal disabled :value="representation.banner_info" />
<CInput
label="تعداد تکنسین های تعمیرگاه"
horizontal
disabled
:value="representation.repair_technicians"
/>
<CInput label="تعداد استادکار تعمیرگاه" horizontal disabled :value="representation.repair_masters" />
<CInput label="تعداد کارکنان اداری" horizontal disabled :value="representation.office_workers" />
<CInput label="تعداد پیک موتوری" horizontal disabled :value="representation.bike_deliveries" />
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h6>آشنایی با آسان سرویس:</h6>
<el-divider></el-divider>
<CForm>
<CInput label="نحوه آشنایی با شرکت" horizontal disabled :value="know_asanServ_from" />
<CTextarea
label="در صورتیکه معرف دارید مشخصات ایشان را ذکر کنید"
horizontal
disabled
rows="5"
:value="representation.introducer_info"
/>
<CInput
label="میزان آشنایی با محصولات آسان سرویس"
horizontal
disabled
:value="asanServ_products_knowledge"
/>
<CInput
label="آیا در زمینه فروش لوازم جانبی موبایل و کامپیوتر فعالیت دارید؟"
horizontal
disabled
:value="computer_saling_exp"
/>
<CTextarea
label="در صورت فعالیت فروش، نام شرکت و نوع محصول را نام ببرید"
horizontal
disabled
rows="5"
:value="representation.computer_saling_description"
/>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h6>سابقه فعالیت:</h6>
<el-divider></el-divider>
<CForm>
<CInput
label="سابقه فعالیت در تعمیر ابزار جانبی موبایل و کامپیوتر (سال)"
horizontal
disabled
:value="representation.computer_repair_exp"
/>
<CInput
label="سابقه فعالیت در تعمیر لوزام صوتی و تصویری (سال)"
horizontal
disabled
:value="representation.multimedia_repair_exp"
/>
<CInput label="سابقه در محل کسب (سال)" horizontal disabled :value="representation.business_exp" />
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h6>سایر توضیحات:</h6>
<el-divider></el-divider>
<CForm>
<CTextarea label="سایر توضیحات" horizontal disabled rows="5" :value="representation.more_descriptions" />
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="12">
<CCard>
<CCardBody>
<h6>نمایندگی نشان تجاری دیگر:</h6>
<el-divider></el-divider>
<el-table :data="representation.other_representations" style="width: 100%">
<el-table-column type="index" label="#"> </el-table-column>
<el-table-column prop="trademark" label="نشان تجاری" width=""> </el-table-column>
<el-table-column prop="company_name" label="نام شرکت" width=""> </el-table-column>
<el-table-column prop="cooperation_history" label="سابقه همکاری (سال)" width=""> </el-table-column>
<el-table-column prop="cooperation_start_year" label="سال شروع همکاری" width=""> </el-table-column>
</el-table>
</CCardBody>
</CCard>
</CCol>
<CCol v-for="item in agentAssetCategories" :key="item.fieldName" lg="12">
<CCard>
<CCardBody>
<CRow>
<CCol>
<h6>
{{ item.title }}
(عکس های آپلود شده)
</h6>
<el-divider></el-divider>
<el-image
v-for="image in representation[item.fieldName] || []"
:key="image._id"
style="width: 100px; height: 100px"
:src="image.url"
:preview-src-list="getImagePreviewList(representation[item.fieldName] || [])"
fit="cover"
class="ml-2"
>
</el-image>
</CCol>
</CRow>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'AddminRepresentationDetails',
layout: 'admin',
async asyncData({ $axios, params, error }) {
try {
const representation = await $axios.get(`/api/admin/representation/${params.representation}`)
return {
representation: representation.data
}
} catch (e) {
error({ status: 404, message: 'Page not found' })
}
},
data() {
return {
title: 'مشاهده درخواست نمایندگی',
representation: null,
validation: {}
}
},
head() {
return {
title: this.title
}
},
computed: {
...mapGetters({
agentAssetCategories: 'front/agentAssetCategories'
}),
business_license() {
if (this.representation.business_license) return 'دارد'
else return 'ندارد'
},
ownership_type() {
if (this.representation.ownership_type === 'owner') return 'مالک'
else if (this.representation.ownership_type === 'rent') return 'استیجاری'
else return 'سرقفلی'
},
place_location() {
if (this.representation.place_location === 'tech_passage') return 'مرکز صنف موبایل و کامپیوتر'
else return 'سایر'
},
geo_location() {
if (this.representation.geo_location === 'main_street') return 'خیابان اصلی'
else if (this.representation.geo_location === 'side_street') return 'خیابان فرعی'
else if (this.representation.geo_location === 'alley') return 'کوچه'
else if (this.representation.geo_location === 'inside_passage') return 'داخل پاساژ'
else return 'بر پاساژ'
},
know_asanServ_from() {
if (this.representation.know_asanServ_from === 'company_agents') return 'نماینده فروش'
else if (this.representation.know_asanServ_from === 'website') return 'وب سایت'
else if (this.representation.know_asanServ_from === 'company_workers') return 'پرسنل سازمان'
else if (this.representation.know_asanServ_from === 'exhibition') return 'نمایشگاه'
else if (this.representation.know_asanServ_from === 'introduced') return 'معرفی'
else return 'سایر'
},
asanServ_products_knowledge() {
if (this.representation.asanServ_products_knowledge === 4) return 'زیاد'
else if (this.representation.asanServ_products_knowledge === 3) return 'نسبتاً خوب'
else if (this.representation.asanServ_products_knowledge === 2) return 'متوسط'
else if (this.representation.asanServ_products_knowledge === 1) return 'کم'
else return 'خیلی کم'
},
computer_saling_exp() {
if (this.representation.computer_saling_exp) return 'دارد'
else return 'ندارد'
}
},
methods: {
updateStatus(status) {
if (status === this.representation.status) return
const title = 'هشدار'
function getMsg() {
const msg1 = 'با تغییر وضعیت فرم به بررسی مدارک بلافاصله پیامک اطلاع رسانی برای متقاضی ارسال خواهد شد'
const msg2 =
'با تغییر وضعیت به رد شده یا تایید شده دیگر امکان تغییر وضعیت نخواهید داشت و پیامک تغییر وضعیت بلافاصله برای متقاضی ارسال خواهد شد، ادامه میدهید؟'
const msg3 = 'پیامک ایجاد دسرترسی آپلود برای متقاضی ارسال خواهد شد، ادامه میدهید؟'
const msg4 = 'با برداشتن دسترسی آپلود پیامکی برای متقاضی ارسال نخواهد شد'
if (status === 'verification') return msg1
else if (status === 'rejected' || status === 'accepted') return msg2
else if (status === 'uploadOn') return msg3
else return msg4
}
this.$confirm(getMsg(), title, {
confirmButtonText: 'ادامه',
cancelButtonText: 'لغو',
type: 'warning'
})
.then(() => {
this.$axios
.put(`/api/admin/representationStatus/${this.representation._id}`, { status })
.then(response => {
this.$message({
type: 'success',
message: response.data.message
})
this.$nuxt.refresh()
})
.catch(err => {
this.$message({
type: 'error',
message: err.response.data.message
})
})
})
.catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
},
getImagePreviewList(images) {
return images.map(item => item.url)
}
}
}
</script>
+232
View File
@@ -0,0 +1,232 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fas fa-filter"></i>
<b>فیلتر ها</b>
</slot>
</CCardHeader>
<CCardBody>
<CRow>
<CCol sm="12">
<CButtonGroup>
<CButton
:color="filterType === 'all' ? 'primary' : 'light'"
:class="filterType === 'all' && 'selected'"
@click="filterType = 'all'"
>
<span>همه</span>
<span> ({{ representations.length }}) </span>
</CButton>
<CButton
:color="filterType === 'registered' ? 'primary' : 'light'"
:class="filterType === 'registered' && 'selected'"
@click="filterType = 'registered'"
>
<span>جدید</span>
<span> ({{ getListCountByStatus('registered') }}) </span>
</CButton>
<CButton
:color="filterType === 'ongoing' ? 'primary' : 'light'"
:class="filterType === 'ongoing' && 'selected'"
@click="filterType = 'ongoing'"
>
<span>در دست اقدام</span>
<span> ({{ getListCountByStatus('ongoing') }}) </span>
</CButton>
<CButton
:color="filterType === 'verification' ? 'primary' : 'light'"
:class="filterType === 'verification' && 'selected'"
@click="filterType = 'verification'"
>
<span>بررسی مدارک</span>
<span> ({{ getListCountByStatus('verification') }} )</span>
</CButton>
<CButton
:color="filterType === 'accepted' ? 'primary' : 'light'"
:class="filterType === 'accepted' && 'selected'"
@click="filterType = 'accepted'"
>
<span>تایید شده</span>
<span> ({{ getListCountByStatus('accepted') }}) </span>
</CButton>
<CButton
:color="filterType === 'rejected' ? 'primary' : 'light'"
:class="filterType === 'rejected' && 'selected'"
@click="filterType = 'rejected'"
>
<span>رد شده</span>
<span> ({{ getListCountByStatus('rejected') }}) </span>
</CButton>
</CButtonGroup>
</CCol>
<CCol sm="12">
<el-divider></el-divider>
</CCol>
<CCol sm="12">
<h4>جستجو در لیست:</h4>
<el-input
v-model="filterText"
clearable
placeholder="کد پیگیری - شماره موبایل - کد ملی - استان - شهر"
style="display: inline-block; max-width: 500px; margin-top: 8px"
></el-input>
</CCol>
</CRow>
</CCardBody>
</CCard>
<CCard>
<CCardHeader>
<slot name="header">
<CIcon name="cil-grid" />
{{ list_title }}
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="filteredItems"
style="width: 100%"
:row-class-name="({ row, rowIndex }) => row.status === 'registered' && 'unread'"
>
<el-table-column type="index" label="#"> </el-table-column>
<el-table-column prop="full_name" label="نام" width=""> </el-table-column>
<el-table-column prop="national_code" label="کد ملی" width=""> </el-table-column>
<el-table-column prop="mobile_number" label="شماره موبایل" width=""> </el-table-column>
<el-table-column prop="representation_code" label="کد پیگیری" width=""> </el-table-column>
<el-table-column prop="province_name" label="استان" width=""> </el-table-column>
<el-table-column prop="city_name" label="شهر" width=""> </el-table-column>
<el-table-column label="تاریخ ثبت درخواست" width="">
<template slot-scope="scope">
<span> {{ $jDate(scope.row.created_at) }} </span>
</template>
</el-table-column>
<el-table-column label="وضعیت" width="">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'registered'" type="info">ثبت شده</el-tag>
<el-tag v-if="scope.row.status === 'ongoing'" type="primary">در دست اقدام</el-tag>
<el-tag v-if="scope.row.status === 'verification'" type="warning">بررسی مدارک</el-tag>
<el-tag v-if="scope.row.status === 'accepted'" type="success">تایید شده</el-tag>
<el-tag v-if="scope.row.status === 'rejected'" type="danger">رد شده</el-tag>
</template>
</el-table-column>
<el-table-column label="بررسی" width="65" align="center">
<template slot-scope="scope">
<CButton
:key="scope.row._id"
color="success"
variant="outline"
:to="{ name: 'admin-representations-representation', params: { representation: scope.row._id } }"
>
<i class="fal fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
name: 'AdminRepresentationsList',
layout: 'admin',
async asyncData({ $axios, error }) {
try {
const representations = await $axios.get('/api/admin/representations')
return {
representations: representations.data
}
} catch (err) {
error({ status: 404, message: 'There is a problem here' })
}
},
data() {
return {
title: 'درخواست های نمایندگی',
list_title: 'لیست',
representations: null,
filterText: ''
}
},
head() {
return {
title: this.title
}
},
computed: {
filteredItems() {
const filterData = this.representations.filter(item =>
this.filterType === 'all' ? item : item.status === this.filterType
)
const filterText = this.filterText.toLowerCase()
if (!filterText.length) return filterData
else
return filterData.filter(item => {
return (
item.representation_code.toLowerCase().includes(filterText) ||
item.full_name.toLowerCase().includes(filterText) ||
item.mobile_number.toLowerCase().includes(filterText) ||
item.national_code.toLowerCase().includes(filterText) ||
item.province_name.toLowerCase().includes(filterText) ||
item.city_name.toLowerCase().includes(filterText)
)
})
},
filterType: {
get() {
return this.$route.query.status
},
set(val) {
this.$router.push({ name: 'admin-representations', query: { status: val } })
}
}
},
methods: {
getListCountByStatus(status) {
return this.representations.filter(item => item.status === status).length
}
}
}
</script>
<style lang="scss" scopped>
.selected {
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
z-index: 2;
span {
color: #fff;
}
}
.unread {
background: rgba(orange, 0.1) !important;
}
</style>