Compare commits
No commits in common. "4348fac56c16fe2630b269080cb8d3c48abb9f44" and "41ede28a1c1158e288b7c732ccbd96fca01fff06" have entirely different histories.
4348fac56c
...
41ede28a1c
6 changed files with 64 additions and 165 deletions
|
|
@ -51,6 +51,3 @@
|
||||||
font-size: 1.75rem
|
font-size: 1.75rem
|
||||||
font-weight: 700
|
font-weight: 700
|
||||||
padding: 0.5rem 1rem
|
padding: 0.5rem 1rem
|
||||||
|
|
||||||
.profile
|
|
||||||
cursor: pointer
|
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ export default () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateOp = async () => {
|
const updateOp = async () => {
|
||||||
|
console.log(applicationId())
|
||||||
try {
|
try {
|
||||||
await ofetch(API + 'update-opprinted-electrical', {
|
await ofetch(API + 'update-opprinted-electrical', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
@ -325,11 +326,6 @@ export default () => {
|
||||||
navigate('/')
|
navigate('/')
|
||||||
}
|
}
|
||||||
|
|
||||||
const gotoProfile = async () => {
|
|
||||||
sessionStorage.setItem('name', employeeName())
|
|
||||||
navigate('/profile')
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const logged = await checkLogged()
|
const logged = await checkLogged()
|
||||||
|
|
||||||
|
|
@ -361,9 +357,7 @@ export default () => {
|
||||||
|
|
||||||
<Row content="left" gap={1}>
|
<Row content="left" gap={1}>
|
||||||
<Box curved thickness={0} padding="1.25rem 2.25rem" background="#0f131d56">
|
<Box curved thickness={0} padding="1.25rem 2.25rem" background="#0f131d56">
|
||||||
<span class="profile" onClick={gotoProfile}>
|
<span class="name">{employeeName()}</span>
|
||||||
{employeeName()}
|
|
||||||
</span>
|
|
||||||
</Box>
|
</Box>
|
||||||
<Clickable onClick={logout}>
|
<Clickable onClick={logout}>
|
||||||
<Row gap={0.5}>
|
<Row gap={0.5}>
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,12 @@ import { Tabs } from '@kobalte/core/tabs'
|
||||||
import { ofetch } from 'ofetch'
|
import { ofetch } from 'ofetch'
|
||||||
import { onMount, createSignal } from 'solid-js'
|
import { onMount, createSignal } from 'solid-js'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { checkConnection, getApi, getApiMulti, postApi } from '../../utils/functions'
|
import { checkConnection, getApi, getApiMulti } 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'
|
||||||
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signatureAssessor, _signatureApprover, _assessorid, _approvedDate, _assessedDate } from '../../stores/pdfinfo'
|
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'
|
import { VsRefresh } from 'solid-icons/vs'
|
||||||
import { BiRegularErrorAlt } from 'solid-icons/bi'
|
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -22,7 +21,7 @@ const PUBLICIP = import.meta.env.VITE_PUBLICIP
|
||||||
export default () => {
|
export default () => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const [totalOp, setTotalOp] = createSignal('')
|
const [totalOp, setTotalOp] = createSignal(0)
|
||||||
const [assessor, setAssessor] = createSignal('')
|
const [assessor, setAssessor] = createSignal('')
|
||||||
const [dateOp, setDateOp] = createSignal('')
|
const [dateOp, setDateOp] = createSignal('')
|
||||||
const [location, setLocation] = createSignal('')
|
const [location, setLocation] = createSignal('')
|
||||||
|
|
@ -51,8 +50,6 @@ export default () => {
|
||||||
const [employeeId, setEmployeeId] = createSignal(0)
|
const [employeeId, setEmployeeId] = createSignal(0)
|
||||||
const [employeeName, setEmployeeName] = createSignal('')
|
const [employeeName, setEmployeeName] = createSignal('')
|
||||||
|
|
||||||
const [apology, setApology] = createSignal(false)
|
|
||||||
|
|
||||||
const getListForApproval = async () => {
|
const getListForApproval = async () => {
|
||||||
const responseE = await getApiMulti('get-listopapproval-electrical')
|
const responseE = await getApiMulti('get-listopapproval-electrical')
|
||||||
setApplicationListElectrical(responseE.result)
|
setApplicationListElectrical(responseE.result)
|
||||||
|
|
@ -101,24 +98,23 @@ export default () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getopdetails = async (division: string, applicationNo: string) => {
|
const getopdetails = async (division: string, applicationNo: string) => {
|
||||||
let op
|
|
||||||
if (division === 'electrical') {
|
if (division === 'electrical') {
|
||||||
op = await getApiMulti('get-opdetails-electrical', applicationNo)
|
const op = await getApiMulti('get-opdetails-electrical', applicationNo)
|
||||||
|
setAssessor(op.result7[0])
|
||||||
|
setLocation(op.result5[0])
|
||||||
|
setType(op.result6[0])
|
||||||
|
setDateOp(dayjs(op.result10[0]).format('MMMM DD, YYYY'))
|
||||||
|
setApplicationId(op.result11[0])
|
||||||
|
setTotalOp(calculateTotal(op.result9))
|
||||||
} else if (division === 'occupancy') {
|
} else if (division === 'occupancy') {
|
||||||
op = await getApiMulti('get-opdetails-occupancy', applicationNo)
|
const op = await getApiMulti('get-opdetails-occupancy', applicationNo)
|
||||||
|
setAssessor(op.result7[0])
|
||||||
|
setLocation(op.result5[0])
|
||||||
|
setType(op.result6[0])
|
||||||
|
setDateOp(dayjs(op.result10[0]).format('MMMM DD, YYYY'))
|
||||||
|
setApplicationId(op.result11[0])
|
||||||
|
setTotalOp(calculateTotal(op.result9))
|
||||||
}
|
}
|
||||||
|
|
||||||
setLocation(op.result[0])
|
|
||||||
setType(op.result2[0])
|
|
||||||
setAssessor(op.result3[0])
|
|
||||||
const total = calculateTotal(op.result4)
|
|
||||||
const formattedTotal = new Intl.NumberFormat('en-US', {
|
|
||||||
minimumFractionDigits: 2,
|
|
||||||
maximumFractionDigits: 2,
|
|
||||||
}).format(total)
|
|
||||||
setTotalOp(formattedTotal)
|
|
||||||
setDateOp(dayjs(op.result5[0]).format('MMMM DD, YYYY'))
|
|
||||||
setApplicationId(op.result6[0])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateTotal = (list: number[]) => {
|
const calculateTotal = (list: number[]) => {
|
||||||
|
|
@ -167,15 +163,15 @@ export default () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (division === 'electrical') {
|
if (division === 'electrical') {
|
||||||
signed = await setNewStatus(division, 'ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED', 1)
|
signed = await setNewStatus('ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED', 1)
|
||||||
const approvedid = await getIdByApplication(division, application)
|
const approvedid = await getIdByApplication(application)
|
||||||
updateDocflow(division, approvedid, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL')
|
updateDocflow(approvedid, 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL')
|
||||||
if (!signed) return
|
if (!signed) return
|
||||||
|
|
||||||
forprinting = await setNewStatus(division, 'FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT', 0)
|
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT', 0)
|
||||||
if (!forprinting) return
|
if (!forprinting) return
|
||||||
|
|
||||||
updateOrderofpayment = await updateOp(division)
|
updateOrderofpayment = await updateOp()
|
||||||
|
|
||||||
if (updateOrderofpayment) {
|
if (updateOrderofpayment) {
|
||||||
postTransaction()
|
postTransaction()
|
||||||
|
|
@ -184,42 +180,43 @@ export default () => {
|
||||||
setApproved(true)
|
setApproved(true)
|
||||||
}
|
}
|
||||||
} else if (division === 'occupancy') {
|
} else if (division === 'occupancy') {
|
||||||
signed = await setNewStatus(division, 'OCCUPANCY ORDER OF PAYMENT APPROVED AND SIGNED', '172', 'OCCOPAPPROVEDSIGNED', 1)
|
signed = await setNewStatus('OCCUPANCY ORDER OF PAYMENT APPROVED AND SIGNED', '172', 'OCCOPAPPROVEDSIGNED', 1)
|
||||||
const approvedid = await getIdByApplication(division, application)
|
const approvedid = await getIdByApplication(application)
|
||||||
updateDocflow(division, approvedid, 'FOR OCCUPANCY RECOMMENDING APPROVAL')
|
updateDocflow(approvedid, 'FOR OCCUPANCY RECOMMENDING APPROVAL')
|
||||||
if (!signed) return
|
if (!signed) return
|
||||||
|
|
||||||
forprinting = await setNewStatus(division, 'APPROVED FOR PRINTING OF BUREAU OF FIRE AND ORDER OF PAYMENT', '23', 'OCORDEROFPAYMENT', 0)
|
forprinting = await setNewStatus('APPROVED FOR PRINTING OF BUREAU OF FIRE AND ORDER OF PAYMENT', '23', 'OCORDEROFPAYMENT', 0)
|
||||||
if (!forprinting) return
|
if (!forprinting) return
|
||||||
|
|
||||||
updateOrderofpayment = await updateOp(division)
|
updateOrderofpayment = await updateOp()
|
||||||
|
|
||||||
if (updateOrderofpayment) {
|
|
||||||
postTransaction()
|
|
||||||
postPops(division, application)
|
|
||||||
setApprovedApplication(application)
|
|
||||||
setApproved(true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const setNewStatus = async (division: string, status: string, tag: string, tagword: string, approved: number) => {
|
const setNewStatus = async (status: string, tag: string, tagword: string, approved: number) => {
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
const formattedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
const formattedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||||
const statusid = parseInt(applicationId().toString())
|
const statusid = parseInt(applicationId().toString())
|
||||||
|
|
||||||
if (division === 'electrical') {
|
try {
|
||||||
return await postApi('post-newstatus-electrical', { data: statusid, data2: formattedDate, data3: status, data4: tag, data5: tagword, data6: parseInt(approved.toString()), data7: parseInt(ID) })
|
await ofetch(API + 'post-newstatus-electrical', {
|
||||||
} else {
|
method: 'POST',
|
||||||
return await postApi('post-newstatus-occupancy', { data: statusid, data2: formattedDate, data3: status, data4: tag, data5: tagword, data6: parseInt(approved.toString()), data7: parseInt(ID) })
|
body: { data: statusid, data2: formattedDate, data3: status, data4: tag, data5: tagword, data6: parseInt(approved.toString()), data7: parseInt(ID) },
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
} catch {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateOp = async (division: string) => {
|
const updateOp = async () => {
|
||||||
if (division === 'electrical') {
|
try {
|
||||||
return await postApi('update-opapproved-electrical', { data: parseInt(applicationId().toString()) })
|
await ofetch(API + 'update-opapproved-electrical', {
|
||||||
} else {
|
method: 'POST',
|
||||||
return await postApi('update-opapproved-occupancy', { data: parseInt(applicationId().toString()) })
|
body: { data: parseInt(applicationId().toString()) },
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
} catch {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,22 +338,20 @@ export default () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateDocflow = async (division: string, applicationid: number, status: string) => {
|
const updateDocflow = async (electricalid: number, status: string) => {
|
||||||
if (division === 'electrical') {
|
await ofetch(API + 'update-docflow-electrical', {
|
||||||
await postApi('update-docflow-electrical', { data: parseInt(applicationid.toString()), data2: status })
|
method: 'POST',
|
||||||
} else if (division === 'occupancy') {
|
body: { data: parseInt(electricalid.toString()), data2: status },
|
||||||
await postApi('update-docflow-occupancy', { data: parseInt(applicationid.toString()), data2: status })
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getIdByApplication = async (division: string, applicationNo: string) => {
|
const getIdByApplication = async (applicationNo: string) => {
|
||||||
let response
|
try {
|
||||||
if (division === 'electrical') {
|
const response = await getApi('get-idbyapplication-electrical', applicationNo)
|
||||||
response = await getApi('get-idbyapplication-electrical', applicationNo)
|
|
||||||
} else if (division === 'occupancy') {
|
|
||||||
response = await getApi('get-idbyapplication-occupancy', applicationNo)
|
|
||||||
}
|
|
||||||
return parseInt(response)
|
return parseInt(response)
|
||||||
|
} catch {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const refresh = async (division: string) => {
|
const refresh = async (division: string) => {
|
||||||
|
|
@ -456,7 +451,7 @@ export default () => {
|
||||||
</Padding>
|
</Padding>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<table class="table__disabled">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Application Number</th>
|
<th>Application Number</th>
|
||||||
|
|
@ -471,15 +466,13 @@ export default () => {
|
||||||
<td>{nameListOccupancy()[index]}</td>
|
<td>{nameListOccupancy()[index]}</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<Button
|
<ModalButton
|
||||||
// class="modal"
|
class="modal"
|
||||||
label="Show Details"
|
label="Show Details"
|
||||||
design="bo-link"
|
design="bo-link"
|
||||||
background="#121e2acc"
|
background="#121e2acc"
|
||||||
color="#ffffffec"
|
color="#ffffffec"
|
||||||
onClick={async () => {
|
function={async () => {
|
||||||
setApology(true)
|
|
||||||
setErrorMessage('Modification of Occupancy Printing has not yet finished')
|
|
||||||
await getopdetails('occupancy', item)
|
await getopdetails('occupancy', item)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -515,7 +508,7 @@ export default () => {
|
||||||
<section class="modal__row">
|
<section class="modal__row">
|
||||||
<span class="modal__row__label">Total Fee:</span>
|
<span class="modal__row__label">Total Fee:</span>
|
||||||
<span class="modal__row__detail__price">
|
<span class="modal__row__detail__price">
|
||||||
{PESO} {totalOp()}
|
{PESO} {totalOp().toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
</section>
|
</section>
|
||||||
</Padding>
|
</Padding>
|
||||||
|
|
@ -525,7 +518,7 @@ export default () => {
|
||||||
<span class="modal__cancel">Click anywhere to cancel</span>
|
<span class="modal__cancel">Click anywhere to cancel</span>
|
||||||
</Row>
|
</Row>
|
||||||
</Padding>
|
</Padding>
|
||||||
</Button>
|
</ModalButton>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
|
|
@ -602,7 +595,7 @@ export default () => {
|
||||||
<section class="modal__row">
|
<section class="modal__row">
|
||||||
<span class="modal__row__label">Total Fee:</span>
|
<span class="modal__row__label">Total Fee:</span>
|
||||||
<span class="modal__row__detail__price">
|
<span class="modal__row__detail__price">
|
||||||
{PESO} {totalOp()}
|
{PESO} {totalOp().toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
</section>
|
</section>
|
||||||
</Padding>
|
</Padding>
|
||||||
|
|
@ -690,35 +683,6 @@ export default () => {
|
||||||
</Padding>
|
</Padding>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div onClick={() => setApology(false)}>
|
|
||||||
<Modal trigger={apology()} background="#562020ff" color="#ffebebe6" opacity={0.8}>
|
|
||||||
<Padding top={1} bottom={1} left={4} right={4}>
|
|
||||||
<Column>
|
|
||||||
<Row gap={2}>
|
|
||||||
<BiRegularErrorAlt size={90} color="#ffebebe6" />
|
|
||||||
<Box curved thickness={3} color="#ffebebe6" padding="1rem">
|
|
||||||
<h2>Delayed Release of Feature</h2>
|
|
||||||
</Box>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<Row>
|
|
||||||
<h3>{errorMessage()}</h3>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<Row>
|
|
||||||
<Column gap={0.5}>
|
|
||||||
<span>Occupancy Approval is delayed until Occupancy Printing is complete</span>
|
|
||||||
</Column>
|
|
||||||
</Row>
|
|
||||||
|
|
||||||
<Row>
|
|
||||||
<span class="close-text">Click anywhere to close</span>
|
|
||||||
</Row>
|
|
||||||
</Column>
|
|
||||||
</Padding>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
.name
|
|
||||||
padding: 1rem 2rem
|
|
||||||
border-radius: 8px
|
|
||||||
font-size: 1.75rem
|
|
||||||
font-weight: 800
|
|
||||||
display: flex
|
|
||||||
flex-direction: column
|
|
||||||
flex-wrap: wrap
|
|
||||||
align-items: center
|
|
||||||
background: #16212C
|
|
||||||
box-shadow: 8px 8px 28px #0d141b, -8px -8px 28px #1f2e3d
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
import './Profile.sass'
|
|
||||||
import { Logo, Link, Page, Row, Padding, Combobox, Box, Button, Modal, Column, QR, Input, Display } from '../../components'
|
|
||||||
import { IoChevronBack } from 'solid-icons/io'
|
|
||||||
import { _employeeName, _employeeId } from '../../stores/employee'
|
|
||||||
|
|
||||||
export default () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Page>
|
|
||||||
<Padding left={4.75} right={4.75} top={0} bottom={0}>
|
|
||||||
<Row content="split">
|
|
||||||
<Link to="/">
|
|
||||||
<Row content="left" gap={2}>
|
|
||||||
<Logo size={200} />
|
|
||||||
<h1>OCBO e-Sign</h1>
|
|
||||||
</Row>
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<Link to="/">
|
|
||||||
<Row content="right">
|
|
||||||
<IoChevronBack size={45} />
|
|
||||||
<span class="back-button-text">Back</span>
|
|
||||||
</Row>
|
|
||||||
</Link>
|
|
||||||
</Row>
|
|
||||||
<Column>
|
|
||||||
<h1 class="name">{sessionStorage.getItem('name')}</h1>
|
|
||||||
|
|
||||||
<Row content="left">
|
|
||||||
<span>Role:</span>
|
|
||||||
</Row>
|
|
||||||
</Column>
|
|
||||||
</Padding>
|
|
||||||
</Page>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -114,11 +114,3 @@
|
||||||
|
|
||||||
tbody tr:nth-child(even)
|
tbody tr:nth-child(even)
|
||||||
background-color: rgba(color.adjust(vars.$background, $lightness: 10%), 0.8)
|
background-color: rgba(color.adjust(vars.$background, $lightness: 10%), 0.8)
|
||||||
|
|
||||||
// &__electrical
|
|
||||||
// @extend .table
|
|
||||||
// box-shadow: inset 0 1px 2px #2c2c16, 0 2px 4px #4d572432, 0 4px 8px #5e65344e
|
|
||||||
|
|
||||||
&__disabled
|
|
||||||
@extend .table
|
|
||||||
cursor: not-allowed
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue