POST 修改服务报价单
POST 修改报价单(部分更新,未传字段不变),仅「草稿」可改,已发送的需先撤回。body 为 JSON:必填 id(报价单ID);可选 customerName/contactPerson/contactPhone/serviceAddress(客户抬头快照)、chargeReason(收费原因,最多128字)、warrantyCovered(1=质保内全免,合计置0)、discountPct(折扣比例0-100,优先)、discountAmount(折扣金额,不能超过小计)、validUntil(有效期 yyyy-MM-dd)、priceModel(fixed 固定价/estimate 预估价)、paymentMode(upfront 全款预付/milestone 分阶段)、paymentTemplateId(付款条件模板ID)、paymentNote、note、stages(分阶段付款时必填,每段 stageName、percent,合计须为100,可选 dueCondition);lines 传入时整体替换明细(传 null 不动明细),lines 为明细数组,每行必填 itemName(项目名称)、qty(数量,>0)、unitPrice(单价,>=0);可选 source(备件/服务费)、catalogId(收费项目或物料ID)、model、unitName、warrantyFree(1=质保内免收,单价与金额置0)、refType(PART_REQUEST/FEE_CATALOG)、refId、remark、sortOrder、chargeScopeId(收费范围ID,用于占用)。金额由服务端按数量×单价计算。
| 接口编码 | 所需范围 | 后端接口 |
|---|---|---|
sales.service-quotation.update | sales:write | POST /v1/service-orders/quotation/update(comap-sales) |
必填字段
| 字段 | 依据 |
|---|---|
id | 参数说明、接口规格 |
itemName | 参数说明 |
qty | 参数说明 |
unitPrice | 参数说明 |
lines[].itemName | 接口规格 |
lines[].qty | 接口规格 |
lines[].unitPrice | 接口规格 |
stages[].stageName | 接口规格 |
stages[].percent | 接口规格 |
条件必填(如「某状态时必填」)不在此表,以上方参数说明为准。 判定规则见必填字段的判定。
请求体字段(body)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | 是 | 报价单ID |
customerName | string | — | 客户名称(快照) |
contactPerson | string | — | 联系人 |
contactPhone | string | — | 联系电话 |
serviceAddress | string | — | 服务地址 |
chargeReason | string | — | 收费原因(自定义文本,最多 128 字) |
warrantyCovered | integer(int32) | — | 质保内全免:0否 1是;为 1 时合计强制置 0 |
discountPct | number | — | 折扣比例 %,0~100;传了则折扣金额按小计算出 |
discountAmount | number | — | 折扣金额;仅在未传折扣比例时生效 |
validUntil | string(date-time) | — | 报价有效期 |
priceModel | string | — | 计价模型:fixed 固定价 / estimate 预估价 |
paymentMode | string | — | 付款方式:upfront 全款预付 / milestone 分阶段 |
paymentTemplateId | integer(int64) | — | 引用的付款条件模板ID;换模板会按快照重新复制阶段 |
paymentNote | string | — | 付款说明 |
note | string | — | 备注 |
lines13 | ServiceQuotationLineDTO[] | — | 明细行;整体替换,传 null 表示不修改明细 |
stages3 | ServiceQuotationStageDTO[] | — | 付款阶段;整体替换,传 null 表示不修改阶段 |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求示例
curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "sales.service-quotation.update",
"body": {
"id": "1961000000000000001"
}
}'
响应 data 字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | — | 报价单ID |
quotationNo | string | — | 报价单号 |
orderId | integer(int64) | — | 所属工单ID |
orderNo | string | — | 所属工单编号 |
rootQuotationId | integer(int64) | — | 版本链根报价ID;首版为自身ID |
versionNo | integer(int32) | — | 版本号,同一版本链内从1递增 |
serviceCycleNo | integer(int32) | — | 所属服务周期号 |
changeReason | string | — | 本版变更原因 |
voidReason | string | — | 作废原因 |
customerName | string | — | 客户名称(快照) |
contactPerson | string | — | 联系人 |
contactPhone | string | — | 联系电话 |
serviceAddress | string | — | 服务地址 |
chargeReason | string | — | 收费原因(自定义文本) |
subtotal | number | — | 小计 = 各明细行金额之和 |
warrantyCovered | integer(int32) | — | 质保内全免:0否 1是;为 1 时合计为 0 |
discountPct | number | — | 折扣比例 % |
discountAmount | number | — | 折扣金额 |
totalAmount | number | — | 合计 = 小计 - 折扣金额;warrantyCovered=1 时为 0 |
validUntil | string(date-time) | — | 报价有效期 |
priceModel | string | — | 计价模型:fixed 固定价 / estimate 预估价 |
paymentMode | string | — | 付款方式:upfront 全款预付 / milestone 分阶段 |
paymentTemplateId | integer(int64) | — | 引用的付款条件模板ID |
paymentNote | string | — | 付款说明 |
status | string | — | 状态:草稿/已发送/客户已接受/执行中/已完成/客户已拒绝/已失效 |
sentAt | string(date-time) | — | 发送时间;撤回报价后清空 |
customerRespondedAt | string(date-time) | — | 客户响应时间 |
customerRespondedVia | string | — | 客户响应渠道 |
customerSignatureId | string | — | 客户签名 fileId(comap-file) |
rejectReason | string | — | 客户拒绝原因 |
convertedOrderId | integer(int64) | — | 转成的服务订单ID |
convertedSettlementId | integer(int64) | — | 转成的结算单ID |
note | string | — | 备注 |
createdBy | string | — | 创建人 |
createTime | string(date-time) | — | 创建时间 |
updateTime | string(date-time) | — | 更新时间 |
lineCount | integer(int32) | — | 明细行数 |
lines14 | ServiceQuotationLineVO[] | — | 明细行,按 sortOrder 升序 |
stages6 | ServiceQuotationStageVO[] | — | 付款阶段,按 stageNo 升序;非分阶段付款时为空集合 |
错误处理
响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:
| 错误码 | 说明 | 可重试 |
|---|---|---|
| 92101 | 访问凭证无效 | 否 |
| 92201 | 接口未登记或已停用 | 否 |
| 92202 | 超出凭证授权范围——本接口需 sales:write | 否 |
| 92204 | 绑定员工无此接口的功能权限 | 否 |
| 92203 | 上游服务调用失败 | 先查询处理结果,禁止盲目重试 |
| 92301 | 请求过于频繁 | 是 |
| 92205 | 写操作处理超时,结果未知(下游可能仍在执行) | 否,先查询确认结果 |
| 92302 | 有参数相同的写请求正在处理中 | 等待并确认前一次结果,勿重复提交 |
除此之外,comap-sales 自身的业务校验失败会原样透传其业务码与提示
(如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内,
以响应里的 message 为准。完整的平台层错误码见错误码说明。