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 { FaSolidThumbsUp } from 'solid-icons/fa'
|
||||||
import { _employeeName } from '../../stores/employee'
|
import { _employeeName } from '../../stores/employee'
|
||||||
import { useNavigate } from '@solidjs/router'
|
import { useNavigate } from '@solidjs/router'
|
||||||
// @ts-ignore
|
|
||||||
// import * as openssl from 'openssl-nodejs'
|
|
||||||
|
|
||||||
const API = import.meta.env.VITE_BACKEND
|
const API = import.meta.env.VITE_BACKEND
|
||||||
const PESO = import.meta.env.VITE_PESO
|
const PESO = import.meta.env.VITE_PESO
|
||||||
|
|
@ -25,15 +23,15 @@ export default () => {
|
||||||
const [location, setLocation] = createSignal('')
|
const [location, setLocation] = createSignal('')
|
||||||
const [type, setType] = createSignal('')
|
const [type, setType] = createSignal('')
|
||||||
const [applicationId, setApplicationId] = createSignal(0)
|
const [applicationId, setApplicationId] = createSignal(0)
|
||||||
const [assessorId, setAssessorId] = createSignal(0)
|
// const [assessorId, setAssessorId] = createSignal(0)
|
||||||
|
|
||||||
const [gflgu, setGflgu] = createSignal<number[]>([])
|
// const [gflgu, setGflgu] = createSignal<number[]>([])
|
||||||
const [gfdpwh, setGfdpwh] = createSignal<number[]>([])
|
// const [gfdpwh, setGfdpwh] = createSignal<number[]>([])
|
||||||
const [tfbo, setTfbo] = createSignal<number[]>([])
|
// const [tfbo, setTfbo] = createSignal<number[]>([])
|
||||||
|
|
||||||
const [descriptionList, setDescriptionList] = createSignal<string[]>([])
|
// const [descriptionList, setDescriptionList] = createSignal<string[]>([])
|
||||||
const [amountList, setAmountList] = createSignal<string[]>([])
|
// const [amountList, setAmountList] = createSignal<string[]>([])
|
||||||
const [dateOpList, setDateOpList] = createSignal<string[]>([])
|
// const [dateOpList, setDateOpList] = createSignal<string[]>([])
|
||||||
|
|
||||||
const [applicationList, setApplicationList] = createSignal<string[]>([])
|
const [applicationList, setApplicationList] = createSignal<string[]>([])
|
||||||
const [nameList, setNameList] = createSignal<string[]>([])
|
const [nameList, setNameList] = createSignal<string[]>([])
|
||||||
|
|
@ -73,13 +71,13 @@ export default () => {
|
||||||
setType(op.result6[0])
|
setType(op.result6[0])
|
||||||
setDateOp(dayjs(op.result10[0]).format('MMMM DD, YYYY'))
|
setDateOp(dayjs(op.result10[0]).format('MMMM DD, YYYY'))
|
||||||
setApplicationId(op.result11[0])
|
setApplicationId(op.result11[0])
|
||||||
setAssessorId(op.result12[0])
|
// setAssessorId(op.result12[0])
|
||||||
setTotalOp(calculateTotal(op.result9))
|
setTotalOp(calculateTotal(op.result9))
|
||||||
|
|
||||||
setDescriptionList(op.result8)
|
// setDescriptionList(op.result8)
|
||||||
setAmountList(op.result9)
|
// setAmountList(op.result9)
|
||||||
setDateOpList(op.result10)
|
// setDateOpList(op.result10)
|
||||||
calculateAmounts()
|
// calculateAmounts()
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateTotal = (list: number[]) => {
|
const calculateTotal = (list: number[]) => {
|
||||||
|
|
@ -130,7 +128,7 @@ export default () => {
|
||||||
|
|
||||||
const updateOp = async () => {
|
const updateOp = async () => {
|
||||||
try {
|
try {
|
||||||
await ofetch(API + 'update-op-electrical', {
|
await ofetch(API + 'update-opapproved-electrical', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: { data: parseInt(applicationId().toString()) },
|
body: { data: parseInt(applicationId().toString()) },
|
||||||
})
|
})
|
||||||
|
|
@ -140,30 +138,30 @@ export default () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateAmounts = () => {
|
// const calculateAmounts = () => {
|
||||||
const amounts: string[] = amountList()
|
// const amounts: string[] = amountList()
|
||||||
let gflguList: number[] = []
|
// let gflguList: number[] = []
|
||||||
let gfdpwhList: number[] = []
|
// let gfdpwhList: number[] = []
|
||||||
let tfboList: number[] = []
|
// let tfboList: number[] = []
|
||||||
|
|
||||||
for (let i = 0; i < amounts.length; i++) {
|
// for (let i = 0; i < amounts.length; i++) {
|
||||||
const gflgu = parseFloat(amounts[i]) * 0.8
|
// const gflgu = parseFloat(amounts[i]) * 0.8
|
||||||
const gfdpwh = parseFloat(amounts[i]) * 0.05
|
// const gfdpwh = parseFloat(amounts[i]) * 0.05
|
||||||
const tfbo = parseFloat(amounts[i]) * 0.15
|
// const tfbo = parseFloat(amounts[i]) * 0.15
|
||||||
|
|
||||||
const roundedGflgu = parseFloat(gflgu.toFixed(2))
|
// const roundedGflgu = parseFloat(gflgu.toFixed(2))
|
||||||
const roundedGfdpwh = parseFloat(gfdpwh.toFixed(2))
|
// const roundedGfdpwh = parseFloat(gfdpwh.toFixed(2))
|
||||||
const roundedTfbo = parseFloat(tfbo.toFixed(2))
|
// const roundedTfbo = parseFloat(tfbo.toFixed(2))
|
||||||
|
|
||||||
gflguList.push(roundedGflgu)
|
// gflguList.push(roundedGflgu)
|
||||||
gfdpwhList.push(roundedGfdpwh)
|
// gfdpwhList.push(roundedGfdpwh)
|
||||||
tfboList.push(roundedTfbo)
|
// tfboList.push(roundedTfbo)
|
||||||
}
|
// }
|
||||||
|
|
||||||
setGflgu(gflguList)
|
// setGflgu(gflguList)
|
||||||
setGfdpwh(gfdpwhList)
|
// setGfdpwh(gfdpwhList)
|
||||||
setTfbo(tfboList)
|
// setTfbo(tfboList)
|
||||||
}
|
// }
|
||||||
|
|
||||||
const closeNotification = async () => {
|
const closeNotification = async () => {
|
||||||
setApproved(false)
|
setApproved(false)
|
||||||
|
|
@ -219,7 +217,9 @@ export default () => {
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Row content="left" gap={1}>
|
<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}>
|
<Clickable onClick={logout}>
|
||||||
<Row gap={0.5}>
|
<Row gap={0.5}>
|
||||||
<FiLogOut size={25} />
|
<FiLogOut size={25} />
|
||||||
|
|
@ -247,7 +247,10 @@ export default () => {
|
||||||
|
|
||||||
<Tabs.Content class="tabs__content" value="building">
|
<Tabs.Content class="tabs__content" value="building">
|
||||||
<Row>
|
<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>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
|
|
@ -265,7 +268,10 @@ export default () => {
|
||||||
</Tabs.Content>
|
</Tabs.Content>
|
||||||
<Tabs.Content class="tabs__content" value="occupancy">
|
<Tabs.Content class="tabs__content" value="occupancy">
|
||||||
<Row>
|
<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>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue