فهرست منبع

1. 合同支付,行引用公式正则判断问题
2. 合同支付,公式计算兼容无穷大
3. 同步台账url错误

MaiXinRong 1 سال پیش
والد
کامیت
5c4ccfd5e3
3فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      app/controller/ledger_controller.js
  2. 2 2
      app/lib/pay_calc.js
  3. 1 1
      app/service/stage_pay.js

+ 1 - 1
app/controller/ledger_controller.js

@@ -158,7 +158,7 @@ module.exports = app => {
                     dealBillsPermission: this._canUpdateDealBills(tender.data, auditors.filter(x => {return x.audit_order > 0})),
                     shenpiConst,
                     categoryData,
-                    syncLedgerUrl: syncLedger ? `${ctx.app.config.url3f}/${syncLedger.pull_class}/sync-tz?pCode=${tender.id}` : '',
+                    syncLedgerUrl: syncLedger ? `${ctx.app.config.url3f}/${syncLedger.pull_class}/sync-tz/${tender.id}` : '',
                     nodeType: stdConst.nodeType,
                     authMobile: pa.auth_mobile,
                 };

+ 2 - 2
app/lib/pay_calc.js

@@ -91,7 +91,7 @@ class PayCalculate {
             // const value = this.ctx.helper.calcExprStrRpn(formula);
             // 使用mathjs的大数运算,可支持所有
             const value = parseFloat(math.eval(formula));
-            return value;
+            return Number.isFinite(value) ? value : 0;
         } catch(err) {
             return 0;
         }
@@ -116,7 +116,7 @@ class PayCalculate {
             // const value = this.ctx.helper.calcExprStrRpn(formula);
             // 使用mathjs的大数运算,可支持所有
             const value = parseFloat(math.eval(formula));
-            return value;
+            return Number.isFinite(value) ? value : 0;
         } catch(err) {
             return 0;
         }

+ 1 - 1
app/service/stage_pay.js

@@ -80,7 +80,7 @@ module.exports = app => {
          */
         async addInitialStageData(stage, transaction) {
             const basesReg = new RegExp(payConst.calcBase.map(x => {return '(' + x.code + ')'}).join('|'));
-            const orderReg = /f\d+/ig;
+            const orderReg = /f\d+/im;
             if (!stage) {
                 throw '初始化期合同支付数据失败';
             }