Updated assessor page
This commit is contained in:
parent
2ee72c8ae1
commit
f55447a116
1 changed files with 19 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ import { checkConnection, createPdf } from '../../utils/functions'
|
||||||
import { FaSolidThumbsUp } from 'solid-icons/fa'
|
import { FaSolidThumbsUp } from 'solid-icons/fa'
|
||||||
import { _employeeName, _employeeId } from '../../stores/employee'
|
import { _employeeName, _employeeId } from '../../stores/employee'
|
||||||
import { useNavigate } from '@solidjs/router'
|
import { useNavigate } from '@solidjs/router'
|
||||||
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList } from '../../stores/pdfinfo'
|
import { _applicationNo, _date, _optn, _name, _location, _type, _assessor, _feeList, _codeList, _amountList, _signature, _assessorid } from '../../stores/pdfinfo'
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -48,6 +48,8 @@ export default () => {
|
||||||
const [employeeId, setEmployeeId] = createSignal(0)
|
const [employeeId, setEmployeeId] = createSignal(0)
|
||||||
const [employeeName, setEmployeeName] = createSignal('')
|
const [employeeName, setEmployeeName] = createSignal('')
|
||||||
|
|
||||||
|
const [sign, setSign] = createSignal('')
|
||||||
|
|
||||||
// const [docApplicationNo, setDocApplicationNo] = createSignal('')
|
// const [docApplicationNo, setDocApplicationNo] = createSignal('')
|
||||||
// const [docDate, setDocDate] = createSignal('')
|
// const [docDate, setDocDate] = createSignal('')
|
||||||
// const [docLocation, setDocLocation] = createSignal('')
|
// const [docLocation, setDocLocation] = createSignal('')
|
||||||
|
|
@ -79,6 +81,7 @@ export default () => {
|
||||||
_location.set(location)
|
_location.set(location)
|
||||||
_type.set(type)
|
_type.set(type)
|
||||||
_assessor.set(assessor)
|
_assessor.set(assessor)
|
||||||
|
_assessorid.set(employeeId())
|
||||||
}
|
}
|
||||||
|
|
||||||
const getPrintDetailsFees = async (id: number) => {
|
const getPrintDetailsFees = async (id: number) => {
|
||||||
|
|
@ -151,6 +154,7 @@ export default () => {
|
||||||
|
|
||||||
getPrintDetails(op.result11[0])
|
getPrintDetails(op.result11[0])
|
||||||
getPrintDetailsFees(op.result11[0])
|
getPrintDetailsFees(op.result11[0])
|
||||||
|
getSignatureImage(employeeId())
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateTotal = (list: number[]) => {
|
const calculateTotal = (list: number[]) => {
|
||||||
|
|
@ -207,14 +211,14 @@ export default () => {
|
||||||
// updateOrderofpayment = await updateOp()
|
// updateOrderofpayment = await updateOp()
|
||||||
|
|
||||||
// if (updateOrderofpayment) {
|
// if (updateOrderofpayment) {
|
||||||
// setPrintedApplication(application)
|
// setPrintedApplication(application)
|
||||||
// setPrinted(true)
|
// setPrinted(true)
|
||||||
// getPrintDetails(applicationId())
|
|
||||||
createPdf()
|
createPdf()
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
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',
|
||||||
|
|
@ -242,6 +246,17 @@ export default () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getSignatureImage = async (id: number) => {
|
||||||
|
try {
|
||||||
|
const response = await ofetch(API + 'get-signatureimage/' + id, { parseResponse: JSON.parse })
|
||||||
|
const image = response.result
|
||||||
|
_signature.set(image)
|
||||||
|
return true
|
||||||
|
} catch {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const logout = async () => {
|
const logout = async () => {
|
||||||
removeEmployee()
|
removeEmployee()
|
||||||
navigate('/')
|
navigate('/')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue