import CfagitCheck from '~/components/business/Cfagit/model/check.js';
import RmbbopCheck from "../../../../components/business/rmb/rmbbop/model/check";
import BoppayCheck from "../../../../components/business/Boppay/model/check"
import moment from "moment";

export default function () {
    return {
        ...new RmbbopCheck(this).check,
        ...new CfagitCheck(this).check,
        ...new BoppayCheck(this).check,
        "gctp.gidget.sdamod.dadsnd": [{
            type: "string",
            required: false,
            message: "必输项"
        },

            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "ischktyp": [
            {
                type: "string",
                required: true,
                message: "必输项"
            }
        ],
        "prechkdat": [
            {
                validator: (rule, value, callback) => {
                    if (moment(value).diff(moment(new Date()), 'days') < 0) {
                        callback(new Error('输入日期不得早于当前日期!'))
                    } else {
                        callback()
                    }
                },
                trigger: 'change'
            },
            {
                validator: (rule, value, callback) => {
                    if (this.model.ischktyp == 'Y') {
                        if (this.model.prechkdat == null || this.model.prechkdat == '') {
                            callback(new Error('This field is mandatory'))
                        } else {
                            callback()
                        }
                    } else {
                        callback()
                    }
                },
                trigger: 'change'
            },
        ],
        "gidgrp.rec.ownref": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gctp.gidget.sdamod.seainf": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],


        "gidgrp.rec.expdat": [{

            required: false,
            message: "输入正确的日期"
        }],
        "gidgrp.cbs.opn1.cur": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],
        "gidgrp.cbs.opn1.amt": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 17,
                message: "整数位不能超过14位"
            },
            // {pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" }
        ],
        "gcdgrp.rec.ownref": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gctp.recget.sdamod.seainf": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],

        "gctp.recget.sdamod.dadsnd": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gcdgrp.rec.nam": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 40,
                message: "长度不能超过40"
            }
        ],
        "gcdgrp.cbs.max.cur": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],
        "gcdgrp.cbs.max.amt": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 17,
                message: "整数位不能超过14位"
            },
            // {pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" }
        ],

        "gcdgrp.apl.pts.ref": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gcdgrp.cbs.opn1.cur": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],
        "gcdgrp.apl.pts.nam": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 40,
                message: "长度不能超过40"
            }
        ],


        "gcdgrp.ben.pts.ref": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],


        "gidgrp.rec.liadat": [{

            required: false,
            message: "输入正确的日期"
        }],
        "gcdgrp.ben.pts.nam": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 40,
                message: "长度不能超过40"
            }
        ],
        "gcdgrp.rec.clmdat": [{

            required: false,
            message: "输入正确的日期"
        }],

        "gcdgrp.prb.pts.ref": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],

        "gcdgrp.cbs.max2.amt": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 17,
                message: "整数位不能超过14位"
            },
            // {pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" }
        ],
        "gctp.prbp.ptsget.sdamod.dadsnd": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gcdgrp.prb.pts.extkey": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gctp.prbp.ptsget.sdamod.seainf": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],


        "gcdgrp.prb.namelc": [{
            type: "string",
            required: true,
            message: "必输项"
        },
            {
                max: 35,
                message: "长度不能超过35"
            }
        ],
        "gcdgrp.prb.pts.adrblk": [{
            type: "string",
            required: true,
            message: "必输项"
        },
        ],
        "gcdgrp.prb.dbfadrblkcn": [{
            type: "string",
            required: true,
            message: "必输项"
        },
        ],

        "gcdgrp.prb.adrelc": [{
            type: "string",
            required: true,
            message: "必输项"
        },
            {
                max: 35,
                message: "长度不能超过35"
            }
        ],

        "gctp.othp.ptsget.sdamod.dadsnd": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gcdgrp.oth.pts.extkey": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 16,
                message: "长度不能超过16"
            }
        ],
        "gctp.othp.ptsget.sdamod.seainf": [{
            type: "string",
            required: false,
            message: "必输项"
        },
            {
                max: 3,
                message: "长度不能超过3"
            }
        ],

        "gcdgrp.oth.namelc": [{
            type: "string",
            required: true,
            message: "必输项"
        },
            {
                max: 35,
                message: "长度不能超过35"
            }
        ],
        "gcdgrp.oth.pts.adrblk": [{
            type: "string",
            required: true,
            message: "必输项"
        },
        ],
        "gcdgrp.oth.dbfadrblkcn": [{
            type: "string",
            required: true,
            message: "必输项"
        },
        ],
        "gcdgrp.oth.adrelc": [{
            type: "string",
            required: true,
            message: "必输项"
        },
            {
                max: 35,
                message: "长度不能超过35"
            }
        ],
        "cmtflg": [
            {
                type: "string",
                required: true,
                message: "必输项"
            }
        ],
        "cipmodVo.fuyns1": [
            {
                validator: (rule, value, callback) => {
                    if (this.model.swftyp == "CIV" || this.model.swftyp == "CIU") {
                        if (this.model.cipmodVo.fuyns1 == '' && (this.model.cipmodVo.fuyns2 != '' || this.model.cipmodVo.fuyns3 != '' || this.model.cipmodVo.fuyns4 != '')) {
                            callback(new Error('请按顺序先输入致收款人银行附言1栏位!'))
                        } else {
                            callback()
                        }
                    }
                },
                trigger: 'change'
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/^[,,。,-]/.test(value)) {
                            callback(new Error("此栏位不能以\",\"或\"。\"或\"-\"开始!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/:+/.test(value)) {
                            callback(new Error("此栏位不能出现半角\":\"!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
        ],
        "cipmodVo.fuyns2": [
            {
                validator: (rule, value, callback) => {
                    if (this.model.swftyp == "CIV" || this.model.swftyp == "CIU") {
                        if (this.model.cipmodVo.fuyns1 == '' && (this.model.cipmodVo.fuyns2 != '' || this.model.cipmodVo.fuyns3 != '' || this.model.cipmodVo.fuyns4 != '')) {
                            callback(new Error('请按顺序先输入致收款人银行附言1栏位!'))
                        } else {
                            callback()
                        }
                    }
                },
                trigger: 'change'
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/^[,,。,-]/.test(value)) {
                            callback(new Error("此栏位不能以\",\"或\"。\"或\"-\"开始!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/:+/.test(value)) {
                            callback(new Error("此栏位不能出现半角\":\"!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
        ],
        "cipmodVo.fuyns3": [
            {
                validator: (rule, value, callback) => {
                    if (this.model.swftyp == "CIV" || this.model.swftyp == "CIU") {
                        if (this.model.cipmodVo.fuyns1 == '' && (this.model.cipmodVo.fuyns2 != '' || this.model.cipmodVo.fuyns3 != '' || this.model.cipmodVo.fuyns4 != '')) {
                            callback(new Error('请按顺序先输入致收款人银行附言1栏位!'))
                        } else {
                            callback()
                        }
                    }
                },
                trigger: 'change'
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/^[,,。,-]/.test(value)) {
                            callback(new Error("此栏位不能以\",\"或\"。\"或\"-\"开始!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/:+/.test(value)) {
                            callback(new Error("此栏位不能出现半角\":\"!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
        ],
        "cipmodVo.fuyns4": [
            {
                validator: (rule, value, callback) => {
                    if (this.model.swftyp == "CIV" || this.model.swftyp == "CIU") {
                        if (this.model.cipmodVo.fuyns1 == '' && (this.model.cipmodVo.fuyns2 != '' || this.model.cipmodVo.fuyns3 != '' || this.model.cipmodVo.fuyns4 != '')) {
                            callback(new Error('请按顺序先输入致收款人银行附言1栏位!'))
                        } else {
                            callback()
                        }
                    }
                },
                trigger: 'change'
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/^[,,。,-]/.test(value)) {
                            callback(new Error("此栏位不能以\",\"或\"。\"或\"-\"开始!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/:+/.test(value)) {
                            callback(new Error("此栏位不能出现半角\":\"!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
        ],
        "cipmodVo.pyebchkey": [
            {
                validator: (rule, value, callback) => {
                    if (!this.model.cipmodVo.pyebchkey && !this.model.cipmodVo.pyebchnam) {
                        callback(new Error('开户行行号和开户行名称至少填一项!'));
                    } else {
                        callback();
                    }
                }, trigger: ['blur', 'change']
            },
            {
                type: "string",
                required: true,
                message: "必输项"
            },
        ],
        "cipmodVo.skkhhh": [
            {
                validator: (rule, value, callback) => {
                    if (!this.model.cipmodVo.skkhhh && !this.model.cipmodVo.skkhhm && !this.model.cipmodVo.skkhdz) {
                        callback(new Error('收款行行号、名称和地址至少填一项!'));
                    } else {
                        callback();
                    }
                }, trigger: ['blur', 'change']
            }],
        "cipmodVo.zjg1hh": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            }
        ],
        "cipmodVo.zjg1mc": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            }
        ],
        "cipmodVo.zjg2hh": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            }
        ],
        "cipmodVo.zjg2mc": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            }
        ],
        "cipmodVo.fuynh2": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 140,
                message: "The name is too long, need to be less than 140"
            }
        ],
        "cipmodVo.fuynh3": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 140,
                message: "The name is too long, need to be less than 140"
            }
        ],
        "cipmodVo.fuynh4": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 140,
                message: "The name is too long, need to be less than 140"
            }
        ],
        "cipmodVo.commen": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/^[,,。,-]/.test(value)) {
                            callback(new Error("此栏位不能以\",\"或\"。\"或\"-\"开始!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/:+/.test(value)) {
                            callback(new Error("此栏位不能出现半角\":\"!"))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 135,
                message: "The name is too long, need to be less than 135"
            }
        ],
        "cipmodVo.ddbhao": [{
            type: "string",
            required: true,
            message: "必输项"
        },],
        "cipmodVo.ddmisu": [{
            type: "string",
            required: true,
            message: "必输项"
        },],
        "cipmodVo.fkrkhh": [{
            type: "string",
            required: true,
            message: "必输项"
        },],
        "cipmodVo.fukrhm": [{
            type: "string",
            required: true,
            message: "必输项"
        },],
        "cipmodVo.pyebchnam": [{
            type: "string",
            required: true,
            message: "必输项"
        },],
        "cipmodVo.skkhhm": [{
            type: "string",
            required: true,
            message: "必输项"
        },
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 120,
                message: "The name is too long, need to be less than 120"
            }
        ],
        "cipmodVo.skkhdz": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 70,
                message: "The name is too long, need to be less than 70"
            }
        ],
        "cipmodVo.fkkhmc": [
            {
                max: 120,
                message: "The name is too long, need to be less than 120"
            }
        ],
        "cipmodVo.fkhdzh": [
            {
                validator: function (rule, value, callback) {
                    if (value) {
                        if (/[<,>,&,\',\"']/.test(value)) {
                            callback(new Error('此栏位不允许输入<,>,&,\'和\"'))
                        } else {
                            callback()
                        }
                    }
                    callback()
                },
                trigger: ['blur', 'change']
            },
            {
                max: 70,
                message: "The name is too long, need to be less than 70"
            }
        ],
        "cipmodVo.reconebch": [
            {
                type: "string",
                required: true,
                message: "必输项"
            },
        ],
        "cipmodVo.reconebchnam": [
            {
                type: "string",
                required: true,
                message: "必输项"
            },
        ],
        "gcdgrp.cbs.opn1.amt": [
            {
                validator: (rule, value, callback) => {

                    if (this.model.actualMax != "" && Number(value) > Number(this.model.actualMax)) {

                        callback(new Error('实际赔付金额不能大于索赔余额'))
                    } else if (value <= 0) {
                        callback(new Error('实际赔付金额不能小于等于零'))
                    } else {
                        callback()
                    }
                },
                trigger: ['blur', 'change']
            },
            {
                max: 17,
                message: "整数位不能超过14位"
            },
        ],
        "gcdgrp.cbs.opn2.amt": [
            {
                validator: (rule, value, callback) => {

                    if (this.model.actualMax2 != "" && Number(value) > Number(this.model.actualMax2)) {

                        callback(new Error('实际赔付附加金额不能大于赔付附加金额'))
                    } else if (value <= 0) {
                        callback(new Error('实际赔付附加金额不能小于等于零'))
                    } else {
                        callback()
                    }
                },
                trigger: ['blur', 'change']
            },

        ],
    }
}