[EQD-6838] 修复约定2补充:计算器算不出时另两字段清空+三标识全清(main.post reject 未走 .done)
- 根因:main.__post 在 resp.success===false(业务错误) 时 deferred.reject,而 calcBondForItem 仅挂 .done, 导致业务错误/网络异常分支整段被跳过,applyBondCalcFailure+syncBondFlags 不执行,约定2补充静默失效。 - 修复:main.post 链补 .fail 处理 reject(业务错误+网络异常),统一在此清空非源字段+清 源/AUTO/REV 标识; 另为两个 pre-POST 失败分支(源为空、开始日缺失)补 syncBondFlags,使视图刷新。 - 错误文案仍由 __post 的 alertFn(main.message) 非阻塞提示,不重复弹。纯函数 applyBondCalcFailure 逻辑不变。
This commit is contained in:
@@ -421,6 +421,7 @@ const vue = new Vue({
|
||||
if (price === null || price === '' || isNaN(price)) {
|
||||
// 交互约定2补充:源字段为空/非数也算"算不出来",清另两字段+所有标识
|
||||
SwapCalc.applyBondCalcFailure(item, driver);
|
||||
self.syncBondFlags(item);
|
||||
return;
|
||||
}
|
||||
var priceType = driver === 'CP' ? 'CP' : driver === 'DP' ? 'DP' : 'YD';
|
||||
@@ -435,6 +436,7 @@ const vue = new Vue({
|
||||
if (SwapCalc.shouldShowBondErr(item, sdMsg)) main.message(sdMsg);
|
||||
// 交互约定2补充:开始日缺失也算"算不出来",清另两字段+所有标识
|
||||
SwapCalc.applyBondCalcFailure(item, driver);
|
||||
self.syncBondFlags(item);
|
||||
return; // 估值日缺失:不调用计算器、不覆盖任何手工输入
|
||||
}
|
||||
main.post('/Bond/CalcBond', {
|
||||
@@ -485,6 +487,14 @@ const vue = new Vue({
|
||||
// 名义本金依赖全价(PosiGrossPrice):以净价/收益率为源反算出的全价被回写后,
|
||||
// 直接赋值不会触发组件 input 事件,需在此显式重算,保持名义本金与全价一致。
|
||||
if (self.calcNotional) self.calcNotional();
|
||||
}).fail(function (resp) {
|
||||
// 交互约定2补充:main.post 在 success:false(业务错误=计算器算不出来)或网络异常时
|
||||
// 走 reject,.done 不会触发;故"计算器算不出来"统一在此落地:
|
||||
// 保留源字段值、另两字段清空为空白、三个数值旁标识(源/AUTO/REV)全清。
|
||||
// 错误文案已由 __post 的 alertFn(main.message) 非阻塞提示,此处不重复弹,仅清数值+清标识
|
||||
// (与 .done 内 !resp.obj / getBondCalcErrorMessage 两个失败分支行为一致)。
|
||||
SwapCalc.applyBondCalcFailure(item, driver);
|
||||
self.syncBondFlags(item);
|
||||
});
|
||||
},
|
||||
//变更收费基本单位
|
||||
|
||||
Reference in New Issue
Block a user