buildCommons.js 4.11 KB
Newer Older
WH committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
export default {
  buildPtspta (ptsptaObj) {
    let pts = ptsptaObj.pts;
    let ptspta = {
      rol: pts.rol,
      name: pts.nam,
      ptyinr: pts.ptyinr,
      ptainr: pts.ptainr,
      extkey: pts.extkey,
      dftdsp: pts.dftdsp,
      dftcur: pts.dftcur,
      dftact: pts.dftact,
      dftfeecur: pts.dftfeecur,
      dftactptainr: pts.dftactptainr,
      glggrpflg: pts.glggrpflg,
      adrblk: pts.adrblk
    };
    return ptspta;
  },
  buildCommonData (model, trnName) {
    let ptsptaList = [];
WH committed
22 23
    if (model.lidgrp.apl.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.lidgrp.apl));
WH committed
24
    }
WH committed
25 26
    if (model.lidgrp.adv.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.lidgrp.adv));
WH committed
27
    }
WH committed
28 29
    if (model.lidgrp.ben.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.lidgrp.ben));
WH committed
30 31 32
    }
    let dataObj = {
      rec: {
liaoxing committed
33
        objtyp: 'BRD',
panziyi committed
34 35 36 37 38
        objinr: model.brdgrp.rec.inr,
        ownref: model.brdgrp.rec.ownref,
        opndat: model.brdgrp.rec.opndat,
        expdat: model.brdgrp.rec.expdat,
        branchInr: model.brdgrp.rec.branchinr,
WH committed
39 40 41 42 43 44 45 46 47 48 49 50
        hndtyp: model.lidgrp.rec.hndtyp,
        gartyp: model.lidgrp.rec.gartyp,
        fingua: model.lidgrp.rec.fingua,
        // segtyp: model.gidgrp.ghd.segtyp,
        fromflg: model.lidgrp.rec.fromflg,
        othersno: model.lidgrp.rec.othersno,
        sndto: model.lidgrp.rec.sndto,
        // swiftflg: model.gitp.swiftflg,
        giduil: model.lidgrp.rec.giduil,
        purpos: model.lidgrp.rec.purpos,
        revflg: model.lidgrp.rec.revflg,
        cnfsta: model.lidgrp.rec.cnfsta,
liaoxing committed
51
        advtyp: model.brdgrp.rec.advtyp,
WH committed
52 53
      },
      cbsMap: {
panziyi committed
54 55 56 57 58 59 60 61
        // MAX: model.lidgrp.cbs.max,
        // OLDMAX: model.lidgrp.cbs.oldmax,
        // MAX2: model.lidgrp.cbs.max2,
        // NOM1: model.lidgrp.cbs.nom1,
        // OPN1: model.lidgrp.cbs.opn1,
        MAX: model.brdgrp.cbs.max,
        MAX2: model.brdgrp.cbs.max2,
        OPN2: model.brdgrp.cbs.opn1,
WH committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
      },
      ptsList: ptsptaList,
      transName: trnName,
      userId: window.sessionStorage.userId ? window.sessionStorage.userId : 'ZL'
    };
    return dataObj
  },
  buildSetfeg (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      liaall: model.liaall,
      liaccv: model.liaccv,
      doceot: model.trnmod.trndoc.doceot,
    };
    return params
  },
  buildSetglg (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      setfeg: model.setmod.setfeg,
      liaall: model.liaall,
      liaccv: model.liaccv,
    };
    return params
  },
  buildGlentry (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      liaallg: model.liaall.liaallg,
      setfog: model.setmod.setfog,
      setfeg: model.setmod.setfeg,
      setglg: model.setmod.setglg,
    };
    return params
  },
  buildEngp (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      liaallg: model.liaall.liaallg,
    };
    return params
  },
  buildDocpan (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
    };
    return params
  },
  buildCcvpan (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      liaccvg: model.liaccv.liaccvg,
      oldamt: model.liaccv.oldamt,
      chgamt: model.liaccv.chgamt,
      concur: model.liaccv.concur,
    };
    return params
  },
  buildLimitbody (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      rec: {
WH committed
124
        objtyp: 'LID',
125 126
        objinr: model.lidgrp.rec.objinr,
        ownref: model.lidgrp.rec.ownref,
WH committed
127 128 129 130 131 132 133 134
      },
    };
    return params
  },
  buildDoctre (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      rec: {
WH committed
135
        objtyp: 'LID',
136 137 138
        objinr: model.lidgrp.rec.objinr,
        ownref: model.lidgrp.rec.ownref,
        // swiftflg: model.gitp.swiftflg,
WH committed
139 140 141 142 143 144 145 146 147 148 149 150 151
      },
    };
    return params
  },
  // 公共组件setmod中dsp字段改变,触发联动时候的入参
  buildSetgllAccts (model, trnName, setglg) {
    let params = {
      ...this.buildCommonData(model, trnName),
      setglg
    };
    return params
  }
}