import qs from "qs"
import config from "../commons"
import request from "../utils/request"

const {api:{asset}} = config

class AssetsManageService{

    async getAllQuestionWarning(payload={},autotip=false){
        let result = await request({ url: `${asset}/takeResponsibilityApi/listSubmitForAuditAssetsInfo`, method: "get", data: payload },autotip).then(data=>{
            return data;
        }).catch(error=>{
            return error
        })
        return result;
    }

    async saveQuestionItem(payload={},autotip=false){
        let result = await request({ url: `${asset}/takeResponsibilityApi/submitForAudit`, method: "post", data: payload },autotip).then(data=>{
            return data;
        }).catch(error=>{
            return error
        })
        return result;
    }

    async getProcessDetail(payload={},autotip=false){
        let result = await request({ url: `${asset}/takeResponsibilityApi/processDetail`, method: "get", data: payload },autotip).then(data=>{
            return data;
        }).catch(error=>{
            return error
        })
        return result;
    }

    async saveQuestionNext(payload={},autotip=false){
        let result = await request({ url: `${asset}/takeResponsibilityApi/reDistribute`, method: "post", data: payload },autotip).then(data=>{
            return data;
        }).catch(error=>{
            return error
        })
        return result;
    }

    async saveQuestionFinal(payload={},autotip=false){
        let result = await request({ url: `${asset}/takeResponsibilityApi/auditProcess`, method: "post", data: payload },autotip).then(data=>{
            return data;
        }).catch(error=>{
            return error
        })
        return result;
    }

}

export default new AssetsManageService()