import Api from "~/service/Api"
import Utils from "~/utils/index"
export default {
    async onDitpButgetref() {
        let rtnmsg = await this.executeRule("ditp.butgetref")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            this.model.didgrp.rec.ownref = rtnmsg.data.didgrp_rec_ownref
            this.$message({
                type: 'success',
                message: '获取成功！'
            });
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败！' });
        }
    },
    async onAplpDet() {
        let rtnmsg = await this.executeRule("ditp.aplp.det")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            // console.log(rtnmsg.data);
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败！' });
        }
    },
    async onBenpDet() {
        let rtnmsg = await this.executeRule("benp_det")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑

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

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

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

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

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

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

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

        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败！' });
        }
    },
    async onPreperButtxmsel() {
        let rtnmsg = await this.executeRule("preper_buttxmsel")
        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 onLiaallButmisamt() {
        let rtnmsg = await this.executeRule("liaall_butmisamt")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑

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

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

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

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

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

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

        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败！' });
        }
    },
    async onLiaccvAdd() {
        let rtnmsg = await this.executeRule("liaall.liaccv.add")
        //const that = this.root;
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            debugger;
            this.stmData.data = rtnmsg.data.vals.rows;
            this.dialogTableVisible = true;
        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败！' });
        }
    },
    async onLiaccvDel(index,row) {
        let ids = [index+1];
        let params = {selDst:"liaall.liaccv.liaccvg",selIds:ids};
        let rtnmsg = await this.executeRule("liaall.liaccv.del",params)
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            debugger;
            this.$message({
                type: 'success',
                message: '删除成功！'
            });
            //this.model.liaall.liaccv.liaccvg = [];
            Utils.copyValueFromVO(this.model, rtnmsg.data);

        }
        else {
            this.$notify.error({ title: '错误', message: '服务请求失败！' });
        }
    },
    async onSeaParty(path) {
        let rtnmsg =  await this.executeRule(path) 
        if (rtnmsg.respCode == SUCCESS) {
            Utils.copyValueFromVO(this.model,rtnmsg.data);
        }

    },

    onSeainf() {
      

    },
    async BlurBennam(e) {
        let rtnmsg = await this.executeDefault("ditp.remark")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            this.model.ditp.remark = rtnmsg.data.ditp_remark
        }
    },
    async BlurAplname(e) {
        let rtnmsg = await this.executeDefault("ditp.remark")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            this.model.ditp.remark = rtnmsg.data.ditp_remark
        }
    },
    async BlurSignam(e) {
        let rtnmsg = await this.executeDefault("ditp.remark")
        if (rtnmsg.respCode == SUCCESS) {
            //TODO 处理数据逻辑
            this.model.ditp.remark = rtnmsg.data.ditp_remark
        }
    },
    async onExtkey(e) {

    },
    async pickDepItem(idx,row) {
        var params = {selDst:"",selIds:[idx+1]}
        let rtnmsg = await this.executeRule("liaall.liaccv.add", params)
        if (rtnmsg.respCode == SUCCESS) {
            this.dialogTableVisible = false;
            Utils.copyValueFromVO(this.model, rtnmsg.data);
        }
    },
    // didgrp.iss.pts.extkey
    async changeExtkey() {
        let rtnmsg = await this.executeRule("didgrp.iss.pts.extkey")
        if (rtnmsg.respCode == SUCCESS) {
            Utils.copyValueFromVO(this.model, rtnmsg.data);
        }
    }

}