Used new api for updating op
This commit is contained in:
parent
a7e47cfc90
commit
fb518587b1
1 changed files with 17 additions and 1 deletions
|
|
@ -98,6 +98,7 @@ export default () => {
|
||||||
const approveHandler = async (application: string) => {
|
const approveHandler = async (application: string) => {
|
||||||
let signed: boolean = false
|
let signed: boolean = false
|
||||||
let forprinting: boolean = false
|
let forprinting: boolean = false
|
||||||
|
let updateOrderofpayment: boolean = false
|
||||||
|
|
||||||
setConnected(await checkConnection())
|
setConnected(await checkConnection())
|
||||||
if (connected() === false) {
|
if (connected() === false) {
|
||||||
|
|
@ -109,8 +110,11 @@ export default () => {
|
||||||
if (!signed) return
|
if (!signed) return
|
||||||
|
|
||||||
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
||||||
|
if (!forprinting) return
|
||||||
|
|
||||||
if (forprinting) {
|
updateOrderofpayment = await updateOp()
|
||||||
|
|
||||||
|
if (updateOrderofpayment) {
|
||||||
setApprovedApplication(application)
|
setApprovedApplication(application)
|
||||||
setApproved(true)
|
setApproved(true)
|
||||||
}
|
}
|
||||||
|
|
@ -132,6 +136,18 @@ export default () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const updateOp = async () => {
|
||||||
|
try {
|
||||||
|
await ofetch(API + 'update-op-electrical', {
|
||||||
|
method: 'POST',
|
||||||
|
body: { data: parseInt(applicationId().toString()) },
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
} catch {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const calculateAmounts = () => {
|
const calculateAmounts = () => {
|
||||||
const amounts: string[] = amountList()
|
const amounts: string[] = amountList()
|
||||||
let gflguList: number[] = []
|
let gflguList: number[] = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue