import Api from "~/service/Api"
import Utils from "~/utils"

export default {
                async onInfbutSearow(){
                let rtnmsg = await this.executeRule("infbut.searow")
                if(rtnmsg.respCode == SUCCESS)
                {
                    console.log(rtnmsg.data);
                    //TODO 处理数据逻辑
                    this.updateModel(rtnmsg.data);
                    this.stmData.data = rtnmsg.data.infbut_dspstm.rows;
                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onInfbutDsp(idx, row){  
                // const selIds= [idx + 1];
                // const selDst= "dspstm";//dspstm是数据流
                // let params = {selIds,selDst};
                // this.model.infbut.selrow = idx + 1;
                // let rtnmsg = await this.executeRule("infbut.dsp", params)
                // if(rtnmsg.respCode == SUCCESS)
                // {
                //     console.log(rtnmsg.data);
                //     //TODO 处理数据逻辑
                //     this.updateModel(rtnmsg.data);
                //     console.log(this);  
                //     this.root.tabVal="ptyp0";
                //     // this.model.ptysea.extkey=rtnmsg.data.recgrp_rec_extkey;
                // }
                // else
                // {
                // this.$notify.error({title: '错误',message: '服务请求失败!'});
                // }

                this.$router.push({ name: 'Pty', params: { inr: row['INR'] } })
            },
        async onInfbutUserow(){
                let rtnmsg = await this.executeRule("infbut.userow")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onInfbutClr(){
                let rtnmsg = await this.executeRule("infbut.clr")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onInfbutButprt(){
                let rtnmsg = await this.executeRule("infbut.butprt")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onExcel(){
                let rtnmsg = await this.executeRule("excel")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onInfbutExi(){
                let rtnmsg = await this.executeRule("infbut.exi")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanGetpty(){
                let rtnmsg = await this.executeRule("recpan.getpty")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanAltnam(){
                let rtnmsg = await this.executeRule("recpan.altnam")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanGet(){
                let rtnmsg = await this.executeRule("recpan.get")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
            async onRecpanUpd(){
                let rtnmsg = await this.executeRule("recpan.upd")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanUpdall(){
                let rtnmsg = await this.executeRule("recpan.updall")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanEcif(){
                let rtnmsg = await this.executeRule("recpan.ecif")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanDspadr(){
                let rtnmsg = await this.executeRule("recpan.dspadr")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
        async onRecpanLnkdbmpty(){
                let rtnmsg = await this.executeRule("recpan.lnkdbmpty")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
    
        async onRecpanLnkinfptm(){
                let rtnmsg = await this.executeRule("recpan.lnkinfptm")
                if(rtnmsg.respCode == SUCCESS)
                {
                //TODO 处理数据逻辑

                }
                else
                {
                this.$notify.error({title: '错误',message: '服务请求失败!'});
                }
            },
            async handleReset() {
               this.model.ptysea.nam=""
               this.model.ptysea.extkey=""
               this.model.adrsea.str1=""
               this.model.adrsea.bic=""
               this.model.adrsea.loctxt=""
               this.model.adrsea.loczip=""
               this.model.persontype=""
               this.model.jyzt=""
            },
            /**
     * Tabs切换事件
     * @param {VM} tab 
     */
        //    async tabClick(tab){
                
        //         const name=this.tab.name
        //         let rulePath;
        //         if(name=== "actinf" ){
        //         rulePath="recpan.actinf"
        //         let rtnmsg = await this.executeRule(rulePath)
        //         }
        //         if(rtnmsg.respCode == SUCCESS)
        //         {
        //         //TODO 处理数据逻辑
        //         console.log(事件触发了)
        //         }
        //     },

}