// 点价审核
import {ContractOperateApplyReq} from "@/services/proto/contract/interface";
import {Ref} from "vue";
import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
import {SomePriceSign} from "@/views/manage/business-review/setup";
import {contractOperateApply} from "@/services/proto/contract";

/**
 * 管理 - 业务审核 - 点价操作
 * @param req.OperateApplyID  合同id
 * @param req.OperateType  2:确认3：拒绝4：撤销
 * @param loading
 */
export function somePriceControl(req: ContractOperateApplyReq, loading: Ref<boolean>): Promise<string> {
    loading.value = true;
    const sign = getRequestResultInfo(SomePriceSign, req.OperateType)  // 接口请求后的返回提示 这里统一进行管理
    // 接口调用
    const result = contractOperateApply(req)
    // 接口调用结果处理，提示成功或者失败信息，并关闭loading效果
    return commonResultInfo(result, sign, loading)

}