{"version":3,"sources":["webpack:///./src/views/management/StaffDetail.vue","webpack:///./src/types/StaffModel.ts","webpack:///./src/views/management/StaffDetail.vue?efe3","webpack:///./src/views/management/StaffDetail.vue?6d4a","webpack:///./src/views/management/StaffDetail.vue?66d4","webpack:///./src/types/AddressModel.ts"],"names":["class","staffId","staffDetail","id","model","ref","for","placeholder","type","types","label","value","key","name","disabled","staff_id","prop","first_name","last_name","position","acceptPhoneNumber","phone","email","birth_date","format","address","address1","style","address2","city","state","zipcode","start_date","memo","rows","fileList","length","data","border","stripe","moment","scope","row","create_date","width","size","downloadFile","file_name","deleteSavedFile","on-change","addFileData","on-remove","removeFileData","action","limit","on-exceed","handleExceed","auto-upload","trigger","tip","is_active","backToList","submit","deleteStaff","this","components","route","params","formRef","submitButton","uploadFileList","getFiles","Promise","resolve","reject","ApiService","setHeader","get","then","catch","response","Error","errors","getStaffTypes","getStaff","Object","assign","setAttribute","formData","FormData","map","file","append","raw","JSON","stringify","setFormDataHeader","post","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","router","push","console","log","finally","removeAttribute","update","CommonService","getPhoneNumber","filter","x","uid","a","document","createElement","event","MouseEvent","download","href","url","dispatchEvent","error","confirm","delete","statusCode","go","render","__scopeId","Address"],"mappings":"kJACOA,MAAM,sB,GACJA,MAAM,wB,6BAINA,MAAM,uB,GAOEA,MAAM,gC,GACFA,MAAM,Y,GAIFA,MAAM,mB,SAcVA,MAAM,Y,GAIFA,MAAM,mB,GAUVA,MAAM,Y,GAIFA,MAAM,mB,GACFA,MAAM,O,GACNA,MAAM,mB,GAWNA,MAAM,mB,GAcdA,MAAM,Y,GAIFA,MAAM,mB,GACFA,MAAM,O,GACFA,MAAM,mB,GAclBA,MAAM,Y,GAIFA,MAAM,mB,GAYVA,MAAM,Y,GAIFA,MAAM,mB,GAWVA,MAAM,Y,GAIFA,MAAM,mB,GAWVA,MAAM,Y,GAKFA,MAAM,mB,GACFA,MAAM,O,GACFA,MAAM,oB,GAWNA,M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AEhB1B,KAAK,KACJP,QAIXQ,MAAO+C,IACJnB,QAAQC,IAAI,4BAA4BkB,QAK9C/D,EAAc,KAChB,QAAagE,QAAQ,sCAChBjD,KAAK,KACFH,EAAA,KAAWqD,OAAO,SAAS/H,GACtB6E,KAAK,KACF,IAAKoB,KAAK,CACNC,KAAM,gCACNC,KAAM,UACNC,gBAAgB,EAChBC,kBAAmB,cACnBC,YAAa,CACTC,cAAe,qBAGlB1B,KAAK,KACF2B,GAAA,KAAOC,KAAK,CAAE7F,KAAM,cAG/BkE,MAAM,EAAGC,eACN2B,QAAQC,IAAI5B,GACZ,IAAKkB,KAAK,CACVC,KAAM,6BACNC,KAAM,QACNC,gBAAgB,EAChBC,kBAAmB,cACnBC,YAAa,CACTC,cAAe,uBAItBK,QAAQ,K,MACa,QAAlB,EAAAxC,EAAa1D,aAAK,SAAEmG,gBAAgB,0BAKlDjD,EAAa,KACf4C,GAAA,KAAOyB,IAAI,IAaf,OAVA,2BAAc,KACV/C,IACAC,IACAb,MAGJ,uBAAU,KACN,gBAAqC,GAAXtE,EAAe,eAAgB,eAAgB,CAAC,aAAc,oBAGrF,CACH6D,SACAM,UACAlE,cACAD,UACAQ,QACAW,oBACA8B,cACAf,WACAa,kBACAF,eACAN,OAAA,KACAY,iBACAW,cACAF,iB,UCvRZ,GAAOsE,OAASA,EAChB,GAAOC,UAAY,kBAEJ,iB,oCCRf,W,6DCAA,kCAAO,MAAMC","file":"js/chunk-5158ed55.371c5cb4.js","sourcesContent":["\r\n\r\n\r\n\r\n","import { Address } from \"./AddressModel\";\r\n\r\nexport class StaffDetails {\r\n constructor (){\r\n this.address = new Address();\r\n }\r\n\r\n id: number;\r\n first_name: string;\r\n last_name: string;\r\n position: string;\r\n staff_id : string;\r\n phone: string;\r\n email: string;\r\n address : Address;\r\n birth_date: Date;\r\n start_date: Date;\r\n memo : string;\r\n is_active : boolean;\r\n user_id : number;\r\n}","\r\nimport { defineComponent, ref, reactive, onBeforeMount, onMounted } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.min.js\";\r\nimport { useRoute } from 'vue-router'\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport router from \"@/router\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport { Address } from \"@/types/AddressModel\";\r\nimport { StaffDetails } from \"@/types/StaffModel\";\r\nimport CommonService from \"@/core/services/CommonService\";\r\nimport { ElMessageBox } from \"element-plus\";\r\nimport moment from \"moment\";\r\n\r\nexport default defineComponent({\r\n name: \"agent-detail-modal\",\r\n components: {\r\n },\r\n setup() {\r\n const route = useRoute();\r\n const staffId = +route.params.id; \r\n const formRef = ref(null);\r\n const submitButton = ref(null);\r\n const staffDetail = reactive({} as any);\r\n const types = ref([]);\r\n const fileList = ref([]);\r\n const uploadFileList = ref([] as any);\r\n\r\n const getFiles = () =>{\r\n if(staffId != 0){\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"file/staff/\"+staffId)\r\n .then(({ data }) => {\r\n fileList.value = data.data;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getStaffTypes => '+response.data.errors));\r\n });\r\n });\r\n }\r\n }\r\n const getStaffTypes = async() =>{\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"staff/types\")\r\n .then(({ data }) => {\r\n types.value = data.data;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getStaffTypes => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const getStaff = () => {\r\n if(staffId == 0) {\r\n Object.assign(staffDetail,new StaffDetails());\r\n }\r\n else {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"staff/\"+staffId)\r\n .then(({ data }) => {\r\n if(data.data){\r\n if(!data.data.address){\r\n data.data.address = new Address();\r\n }\r\n Object.assign(staffDetail,data.data);\r\n }\r\n\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getStaff error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n }\r\n\r\n const submit = () => {\r\n submitButton.value?.setAttribute(\"data-kt-indicator\", \"on\");\r\n\r\n var formData = new FormData();\r\n uploadFileList.value.map(file=>{\r\n formData.append('files', file.raw, file.name);\r\n });\r\n formData.append(\"document\", JSON.stringify(staffDetail));\r\n ApiService.setHeader();\r\n ApiService.setFormDataHeader();\r\n\r\n if(staffId === 0){\r\n ApiService.post(\"staff\", formData as any)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Staff information has been successfully saved!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn fw-bold btn-light-primary\",\r\n },\r\n }).then(() => {\r\n router.push({ name: \"staff\"});\r\n });\r\n })\r\n .catch(({ response }) => {\r\n console.log(response);\r\n Swal.fire({\r\n text: \"Failed to create the new staff\",\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 .finally(() =>{\r\n submitButton.value?.removeAttribute(\"data-kt-indicator\");\r\n });\r\n }\r\n else\r\n {\r\n ApiService.update(\"staff\", staffId, formData as any)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Staff is 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 .then(() => {\r\n router.push({ name: \"staff\"});\r\n });\r\n })\r\n .catch(({ response }) => {\r\n console.log(response);\r\n Swal.fire({\r\n text: \"Failed to update the staff\",\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 acceptPhoneNumber = () => {\r\n staffDetail.phone = CommonService.getPhoneNumber(staffDetail.phone);\r\n }\r\n\r\n const addFileData = (file) => {\r\n uploadFileList.value.push(file);\r\n return false;\r\n }\r\n\r\n const removeFileData = (file) =>{\r\n uploadFileList.value = uploadFileList.value.filter(x=>x.uid != file.uid);\r\n }\r\n\r\n const downloadFile = (id,name) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"file/url/\"+id)\r\n .then(({ data }) => {\r\n var a = document.createElement('a');\r\n var event = new MouseEvent('click');\r\n a.download = name;\r\n a.href = data.url;\r\n a.dispatchEvent(event);\r\n })\r\n .catch((error)=>{\r\n console.log('downloadFile error => '+error);\r\n })\r\n }\r\n\r\n const deleteSavedFile = (row) =>{\r\n ElMessageBox.confirm('Are you sure to delete this file?')\r\n .then(() => {\r\n ApiService.setHeader();\r\n ApiService.delete(\"file/\"+row.id)\r\n .then(({ data }) => {\r\n if(data.statusCode != 200){\r\n Swal.fire({\r\n text: \"Deleting file error\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Please try again\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n }\r\n else{\r\n Swal.fire({\r\n text: \"Deleted 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 }).then(() => {\r\n getFiles();\r\n });\r\n }\r\n })\r\n .catch((error)=>{\r\n console.log('deleteSavedFile error => '+error);\r\n });\r\n });\r\n }\r\n\r\n const deleteStaff = () =>{\r\n ElMessageBox.confirm('Are you sure to delete this staff?')\r\n .then(() => {\r\n ApiService.delete(\"staff/\"+staffId)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Staff is deleted 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 router.push({ name: \"staff\"});\r\n });\r\n })\r\n .catch(({ response }) => {\r\n console.log(response);\r\n Swal.fire({\r\n text: \"Failed to delete the staff\",\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 .finally(() =>{\r\n submitButton.value?.removeAttribute(\"data-kt-indicator\");\r\n });\r\n });\r\n }\r\n\r\n const backToList = () =>{\r\n router.go(-1);\r\n }\r\n\r\n onBeforeMount(() => {\r\n getStaffTypes();\r\n getStaff();\r\n getFiles();\r\n })\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(staffId != 0 ? \"Staff Detail\": \"Create staff\", [\"Management\", \"Faculty/Staff\"]);\r\n });\r\n\r\n return {\r\n submit,\r\n formRef,\r\n staffDetail,\r\n staffId,\r\n types,\r\n acceptPhoneNumber,\r\n addFileData,\r\n fileList,\r\n deleteSavedFile,\r\n downloadFile,\r\n moment,\r\n removeFileData,\r\n deleteStaff,\r\n backToList\r\n };\r\n },\r\n});\r\n","import { render } from \"./StaffDetail.vue?vue&type=template&id=6cd71a4a&scoped=true\"\nimport script from \"./StaffDetail.vue?vue&type=script&lang=ts\"\nexport * from \"./StaffDetail.vue?vue&type=script&lang=ts\"\n\nimport \"./StaffDetail.vue?vue&type=style&index=0&id=6cd71a4a&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-6cd71a4a\"\n\nexport default script","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./StaffDetail.vue?vue&type=style&index=0&id=6cd71a4a&scoped=true&lang=css\"","export class Address {\r\n id : number;\r\n address1 : string;\r\n address2 : string;\r\n city : string;\r\n state : string;\r\n zipcode : string;\r\n }"],"sourceRoot":""}