Browse Source

修复bug

laiguoran 3 years ago
parent
commit
942620ff8f
2 changed files with 7 additions and 4 deletions
  1. 6 4
      app/public/js/material_exponent.js
  2. 1 0
      app/view/material/exponent.ejs

+ 6 - 4
app/public/js/material_exponent.js

@@ -527,12 +527,14 @@ $(document).ready(() => {
         $('#changeRate').change(function () {
             const rate = parseInt($(this).val());
             postData(window.location.pathname + '/save', { type:'rate', rate: rate }, function (result) {
-                const bqhs = ZhCalc.round(ZhCalc.mul(m_tp, 1+rate/100), 2);
                 const exbqhs = ZhCalc.round(ZhCalc.mul(ex_tp, 1+rate/100), 2);
-                const jzbqhs = ZhCalc.round(ZhCalc.add(pre_tp_hs, bqhs), 2);
                 const exjzbqhs = ZhCalc.round(ZhCalc.add(ex_pre_tp_hs, exbqhs), 2);
-                $('#rate_set').find('td').eq(1).text(bqhs !== 0 ? bqhs : '');
-                $('#rate_set').find('td').eq(2).text(jzbqhs !== 0 ? jzbqhs : '');
+                if (!materialTax) {
+                    const bqhs = ZhCalc.round(ZhCalc.mul(m_tp, 1+rate/100), 2);
+                    const jzbqhs = ZhCalc.round(ZhCalc.add(pre_tp_hs, bqhs), 2);
+                    $('#rate_set').find('td').eq(1).text(bqhs !== 0 ? bqhs : '');
+                    $('#rate_set').find('td').eq(2).text(jzbqhs !== 0 ? jzbqhs : '');
+                }
                 $('#rate_set').find('td').eq(3).text(exbqhs !== 0 ? exbqhs : '');
                 $('#rate_set').find('td').eq(4).text(exjzbqhs !== 0 ? exjzbqhs : '');
             });

+ 1 - 0
app/view/material/exponent.ejs

@@ -146,6 +146,7 @@
 <script>
     const readOnly = <%- material.readOnly %>;
     const materialID = <%- material.id %>;
+    const materialTax = <%- material.material_tax %>;
     const materialOrder = <%- material.order %>;
     const decimal = JSON.parse('<%- JSON.stringify(ctx.tender.info.decimal) %>');
     let m_tp = <%= material.m_tp !== null ? material.m_tp : 0 %>;