Compare commits
No commits in common. "577066c9eacf6a81af049b4f429b683f85bde158" and "050f98f2960c885f3396a67b25dcf68659b94121" have entirely different histories.
577066c9ea
...
050f98f296
3 changed files with 8 additions and 41 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import './Button.sass'
|
import './Button.sass'
|
||||||
import { Show, Switch, Match, type JSXElement } from 'solid-js'
|
import { Show, Switch, Match } from 'solid-js'
|
||||||
import { A } from '@solidjs/router'
|
import { A } from '@solidjs/router'
|
||||||
import { Row } from '../index'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
label?: string
|
label?: string
|
||||||
|
|
@ -13,7 +12,6 @@ interface Props {
|
||||||
newtab?: boolean
|
newtab?: boolean
|
||||||
width?: number
|
width?: number
|
||||||
wide?: boolean
|
wide?: boolean
|
||||||
icon?: (props: { size?: number }) => JSXElement
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getBorderRadius = (edge: Props['edges']) => {
|
const getBorderRadius = (edge: Props['edges']) => {
|
||||||
|
|
@ -31,7 +29,7 @@ const getBorderRadius = (edge: Props['edges']) => {
|
||||||
|
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
const borderRadius = getBorderRadius(props.edges)
|
const borderRadius = getBorderRadius(props.edges)
|
||||||
const Icon = props.icon
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Show when={props.to}>
|
<Show when={props.to}>
|
||||||
|
|
@ -39,9 +37,6 @@ export default (props: Props) => {
|
||||||
<Match when={props.design}>
|
<Match when={props.design}>
|
||||||
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
|
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
|
||||||
<button class={props.design} style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
<button class={props.design} style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
||||||
<Show when={props.icon}>
|
|
||||||
<span>{Icon && <Icon size={24} />}</span>
|
|
||||||
</Show>
|
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
</A>
|
</A>
|
||||||
|
|
@ -49,9 +44,6 @@ export default (props: Props) => {
|
||||||
<Match when={!props.design}>
|
<Match when={!props.design}>
|
||||||
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
|
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
|
||||||
<button class="button" style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
<button class="button" style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
||||||
<Show when={props.icon}>
|
|
||||||
<span>{Icon && <Icon size={24} />}</span>
|
|
||||||
</Show>
|
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
</A>
|
</A>
|
||||||
|
|
@ -64,39 +56,25 @@ export default (props: Props) => {
|
||||||
<Match when={props.design}>
|
<Match when={props.design}>
|
||||||
<Show when={props.submit}>
|
<Show when={props.submit}>
|
||||||
<button class={props.design} type="submit" style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
<button class={props.design} type="submit" style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
||||||
<Show when={props.icon}>
|
|
||||||
<span>{Icon && <Icon size={24} />}</span>
|
|
||||||
</Show>
|
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<Show when={!props.submit}>
|
<Show when={!props.submit}>
|
||||||
<button class={props.design} onClick={props.onClick} style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
<button class={props.design} onClick={props.onClick} style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
||||||
<Row gap={0.5}>
|
{props.label || 'Click Me!'}
|
||||||
<Show when={props.icon}>
|
|
||||||
<span>{Icon && <Icon size={24} />}</span>
|
|
||||||
</Show>
|
|
||||||
{props.label || 'Click Me!'}
|
|
||||||
</Row>
|
|
||||||
</button>
|
</button>
|
||||||
</Show>
|
</Show>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={!props.design}>
|
<Match when={!props.design}>
|
||||||
<Show when={props.submit}>
|
<Show when={props.submit}>
|
||||||
<button class="button" type="submit" style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
<button class="button" type="submit" style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
||||||
<Show when={props.icon}>
|
|
||||||
<span>{Icon && <Icon size={24} />}</span>
|
|
||||||
</Show>
|
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<Show when={!props.submit}>
|
<Show when={!props.submit}>
|
||||||
<button class="button" onClick={props.onClick} style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
<button class="button" onClick={props.onClick} style={`${borderRadius}; width: ${props.wide ? '100%' : props.width}`}>
|
||||||
<Show when={props.icon}>
|
|
||||||
<span>{Icon && <Icon size={24} />}</span>
|
|
||||||
</Show>
|
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,11 @@ 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'
|
|
||||||
|
|
||||||
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
|
||||||
const ID = import.meta.env.VITE_HEADID
|
const ID = import.meta.env.VITE_HEADID
|
||||||
// const NAME = import.meta.env.VITE_HEAD
|
const NAME = import.meta.env.VITE_HEAD
|
||||||
const PUBLICIP = import.meta.env.VITE_PUBLICIP
|
const PUBLICIP = import.meta.env.VITE_PUBLICIP
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
@ -168,7 +167,7 @@ export default () => {
|
||||||
const postPops = async (application: string) => {
|
const postPops = async (application: string) => {
|
||||||
const applicationId = await ofetch(API + 'get-idbyapplication-electrical/' + application, { parseResponse: JSON.parse })
|
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 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 customerid = response.result2[0]
|
||||||
const customerName = response.result3[0]
|
const customerName = response.result3[0]
|
||||||
const location = response.result4[0]
|
const location = response.result4[0]
|
||||||
|
|
@ -182,10 +181,10 @@ export default () => {
|
||||||
const formattedDate = dayjs(today).format('YYYY-MM-DD')
|
const formattedDate = dayjs(today).format('YYYY-MM-DD')
|
||||||
const formattedDatewithTime = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
const formattedDatewithTime = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
|
||||||
for (let i = 0; i < response.result.length; i++) {
|
for (let i = 0; i < applicationNo.length; i++) {
|
||||||
await ofetch(API + 'post-pops', {
|
await ofetch(API + 'post-pops', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: { data: application, data2: formattedDate, data3: customerid, data4: customerName, data5: location, data6: codeList[i], data7: amountList[i], data8: assessor(), data9: formattedDatewithTime, data10: lguList[i], data11: dpwhList[i], data12: boList[i], data13: PUBLICIP },
|
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 },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -280,10 +279,6 @@ export default () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const refresh = async () => {
|
|
||||||
await load()
|
|
||||||
}
|
|
||||||
|
|
||||||
const logout = async () => {
|
const logout = async () => {
|
||||||
removeEmployee()
|
removeEmployee()
|
||||||
navigate('/')
|
navigate('/')
|
||||||
|
|
@ -385,12 +380,6 @@ export default () => {
|
||||||
<h2 onClick={openPDF}>List of Ready to Approve and Sign in Electrical Order of Payments</h2>
|
<h2 onClick={openPDF}>List of Ready to Approve and Sign in Electrical Order of Payments</h2>
|
||||||
</Row>
|
</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>
|
<Row>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
.table
|
.table
|
||||||
width: 80%
|
width: 80%
|
||||||
border-collapse: collapse
|
border-collapse: collapse
|
||||||
margin: 1rem
|
margin: 2rem
|
||||||
box-shadow: inset 0 1px 2px #16212C, 0 2px 4px #2a3f5332, 0 4px 8px #344c654e
|
box-shadow: inset 0 1px 2px #16212C, 0 2px 4px #2a3f5332, 0 4px 8px #344c654e
|
||||||
|
|
||||||
th, td
|
th, td
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue