瀏覽代碼

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 年之前
父節點
當前提交
01c27fd452
共有 4 個文件被更改,包括 7 次插入5 次删除
  1. 2 2
      app/controller/change_controller.js
  2. 1 1
      app/public/js/revise.js
  3. 3 1
      app/service/change.js
  4. 1 1
      app/view/change/info.ejs

+ 2 - 2
app/controller/change_controller.js

@@ -342,8 +342,8 @@ module.exports = app => {
                             cl.detail,
                             cl.lid,
                         ];
-                        ototalCost += ctx.helper.accMul(cl.unit_price, cl.oamount);
-                        ctotalCost += ctx.helper.accMul(cl.unit_price, cl.camount);
+                        ototalCost += ctx.helper.mul(cl.unit_price, cl.oamount, ctx.tender.info.decimal.tp);
+                        ctotalCost += ctx.helper.mul(cl.unit_price, cl.camount, ctx.tender.info.decimal.tp);
                         if (cl.lid !== 0) {
                             changeListData.push(cLArray.join(';'));
                         } else {

+ 1 - 1
app/public/js/revise.js

@@ -60,7 +60,7 @@ $(document).ready(() => {
                 const data = SpreadJsObj.getSelectObject(sheet);
                 if (data) {
                     $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field])
-                        .attr('readOnly', readOnly || cell.locked());
+                        .attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0));
                 } else {
                     $('#bills-expr').val('').attr('readOnly', true);
                 }

+ 3 - 1
app/service/change.js

@@ -279,6 +279,7 @@ module.exports = app => {
          * @return {void}
          */
         async save(postData, tenderId) {
+            const tenderInfo  = await this.ctx.service.tenderInfo.getTenderInfo(tenderId);
             // 初始化事务
             this.transaction = await this.db.beginTransaction();
             let result = false;
@@ -369,7 +370,8 @@ module.exports = app => {
                             spamount: clInfo[6],
                         };
                         insertCL.push(clArray);
-                        total_price = this.ctx.helper.accAdd(total_price, this.ctx.helper.accMul(clArray.unit_price, clArray.spamount));
+                        total_price = this.ctx.helper.accAdd(total_price,
+                            this.ctx.helper.mul(clArray.unit_price, clArray.spamount, tenderInfo.decimal.tp));
                     }
                     await this.transaction.insert(this.ctx.service.changeAuditList.tableName, insertCL);
                 }

+ 1 - 1
app/view/change/info.ejs

@@ -438,7 +438,7 @@
                         <td data-site="2"><%= cl.bwmx %></td>
                         <td data-site="3"><input class="form-control form-control-sm" placeholder="变更详情" type="text" value="<%= cl.detail %>"></td>
                         <td data-site="4"><%= cl.unit %></td>
-                        <td data-site="5"><%= ctx.helper.roundNum(cl.unit_price, tpUnit) %></td>
+                        <td data-site="5"><%= ctx.helper.roundNum(cl.unit_price, upUnit) %></td>
                         <td data-site="6"><%= ctx.helper.roundNum(cl.oamount, ctx.helper.findDecimal(cl.unit)) %></td>
                         <td data-site="7"><%= ctx.helper.roundNum(ctx.helper.accMul(cl.unit_price, cl.oamount), tpUnit) %></td>
                         <td data-site="8"><input class="form-control form-control-sm" placeholder="变更数量" type="text" onkeyup="RegNum(this,event,<%= ctx.helper.findDecimal(cl.unit) %>)"  value="<%= ctx.helper.roundNum(cl.camount, ctx.helper.findDecimal(cl.unit)) %>"></td>