67 lines
1.6 KiB
Vue
67 lines
1.6 KiB
Vue
<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 lg="12">
|
|
<CCard>
|
|
<CCardBody>
|
|
<EnrollRepresentationForm :data="agent" is-admin />
|
|
</CCardBody>
|
|
</CCard>
|
|
</CCol>
|
|
</CRow>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'AdminAgentUpdate',
|
|
layout: 'admin',
|
|
async asyncData({ $axios, query, error }) {
|
|
try {
|
|
const agent = await $axios.get(`/api/admin/agentDetails/${query.agent}`)
|
|
if (agent.data._revoked) throw new Error('err')
|
|
return {
|
|
agent: agent.data
|
|
}
|
|
} catch (e) {
|
|
error({ status: 404, message: 'Page not found' })
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
title: 'ویرایش اطلاعات نماینده',
|
|
agent: null,
|
|
validation: {}
|
|
}
|
|
},
|
|
|
|
head() {
|
|
return {
|
|
title: this.title
|
|
}
|
|
},
|
|
mounted() {
|
|
this.updateNotice()
|
|
},
|
|
methods: {
|
|
updateNotice() {
|
|
const title = 'هشدار'
|
|
const msg =
|
|
'توجه داشته باشید با تغییر اطللاعات نماینده اطلاعات چاپی روی رسید پذیرش موقت مشتریان تحت تاثیر قرار خواهند گرفت.'
|
|
this.$confirm(msg, title, {
|
|
confirmButtonText: 'ادامه',
|
|
cancelButtonText: 'لغو',
|
|
type: 'warning'
|
|
}).catch(() => {
|
|
this.$router.go(-1)
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|