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

export default {
    async handleSearch() {
        // this.stmData.data = [];
        let colflg = this.model.cldgrp.rec.colflg;
        if (!colflg || colflg == '') {
            this.$notify.error({ title: '错误', message: 'Payemnt Disposition必输!' });
            return;
        }
        let cur = this.model.cur;
        if (!cur || cur == '') {
            this.$notify.error({ title: '错误', message: 'cur必输!' });
            return;
        }
        let rtnmsg = await this.executeRule("butsea")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            this.model.bptbckg.docgrd = rtnmsg.data.ccdbatg;
            // this.updateModel(rtnmsg.data);
            //   this.stmData.data = rtnmsg.data.infbut_dspstm.rows;
            //this.model.infbut.dspstm = rtnmsg.data.infbut_dspstm
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
        console.log(this.model.bptbckg.docgrd);
    },
    async handleReset() {
        // this.model.infcon.seaownref = ""
        // this.model.infcon.opndatfrom = new Date();
        // this.model.infcon.opndatto = new Date();
        // this.model.infcon.searef = "";
        // this.model.infcon.pty.extkey = "";
        // this.model.infcon.usr.extkey = "";
        // this.model.infcon.searol = "";
        // this.model.infcon.pty.nam = "";
        // this.model.infcon.seapty = "";
        // this.model.infcon.curtxt1 = "";
        // this.model.infcon.nam = "";
        // this.model.infcon.seaamtfr = "";
        // this.model.infcon.seaamtto = "";
        // this.model.infcon.seasta = "";
        // this.model.infcon.doctypcod = "";
    },
    async onCltpButgetref() {
        let rtnmsg = await this.executeRule("cltp.butgetref")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            this.model.cldgrp.rec.ownref= rtnmsg.data.cldgrp_rec_ownref;
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
    },
    async onGet() {
        let rtnmsg = await this.executeRule("get")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑

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

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

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

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

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

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

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

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

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

        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
    },

}