import Api from "~/service/Api"
import Utils from "~/utils/index"
export default {
    onUsfmodShwflt() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
            let rtnmsg = await Api.post("sptsel/usfmod_shwflt", Utils.flatObject(this.model))
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑

            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败！' });
            }
        })
    },
    onButypt() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
            let rtnmsg = await Api.post("sptsel/butypt", Utils.flatObject(this.model))
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑

            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败！' });
            }
        })
    },
    onDlmft() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
            let rtnmsg = await Api.post("sptsel/dlmft", Utils.flatObject(this.model))
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑

            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败！' });
            }
        })
    },
    onDlaxq() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
            let rtnmsg = await Api.post("sptsel/dlaxq", Utils.flatObject(this.model))
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑

            }
            else {
                this.$notify.error({ title: '错误', message: '服务请求失败！' });
            }
        })
    },
    onButimg() {
        this.$parent.$parent.$parent.$parent.$refs.modelForm.validate(async valid => {
            if (!valid)
                return;
            let rtnmsg = await Api.post("sptsel/butimg", Utils.flatObject(this.model))
            if (rtnmsg.respCode == "AAAAAA") {
                //TODO 处理数据逻辑

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

    },

    async continueEdit(row){
        let rtnmsg = await Api.post("sptsel/getPendingData",{params:{'selsptinr':row[0]}})
        if (rtnmsg.respCode == "AAAAAA") {
            var cacheFileName = rtnmsg.data.cacheFileName;
            let viewurl ="/business/ditopn?cacheFileName="+cacheFileName;
            this.$router.push(viewurl);
        }
    }

}