From f55447a116a179790d8e868e9f8cbe348f1c9ee7 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Tue, 14 Oct 2025 10:13:57 +0800 Subject: [PATCH] Updated assessor page --- src/pages/AssessorPage/Assessor.tsx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index aa76a63..aa183ba 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, _assessor, _feeList, _codeList, _amountList } from '../../stores/pdfinfo' +import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signature, _assessorid } from '../../stores/pdfinfo' const API = import.meta.env.VITE_BACKEND const PESO = import.meta.env.VITE_PESO @@ -48,6 +48,8 @@ export default () => { const [employeeId, setEmployeeId] = createSignal(0) const [employeeName, setEmployeeName] = createSignal('') + const [sign, setSign] = createSignal('') + // const [docApplicationNo, setDocApplicationNo] = createSignal('') // const [docDate, setDocDate] = createSignal('') // const [docLocation, setDocLocation] = createSignal('') @@ -79,6 +81,7 @@ export default () => { _location.set(location) _type.set(type) _assessor.set(assessor) + _assessorid.set(employeeId()) } const getPrintDetailsFees = async (id: number) => { @@ -151,6 +154,7 @@ export default () => { getPrintDetails(op.result11[0]) getPrintDetailsFees(op.result11[0]) + getSignatureImage(employeeId()) } const calculateTotal = (list: number[]) => { @@ -207,14 +211,14 @@ export default () => { // updateOrderofpayment = await updateOp() // if (updateOrderofpayment) { - // setPrintedApplication(application) - // setPrinted(true) - // getPrintDetails(applicationId()) + // setPrintedApplication(application) + // setPrinted(true) createPdf() // } } const updateOp = async () => { + console.log(applicationId()) try { await ofetch(API + 'update-opprinted-electrical', { method: 'POST', @@ -242,6 +246,17 @@ export default () => { } } + const getSignatureImage = async (id: number) => { + try { + const response = await ofetch(API + 'get-signatureimage/' + id, { parseResponse: JSON.parse }) + const image = response.result + _signature.set(image) + return true + } catch { + return false + } + } + const logout = async () => { removeEmployee() navigate('/')