123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- import { EntryBase } from '../ContractBase/EntryBase'
- import type { PageBase } from '../ContractBase/PageBase'
- import type { IRecheckContract } from '../Contracts/IRecheckContract'
- import type { IAuthorizeContract } from '../Contracts/IAuthorizeContract'
- import type { ISubmitContract } from '../Contracts/ISubmitContract'
- import { LoginAuthentication } from '../../Library.Ext/TradeExtension/SSO/LoginAuthentication'
- import { useCheckManager } from '../Function/TradeCheck/CheckManager'
-
- /**
- * 复核逻辑入口
- */
- export class RecheckEntry {
- /**
- * 权限编号
- */
- private powerCode: string
-
- /**
- * 准备复核数据事件
- */
- public previewRecheck?: (page: PageBase, args: PreviewRecheckEventArgs) => void
-
- /**
- * 构造函数
- */
- constructor(powerCode: string) {
- this.powerCode = powerCode
- }
-
- /**
- * 执行复核操作
- */
- public async raiseRecheck(): Promise<boolean> {
- // if (!this.previewRecheck) return false
-
- // const args = new PreviewRecheckEventArgs(PageData)
- // this.previewRecheck(PageData, args)
-
- // const recheckCondition = PageData.tradeAPIs.getCheckElement(args)
- // if (!recheckCondition) return false
-
- // recheckCondition.legalPerson = LoginAuthentication.instance.groupKinbrNo
-
- // const checkManager = useCheckManager()
- // checkManager.onAskSuperResult((result, dataBus) => {
- // switch (result) {
- // case 'Success':
- // const irc = args.page as IRecheckContract
- // const trademodel = PageHelper.getTradeModel(PageData)
-
- // if (trademodel.metadata?.isAuth === 'true') {
- // const contract = PageData as IAuthorizeContract
- // if (!contract?.authorizeEntries?.length) {
- // args.page.tradeAPIs.showInfoMessageBox('复核已通过,在下一步检查授权时出错,请检查')
- // break
- // }
-
- // const entry = contract.authorizeEntries.find(x => x.powerCode === '0')
- // if (!entry) {
- // args.page.tradeAPIs.showInfoMessageBox('复核已通过,在下一步检查授权时出错,请检查')
- // break
- // }
-
- // entry.loadData(irc.recheckEntries[0].pageData, irc.recheckEntries[0].messageData)
- // args.page.tradeAPIs.showInfoMessageBox('复核已通过,将做下一步授权检查')
- // if (!entry.raiseAuthorize()) break
- // } else {
- // args.page.tradeAPIs.showInfoMessageBox('复核已经通过,将提交交易')
- // }
-
- // const submit = args.page as ISubmitContract
- // submit.submitEntry.loadData(irc.recheckEntries[0].pageData, irc.recheckEntries[0].messageData)
- // submit.submitEntry.raiseSubmit()
- // break
-
- // case 'Failed':
- // args.page.tradeAPIs.showInfoMessageBox('复核没有通过')
- // break
-
- // case 'Undo':
- // args.page.tradeAPIs.showInfoMessageBox('复核没已取消')
- // break
- // }
- // })
- //hulei_todo 复核先不做
- return true;
-
- }
- }
-
- /**
- * 准备复核数据事件参数
- */
- export class PreviewRecheckEventArgs {
- public account: string = ''
- public amt: number = 0
- public deAccount: string = ''
- public crAccount: string = ''
- public sinAmt: number = 0
- public ctSigns: string = ''
- public operationType: string = ''
- public deAccountSeqn: string = ''
- public enrollAccount: string = ''
- public enrollAccountName: string = ''
- public enrollAmt: number = 0
- public enrollDescription: string = ''
- public customizePages: Uint8Array[] = []
- public customizeMessage
- public page: PageBase
-
- constructor(page: PageBase) {
- this.page = page
- }
- }
|