exponent.ejs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <% include ./material_sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main d-flex justify-content-between">
  5. <% include ./material_sub_mini_menu.ejs %>
  6. <div>
  7. <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id) { %>
  8. <div class="d-inline-block">
  9. <a href="javascript: void(0);" id="add" class="btn btn-sm btn-light text-primary" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="新增"><i class="fa fa-plus" aria-hidden="true"></i></a>
  10. <a href="javascript: void(0);" id="del" class="btn btn-sm btn-light text-primary" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
  11. </div>
  12. <% } %>
  13. <div class="d-inline-block ml-3">
  14. 本期调差计量期:第<span class="mx-2"><%= material.s_order.split(',').join(',') %></span>期
  15. </div>
  16. <div class="d-inline-block ml-2" >
  17. <a href="#cc-digits" class="btn btn-sm btn-light text-primary" data-toggle="modal" data-placement="bottom" title="小数位数" data-target="#cc-digits" ><i class="fa fa-cog" aria-hidden="true"></i></a>
  18. </div>
  19. <!--<div class="d-inline-block ml-3" style="display: none!important;">-->
  20. <!--本期价差:<b id="ex_expr"><%- material.ex_expr %></b>-->
  21. <!--</div>-->
  22. </div>
  23. <div class="ml-auto">
  24. <% if (ctx.session.sessionProject.page_show.openMaterialChecklist && material.order === material.highOrder) { %>
  25. <a href="/tender/<%- ctx.tender.id %>/measure/material/<%- material.highOrder %>/checklist" class="btn btn-sm btn-outline-primary">清单设置</a>
  26. <% } %>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="content-wrap pr-46">
  31. <div class="c-header p-0">
  32. </div>
  33. <div class="row w-100 sub-content">
  34. <div id="left-view" class="c-body" style="width: 100%">
  35. <!--上部分-->
  36. <div class="sjs-height-1" id="material-exponent-spread">
  37. </div>
  38. <!--下部分-->
  39. <div class="bcontent-wrap" id="main-bottom">
  40. <div id="main-resize" class="resize-y" r-Type="height" div1=".sjs-height-1" div2=".bcontent-wrap" title="调整大小"><!--调整上下高度条--></div>
  41. <div class="bc-bar mb-1">
  42. <div class="input-group input-group-sm ">
  43. <div class="input-group-prepend">
  44. <span class="input-group-text" id="basic-addon1">增值税税率</span>
  45. </div>
  46. <select class="form-control form-control-sm col-1" id="changeRate">
  47. <% if (!material.readOnly) { %>
  48. <option value="9" <% if(material.rate === 9) { %>selected<% } %>>9%</option>
  49. <option value="10" <% if(material.rate === 10) { %>selected<% } %>>10%</option>
  50. <option value="11" <% if(material.rate === 11) { %>selected<% } %>>11%</option>
  51. <% } else { %>
  52. <option value="<%= material.rate %>" selected><%= material.rate %>%</option>
  53. <% } %>
  54. </select>
  55. </div>
  56. </div>
  57. <% if (!material.material_tax && !old_had_tax) { %>
  58. <div class="sp-wrap" style="max-width: 800px;min-width: 500px;">
  59. <div class="col-12 p-0">
  60. <table class="table table-sm table-bordered">
  61. <tr><th rowspan="2"></th><th colspan="2" class="text-center">信息价</th><th colspan="2" class="text-center">价格指数</th></tr>
  62. <tr class="text-center"><th>本期金额</th><th>截止本期金额</th>
  63. <th>本期金额
  64. <a href="javascript:void(0);" id="ex_expr" data-toggle="tooltip" data-placement="bottom" title="本期价差:<%- material.ex_expr ? material.ex_expr : '' %>"><i class="fa fa-question-circle-o"></i></a></th>
  65. <th>截止本期金额</th></tr>
  66. <tr id="tp_set"><td>材料价差费用</td>
  67. <td class="text-center"><%= material.m_tp !== null ? ctx.helper.round(material.m_tp, material.decimal.tp) : null %></td>
  68. <td class="text-center"><%= material.m_tp !== null || material.pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.pre_tp, material.m_tp), material.decimal.tp) : null %></td>
  69. <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, material.decimal.tp) : null %></td>
  70. <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), material.decimal.tp) : null %></td>
  71. </tr>
  72. <tr id="rate_set"><td>材料价差费用(含建筑税)</td>
  73. <td class="text-center"><%= material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), material.decimal.tp) : null %></td>
  74. <td class="text-center"><%= 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), material.decimal.tp)), material.decimal.tp) : null %></td>
  75. <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), material.decimal.tp) : null %></td>
  76. <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), material.decimal.tp)), material.decimal.tp) : null %></td>
  77. </tr>
  78. </table>
  79. </div>
  80. </div>
  81. <% } else { %>
  82. <div class="sp-wrap" style="max-width: 800px;min-width: 500px;">
  83. <div class="col-12 p-0">
  84. <table class="table table-sm table-bordered">
  85. <tr><th rowspan="2"></th><th colspan="2" class="text-center">信息价</th><th colspan="2" class="text-center">价格指数</th></tr>
  86. <tr class="text-center"><th>本期金额</th><th>截止本期金额</th>
  87. <th>本期金额
  88. <a href="javascript:void(0);" id="ex_expr" data-toggle="tooltip" data-placement="bottom" title="本期价差:<%- material.ex_expr ? material.ex_expr : '' %>"><i class="fa fa-question-circle-o"></i></a></th>
  89. <th>截止本期金额</th></tr>
  90. <tr id="tp_set"><td>材料价差费用</td>
  91. <td class="text-center"><%= material.m_tp !== null ? ctx.helper.round(material.m_tp, material.decimal.tp) : null %></td>
  92. <td class="text-center"><%= material.m_tp !== null || material.pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.pre_tp, material.m_tp), material.decimal.tp) : null %></td>
  93. <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, material.decimal.tp) : null %></td>
  94. <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), material.decimal.tp) : null %></td>
  95. </tr>
  96. <tr><td>材料价差费用(含材料税)</td>
  97. <td class="text-center"><%= material.material_tax ? (material.m_tax_tp !== null ? material.m_tax_tp : null) : '-' %></td>
  98. <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), material.decimal.tp) : null) : material.m_tax_pre_tp %></td>
  99. <td class="text-center">-</td>
  100. <td class="text-center">-</td>
  101. </tr>
  102. <tr id="rate_set"><td>材料价差费用(含建筑税)</td>
  103. <td class="text-center"><%= !material.material_tax ? (material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), material.decimal.tp) : null) : '-' %></td>
  104. <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), material.decimal.tp)), material.decimal.tp) : null) : pre_tp_hs !== null ? pre_tp_hs : '-' %></td>
  105. <td class="text-center"><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), material.decimal.tp) : null %></td>
  106. <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), material.decimal.tp)), material.decimal.tp) : null %></td>
  107. </tr>
  108. </table>
  109. </div>
  110. </div>
  111. <% } %>
  112. </div>
  113. </div>
  114. <div id="right-view" class="c-body" style="display:none;width: 33%">
  115. <div class="resize-x" id="right-spr" r-Type="width" div1="#left-view" div2="#right-view" title="调整大小" a-type="percent"><!--调整左右高度条--></div>
  116. <div class="tab-content" style="width: 100%">
  117. <div id="tiaochaje" class="tab-pane active">
  118. <div class="sjs-sh-1">
  119. <table class="table table-bordered">
  120. <thead>
  121. <tr><th>选择</th><th>需调整的价差</th><th>金额</th></tr>
  122. </thead>
  123. <tbody id="calc_basic_select">
  124. <% for (const bq of ex_calc) { %>
  125. <tr>
  126. <td><input type="checkbox" value="<%- bq.code %>" <% if (material.readOnly) { %>disabled<% } %> class="calc_select" <% if (bq.select) { %>checked<% } %>></td>
  127. <td><%- materialType.ex_basic_text[bq.code] %></td><td><% if (bq.code === 'zdy' && !material.readOnly) { %><input type="number" id="calc_zdy" class="form-control form-control-sm" value="<%- bq.value %>"><% } else { %><%- bq.value %><% } %></td>
  128. </tr>
  129. <% } %>
  130. </tbody>
  131. </table>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="side-menu">
  138. <!--右侧菜单-->
  139. <ul class="nav flex-column right-nav">
  140. <li class="nav-item">
  141. <a class="nav-link" content="#base-tab" href="javascript: void(0);">调差基数</a>
  142. </li>
  143. </ul>
  144. </div>
  145. </div>
  146. </div>
  147. <div style="display: none">
  148. <img src="/public/images/ellipsis_horizontal.png" id="ellipsis-icon" />
  149. <img src="/public/images/icon-ok.png" id="icon-ok" />
  150. </div>
  151. <script>
  152. const readOnly = <%- material.readOnly %>;
  153. const materialID = <%- material.id %>;
  154. const materialTax = <%- material.material_tax %>;
  155. const materialOrder = <%- material.order %>;
  156. const materialDecimal = JSON.parse(unescape('<%- escape(JSON.stringify(material.decimal)) %>'));
  157. const decimal = JSON.parse('<%- JSON.stringify(ctx.tender.info.decimal) %>');
  158. let m_tp = <%= material.m_tp !== null ? material.m_tp : 0 %>;
  159. let ex_tp = <%= material.ex_tp !== null ? material.ex_tp : 0 %>;
  160. const pre_tp = <%= material.pre_tp !== null ? material.pre_tp : 0 %>;
  161. const ex_pre_tp = <%= material.ex_pre_tp !== null ? material.ex_pre_tp : 0 %>;
  162. const pre_tp_hs = <%= pre_tp_hs !== null ? pre_tp_hs : 0 %>;
  163. const ex_pre_tp_hs = <%= ex_pre_tp_hs !== null ? ex_pre_tp_hs : 0 %>;
  164. const materialType = JSON.parse('<%- JSON.stringify(materialType) %>');
  165. const ex_calc = JSON.parse('<%- JSON.stringify(ex_calc) %>');
  166. let ex_expr = '<%- material.ex_expr %>';
  167. let materialExponentData = JSON.parse(unescape('<%- escape(JSON.stringify(materialExponentData)) %>'));
  168. </script>