import { split } from "lodash";
import Api from "~/service/Api"
import Utils from "~/utils/index"
export default {
    async onUsfmodShwflt() {
        let rtnmsg = await this.executeRule("usfmod_shwflt")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑

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

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

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

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

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

        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败!' });
        }
    },
    async continueEdit(row) {
        //let rtnmsg = await Api.post("getPendingData",{params:{'selsptinr':row[0]}})
        //if (rtnmsg.respCode == SUCCESS) {
        //var cacheFileName = rtnmsg.data.cacheFileName;
        debugger;
        // let viewurl = "/business/ditopn?selsptinr=" + row[0];
        let viewurl = "/business/ditopn?selsptinr=" + row['INR'];
        this.$router.push(viewurl);
        //}
    },
    async handleReset() {
        this.model.chkinc = "";
        this.model.chkdzt = "";
        this.model.chkpen = "";
        this.model.chkcor = "";
        this.model.chkaut = "";
        this.model.chkdel = "";
        this.model.chktco = "";
        this.model.chkcan = "";
        this.model.selobj = "";
        this.model.seltxt = "";
        this.model.usfmod.flt = "";
        this.model.inidatfro = "";
        this.model.inidattil = "";
        this.model.dflg = "1";
        this.model.chkypt = "";
        this.model.yptinf = "";

    },
    async handleSearch() {
            this.executeDefault("sptstm").then(res => {
                //TODO 处理数据逻辑
                this.stmData.data = res.data.sptstm.rows;
            })
        },

        async sptfndHandleReset() {
            this.model.chkinc = "";
            this.model.chkdzt = "";
            this.model.chkpen = "";
            this.model.chkcor = "";
            this.model.chkaut = "";
            this.model.chkdel = "";
            this.model.chktco = "";
            this.model.chkcan = "";
            this.model.selobj = "";
            this.model.seltxt = "";
            this.model.usfmod.flt = "";
            this.model.inidatfro = "";
            this.model.inidattil = "";
            this.model.dflg = "1";
            this.model.chkypt = "";
            this.model.yptinf = "";
    
        },
        async sptfndHandleSearch() {
                this.model.chkpen = "t";
                this.executeDefault("sptstm").then(res => {
                    //TODO 处理数据逻辑
                    this.stmData.data = res.data.sptstm.rows;
                })
            }

}