{"version":3,"sources":["webpack:///./src/views/student/Profile.vue","webpack:///./src/views/student/Profile.vue?60a4","webpack:///./src/views/student/Profile.vue?d5ab"],"names":["class","id","data-kt-image-input","style","data-kt-image-input-action","data-bs-toggle","title","model","profileDetails","ref","rule","rules","undefined","photoUrl","type","name","showPreview","accept","removeImage","prop","placeholder","first_name","last_name","student_id","sevis_no","acceptPhoneNumber","phone","email","birth_date","start-placeholder","format","address","address1","address2","city","state","zipcode","countries","country","key","value","nationality","sexTypes","sex","i20_start","i20_end","start_date","end_date","agents","agent","agent_id","advisors","advisor","advisor_id","admissionCategories","category","admission_category","studentStatuses","status","deleteStudent","submit","store","route","router","params","formRef","isPhotoUpdated","record_type","required","message","trigger","getTypes","Promise","resolve","reject","ApiService","setHeader","get","then","data","catch","response","errors","console","log","getAgents","getAdvisors","getters","currentStudentProfile","studentProfile","createStudent","isValidStudentId","isValid","generateStudentId","setFormDataHeader","formdata","filterData","post","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","window","location","href","student","formData","FormData","photoFile","append","JSON","stringify","event","URL","createObjectURL","target","files","updateStudent","update","validate","valid","photo_id","confirm","delete","push","CommonService","getPhoneNumber","render"],"mappings":"sJACOA,MAAM,sB,GAOJC,GAAG,kBAAkBD,MAAM,iB,GAQvBA,MAAM,4B,GACJA,MAAM,Y,GAGJA,MAAM,Y,GAEPA,MAAM,kCACNE,sBAAoB,OACpBC,MAAA,sD,GAQEH,MAAM,iFAONI,6BAA2B,SAC3BC,iBAAe,UACfC,MAAM,gB,GA4BTN,MAAM,Y,GAKJA,MAAM,Y,GACJA,MAAM,O,GACJA,MAAM,mB,GAYNA,MAAM,mB,GAeZA,MAAM,Y,GAKJA,MAAM,mB,GAaRA,MAAM,Y,GAKJA,MAAM,mB,GAaRA,MAAM,Y,GAKJA,MAAM,mB,GAcRA,MAAM,Y,GAKJA,MAAM,mB,GAaRA,MAAM,Y,GAKJA,MAAM,mB,GAYRA,MAAM,Y,GAKJA,MAAM,mB,G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AMoF,cAAWhH,GAG5B+C,EAAgB,KACpB,QAAakE,QAAQ,wCACV/C,KAAK,KACFH,GAAA,KAAWC,YACXD,GAAA,KAAWmD,OAAO,WAAW7H,GACxB6E,KAAK,IAAY,gDACdf,EAAOgE,KAAK,CAAChH,KAAK,qBAErBiE,MAAM,EAAGC,eACNE,QAAQC,IAAI,yBAAyBH,EAASF,KAAKG,aAKrEzD,EAAoB,KACtBjB,EAAegC,MAAMd,MAAQsG,GAAA,KAAcC,eAAezH,EAAegC,MAAMd,QAcnF,OAXA,2BAAc,IAAU,sDAChB6C,IAAWO,KAAK,IAAY,gDAChCO,IACAC,YAIJ,uBAAU,KACR,gBAA0B,UAAW,CAAC,cAGjC,CACL1B,SACApD,iBACAyD,UACA/C,cACAP,QACA0B,YACAoB,kBACAH,sBACAZ,WACAM,SACAG,WACAnC,cACA2C,gBACAlC,wBCxUN,GAAOyG,OAASA,GAED","file":"js/chunk-2d0ab8b5.d0cb5de5.js","sourcesContent":["\r\n\r\n\r\n","\r\nimport { defineComponent, onMounted, ref, computed, onBeforeMount } from \"vue\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.js\";\r\nimport { useStore } from \"vuex\";\r\nimport { useRoute, useRouter } from 'vue-router'\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport { ElMessageBox } from \"element-plus\";\r\nimport CommonService from \"@/core/services/CommonService\";\r\n\r\nexport default defineComponent({\r\n name: \"student-settings\",\r\n setup() {\r\n const store = useStore();\r\n const route = useRoute();\r\n const router = useRouter();\r\n const id : number = +route.params.id; \r\n const countries = ref([]);\r\n const studentStatuses = ref([]);\r\n const admissionCategories = ref([]);\r\n const sexTypes = ref([]);\r\n const formRef = ref(null);\r\n const agents = ref([]);\r\n const advisors = ref([]);\r\n const isPhotoUpdated = ref(false);\r\n\r\n const rules = ref({\r\n record_type: [\r\n {\r\n required: true,\r\n message: \"Please select transaction type\",\r\n trigger: \"change\",\r\n },\r\n ],\r\n });\r\n\r\n const getTypes = async() => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader();\r\n ApiService.get(\"student/types\")\r\n .then(({ data }) => {\r\n countries.value = data.countries;\r\n studentStatuses.value = data.studentStatuses;\r\n admissionCategories.value = data.admissionCategories;\r\n sexTypes.value = data.sexTypes;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject('getTypes student error => '+response.data.errors);\r\n console.log('getTypes student error => '+response.data.errors);\r\n });\r\n });\r\n }\r\n\r\n const getAgents = async() =>{\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader();\r\n ApiService.get(\"agent\")\r\n .then(({ data }) => {\r\n agents.value = data.data;\r\n if(profileDetails.value.agent_id == null){\r\n profileDetails.value.agent_id = -1;\r\n }\r\n\r\n resolve(data);\r\n })\r\n .catch(({ response }) => {\r\n console.log('getAgents error => '+response.data.errors);\r\n reject(response.data.errors);\r\n });\r\n });\r\n }\r\n\r\n const getAdvisors = async() =>{\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader();\r\n ApiService.get(\"staff\")\r\n .then(({ data }) => {\r\n advisors.value = data.data;\r\n if(profileDetails.value.advisor_id == null){\r\n profileDetails.value.advisor_id = -1;\r\n }\r\n resolve(data);\r\n })\r\n .catch(({ response }) => {\r\n console.log('getAdvisors error => '+response.data.errors);\r\n reject(response.data.errors);\r\n });\r\n });\r\n }\r\n\r\n const profileDetails = computed(() => {\r\n return store.getters.currentStudentProfile.studentProfile;\r\n });\r\n\r\n const createStudent = async () => {\r\n isValidStudentId().then((isValid)=>{\r\n if(isValid){\r\n generateStudentId().then(() => {\r\n ApiService.setHeader();\r\n ApiService.setFormDataHeader();\r\n let formdata = filterData();\r\n ApiService.post(\"student\", formdata as any)\r\n .then(({data}) => {\r\n Swal.fire({\r\n text: \"New student is created successfully\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n })\r\n .then(() => {\r\n window.location.href=`/student/${data.student.id}/profile`;\r\n });;\r\n \r\n })\r\n .catch(({ response }) => {\r\n console.log('createStudent error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to create the new student\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n });\r\n }\r\n else{\r\n Swal.fire({\r\n text: \"Student ID is duplicated. please enter the correct student ID\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n }\r\n });\r\n }\r\n\r\n const generateStudentId = async() =>{\r\n if(profileDetails.value.status === \"Active\" && (profileDetails.value.student_id === undefined||profileDetails.value.student_id === null||profileDetails.value.student_id === '')){\r\n ApiService.setHeader();\r\n await ApiService.get(\"student/studentno/new\")\r\n .then(({ data }) => {\r\n profileDetails.value.student_id = data.data;\r\n })\r\n .catch(({ response }) => {\r\n console.log('getTypes student error => '+response.data.errors);\r\n });\r\n }\r\n }\r\n\r\n const isValidStudentId = async()=> {\r\n return new Promise((resolve, reject) => { \r\n if(profileDetails.value.student_id){\r\n ApiService.setHeader();\r\n ApiService.get(\"student/\"+profileDetails.value.id+\"/studentno/\"+profileDetails.value.student_id+\"/isValid\")\r\n .then(({ data }) => {\r\n resolve(data.isValid);\r\n })\r\n .catch(({ response }) => {\r\n console.log('getTypes student error => '+response.data.errors);\r\n reject(false);\r\n });\r\n }\r\n else{\r\n resolve(true);\r\n }\r\n });\r\n }\r\n\r\n const filterData = () =>{\r\n if(profileDetails.value.agent_id == -1){\r\n profileDetails.value.agent_id = null;\r\n profileDetails.value.agent = null;\r\n }\r\n\r\n if(profileDetails.value.advisor_id == -1){\r\n profileDetails.value.advisor_id = null;\r\n profileDetails.value.advisor = null;\r\n }\r\n\r\n var formData = new FormData();\r\n\r\n if(profileDetails.value.photoFile){\r\n formData.append('file', profileDetails.value.photoFile);\r\n }\r\n\r\n delete profileDetails.value.photoFile;\r\n delete profileDetails.value.photoUrl;\r\n delete profileDetails.value.agent;\r\n formData.append(\"document\", JSON.stringify(profileDetails.value));\r\n \r\n return formData;\r\n }\r\n\r\n const showPreview = (event) =>{\r\n isPhotoUpdated.value = true;\r\n profileDetails.value.photoUrl = URL.createObjectURL(event.target.files[0]);\r\n profileDetails.value.photoFile = event.target.files[0];\r\n }\r\n\r\n const updateStudent = async () => {\r\n isValidStudentId().then((isValid)=>{\r\n if(isValid){\r\n generateStudentId().then(() =>{\r\n ApiService.setHeader();\r\n ApiService.setFormDataHeader();\r\n ApiService.update(\"student\", id, (filterData()) as any)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Updated successfully\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n })\r\n .catch(({ response }) => {\r\n console.log('updateStudent error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to create the new student\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n });\r\n }\r\n else{\r\n Swal.fire({\r\n text: \"Student ID is duplicated. please enter the correct student ID\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n }\r\n });\r\n }\r\n\r\n const submit = () => {\r\n if (!formRef.value) {\r\n return;\r\n }\r\n\r\n formRef.value.validate((valid) => {\r\n if (valid) {\r\n if(id == 0){\r\n createStudent();\r\n }\r\n else{\r\n updateStudent();\r\n }\r\n } else {\r\n Swal.fire({\r\n text: \"Please fill out all required fields\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n return false;\r\n }\r\n });\r\n };\r\n\r\n const removeImage = () => {\r\n profileDetails.value.photoUrl = undefined;\r\n profileDetails.value.photo_id = undefined;\r\n };\r\n\r\n const deleteStudent = () =>{\r\n ElMessageBox.confirm('Are you sure to delete this student?')\r\n .then(() => {\r\n ApiService.setHeader();\r\n ApiService.delete(\"student/\"+id)\r\n .then(async () => {\r\n router.push({name:\"student-list\"});\r\n })\r\n .catch(({ response }) => {\r\n console.log('handleDelete error => '+response.data.errors);\r\n });\r\n });\r\n }\r\n\r\n const acceptPhoneNumber = () => {\r\n profileDetails.value.phone = CommonService.getPhoneNumber(profileDetails.value.phone);\r\n }\r\n\r\n onBeforeMount(async() =>{\r\n await getTypes().then(async () => {\r\n getAgents();\r\n getAdvisors();\r\n });\r\n })\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"Profile\", [\"Student\"]);\r\n });\r\n\r\n return {\r\n submit,\r\n profileDetails,\r\n formRef,\r\n removeImage,\r\n rules,\r\n countries,\r\n studentStatuses,\r\n admissionCategories,\r\n sexTypes,\r\n agents,\r\n advisors,\r\n showPreview,\r\n deleteStudent,\r\n acceptPhoneNumber\r\n };\r\n },\r\n});\r\n","import { render } from \"./Profile.vue?vue&type=template&id=92a4269c\"\nimport script from \"./Profile.vue?vue&type=script&lang=ts\"\nexport * from \"./Profile.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script"],"sourceRoot":""}