buildCommons.js 4.17 KB
Newer Older
WF1020 committed
1
export default {
2
  buildPtspta(ptsptaObj) {
WF1020 committed
3 4 5 6 7 8 9 10 11 12 13 14 15
    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,
16
      adrblk: pts.adrblk,
WF1020 committed
17 18 19
    };
    return ptspta;
  },
20
  buildCommonData(model, trnName) {
WF1020 committed
21 22 23 24 25 26 27 28 29 30
    let ptsptaList = [];
    if (model.gidgrp.apl.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.gidgrp.apl));
    }
    if (model.gidgrp.ben.pts.extkey) {
      ptsptaList.push(this.buildPtspta(model.gidgrp.ben));
    }
    let dataObj = {
      rec: {
        objtyp: 'GID',
31
        objinr: model.gidgrp.rec.objinr,
WF1020 committed
32
        ownref: model.gidgrp.rec.ownref,
33
        segtyp: model.gidgrp.rec.segtyp,
WF1020 committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
        fromflg: model.gidgrp.rec.fromflg,
        othersno: model.gidgrp.rec.othersno,
        sndto: model.gidgrp.rec.sndto,
        giduil: model.gidgrp.rec.giduil,
        purpos: model.gidgrp.rec.purpos,
        revflg: model.gidgrp.rec.revflg,
        cnfsta: model.gidgrp.rec.cnfsta,
      },
      cbsMap: {
        MAX: model.gidgrp.cbs.max,
        OPN1: model.gidgrp.cbs.opn1,
        MAC: model.gidgrp.cbs.mac,
        MAC2: model.gidgrp.cbs.mac2,
        OPC2: model.gidgrp.cbs.opc2,
        CNF: model.gidgrp.cbs.cnf,
      },
      ptsList: ptsptaList,
      transName: trnName,
52 53 54
      userId: window.sessionStorage.userId
        ? window.sessionStorage.userId
        : 'ZL',
WF1020 committed
55
    };
56
    return dataObj;
WF1020 committed
57
  },
58
  buildSetfeg(model, trnName) {
WF1020 committed
59 60 61 62 63 64
    let params = {
      ...this.buildCommonData(model, trnName),
      liaall: model.liaall,
      liaccv: model.liaccv,
      doceot: model.trnmod.trndoc.doceot,
    };
65
    return params;
WF1020 committed
66
  },
67
  buildSetglg(model, trnName) {
WF1020 committed
68 69 70 71
    let params = {
      ...this.buildCommonData(model, trnName),
      setfeg: model.setmod.setfeg,
    };
72
    return params;
WF1020 committed
73
  },
74
  buildGlentry(model, trnName) {
WF1020 committed
75 76
    let params = {
      ...this.buildCommonData(model, trnName),
77 78 79 80 81 82 83 84 85 86 87 88 89 90
      rec: {
        objtyp: 'GID',
        segtyp: model.gidgrp.rec.segtyp,
        fromflg: model.gidgrp.rec.fromflg,
        othersno: model.gidgrp.rec.othersno,
        sndto: model.gidgrp.rec.sndto,
        giduil: model.gidgrp.rec.giduil,
        purpos: model.gidgrp.rec.purpos,
        revflg: model.gidgrp.rec.revflg,
        cnfsta: model.gidgrp.rec.cnfsta,
      },
      liaccv: model.liaccv,
      doceot: model.trnmod.trndoc.doceot,
      transName: trnName,
WF1020 committed
91
    };
92
    return params;
WF1020 committed
93
  },
94
  buildEngp(model, trnName) {
WF1020 committed
95 96
    let params = {
      ...this.buildCommonData(model, trnName),
97 98 99 100 101 102 103 104 105 106 107 108 109 110
      cbsMap: {
        CNF: model.gidgrp.cbs.cnf,
      },
      liaccv: model.liaccv,
      doceot: model.trnmod.trndoc.doceot,
      transName: trnName,
    };
    params.rec = {
      ...params.rec,
      opndat: model.gidgrp.rec.opndat,
      branchInr: model.gidgrp.rec.branchInr,
      hndtyp: model.gidgrp.rec.hndtyp,
      gartyp: model.gidgrp.rec.gartyp,
      fingua: model.gidgrp.rec.fingua,
WF1020 committed
111
    };
112
    return params;
WF1020 committed
113
  },
114
  buildDocpan(model, trnName) {
WF1020 committed
115 116
    let params = {
      ...this.buildCommonData(model, trnName),
117 118 119 120 121 122 123 124 125 126 127 128 129
      rec: {
        objtyp: 'GID',
        fromflg: model.gidgrp.rec.fromflg,
        othersno: model.gidgrp.rec.othersno,
        sndto: model.gidgrp.rec.sndto,
        giduil: model.gidgrp.rec.giduil,
        purpos: model.gidgrp.rec.purpos,
        cnfsta: model.gidgrp.rec.cnfsta,
        revflg: model.gidgrp.rec.revflg,
      },
      liaccv: model.liaccv,
      doceot: model.trnmod.trndoc.doceot,
      transName: trnName,
WF1020 committed
130
    };
131
    return params;
WF1020 committed
132
  },
133
  buildCcvpan(model, trnName) {
WF1020 committed
134 135
    let params = {
      ...this.buildCommonData(model, trnName),
136 137 138 139 140 141 142 143 144
    };
    params.rec = {
      ...params.rec,
      opndat: model.gidgrp.rec.opndat,
      expdat: model.gidgrp.rec.expdat,
      branchInr: model.gidgrp.rec.branchInr,
      hndtyp: model.gidgrp.rec.hndtyp,
      gartyp: model.gidgrp.rec.gartyp,
      fingua: model.gidgrp.rec.fingua,
WF1020 committed
145 146 147 148 149
      liaccvg: model.liaccv.liaccvg,
      oldamt: model.liaccv.oldamt,
      chgamt: model.liaccv.chgamt,
      concur: model.liaccv.concur,
    };
150
    return params;
WF1020 committed
151
  },
152
};