浏览代码

调差计算增加100-900章基数值

ellisran 1 年之前
父节点
当前提交
3d5bef9d7c
共有 4 个文件被更改,包括 53 次插入14 次删除
  1. 26 1
      app/const/deal_pay.js
  2. 3 1
      app/public/js/material.js
  3. 11 3
      app/service/stage.js
  4. 13 9
      app/view/material/info_modal.ejs

+ 26 - 1
app/const/deal_pay.js

@@ -39,6 +39,30 @@ const calcBase = [
     {name: '本期应付', code: 'bqyf', limit: true, ptNormalLimit: true, sort: 20},
 ];
 
+const materialCalcBase = [
+    {name: '签约合同价', code: 'htj', sort: 10},
+    {name: '暂列金额', code: 'zlje', sort: 2},
+    {name: '签约合同价(不含暂列金)', code: 'htjszl', sort: 1},
+    {name: '签约开工预付款', code: 'kgyfk', sort: 2},
+    {name: '签约材料预付款', code: 'clyfk', sort: 2},
+    {name: '本期完成计量', code: 'bqwc', limit: true, sort: 10},
+    {name: '本期合同计量', code: 'bqht', limit: true, sort: 10},
+    {name: '本期变更计量', code: 'bqbg', limit: true, sort: 10},
+    {name: '本期一般变更计量', code: 'ybbqbg', limit: true, sort: 5},
+    {name: '本期较大变更计量', code: 'jdbqbg', limit: true, sort: 5},
+    {name: '本期重大变更计量', code: 'zdbqbg', limit: true, sort: 5},
+    {name: '100章本期完成计量', code: 'yib', code2: 'ybbqwc', cType: 1, filter: '^[^0-9]*1[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '200章本期完成计量', code: 'erb', cType: 1, filter: '^[^0-9]*2[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '300章本期完成计量', code: 'sanb', cType: 1, filter: '^[^0-9]*3[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '400章本期完成计量', code: 'sib', cType: 1, filter: '^[^0-9]*4[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '500章本期完成计量', code: 'wub', cType: 1, filter: '^[^0-9]*5[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '600章本期完成计量', code: 'liub', cType: 1, filter: '^[^0-9]*6[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '700章本期完成计量', code: 'qib', cType: 1, filter: '^[^0-9]*7[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '800章本期完成计量', code: 'bab', cType: 1, filter: '^[^0-9]*8[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '900章本期完成计量', code: 'jiub', cType: 1, filter: '^[^0-9]*9[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '本期应付', code: 'bqyf', limit: true, ptNormalLimit: true, sort: 20},
+];
+
 const chapterDetailType = {
     chapter: 1,
     withoutChapter: 21,
@@ -80,6 +104,7 @@ module.exports = {
     payType,
     payTemplate,
     calcBase,
+    materialCalcBase,
     chapterDetail,
     deadlineType,
-};
+};

+ 3 - 1
app/public/js/material.js

@@ -1322,7 +1322,9 @@ $(document).ready(() => {
             let html = '';
             calcBase = _.find(calcBaseList, { ms_id: $('#myTab').find('.active').data('msid') }).calcBase;
             for (let iBase = 0; iBase < calcBase.length; iBase++) {
-                html += '<tr><td>' + calcBase[iBase].name + '</td><td>' + calcBase[iBase].code + '</td><td>' + calcBase[iBase].value + '</td></tr>';
+                if (!calcBase[iBase].cType || (calcBase[iBase].cType && calcBase[iBase].cType === 1 && calcBase[iBase].value)) {
+                    html += '<tr><td>' + calcBase[iBase].name + '</td><td>' + calcBase[iBase].code + '</td><td>' + calcBase[iBase].value + '</td></tr>';
+                }
             }
             $('#calcBase').html(html);
             const ms_id = parseInt($('#myTab').find('.active').data('msid'));

+ 11 - 3
app/service/stage.js

@@ -782,7 +782,7 @@ module.exports = app => {
          * @return {Promise<any>}
          */
         async getMaterialCalcBase(stage_list, tenderInfo) {
-            const calcBase = JSON.parse(JSON.stringify(payConst.calcBase));
+            const calcBase = JSON.parse(JSON.stringify(payConst.materialCalcBase));
             const param = tenderInfo.deal_param;
             const sum = await this.ctx.service.stageBills.getSumTotalPriceByMaterial(stage_list);
             const pcSum = await this.ctx.service.stageBillsPc.getSumTotalPriceByMaterial(stage_list);
@@ -812,8 +812,16 @@ module.exports = app => {
                     case 'bqbg':
                         cb.value = sum.qc_tp;
                         break;
-                    case 'ybbqwc':
-                        const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGclByMaterial(stage_list, '^[^0-9]*1[0-9]{2}(-|$)');
+                    case 'yib':
+                    case 'erb':
+                    case 'sanb':
+                    case 'sib':
+                    case 'wub':
+                    case 'liub':
+                    case 'qib':
+                    case 'bab':
+                    case 'jiub':
+                        const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGclByMaterial(stage_list, cb.filter);
                         cb.value = this.ctx.helper.add(sumGcl.contract_tp, sumGcl.qc_tp);
                         break;
                     case 'bqyf':

+ 13 - 9
app/view/material/info_modal.ejs

@@ -17,15 +17,19 @@
                         <button class="btn btn-outline-primary btn-sm">)</button>
                     </p>
                 </div>
-                <table class="table table-sm table-bordered">
-                    <tr><th>基数</th><th>代号</th><th>值</th></tr>
-                    <tbody id="calcBase">
-                    <% const calcB = material.is_stage_self ? calcBase[0].calcBase : calcBase; %>
-                    <% for (let iBase = 0; iBase < calcB.length; iBase++) { %>
-                        <tr><td><%- calcB[iBase].name %></td><td><%- calcB[iBase].code %></td><td><%- calcB[iBase].value %></td></tr>
-                    <% } %>
-                    </tbody>
-                </table>
+                <div class="modal-height-500" style="overflow: auto">
+                    <table class="table table-sm table-bordered">
+                        <tr><th>基数</th><th>代号</th><th>值</th></tr>
+                        <tbody id="calcBase">
+                        <% const calcB = material.is_stage_self ? calcBase[0].calcBase : calcBase; %>
+                        <% for (let iBase = 0; iBase < calcB.length; iBase++) { %>
+                            <% if (!calcB[iBase].cType || (calcB[iBase].cType && calcB[iBase].cType === 1 && calcB[iBase].value)) { %>
+                            <tr><td><%- calcB[iBase].name %></td><td><%- calcB[iBase].code %></td><td><%- calcB[iBase].value %></td></tr>
+                            <% } %>
+                        <% } %>
+                        </tbody>
+                    </table>
+                </div>
             </div>
             <div class="modal-footer">
                 <input type="hidden" id="materialbillsId" value="" />