index.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. export default {
  2. /** 请求 */
  3. request: {
  4. /** 前置通知 */
  5. BA: {},
  6. /** 后置通知 */
  7. AR: {
  8. truckInfo(res: 司机车辆管理信息) {
  9. const rv = [...res.personTruckList]
  10. if (res.truckId) {
  11. rv.push({
  12. carNumber: res.carNumber,
  13. /** 物流公司id */
  14. orgId: res.orgId,
  15. /** 物流公司名称 */
  16. orgName: res.orgName,
  17. })
  18. }
  19. return rv as PersonDriver对象[]
  20. },
  21. getAccountInfo(res: 司机账户余额信息): IAccountInfo {
  22. const accountInfo: IAccountInfo = {
  23. showBalance: '',
  24. unit: '"暂无余额"',
  25. showDet: false,
  26. ...res,
  27. }
  28. accountInfo.orgName = func.convert.nullView(accountInfo.orgName)
  29. accountInfo.carNumber = func.convert.nullView(accountInfo.carNumber)
  30. if (res.orgId) {
  31. accountInfo.unit = '元'
  32. if (res.autoAccount === 1 && res.flag === 1) {
  33. accountInfo.showBalance = `> ${res.limitAmount}`
  34. } else {
  35. accountInfo.showDet = true
  36. accountInfo.showBalance = res.totalBalance.toString()
  37. }
  38. // if (accountInfo.showBalance.balance.includes('.')) {
  39. // const balanceArr = accountInfo.showBalance.balance.split('.')
  40. // accountInfo.showBalance.balance = balanceArr[0]
  41. // accountInfo.showBalance.suffix = '.' + balanceArr[1]
  42. // }
  43. }
  44. return accountInfo
  45. },
  46. },
  47. /** 异常通知 */
  48. AT: {
  49. common({ args, res }) {
  50. // console.log(args,res)
  51. },
  52. },
  53. /** 最终通知 */
  54. AF: {},
  55. /** 环绕通知 */
  56. AA: {},
  57. },
  58. }