import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request"; import { hedgePlanReq, oldHedgePlanReq } from "@/services/proto/hedgeplan"; import { ErmcpHedgePlanReq, HedgePlanOperateReq } from "@/services/proto/hedgeplan/interface"; import { deletePlanSign, hedgePlanSign } from "@/views/business/plan/setup"; import { Ref } from "vue"; /** * 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝 * @param id HedgePlanID * @param type */ export function changeStatus(req: ErmcpHedgePlanReq, type: number, loading: Ref): Promise { const sign = getRequestResultInfo(hedgePlanSign, type) // 接口请求后的返回提示 这里统一进行管理 const result = hedgePlanReq(req) return commonResultInfo(result, sign, loading) } /** * 撤销套保计划 * @param req 撤销套保计划请求 * @param loading */ export function cancelPlan(req: HedgePlanOperateReq, loading: Ref): Promise { const sign = getRequestResultInfo(deletePlanSign, 5) // 接口请求后的返回提示 这里统一进行管理 const result = oldHedgePlanReq(req) return commonResultInfo(result, sign, loading) }