buildCommons.js 3.64 KB
Newer Older
liaoxing 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 = [];
liaoxing committed
22 23 24 25 26
    if (model.ccdgrp.cor.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.ccdgrp.cor));
    }
    if (model.ccdgrp.pre.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.ccdgrp.pre));
liaoxing committed
27
    }
liaoxing committed
28 29
    if (model.ccdgrp.dro.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.ccdgrp.dro));
liaoxing committed
30
    }
liaoxing committed
31 32
    if (model.ccdgrp.col.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.ccdgrp.col));
liaoxing committed
33 34 35 36
    }
    let dataObj = {
      rec: {
        objtyp: 'CCD',
liaoxing committed
37
        objinr: model.ccdgrp.rec.inr,
liaoxing committed
38 39 40
        ownref: model.ccdgrp.rec.ownref,
        opndat: model.ccdgrp.rec.opndat,
        expdat: model.ccdgrp.rec.expdat,
liaoxing committed
41
        branchInr: model.ccdgrp.rec.branchinr,
liaoxing committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
        hndtyp: model.ccdgrp.rec.hndtyp,

      },
      cbsMap: {
        MAX: model.ccdgrp.cbs.max,
        OPN1: model.ccdgrp.cbs.opn1,
        // MAC: model.bodgrp.cbs.mac,
        // MAC2: model.bodgrp.cbs.mac2,
        // OPC2: model.bodgrp.cbs.opc2,
        // CNF: model.bodgrp.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,
liaoxing committed
64
      // doceot: model.trnmod.trndoc.doceot,
liaoxing committed
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 129 130 131 132 133 134 135 136 137 138 139 140 141
    };
    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: {
        objtyp: 'CCD',
        objinr: model.ccdgrp.rec.inr,
        ownref: model.ccdgrp.rec.ownref,
      },
    };
    return params
  },
  buildDoctre (model, trnName) {
    let params = {
      ...this.buildCommonData(model, trnName),
      rec: {
        objtyp: 'CCD',
        objinr: model.ccdgrp.rec.inr,
        ownref: model.ccdgrp.rec.ownref,
        // swiftflg: model.gitp.swiftflg,
      },
    };
    return params
  },
  // 公共组件setmod中dsp字段改变,触发联动时候的入参
  buildSetgllAccts (model, trnName, setglg) {
    let params = {
      ...this.buildCommonData(model, trnName),
      setglg
    };
    return params
  }
}