// 套保计划 import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq"; import APP from "@/services"; import {Callback} from "@/utils/websocket"; import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface"; /** * 套保计划操作请求 * @param param.hedgePlanID Long 套保计划id * @param param.OperateType Int 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回 */ export const operationContractReq = (param: ErmcpHedgePlanReq): Promise => { return new Promise((resolve, reject) => { const params = { protobufName: 'ErmcpHedgePlanReq', funCodeName: 'ErmcpHedgePlanReq', reqParams: param, msgHeadParams: { AccountID: param.accountid, MarketID: 18, GoodsID: 0, } }; const package50 = buildProtoReq50(params); APP.sendTradingServer(package50, undefined, { onSuccess: (res) => { const { isSuccess, result } = parseProtoRsp50(res, 'ErmcpHedgePlanRsp'); if (isSuccess) { resolve(result); } else { reject(result); } }, onFail: (err) => reject(err.message), } as Callback); }); }