diff --git a/wwwroot/api/save_agreement_discount.dspy b/wwwroot/api/save_agreement_discount.dspy index 76928f0..ffc92a6 100644 --- a/wwwroot/api/save_agreement_discount.dspy +++ b/wwwroot/api/save_agreement_discount.dspy @@ -53,4 +53,8 @@ async with DBPools().sqlorContext(dbname) as sor: 'auth_source': 'distribution_agreement', 'auth_source_id': item_id, }) -return {'status': 'ok', 'item_id': item_id or '', 'discount': new_discount, 'productid': productid} +status_text = '已设置' if float(new_discount) > 0 else '已删除' +return { + 'widgettype': 'Message', + 'options': {'title': '保存成功', 'message': f'折扣 {status_text}: {new_discount}', 'type': 'success', 'timeout': 2} +} diff --git a/wwwroot/api/save_contract_discount.dspy b/wwwroot/api/save_contract_discount.dspy index f42adf3..262a201 100644 --- a/wwwroot/api/save_contract_discount.dspy +++ b/wwwroot/api/save_contract_discount.dspy @@ -27,4 +27,8 @@ async with DBPools().sqlorContext(dbname) as sor: 'discount': new_discount, 'created_at': now, }) -return {'status': 'ok', 'item_id': item_id or '', 'discount': new_discount, 'productid': productid} +status_text = '已设置' if float(new_discount) > 0 else '已删除' +return { + 'widgettype': 'Message', + 'options': {'title': '保存成功', 'message': f'折扣 {status_text}: {new_discount}', 'type': 'success', 'timeout': 2} +}