浏览代码

添加签约清单,保留小数位数

MaiXinRong 5 年之前
父节点
当前提交
6c9a0c3593
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      app/controller/ledger_controller.js
  2. 1 0
      app/controller/revise_controller.js

+ 1 - 0
app/controller/ledger_controller.js

@@ -266,6 +266,7 @@ module.exports = app => {
          */
         async _addDeal(ctx, data) {
             if (!data.type || !data.dealBills) throw '数据错误';
+            data.dealBills.unit_price = this.ctx.helper.round(data.dealBills.unit_price, ctx.tender.info.decimal.up);
             if (data.type === 'child') {
                 return await ctx.service.ledger.addChild(ctx.tender.id, data.id, data.dealBills);
             } else if (data.type === 'next') {

+ 1 - 0
app/controller/revise_controller.js

@@ -455,6 +455,7 @@ module.exports = app => {
         }
         async _addDeal(revise, data) {
             if (!data.type || !data.dealBills) throw '数据错误';
+            data.dealBills.unit_price = this.ctx.helper.round(data.dealBills.unit_price, this.ctx.tender.info.decimal.up);
             if (data.type === 'child') {
                 return await this.ctx.service.reviseBills.addChild(revise.tid, data.id, data.dealBills, revise.id);
             } else if (data.type === 'next') {