index.js 8.92 KB
Newer Older
fukai 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';

export default {
  mixins: [commonFunctions],
  methods: {
    changeFreFlg(){
      if(this.model.gcdgrp.rec.frepayflg=='X'){
          this.model.cmtflg = 'O';
          this.model.paypsb = '';
      }
      if(!!this.model.gcdgrp.rec.frepayflg||this.model.gidgrp.rec.hndtyp=='OT'){
          this.model.paypsb='';
      }
    },
    changeCmtFlg(){
      if(this.model.gidgrp.rec.cmtflg != 'X'){
        this.model.cmtflg = '';
      }else{
        if(this.model.gcdgrp.rec.frepayflg=='X'){
          this.model.cmtflg = 'O';
        }
      }
    },
    calcName() {
			this.model.gcdgrp.rec.nam = this.model.gcdgrp.cbs.max.cur + " " + this.model.gcdgrp.cbs.max.amt + " " + this.model.gcdgrp.apl.pts.nam;
			this.model.gcdgrp.rec.nam = this.model.gcdgrp.rec.nam.slice(0, 40);
    },
    changeCmtflg(){
      if(this.model.gidgrp.rec.cmtflg==""){
        this.model.cmtflg="";
      }
    },
		// gcdgrp.rec.docprbrol
		calcPrb() {
			console.log("this.model.gcdgrp.rec.docprbrol-->" + this.model.gcdgrp.rec.docprbrol);
			switch (this.model.gcdgrp.rec.docprbrol) {

				case "ADV":
					Utils.copyValueFromVoData(this.model.gcdgrp.prb.pts, this.model.gidgrp.adv.pts);
					this.model.gcdgrp.prb.pts.rol = "PRB";
					break;
				case "BEN":
					Utils.copyValueFromVoData(this.model.gcdgrp.prb.pts, this.model.gidgrp.ben.pts);
					this.model.gcdgrp.prb.pts.rol = "PRB";
					break;
				case "ISS":
					Utils.copyValueFromVoData(this.model.gcdgrp.prb.pts, this.model.gidgrp.iss.pts);
					this.model.gcdgrp.prb.pts.rol = "PRB";
					break;
				case "ATB":
					Utils.copyValueFromVoData(this.model.gcdgrp.prb.pts, this.model.gidgrp.atb.pts);
					this.model.gcdgrp.prb.pts.rol = "PRB";
					break;
				case "AT2":
					Utils.copyValueFromVoData(this.model.gcdgrp.prb.pts, this.model.gidgrp.at2.pts);
					this.model.gcdgrp.prb.pts.rol = "PRB";
					break;
				default:
					Utils.copyValueFromVoData(this.model.gcdgrp.prb.pts, "");
					this.model.gcdgrp.prb.pts.rol = "PRB";
					break;
			}
		},
		// gcdgrp.rec.payrol
		calcOth() {
			switch (this.model.gcdgrp.rec.payrol) {
				case "APL":
					Utils.copyValueFromVoData(this.model.gcdgrp.oth.pts, this.model.gidgrp.apl.pts);
					this.model.gcdgrp.oth.pts.rol = "OTH";
					break;
				default:
					Utils.copyValueFromVoData(this.model.gcdgrp.oth.pts, "");
					this.model.gcdgrp.oth.pts.rol = "OTH";
					break;
			}
    },

    
    
    async tabClick (tab) {
      if (this.isInDisplay) {
        return;
      }
      let name = tab.name;
      switch (name) {
        case 'cbsp':
          this.getCbsTyp();
          this.queryCbbData();
          break;
        case 'cbep':
          this.queryCbeData();
          break;
        case 'fep':
          this.queryFepData();
          this.queryFcpData();
          break;
        case 'trnp':
          this.queryTrnData();
          break;
        case 'smhp':
          this.querySmhData();
        default:
          return;
      }
    },
    // 点击获取按钮拉取当前key字段下的表单数据
    queryFormData (key) {
    },
    async getCbsTyp() {
      let rtnmsg = await Api.post('/business/gitsel/getCbbTyp', {objtyp: this.objtyp,objinr: this.model.gcdgrp.rec.inr});    
      if (rtnmsg.respCode === SUCCESS) {
        this.cbbtyp = rtnmsg.data;
      }
    },

    async queryCbbData(){
      let rtnmsg = await Api.post('/business/gitsel/queryCbbByCbc', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,cbc:this.model.infcon.cbctxt});
      if(rtnmsg.respCode == SUCCESS){
        this.cbstableData = rtnmsg.data
      }
    },

    changeCbsData(cbsData){
      this.cbstableData = cbsData
    },

    async queryCbbDataInCbb(){
      let rtnmsg = await Api.post('/business/gitsel/queryCbbByCbc', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,cbc:this.model.infcon.cbctxt});
      if(rtnmsg.respCode == SUCCESS){
        this.$emit("changeCbsData",rtnmsg.data)
      }
     
    },

    async queryCbeData(){
     
      let rtnmsg = await Api.post('/business/gitsel/queryCbe', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr});
      if(rtnmsg.respCode  == SUCCESS){
        this.cbetableData = rtnmsg.data
      }
     
    },

    async queryFepData(){
     
      let rtnmsg = await Api.post('/business/gitsel/queryFep', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,feecod:this.model.infcon.fepfeecod,fepdsp:this.model.infcon.fepdsp});
      if(rtnmsg.respCode  == SUCCESS){
        this.feptableData = rtnmsg.data
      }
    
    },
    async queryFepDataInFep(){
     
      let rtnmsg = await Api.post('/business/gitsel/queryFep', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,feecod:this.model.infcon.fepfeecod,fepdsp:this.model.infcon.fepdsp});
      if(rtnmsg.respCode  == SUCCESS){
        this.$emit("changeFepData",rtnmsg.data)
      }
    
    },
    changeFepData(fepData){
      this.feptableData = fepData
    },

    async queryFcpData(){
      let rtnmsg = await Api.post('/business/gitsel/queryFcp', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,fcpdsp:this.model.infcon.fcpdsp});
      if(rtnmsg.respCode  == SUCCESS){
        this.fcptableData = rtnmsg.data
      }
    },
    async queryFcpDataInFcp(){
      let rtnmsg = await Api.post('/business/gitsel/queryFcp', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,fcpdsp:this.model.infcon.fcpdsp});
      if(rtnmsg.respCode  == SUCCESS){
        this.$emit("changeFcpData",rtnmsg.data)
      }
      
    },
    changeFcpData(fcpData){
      this.fcptableData = fcpData
    },

    async queryTrnData(){
      let rtnmsg = await Api.post('/business/gitsel/queryTrn', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,subobjtyp:this.subobjtyp,chksubcon:this.model.infcon.chksubcon,chktrnsta:this.model.infcon.chktrnsta});
      if(rtnmsg.respCode  == SUCCESS){
        this.trntableData = rtnmsg.data
      }
    },

    async queryTrnDataInTrn(){
      let rtnmsg = await Api.post('/business/gitsel/queryTrn', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,subobjtyp:this.subobjtyp,chksubcon:this.model.infcon.chksubcon,chktrnsta:this.model.infcon.chktrnsta});
      if(rtnmsg.respCode  == SUCCESS){
        this.$emit("changeTrnData",rtnmsg.data) 
      }

    },

    changeTrnData(trnData){
      this.trntableData = trnData
    },

    async getInitDataByInr(){
      let res = await Api.post('/business/gitsel/selectGcdByPrimaryKey',this.model.gcdgrp.rec.inr);
      if (res.respCode === SUCCESS) {
        this.model.gcdgrp = res.data.gcdgrp,
        this.model.gidgrp = res.data.gidgrp
       }  
     },  
     changeVal(tabVal){
       this.tabVal = tabVal
     },

    //  async queryTrnDetail(row){
      
    //   let rtnmsg = await Api.post('/business/gitsel/queryTrnDetail', {trninr:row.inr});
    //   if(rtnmsg.respCode  == SUCCESS){
    //     this.model.infcon.trn = rtnmsg.data.trn
    //     this.model.infcon.trs = rtnmsg.data.trs
    //     this.smhtableDataT = rtnmsg.data.smhLst
    //     this.trstableData = rtnmsg.data.trsLst
    //   }     
    //  },

     async  trnTableDblRow(row){
      let rtnmsg = await Api.post('/business/gitsel/queryTrnDetail', {trninr:row.inr});
      if(rtnmsg.respCode  == SUCCESS){
        this.model.infcon.trn = rtnmsg.data.trn
        this.model.infcon.trs = rtnmsg.data.trs
        this.$emit("changeData",rtnmsg.data.smhLst,rtnmsg.data.trsLst)
      } 
      this.model.trnShow = true;
      this.$emit("changeVal",'trnp0')
    },

    changeData(smhtableDataT,trstableData){
      this.smhtableDataT = smhtableDataT;
      this.trstableData = trstableData;
    },
    
    async querySmhData(){
      let rtnmsg = await Api.post('/business/gitsel/querySmh', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,cortyp:this.model.infcon.smhcortyp,datfrom:this.model.infcon.smhdatfrom,datto:this.model.infcon.smhdatto,dir:this.model.infcon.smhdir,chktrn:this.model.infcon.chktrn});
      if(rtnmsg.respCode  == SUCCESS){
        this.smhtableData = rtnmsg.data
      }
    },

    async querySmhDataInSmh(){
      let rtnmsg = await Api.post('/business/gitsel/querySmh', {objtyp:this.objtyp,objinr:this.model.gcdgrp.rec.inr,cortyp:this.model.infcon.smhcortyp,datfrom:this.model.infcon.smhdatfrom,datto:this.model.infcon.smhdatto,dir:this.model.infcon.smhdir,chktrn:this.model.infcon.chktrn});
      if(rtnmsg.respCode  == SUCCESS){
        this.$emit("changeSmhData",rtnmsg.data) 
      }

    },

    changeSmhData(smhData){
      this.smhtableData = smhData
    },
    async getdbCode(codeType,uil,codeNam){
      let params = {
        codeType : codeType,
        uil :  uil ? uil : 'EN'
      }
      let rtnmsg = await Api.post("/manager/dic/listDicInfo",params)
      if(rtnmsg.respCode === SUCCESS){
         let curList = rtnmsg.data.map(item => ({
            value: item.codeValue,
            label: item.codeName
          })); 
          this.model.dbCodes[codeNam] = curList
      } 
    },
    async showMsg(row){
      this.$refs.msgView.fileViewDispaly(-1,{smhinr:row.inr})
    },
  },
};