Updated main page

This commit is contained in:
Patrick Alvin Alcala 2025-10-27 11:42:50 +08:00
parent d6dcec01a0
commit 1816cdf488

View file

@ -10,6 +10,7 @@ import { FaSolidThumbsUp } from 'solid-icons/fa'
import { _employeeName } from '../../stores/employee'
import { useNavigate } from '@solidjs/router'
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate, _assessedDate } from '../../stores/pdfinfo'
import { VsRefresh } from 'solid-icons/vs'
const API = import.meta.env.VITE_BACKEND
const PESO = import.meta.env.VITE_PESO
@ -167,7 +168,7 @@ export default () => {
const postPops = async (application: string) => {
const applicationId = await ofetch(API + 'get-idbyapplication-electrical/' + application, { parseResponse: JSON.parse })
const response = await ofetch(API + 'get-popsdetails-electrical/' + applicationId.result, { parseResponse: JSON.parse })
const applicationNo = response.result[0]
// const applicationNo = response.result[0]
const customerid = response.result2[0]
const customerName = response.result3[0]
const location = response.result4[0]
@ -181,7 +182,7 @@ export default () => {
const formattedDate = dayjs(today).format('YYYY-MM-DD')
const formattedDatewithTime = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
for (let i = 0; i < applicationNo.length; i++) {
for (let i = 0; i < response.result.length; i++) {
await ofetch(API + 'post-pops', {
method: 'POST',
body: { data: application, data2: formattedDate, data3: customerid, data4: customerName, data5: location, data6: codeList[i], data7: amountList[i], data8: NAME, data9: formattedDatewithTime, data10: lguList[i], data11: dpwhList[i], data12: boList[i], data13: PUBLICIP },
@ -279,6 +280,10 @@ export default () => {
}
}
const refresh = async () => {
await load()
}
const logout = async () => {
removeEmployee()
navigate('/')
@ -380,6 +385,12 @@ export default () => {
<h2 onClick={openPDF}>List of Ready to Approve and Sign in Electrical Order of Payments</h2>
</Row>
<Padding top={0} bottom={0} right={10} left={0}>
<Row content="right">
<Button label="Refresh Data" edges="curved" design="bo-primary" icon={VsRefresh} onClick={refresh}></Button>
</Row>
</Padding>
<Row>
<table class="table">
<thead>