Browse Source

调差更改

laiguoran 4 years ago
parent
commit
314b59a4b3
3 changed files with 18 additions and 18 deletions
  1. 8 8
      app/view/material/exponent.ejs
  2. 8 8
      app/view/material/info.ejs
  3. 2 2
      sql/update.sql

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

@@ -53,16 +53,16 @@
                                 <tr><th rowspan="2"></th><th colspan="2" class="text-center">信息价</th><th colspan="2" class="text-center">价格指数</th></tr>
                                 <tr class="text-center"><th>本期金额</th><th>截止本期金额</th><th>本期金额</th><th>截止本期金额</th></tr>
                                 <tr id="tp_set"><td>材料价差费用</td>
-                                    <td><%= material.m_tp !== null ? ctx.helper.round(material.m_tp, 2) : null %></td>
-                                    <td><%= material.m_tp !== null || material.pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.pre_tp, material.m_tp), 2) : null %></td>
-                                    <td><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, 2) : null %></td>
-                                    <td><%= 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>
+                                    <td class="text-center"><%= material.m_tp !== null ? ctx.helper.round(material.m_tp, 2) : null %></td>
+                                    <td class="text-center"><%= material.m_tp !== null || material.pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.pre_tp, material.m_tp), 2) : null %></td>
+                                    <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>
-                                    <td><%= material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2) : null %></td>
-                                    <td><%= 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 %></td>
-                                    <td><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2) : null %></td>
-                                    <td><%= 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>
+                                    <td class="text-center"><%= 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.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 %></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>
                             </table>
                         </div>

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

@@ -55,16 +55,16 @@
                                 <tr><th rowspan="2"></th><th colspan="2" class="text-center">信息价</th><th colspan="2" class="text-center">价格指数</th></tr>
                                 <tr class="text-center"><th>本期金额</th><th>截止本期金额</th><th>本期金额</th><th>截止本期金额</th></tr>
                                 <tr id="tp_set"><td>材料价差费用</td>
-                                    <td><%= material.m_tp !== null ? ctx.helper.round(material.m_tp, 2) : null %></td>
-                                    <td><%= material.m_tp !== null || material.pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.pre_tp, material.m_tp), 2) : null %></td>
-                                    <td><%= material.ex_tp !== null ? ctx.helper.round(material.ex_tp, 2) : null %></td>
-                                    <td><%= 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>
+                                    <td class="text-center"><%= material.m_tp !== null ? ctx.helper.round(material.m_tp, 2) : null %></td>
+                                    <td class="text-center"><%= material.m_tp !== null || material.pre_tp !== null ? ctx.helper.round(ctx.helper.add(material.pre_tp, material.m_tp), 2) : null %></td>
+                                    <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>
-                                    <td><%= material.m_tp !== null ? ctx.helper.round(ctx.helper.mul(material.m_tp, 1+material.rate/100), 2) : null %></td>
-                                    <td><%= 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 %></td>
-                                    <td><%= material.ex_tp !== null ? ctx.helper.round(ctx.helper.mul(material.ex_tp, 1+material.rate/100), 2) : null %></td>
-                                    <td><%= 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>
+                                    <td class="text-center"><%= 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.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 %></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>
                             </table>
                         </div>

+ 2 - 2
sql/update.sql

@@ -47,7 +47,7 @@ CREATE TABLE `zh_material_exponent` (
   `m_price` decimal(30,8) DEFAULT NULL COMMENT '现行价格指数',
   `calc_num` decimal(30,8) DEFAULT NULL COMMENT '计算值',
   `remark` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
-  `is_summary` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否汇总,默认为0否',
+  `is_summary` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否汇总,默认为1是',
   `in_time` datetime NOT NULL COMMENT '添加时间',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='指数调差表';
@@ -64,6 +64,6 @@ CREATE TABLE `zh_material_exponent_history` (
   `basic_times` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '本期基准时间',
   `m_price` decimal(30,8) DEFAULT NULL COMMENT '本期现行价格指数',
   `calc_num` decimal(30,8) DEFAULT NULL COMMENT '计算值',
-  `is_summary` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否汇总',
+  `is_summary` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否汇总',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='指数调差清单历史表';