import event from "../../tga/event"

export default {
    mixins: [event],
    methods: {

        async checkTga() {
            this.$refs['modelForm'].validate(async (validStatic) => {
                if (validStatic) {
                    const loading = this.loading('正在校验数据');
                    // 清除之前的校验状态
                    this.$refs.modelForm.clearValidate();
                    this.$notify({
                        title: "成功",
                        message: "校验成功",
                        type: "success",
                    });
                    loading.close();
                    // const rtnmsg = await Api.post("/report/rmbsel/validate2111", this.model.tdb2111.tdbVo);
                    // if (rtnmsg.respCode === SUCCESS) {
                    //     const fieldErrors = rtnmsg.data;
                    //     if (fieldErrors && Object.keys(fieldErrors).length === 0) {
                    //         // 清除之前的校验状态
                    //         this.$refs.modelForm.clearValidate();
                    //         this.$notify({
                    //             title: "成功",
                    //             message: "校验成功",
                    //             type: "success",
                    //         });
                    //         loading.close();
                    //         return
                    //     }
                    //     const tab = this.showBackendErrors(fieldErrors);
                    //     if (tab) {
                    //         // 判断校验失败的表单不属于当前的tab,则切换tab到对应报错的tab页面
                    //         if (tab.name !== this.tabVal) {
                    //             this.tabClick(tab, '1');
                    //         }
                    //     }
                    //     loading.close();
                    // }
                } else {
                    // 前端校验失败
                    this.$notify({
                        title: '失败',
                        message: '校验失败',
                        type: 'error',
                    });
                }
            })
        },
        // async getInf(val) {
        //     let params = {
        //         banktrano: this.model.tdb2111.tdbVo.banktrano,
        //         rmbtyp: val
        //     };
        //     let rtnmsg = await Api.post("/report/rmbsel/getRef", params);
        //     if (rtnmsg.respCode === SUCCESS) {
        //         this.model.tdb2111.tdbVo.levyno = rtnmsg.data;
        //         this.flg = true;
        //         this.i = this.i + 1
        //     }
        // },
        // async ownextkeyChange(val) {
        //     let res = await Api.post('/report/rmbsel/getDecnum', val);
        //     if (res.respCode === SUCCESS) {
        //         this.model.tdb2111.tdbVo.bankorgcode = res.data;
        //     }
        // },
        // payeeaccttypeC(val) {
        //     if (val === '3') {
        //         this.model.tdb2111.tdbVo.payeeacct = 'N/A'
        //     } else {
        //         this.model.tdb2111.tdbVo.payeeacct = ''
        //     }
        // }
    }
}