buildCommons.js 4.25 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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
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 = [];
    if (model.bedgrp.apl.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.bedgrp.apl));
    }
    if (model.bedgrp.iss.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.bedgrp.iss));
    }
    if (model.bedgrp.prb.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.bedgrp.prb));
    }
    if (model.bedgrp.oth.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.bedgrp.oth));
    }

    let dataObj = {
      rec: {
panziyi committed
37
        objtyp: 'LED',
panziyi committed
38
        objinr: model.ledgrp.rec.inr,
panziyi committed
39 40 41
        ownref: model.ledgrp.rec.ownref,
        opndat: model.ledgrp.rec.opndat,
        expdat: model.ledgrp.rec.expdat,
panziyi committed
42
        branchInr: model.ledgrp.rec.branchinr,
panziyi committed
43 44 45
        hndtyp: model.ledgrp.rec.hndtyp,
        gartyp: model.ledgrp.rec.gartyp,
        fingua: model.ledgrp.rec.fingua,
WH committed
46
        // segtyp: model.bedgrp.ghd.segtyp,
panziyi committed
47 48 49
        fromflg: model.ledgrp.rec.fromflg,
        othersno: model.ledgrp.rec.othersno,
        sndto: model.ledgrp.rec.sndto,
WH committed
50
        // swiftflg: model.gitp.swiftflg,
panziyi committed
51 52 53 54 55
        giduil: model.ledgrp.rec.giduil,
        purpos: model.ledgrp.rec.purpos,
        revflg: model.ledgrp.rec.revflg,
        cnfsta: model.ledgrp.rec.cnfsta,
        doctypcod: model.bedgrp.rec.doctypcod,
WH committed
56 57 58
      },
      cbsMap: {
        MAX: model.bedgrp.cbs.max,
panziyi committed
59 60
        OLDMAX: model.oldbedgrp.cbs.max,
        OLDMAX2: model.oldbedgrp.cbs.max,
WH committed
61
        OPN1: model.bedgrp.cbs.opn1,
panziyi committed
62
        OPN2: model.bedgrp.cbs.opn2,
WH committed
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 124 125 126 127 128
        MAC: model.bedgrp.cbs.mac,
        MAC2: model.bedgrp.cbs.mac2,
        OPC2: model.bedgrp.cbs.opc2,
        CNF: model.bedgrp.cbs.cnf,
      },
      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: {
panziyi committed
129
        objtyp: 'LED',
WH committed
130 131 132 133 134 135 136 137 138 139
        objinr: model.bedgrp.rec.objinr,
        ownref: model.bedgrp.rec.ownref,
      },
    };
    return params
  },
  buildDoctre (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      rec: {
panziyi committed
140
        objtyp: 'LED',
WH committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
        objinr: model.bedgrp.rec.objinr,
        ownref: model.bedgrp.rec.ownref,
        // swiftflg: model.gitp.swiftflg,
      },
    };
    return params
  },
  // 公共组件setmod中dsp字段改变,触发联动时候的入参
  buildSetgllAccts (model, trnName, setglg) {
    let params = {
      ...this.buildCommonData(model, trnName),
      setglg
    };
    return params
  }
}