import Utils from "~/utils"

/**
* Ditopn Check规则
*/
let checkObj = {
    "litp1.advp.ptsget.sdamod.dadsnd"                      :null,
    "liaall.misamt"                      :null,
    "lidgrp.rec.shpdat"                      :null,
    "lidgrp.blk.preper"                      :null,
    "lidgrp.rec.lcrtyp"                      :null,
    "litp1.recget.sdamod.dadsnd"                      :null,
    "lidgrp.cbs.nom1.cur"                      :null,
    "ameadvrmk"                      :null,
    "lidgrp.rec.isstyp"                      :null,
    "lidgrp.rec.jjh"                      :null,
    "lidgrp.yfb.pts.adrblk"                      :null,
    "lidgrp.adv.pts.adrblk"                      :null,
    "lidgrp.blk.lcrgod"                      :null,
    "lidgrp.blk.adlcnd"                      :null,
    "litp1.aplp.ptsget.sdamod.dadsnd"                      :null,
    "lidgrp.rec.expplc"                      :null,
    "lidgrp.rmb.pts.extkey"                      :null,
    "mtabut.coninf.conexedat"                      :null,
    "lidgrp.adv.pts.extkey"                      :null,
    "lidgrp.rec.avbby"                      :null,
    "lidgrp.ben.pts.extkey"                      :null,
    "lidgrp.age.pts.extkey"                      :null,
    "lidgrp.cbs.nom1.amt"                      :lidgrpCbsNom1AmtCheck,
    "lidgrp.blk.defdet"                      :null,
    "lidgrp.blk.lcrdoc"                      :null,
    "lidgrp.rmb.pts.adrblk"                      :null,
    "lidgrp.blk.insbnk"                      :null,
    "litp1.rmbp.ptsget.sdamod.dadsnd"                      :null,
    "litp1.agep.ptsget.sdamod.dadsnd"                      :null,
    "setmod.dspflg"                      :null,
    "lidgrp.ben.pts.ref"                      :null,
    "lidgrp.rec.expdat"                      :null,
    "lidgrp.apl.pts.ref"                      :null,
    "lidgrp.rec.yfxx"                      :null,
    "lidgrp.apl.pts.adrblk"                      :null,
    "setmod.docamt"                      :null,
    "litp1.usr.extkey"                      :null,
    "lidgrp.ben.pts.adrblk"                      :null,
    "liaall.liaccv.cshpct"                      :null,
    "lidgrp.age.pts.adrblk"                      :null,
    "lidgrp.apl.pts.extkey"                      :null,
    "lidgrp.rec.opndat"                      :null,
    "liaall.liaccv.totcovamt"                      :null,
    "lidgrp.rec.apprulrmb"                      :null,
    "lidgrp.rec.tenmaxday"                      :null,
    "litp1.benp.ptsget.sdamod.dadsnd"                      :null,
    "lidgrp.adv.dbfadrblkcn"                      :null,
    "litp1.yfbp.ptsget.sdamod.dadsnd"                      :null,
    "lidgrp.rec.rmbcha"                      :null,
    "litameadv"                      :null,
    "lidgrp.yfb.pts.extkey"                      :null,
    "lidgrp.blk.revcls"                      :null,
    "lidgrp.rec.revtyp"                      :null,
    "lidgrp.rec.revdat"                      :null,
    "liaall.liaccv.relcshpct"                      :null,
}

for (const key in checkObj) {
    if (Object.hasOwnProperty.call(checkObj, key)) {
        checkObj[key] = checkObj[key] ? checkObj[key] : Utils.reflectCheck(key)
    }
}

async function lidgrpCbsNom1AmtCheck (rule, value, callback){
    //调用具体的check
    const key = "lidgrp.cbs.nom1.amt";
    const res = await this.exeuteCheck(key)
    if (res.respCode == SUCCESS){
        Utils.copyValueFromVO(this.model, res.data)
    }
    if (Object.hasOwnProperty.call(res.fieldErrors, key)) {
        callback(new Error(res.fieldErrors[key]))
    } else {
        callback();
    }
}
export default checkObj

