{"version":3,"sources":["webpack:///./src/views/management/SchoolForms.vue","webpack:///./src/views/management/modals/UploadSchoolForm.vue","webpack:///./src/views/management/modals/UploadSchoolForm.vue?de22","webpack:///./src/views/management/modals/UploadSchoolForm.vue?94aa","webpack:///./src/views/management/SchoolForms.vue?113b","webpack:///./src/views/management/SchoolForms.vue?6fc2","webpack:///./src/views/management/SchoolForms.vue?3d4b"],"names":["style","align","class","search","searchValue","placeholder","href","data-bs-toggle","data-bs-target","id","data","pagedFiles","default-sort","prop","order","width","label","moment","scope","row","create_date","format","default","src","title","downloadFile","file_name","deleteSavedFile","layout","page-size","pageSize","total","files","length","setPage","getFiles","tabindex","aria-hidden","data-bs-dismiss","resetForm","ref","on-change","addFileData","action","limit","on-exceed","handleExceed","auto-upload","trigger","type","tip","fileDescription","submitUpload","name","components","props","emits","emit","upload","uploadUrl","fd","value","clearFiles","handleStart","window","FormData","ApiService","setHeader","setFormDataHeader","post","then","setTimeout","closeBtn","document","getElementById","click","catch","response","console","log","errors","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","file","append","raw","render","Invoice","UploadSchoolForm","page","pageValue","Promise","resolve","reject","get","Error","a","createElement","event","MouseEvent","download","url","dispatchEvent","error","confirm","delete","statusCode","filter","x","student","first_name","toLowerCase","includes","last_name","student_id","memo","sort","b","Date","parse","slice","val","__scopeId"],"mappings":"0LACSA,MAAA,uC,GACIC,MAAM,QAAQD,MAAA,oD,GAiBlBE,MAAM,sB,GAOUF,MAAA,0B,+BAiBZC,MAAM,S,kWA1Cf,gCAiBM,MAjBN,EAiBM,CAhBF,gCAeM,MAfN,EAeM,CAdF,yBAIsD,G,WAHzC,EAAAE,OAAOC,Y,qCAAP,EAAAD,OAAkB,eAC3BE,YAAY,iBACZH,MAAM,WACNF,MAAA,kD,mCACJ,gCAQM,OARDE,MAAM,OAAOF,MAAA,0B,CAClB,gCAMI,KANDM,KAAK,IACJJ,MAAM,yBACNK,iBAAe,QACfC,iBAAe,4BACfC,GAAG,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gB,CAAC,iBAGxC,CACHD,UACAJ,WACAgE,OACA9D,QACA7B,SACAc,OAAA,IACAU,kBACAhB,aACAc,eACAU,e,UClIZ,EAAOwD,OAASA,EAChB,EAAOoC,UAAY,kBAEJ,gB,yDCRf","file":"js/chunk-661bf2de.80c79d01.js","sourcesContent":["\r\n\r\n\r\n\r\n\r\n\r\n","\r\n\r\n","\r\nimport { defineComponent, ref } from \"vue\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport Swal from \"sweetalert2\";\r\n\r\nexport default defineComponent({\r\n name: \"student-settings\",\r\n components: {\r\n },\r\n props:{\r\n },\r\n emits: ['getFiles'],\r\n setup(props,{emit}) { \r\n const upload = ref(null);\r\n const uploadUrl = ref('');\r\n const fileDescription = ref('');\r\n var fd = ref({} as any);\r\n\r\n const handleExceed = (files) => {\r\n upload.value.clearFiles();\r\n upload.value.handleStart(files[0]);\r\n }\r\n\r\n const resetForm = () =>{\r\n fileDescription.value = '';\r\n upload.value?.clearFiles();\r\n fd.value = new window.FormData();\r\n }\r\n\r\n const submitUpload = () => {\r\n ApiService.setHeader();\r\n ApiService.setFormDataHeader();\r\n ApiService.post(\"file/upload/school-form/\"+ fileDescription.value, fd.value)\r\n .then(()=>{\r\n setTimeout(() =>{\r\n let closeBtn = document.getElementById('close_upload_schoolform_button');\r\n closeBtn?.click();\r\n emit('getFiles');\r\n }, 500);\r\n })\r\n .catch(({ response }) => {\r\n console.log('createInvoice error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to create the new invoice\",\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 const addFileData = (file) => {\r\n fd.value = new window.FormData();\r\n fd.value.append('file', file.raw, file.name);\r\n return false;\r\n }\r\n\r\n return {\r\n uploadUrl,\r\n handleExceed,\r\n submitUpload,\r\n fileDescription,\r\n upload,\r\n addFileData,\r\n resetForm,\r\n };\r\n },\r\n});\r\n\r\nfunction useRef() {\r\n throw new Error(\"Function not implemented.\");\r\n}\r\n","import { render } from \"./UploadSchoolForm.vue?vue&type=template&id=3401b046\"\nimport script from \"./UploadSchoolForm.vue?vue&type=script&lang=ts\"\nexport * from \"./UploadSchoolForm.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport { computed, defineComponent, onBeforeMount, onMounted, reactive, ref} from \"vue\";\r\nimport { ElMessageBox } from \"element-plus\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport moment from \"moment\";\r\nimport Swal from \"sweetalert2\";\r\nimport UploadSchoolForm from \"@/views/management/modals/UploadSchoolForm.vue\"\r\n\r\nexport class Invoice{\r\n id : number;\r\n invoice_date : Date;\r\n student_id : number;\r\n memo : string;\r\n}\r\n\r\nexport default defineComponent({\r\n name: \"school-form\",\r\n components : {\r\n UploadSchoolForm\r\n },\r\n setup() {\r\n const pageSize = 15;\r\n const page = reactive({pageValue : 1});\r\n const files = ref([]);\r\n\r\n const getFiles = async () => {\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"file/type/school-form\")\r\n .then(({ data }) => {\r\n files.value = data.data;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getFinanceRecords error => '+response.data.errors));\r\n });\r\n });\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('getStudentFiles error => '+error);\r\n })\r\n }\r\n\r\n const deleteSavedFile = (row) =>{\r\n ElMessageBox.confirm('Are you sure to delete this record?')\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-error\",\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 });\r\n files.value = files.value.filter(x=> x.id != row.id);\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 search = reactive({searchValue : ''});\r\n\r\n const pagedFiles = computed(()=>{\r\n return files.value\r\n .filter(data => (!search \r\n || data.student?.first_name.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.student?.last_name.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.student?.student_id.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.memo.toLowerCase().includes(search.searchValue.toLowerCase()))\r\n )\r\n .sort(function(a,b) { \r\n if(a.id == b.id) return 0;\r\n\r\n if (Date.parse(a.create_date!) < Date.parse(b.create_date!))\r\n return 1;\r\n if (Date.parse(a.create_date!) > Date.parse(b.create_date!))\r\n return -1;\r\n return 0;\r\n })\r\n .slice(pageSize * page.pageValue - pageSize, pageSize * page.pageValue)\r\n })\r\n\r\n const setPage = (val) => {\r\n page.pageValue = val;\r\n }\r\n\r\n onBeforeMount(async () => {\r\n getFiles();\r\n });\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"School Forms\", [\"Management\"]);\r\n });\r\n\r\n return {\r\n setPage,\r\n pageSize,\r\n page,\r\n files,\r\n search,\r\n moment,\r\n deleteSavedFile,\r\n pagedFiles,\r\n downloadFile,\r\n getFiles\r\n };\r\n },\r\n});\r\n","import { render } from \"./SchoolForms.vue?vue&type=template&id=1bfb91aa&scoped=true\"\nimport script from \"./SchoolForms.vue?vue&type=script&lang=ts\"\nexport * from \"./SchoolForms.vue?vue&type=script&lang=ts\"\n\nimport \"./SchoolForms.vue?vue&type=style&index=0&id=1bfb91aa&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-1bfb91aa\"\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!./SchoolForms.vue?vue&type=style&index=0&id=1bfb91aa&scoped=true&lang=css\""],"sourceRoot":""}