ソースを参照

调差显示bug修复

laiguoran 3 年 前
コミット
4ef20c9715
3 ファイル変更8 行追加8 行削除
  1. 2 2
      app/public/js/material.js
  2. 4 4
      app/view/material/exponent.ejs
  3. 2 2
      app/view/material/info.ejs

+ 2 - 2
app/public/js/material.js

@@ -75,8 +75,8 @@ function resetTpTable() {
     $('#tp_set').find('td').eq(1).text(ZhCalc.round(m_tp, 2));
     $('#tp_set').find('td').eq(2).text(ZhCalc.round(ZhCalc.add(pre_tp, m_tp), 2));
     if (materialTax) {
-        $('#rate_set').find('td').eq(1).text(ZhCalc.round(m_tax_tp, 2));
-        $('#rate_set').find('td').eq(2).text(ZhCalc.round(ZhCalc.add(m_tax_pre_tp, m_tax_tp), 2));
+        $('#tax_rate_set').find('td').eq(1).text(ZhCalc.round(m_tax_tp, 2));
+        $('#tax_rate_set').find('td').eq(2).text(ZhCalc.round(ZhCalc.add(m_tax_pre_tp, m_tax_tp), 2));
     } else {
         const rate = $('#changeRate').val();
         const bqhs = ZhCalc.round(ZhCalc.mul(m_tp, 1+rate/100), 2);

+ 4 - 4
app/view/material/exponent.ejs

@@ -89,14 +89,14 @@
                                         <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.ex_pre_tp, material.ex_tp), 2) : null %></td>
                                     </tr>
                                     <tr><td>材料价差费用(含材料税)</td>
-                                        <td class="text-center"><%= material.m_tax_tp !== null ? material.m_tax_tp : null %></td>
-                                        <td class="text-center"><%= material.m_tax_tp !== null || material.tax_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.tax_pre_tp, material.m_tax_tp), 2) : null %></td>
+                                        <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null ? material.m_tax_tp : null) : '-' %></td>
+                                        <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null || material.m_tax_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.m_tax_pre_tp, material.m_tax_tp), 2) : null) : material.m_tax_pre_tp %></td>
                                         <td class="text-center">-</td>
                                         <td class="text-center">-</td>
                                     </tr>
                                     <tr id="rate_set"><td>材料价差费用(含建筑税)</td>
-                                        <td class="text-center">-</td>
-                                        <td class="text-center"><%= pre_tp_hs !== null ? pre_tp_hs : '-' %></td>
+                                        <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2) : null) : '-' %></td>
+                                        <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null || pre_tp_hs !== null ? ctx.helper.round(ctx.helper.add(pre_tp_hs, ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2)), 2) : null) : pre_tp_hs !== null ? pre_tp_hs : '-' %></td>
                                         <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2) : null %></td>
                                         <td class="text-center"><%= material.ex_tp !== null || ex_pre_tp_hs !== null ? ctx.helper.round(ctx.helper.add(ex_pre_tp_hs, ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2)), 2) : null %></td>
                                     </tr>

+ 2 - 2
app/view/material/info.ejs

@@ -93,13 +93,13 @@
                                     <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, 2) : null %></td>
                                     <td class="text-center"><%= material.ex_tp !== null || material.ex_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.ex_pre_tp, material.ex_tp), 2) : null %></td>
                                 </tr>
-                                <tr id="rate_set"><td>材料价差费用(含材料税)</td>
+                                <tr id="tax_rate_set"><td>材料价差费用(含材料税)</td>
                                     <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null ? material.m_tax_tp : null) : '-' %></td>
                                     <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null || material.m_tax_pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.m_tax_pre_tp, material.m_tax_tp), 2) : null) : material.m_tax_pre_tp %></td>
                                     <td class="text-center">-</td>
                                     <td class="text-center">-</td>
                                 </tr>
-                                <tr><td>材料价差费用(含建筑税)</td>
+                                <tr id="rate_set"><td>材料价差费用(含建筑税)</td>
                                     <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2) : null) : '-' %></td>
                                     <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null || pre_tp_hs !== null ? ctx.helper.round(ctx.helper.add(pre_tp_hs, ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2)), 2) : null) : pre_tp_hs !== null ? pre_tp_hs : '-' %></td>
                                     <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2) : null %></td>