前端转vue
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RecheckEntry.ts 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import { EntryBase } from '../ContractBase/EntryBase'
  2. import type { PageBase } from '../ContractBase/PageBase'
  3. import type { IRecheckContract } from '../Contracts/IRecheckContract'
  4. import type { IAuthorizeContract } from '../Contracts/IAuthorizeContract'
  5. import type { ISubmitContract } from '../Contracts/ISubmitContract'
  6. import { LoginAuthentication } from '../../Library.Ext/TradeExtension/SSO/LoginAuthentication'
  7. import { useCheckManager } from '../Function/TradeCheck/CheckManager'
  8. /**
  9. * 复核逻辑入口
  10. */
  11. export class RecheckEntry {
  12. /**
  13. * 权限编号
  14. */
  15. private powerCode: string
  16. /**
  17. * 准备复核数据事件
  18. */
  19. public previewRecheck?: (page: PageBase, args: PreviewRecheckEventArgs) => void
  20. /**
  21. * 构造函数
  22. */
  23. constructor(powerCode: string) {
  24. this.powerCode = powerCode
  25. }
  26. /**
  27. * 执行复核操作
  28. */
  29. public async raiseRecheck(): Promise<boolean> {
  30. // if (!this.previewRecheck) return false
  31. // const args = new PreviewRecheckEventArgs(PageData)
  32. // this.previewRecheck(PageData, args)
  33. // const recheckCondition = PageData.tradeAPIs.getCheckElement(args)
  34. // if (!recheckCondition) return false
  35. // recheckCondition.legalPerson = LoginAuthentication.instance.groupKinbrNo
  36. // const checkManager = useCheckManager()
  37. // checkManager.onAskSuperResult((result, dataBus) => {
  38. // switch (result) {
  39. // case 'Success':
  40. // const irc = args.page as IRecheckContract
  41. // const trademodel = PageHelper.getTradeModel(PageData)
  42. // if (trademodel.metadata?.isAuth === 'true') {
  43. // const contract = PageData as IAuthorizeContract
  44. // if (!contract?.authorizeEntries?.length) {
  45. // args.page.tradeAPIs.showInfoMessageBox('复核已通过,在下一步检查授权时出错,请检查')
  46. // break
  47. // }
  48. // const entry = contract.authorizeEntries.find(x => x.powerCode === '0')
  49. // if (!entry) {
  50. // args.page.tradeAPIs.showInfoMessageBox('复核已通过,在下一步检查授权时出错,请检查')
  51. // break
  52. // }
  53. // entry.loadData(irc.recheckEntries[0].pageData, irc.recheckEntries[0].messageData)
  54. // args.page.tradeAPIs.showInfoMessageBox('复核已通过,将做下一步授权检查')
  55. // if (!entry.raiseAuthorize()) break
  56. // } else {
  57. // args.page.tradeAPIs.showInfoMessageBox('复核已经通过,将提交交易')
  58. // }
  59. // const submit = args.page as ISubmitContract
  60. // submit.submitEntry.loadData(irc.recheckEntries[0].pageData, irc.recheckEntries[0].messageData)
  61. // submit.submitEntry.raiseSubmit()
  62. // break
  63. // case 'Failed':
  64. // args.page.tradeAPIs.showInfoMessageBox('复核没有通过')
  65. // break
  66. // case 'Undo':
  67. // args.page.tradeAPIs.showInfoMessageBox('复核没已取消')
  68. // break
  69. // }
  70. // })
  71. //hulei_todo 复核先不做
  72. return true;
  73. }
  74. }
  75. /**
  76. * 准备复核数据事件参数
  77. */
  78. export class PreviewRecheckEventArgs {
  79. public account: string = ''
  80. public amt: number = 0
  81. public deAccount: string = ''
  82. public crAccount: string = ''
  83. public sinAmt: number = 0
  84. public ctSigns: string = ''
  85. public operationType: string = ''
  86. public deAccountSeqn: string = ''
  87. public enrollAccount: string = ''
  88. public enrollAccountName: string = ''
  89. public enrollAmt: number = 0
  90. public enrollDescription: string = ''
  91. public customizePages: Uint8Array[] = []
  92. public customizeMessage
  93. public page: PageBase
  94. constructor(page: PageBase) {
  95. this.page = page
  96. }
  97. }