Pārlūkot izejas kodu

Merge branch 'dev' into uat

MaiXinRong 3 gadi atpakaļ
vecāks
revīzija
dc4dc9f84a

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

@@ -76,7 +76,7 @@ function tableScroll(tableid, hei, speed, len) {
         'height': hei + 'px'
     })
     $(".tableid_").find('th').each(function(i) {
-        $(this).css('width', $('#' + tableid).find('th:eq(' + i + ')').width());
+        $(this).css('width', $('#' + tableid).find('th:eq(' + i + ')').innerWidth());
     });
     $(".tableid_").css({
         'position': 'absolute',

+ 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 - 1
app/service/datacollect_audit.js

@@ -55,7 +55,7 @@ module.exports = app => {
         }
 
         async getList(pid) {
-            const list = await this.db.select(this.tableName, { pid });
+            const list = await this.db.select(this.tableName, { where: { pid } });
             for (const l of list) {
                 if (l.uid) {
                     const accountInfo = await this.ctx.service.projectAccount.getDataById(l.uid);

+ 1 - 1
app/service/datacollect_tender.js

@@ -55,7 +55,7 @@ module.exports = app => {
         // }
 
         async getList(pid) {
-            return await this.db.select(this.tableName, { pid });
+            return await this.db.select(this.tableName, { where: { pid } });
         }
 
         async updateList(pid, tids) {

+ 10 - 10
app/view/datacollect/index.ejs

@@ -86,7 +86,7 @@
                                     <div class="card text-center bg-dark text-white ml-2 mr-2 py-2 height-100">
                                         <div class="card-body card-per-body">
                                             <h5 class="card-title card-case-title data_total_price">0.00</h5>
-                                            <p class="card-text card-case-text text-muted">台金额</p>
+                                            <p class="card-text card-case-text text-muted">台金额</p>
                                         </div>
                                     </div>
                                 </div>
@@ -151,11 +151,11 @@
                                             <tr>
                                                 <th>标段</th>
                                                 <th>期数</th>
-                                                <th>0号台</th>
+                                                <th>0号台</th>
                                                 <th>本期完成</th>
-                                                <th>截本期完成</th>
+                                                <th>截本期完成</th>
                                                 <th>本期应付</th>
-                                                <th>截本期应付</th>
+                                                <th>截本期应付</th>
                                             </tr>
                                             </thead>
                                             <tbody id="stage-data">
@@ -193,7 +193,7 @@
                                             <div class="card text-center bg-dark text-white border-right-0 border-top-0 height-100">
                                                 <div class="card-body card-small-body height-100">
                                                     <h5 class="card-title card-approve-title height-50"><span class="month_revise_num">0</span><small  class="small-text">次</small></h5>
-                                                    <p class="card-text text-muted height-50">台修订</p>
+                                                    <p class="card-text text-muted height-50">台修订</p>
                                                 </div>
                                             </div>
                                         </div>
@@ -351,7 +351,7 @@
                                             <div class="card text-center bg-dark text-white height-100">
                                                 <div class="card-body card-per-body">
                                                     <h5 class="card-title card-case-title data_total_price">0.00</h5>
-                                                    <p class="card-text card-case-text text-muted">台金额</p>
+                                                    <p class="card-text card-case-text text-muted">台金额</p>
                                                 </div>
                                             </div>
                                         </div>
@@ -561,7 +561,7 @@
                                                         <div class="card text-center bg-dark text-white border-right-0 border-top-0 height-100">
                                                             <div class="card-body card-small-body">
                                                                 <h5 class="card-title card-approve-title height-50"><span class="month_revise_num">0</span><small class="small-text">次</small></h5>
-                                                                <p class="card-text text-muted height-50">台修订</p>
+                                                                <p class="card-text text-muted height-50">台修订</p>
                                                             </div>
                                                         </div>
                                                     </div>
@@ -690,7 +690,7 @@
             // }
         ],
         legend: {
-            data: ['台', '合同计量', '变更计量'],
+            data: ['台', '合同计量', '变更计量'],
             top:'17%'
         },
         grid: {
@@ -761,7 +761,7 @@
         ],
         series: [
             {
-                name: '台',
+                name: '台',
                 type: 'bar',
                 emphasis: {
                     focus: 'series'
@@ -1367,7 +1367,7 @@
                 month_material_num = ZhCalc.add(month_material_num, t.month_material_num);
                 html += '<tr>\n' +
                     '                                                    <td><span data-toggle="tooltip" data-placement="right" data-original-title="'+ t.name +'">'+ (t.name.length > 15 ? t.name.substring(0, 15) + '...' : t.name) +'</span></td>\n' +
-                    '                                                    <td>第'+ (t.lastStage ? t.lastStage.order : 0) +'期</td>\n' +
+                    '                                                    <td>'+ (t.lastStage ? '第' + (t.lastStage ? t.lastStage.order : 0) + '期': '台账' ) + '</td>\n' +
                     '                                                    <td>'+ (t.total_price ? t.total_price : 0) +'</td>\n' +
                     '                                                    <td>'+ (t.gather_tp ? t.gather_tp : 0) +'</td>\n' +
                     '                                                    <td>'+ (t.end_gather_tp ? t.end_gather_tp : 0) +'</td>\n' +

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

@@ -88,7 +88,7 @@
                                         <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><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">-</td>
@@ -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 %>;

+ 1 - 1
app/view/wap/dashboard.ejs

@@ -53,7 +53,7 @@
                                 <tr><th>本期完成计量</th><td class="text-right"><%- audit.gather_tp ? audit.gather_tp : 0 %></td></tr>
                                 <tr><th>截止上期完成计量</th><td class="text-right"><%- audit.pre_gather_tp ? audit.pre_gather_tp : 0 %></td></tr>
                                 <tr><th>截止本期完成计量</th><td class="text-right"><%- audit.end_gather_tp ? audit.end_gather_tp : 0 %></td></tr>
-                                <% if (ctx.session.sessionProject.page_show.closeWapYfSf) { %>
+                                <% if (!ctx.session.sessionProject.page_show.closeWapYfSf) { %>
                                 <tr><th>本期应付</th><td class="text-right"><%- audit.yf_tp ? audit.yf_tp : 0 %></td></tr>
                                 <tr><th>本期实付</th><td class="text-right"><%- audit.sf_tp ? audit.sf_tp : 0 %></td></tr>
                                 <% } %>

+ 2 - 2
app/view/wap/shenpi_stage.ejs

@@ -79,14 +79,14 @@
                                 <p class="mb-0">截止本期完成计量</p>
                                 <b>¥<%- stage.end_tp ? stage.end_tp : 0 %></b>
                             </td>
-                            <% if (ctx.session.sessionProject.page_show.closeWapYfSf) { %>
+                            <% if (!ctx.session.sessionProject.page_show.closeWapYfSf) { %>
                             <td>
                                 <p class="mb-0">本期应付</p>
                                 <b>¥<%- stage.yf_tp ? stage.yf_tp : 0 %></b>
                             </td>
                             <% } %>
                         </tr>
-                        <% if (ctx.session.sessionProject.page_show.closeWapYfSf) { %>
+                        <% if (!ctx.session.sessionProject.page_show.closeWapYfSf) { %>
                         <tr>
                             <td>
                                 <p class="mb-0">本期实付</p>

+ 2 - 2
app/view/wap/tender.ejs

@@ -173,14 +173,14 @@
                                     <p class="mb-0">截止本期完成计量</p>
                                     <b>¥<%- s.end_tp ? s.end_tp : 0 %></b>
                                 </td>
-                                <% if (ctx.session.sessionProject.page_show.closeWapYfSf) { %>
+                                <% if (!ctx.session.sessionProject.page_show.closeWapYfSf) { %>
                                 <td>
                                     <p class="mb-0">本期应付</p>
                                     <b>¥<%- s.yf_tp ? s.yf_tp : 0 %></b>
                                 </td>
                                 <% } %>
                             </tr>
-                            <% if (ctx.session.sessionProject.page_show.closeWapYfSf) { %>
+                            <% if (!ctx.session.sessionProject.page_show.closeWapYfSf) { %>
                             <tr>
                                 <td>
                                     <p class="mb-0">本期实付</p>

+ 9 - 0
sql/update.sql

@@ -1,3 +1,12 @@
+-- 调差材料税计算
+ALTER TABLE `zh_material` ADD `material_tax` TINYINT NOT NULL DEFAULT '0' COMMENT '是否已使用材料税,默认为0' AFTER `rate`;
+ALTER TABLE `zh_material` ADD `m_tax_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '材料含税金额' AFTER `material_tax`;
+ALTER TABLE `zh_material` ADD `m_tax_pre_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '截止上期材料含税金额' AFTER `m_tax_tp`;
+ALTER TABLE `zh_material_bills` ADD `m_tax_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '调差金额(材料税)' AFTER `pre_tp`, ADD `tax_pre_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '截止上期调差金额(材料税)' AFTER `m_tax_tp`;
+ALTER TABLE `zh_material_bills` ADD `m_tax` SMALLINT(3) NULL DEFAULT NULL COMMENT '材料税税率' AFTER `is_summary`;
+ALTER TABLE `zh_material_bills_history` ADD `m_tax_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '调差金额(材料税)' AFTER `pre_tp`, ADD `tax_pre_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '截止上期调差金额(材料税)' AFTER `m_tax_tp`;
+ALTER TABLE `zh_material_bills_history` ADD `m_tax` SMALLINT(3) NULL DEFAULT NULL COMMENT '材料税税率' AFTER `is_summary`;
+
 CREATE TABLE `zh_datacollect_tender`  (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `pid` int(11) NOT NULL,

+ 0 - 7
sql/update20211208.sql

@@ -1,11 +1,3 @@
 -- 附件文件地址更新
 UPDATE `zh_advance_file` SET `filepath` = CONCAT('app/',`filepath`);
 UPDATE `zh_material_file` SET `filepath` = CONCAT('app/',`filepath`);
-ALTER TABLE `zh_material` ADD `material_tax` TINYINT NOT NULL DEFAULT '0' COMMENT '是否已使用材料税,默认为0' AFTER `rate`;
-ALTER TABLE `zh_material` ADD `m_tax_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '材料含税金额' AFTER `material_tax`;
-ALTER TABLE `zh_material` ADD `m_tax_pre_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '截止上期材料含税金额' AFTER `m_tax_tp`;
-ALTER TABLE `zh_material_bills` ADD `m_tax_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '调差金额(材料税)' AFTER `pre_tp`, ADD `tax_pre_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '截止上期调差金额(材料税)' AFTER `m_tax_tp`;
-ALTER TABLE `zh_material_bills` ADD `m_tax` SMALLINT(3) NOT NULL DEFAULT NULL COMMENT '材料税税率' AFTER `is_summary`;
-ALTER TABLE `zh_material_bills_history` ADD `m_tax_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '调差金额(材料税)' AFTER `pre_tp`, ADD `tax_pre_tp` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '截止上期调差金额(材料税)' AFTER `m_tax_tp`;
-ALTER TABLE `zh_material_bills_history` ADD `m_tax` SMALLINT(3) NOT NULL DEFAULT NULL COMMENT '材料税税率' AFTER `is_summary`;