Updated main page
This commit is contained in:
parent
ffe0f4c927
commit
b88b6b56ea
1 changed files with 44 additions and 38 deletions
|
|
@ -9,8 +9,6 @@ import { checkConnection, createPdf } from '../../utils/functions'
|
|||
import { FaSolidThumbsUp } from 'solid-icons/fa'
|
||||
import { _employeeName } from '../../stores/employee'
|
||||
import { useNavigate } from '@solidjs/router'
|
||||
// @ts-ignore
|
||||
// import * as openssl from 'openssl-nodejs'
|
||||
|
||||
const API = import.meta.env.VITE_BACKEND
|
||||
const PESO = import.meta.env.VITE_PESO
|
||||
|
|
@ -25,15 +23,15 @@ export default () => {
|
|||
const [location, setLocation] = createSignal('')
|
||||
const [type, setType] = createSignal('')
|
||||
const [applicationId, setApplicationId] = createSignal(0)
|
||||
const [assessorId, setAssessorId] = createSignal(0)
|
||||
// const [assessorId, setAssessorId] = createSignal(0)
|
||||
|
||||
const [gflgu, setGflgu] = createSignal<number[]>([])
|
||||
const [gfdpwh, setGfdpwh] = createSignal<number[]>([])
|
||||
const [tfbo, setTfbo] = createSignal<number[]>([])
|
||||
// const [gflgu, setGflgu] = createSignal<number[]>([])
|
||||
// const [gfdpwh, setGfdpwh] = createSignal<number[]>([])
|
||||
// const [tfbo, setTfbo] = createSignal<number[]>([])
|
||||
|
||||
const [descriptionList, setDescriptionList] = createSignal<string[]>([])
|
||||
const [amountList, setAmountList] = createSignal<string[]>([])
|
||||
const [dateOpList, setDateOpList] = createSignal<string[]>([])
|
||||
// const [descriptionList, setDescriptionList] = createSignal<string[]>([])
|
||||
// const [amountList, setAmountList] = createSignal<string[]>([])
|
||||
// const [dateOpList, setDateOpList] = createSignal<string[]>([])
|
||||
|
||||
const [applicationList, setApplicationList] = createSignal<string[]>([])
|
||||
const [nameList, setNameList] = createSignal<string[]>([])
|
||||
|
|
@ -73,13 +71,13 @@ export default () => {
|
|||
setType(op.result6[0])
|
||||
setDateOp(dayjs(op.result10[0]).format('MMMM DD, YYYY'))
|
||||
setApplicationId(op.result11[0])
|
||||
setAssessorId(op.result12[0])
|
||||
// setAssessorId(op.result12[0])
|
||||
setTotalOp(calculateTotal(op.result9))
|
||||
|
||||
setDescriptionList(op.result8)
|
||||
setAmountList(op.result9)
|
||||
setDateOpList(op.result10)
|
||||
calculateAmounts()
|
||||
// setDescriptionList(op.result8)
|
||||
// setAmountList(op.result9)
|
||||
// setDateOpList(op.result10)
|
||||
// calculateAmounts()
|
||||
}
|
||||
|
||||
const calculateTotal = (list: number[]) => {
|
||||
|
|
@ -130,7 +128,7 @@ export default () => {
|
|||
|
||||
const updateOp = async () => {
|
||||
try {
|
||||
await ofetch(API + 'update-op-electrical', {
|
||||
await ofetch(API + 'update-opapproved-electrical', {
|
||||
method: 'POST',
|
||||
body: { data: parseInt(applicationId().toString()) },
|
||||
})
|
||||
|
|
@ -140,30 +138,30 @@ export default () => {
|
|||
}
|
||||
}
|
||||
|
||||
const calculateAmounts = () => {
|
||||
const amounts: string[] = amountList()
|
||||
let gflguList: number[] = []
|
||||
let gfdpwhList: number[] = []
|
||||
let tfboList: number[] = []
|
||||
// const calculateAmounts = () => {
|
||||
// const amounts: string[] = amountList()
|
||||
// let gflguList: number[] = []
|
||||
// let gfdpwhList: number[] = []
|
||||
// let tfboList: number[] = []
|
||||
|
||||
for (let i = 0; i < amounts.length; i++) {
|
||||
const gflgu = parseFloat(amounts[i]) * 0.8
|
||||
const gfdpwh = parseFloat(amounts[i]) * 0.05
|
||||
const tfbo = parseFloat(amounts[i]) * 0.15
|
||||
// for (let i = 0; i < amounts.length; i++) {
|
||||
// const gflgu = parseFloat(amounts[i]) * 0.8
|
||||
// const gfdpwh = parseFloat(amounts[i]) * 0.05
|
||||
// const tfbo = parseFloat(amounts[i]) * 0.15
|
||||
|
||||
const roundedGflgu = parseFloat(gflgu.toFixed(2))
|
||||
const roundedGfdpwh = parseFloat(gfdpwh.toFixed(2))
|
||||
const roundedTfbo = parseFloat(tfbo.toFixed(2))
|
||||
// const roundedGflgu = parseFloat(gflgu.toFixed(2))
|
||||
// const roundedGfdpwh = parseFloat(gfdpwh.toFixed(2))
|
||||
// const roundedTfbo = parseFloat(tfbo.toFixed(2))
|
||||
|
||||
gflguList.push(roundedGflgu)
|
||||
gfdpwhList.push(roundedGfdpwh)
|
||||
tfboList.push(roundedTfbo)
|
||||
}
|
||||
// gflguList.push(roundedGflgu)
|
||||
// gfdpwhList.push(roundedGfdpwh)
|
||||
// tfboList.push(roundedTfbo)
|
||||
// }
|
||||
|
||||
setGflgu(gflguList)
|
||||
setGfdpwh(gfdpwhList)
|
||||
setTfbo(tfboList)
|
||||
}
|
||||
// setGflgu(gflguList)
|
||||
// setGfdpwh(gfdpwhList)
|
||||
// setTfbo(tfboList)
|
||||
// }
|
||||
|
||||
const closeNotification = async () => {
|
||||
setApproved(false)
|
||||
|
|
@ -219,7 +217,9 @@ export default () => {
|
|||
</Link>
|
||||
|
||||
<Row content="left" gap={1}>
|
||||
<span class="name">{employeeName()}</span>
|
||||
<Box curved thickness={0} padding="1.25rem 2.25rem" background="#0f131d56">
|
||||
<span class="name">{employeeName()}</span>
|
||||
</Box>
|
||||
<Clickable onClick={logout}>
|
||||
<Row gap={0.5}>
|
||||
<FiLogOut size={25} />
|
||||
|
|
@ -247,7 +247,10 @@ export default () => {
|
|||
|
||||
<Tabs.Content class="tabs__content" value="building">
|
||||
<Row>
|
||||
<h2>List of Ready to Approve and Sign Building Order of Payments</h2>
|
||||
{/* <h2>List of Ready to Approve and Sign Building Order of Payments</h2> */}
|
||||
<Box curved thickness={0} background="#602a2abf" padding="1rem 2rem">
|
||||
<h2>Under Development</h2>
|
||||
</Box>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
|
|
@ -265,7 +268,10 @@ export default () => {
|
|||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="occupancy">
|
||||
<Row>
|
||||
<h2>List of Ready to Approve and Sign Occupancy Order of Payments</h2>
|
||||
{/* <h2>List of Ready to Approve and Sign Occupancy Order of Payments</h2> */}
|
||||
<Box curved thickness={0} background="#602a2abf" padding="1rem 2rem">
|
||||
<h2>Under Development</h2>
|
||||
</Box>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue