From 320a53aac9db03d603b67158ca660427ff7f61e2 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Thu, 9 Oct 2025 18:06:13 +0800 Subject: [PATCH] Updated assessor page --- src/pages/AssessorPage/Assessor.tsx | 28 +++++++++++++++++++--------- src/stores/pdfinfo.ts | 4 ++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index 6f632b9..aa76a63 100644 --- a/src/pages/AssessorPage/Assessor.tsx +++ b/src/pages/AssessorPage/Assessor.tsx @@ -9,7 +9,7 @@ import { checkConnection, createPdf } from '../../utils/functions' import { FaSolidThumbsUp } from 'solid-icons/fa' import { _employeeName, _employeeId } from '../../stores/employee' import { useNavigate } from '@solidjs/router' -import { _applicationNo, _date, _optn, _name, _location, _type } from '../../stores/pdfinfo' +import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList } from '../../stores/pdfinfo' const API = import.meta.env.VITE_BACKEND const PESO = import.meta.env.VITE_PESO @@ -65,11 +65,12 @@ export default () => { const getPrintDetails = async (id: number) => { const response = await ofetch(API + 'get-printdetails-electrical/' + id) - const applicationno = response.result[0] - const date = response.result2[0] - const location = response.result3[0] - const name = response.result8[0] - const type = `${response.result4[0]} - ${response.result5[0]}` + const applicationno = response.result + const date = response.result2 + const location = response.result3 + const name = response.result8 + const type = `${response.result4} - ${response.result5}` + const assessor = response.result7 _optn.set('M' + applicationno.split('-')[0] + applicationno.split('-')[1]) _applicationNo.set(applicationno) @@ -77,10 +78,18 @@ export default () => { _name.set(name) _location.set(location) _type.set(type) + _assessor.set(assessor) + } - // setDocApplicationNo(applicationno) - // setDocDate(dayjs(date).format('MMMM DD, YYYY')) - // setDocLocation(location) + const getPrintDetailsFees = async (id: number) => { + const response = await ofetch(API + 'get-printdetailsfees-electrical/' + id) + const feeList = response.result + const accountCodeList = response.result2 + const amountList = response.result3 + + _feeList.set(feeList) + _codeList.set(accountCodeList) + _amountList.set(amountList) } // const calculateAmounts = () => { @@ -141,6 +150,7 @@ export default () => { // calculateAmounts() getPrintDetails(op.result11[0]) + getPrintDetailsFees(op.result11[0]) } const calculateTotal = (list: number[]) => { diff --git a/src/stores/pdfinfo.ts b/src/stores/pdfinfo.ts index 2b818bd..345d707 100644 --- a/src/stores/pdfinfo.ts +++ b/src/stores/pdfinfo.ts @@ -7,4 +7,8 @@ export const _name = atom('') export const _location = atom('') export const _type = atom('') export const _code = atom('') +export const _assessor = atom('') +export const _feeList = atom([]) +export const _codeList = atom([]) +export const _amountList = atom([])