Fixed display of assessed date on pdf

This commit is contained in:
Patrick Alvin Alcala 2025-10-21 11:43:51 +08:00
parent 084da93524
commit 65b5237169
3 changed files with 33 additions and 3 deletions

View file

@ -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, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate } from '../../stores/pdfinfo'
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate, _assessedDate } from '../../stores/pdfinfo'
const API = import.meta.env.VITE_BACKEND
const PESO = import.meta.env.VITE_PESO
@ -156,6 +156,14 @@ export default () => {
const approversignId = await geteSignId(276)
getApprovedDate(approversignId, applicationNo)
const assessorId = await getEmployeeId(op.result7[0])
const assessorsignId = await geteSignId(assessorId)
getAssessedDate(op.result11[0])
console.log('name', op.result7[0])
console.log('id', assessorId)
console.log('esignid', assessorsignId)
console.log('aaaa', op.result11[0])
}
const calculateTotal = (list: number[]) => {
@ -294,6 +302,27 @@ export default () => {
}
}
const getAssessedDate = async (electricalid: number) => {
try {
const response = await ofetch(API + 'get-signeddateassessed-electrical/' + electricalid, { parseResponse: JSON.parse })
const result = response.result
console.log('date', result)
_assessedDate.set(result)
} catch (error) {
_assessedDate.set('')
}
}
const getEmployeeId = async (name: string) => {
try {
const response = await ofetch(API + 'get-employeeid/' + name, { parseResponse: JSON.parse })
const result = response.result
return parseInt(result)
} catch (error) {
return 0
}
}
const logout = async () => {
removeEmployee()
navigate('/')