Procházet zdrojové kódy

1. 汇总,冻结列
2. 计量台账,查看变更后数量明细

MaiXinRong před 1 týdnem
rodič
revize
4061783fc9

+ 2 - 0
app/public/js/spss_gather_ledger.js

@@ -35,6 +35,8 @@ $(document).ready(() => {
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
         readOnly: true,
+        frozenColCount: 5,
+        frozenLineColor: '#93b5e4',
     };
     const posSpreadSetting = {
         cols: [

+ 2 - 0
app/public/js/spss_gather_stage.js

@@ -43,6 +43,8 @@ $(document).ready(() => {
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
         readOnly: true,
+        frozenColCount: 5,
+        frozenLineColor: '#93b5e4',
     };
     const posSpreadSetting = {
         cols: [

+ 8 - 0
app/public/js/spss_gather_stage_extra.js

@@ -36,6 +36,8 @@ $(document).ready(() => {
             headerFont: '12px 微软雅黑',
             font: '12px 微软雅黑',
             readOnly: true,
+            frozenColCount: 3,
+            frozenLineColor: '#93b5e4',
         },
         yjcl: {
             cols: [
@@ -65,6 +67,8 @@ $(document).ready(() => {
             headerFont: '12px 微软雅黑',
             font: '12px 微软雅黑',
             readOnly: true,
+            frozenColCount: 3,
+            frozenLineColor: '#93b5e4',
         },
         bonus: {
             cols: [
@@ -110,6 +114,8 @@ $(document).ready(() => {
             headerFont: '12px 微软雅黑',
             font: '12px 微软雅黑',
             readOnly: true,
+            frozenColCount: 3,
+            frozenLineColor: '#93b5e4',
         },
         tempLand: {
             cols: [
@@ -129,6 +135,8 @@ $(document).ready(() => {
             headerFont: '12px 微软雅黑',
             font: '12px 微软雅黑',
             readOnly: true,
+            frozenColCount: 4,
+            frozenLineColor: '#93b5e4',
         },
         other: {
             cols: [

+ 2 - 0
app/public/js/spss_gather_stage_pay.js

@@ -23,6 +23,8 @@ $(document).ready(() => {
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
         readOnly: true,
+        frozenColCount: 2,
+        frozenLineColor: '#93b5e4',
     };
 
     const paySpread = SpreadJsObj.createNewSpread($('#pay-spread')[0]);

+ 66 - 3
app/public/js/stage.js

@@ -1589,6 +1589,7 @@ $(document).ready(() => {
                         : findEmptyBills(tree, change, changeBills);
 
                     if (!node) continue;
+                    if (!node.changeBills) node.changeBills = [];
                     node.tz_qc_qty = ZhCalc.add(node.tz_qc_qty, changeBills.checked_amount);
                     if (tenderInfo.calc_type === 'up') {
                         node.tz_qc_tp = ZhCalc.add(node.tz_qc_tp, changeBills.checked_price);
@@ -1600,7 +1601,25 @@ $(document).ready(() => {
                     if (posData && posData.length > 0) {
                         for (const p of changeBills.pos) {
                             const changePos = p.bwmx ? posData.find(x => { return x.name === p.bwmx; }) : posData[0];
-                            if (changePos) changePos.tz_qc_qty = ZhCalc.add(changePos.tz_qc_qty, p.checked_amount);
+                            if (changePos) {
+                                changePos.tz_qc_qty = ZhCalc.add(changePos.tz_qc_qty, p.checked_amount);
+                                if (!changePos.changeBills) changePos.changeBills = [];
+                                changePos.changeBills.push({
+                                    code: change.code || '', name: change.name || '', is_valuation:  p.is_valuation,
+                                    qty: p.checked_amount || 0, tp: p.checked_price || 0, pos: changePos.name,
+                                });
+                                node.changeBills.push({
+                                    code: change.code || '', name: change.name || '', is_valuation: p.is_valuation,
+                                    qty: p.checked_amount || 0, tp: p.checked_price || 0, pos: changePos.name,
+                                });
+                            }
+                        }
+                    } else {
+                        for (const p of changeBills.pos) {
+                            node.changeBills.push({
+                                code: change.code || '', name: change.name || '', is_valuation: p.is_valuation,
+                                qty: p.checked_amount || 0, tp: p.checked_price || 0, pos: '',
+                            });
                         }
                     }
                 }
@@ -2009,6 +2028,28 @@ $(document).ready(() => {
                     return !node;
                 }
             },
+            detail: {
+                name: '查看变更后数量明细',
+                callback: function(key, opt, menu, e) {
+                    const curBills = SpreadJsObj.getSelectObject(slSheet);
+                    $('#tz2d-hint').html(`当前清单:${curBills.b_code || ''} ${curBills.name || ''}`);
+                    $('#tz2d-tz').html(`台账数量:${ curBills.quantity || 0}`);
+                    $('#tz2d-qc').html(`变更数量:${ ZhCalc.sub(curBills.tz2_qty, curBills.quantity) || 0}`);
+                    $('#tz2d-sum').html(`变更后数量:${ curBills.tz2_qty || 0}`);
+                    const html = [];
+                    html.push('<tr class="text-center"><th>变更令编号</th><th>变更令名称</th><th>计量单元</th><th>计价</th><th>批复数量</th></tr>');
+                    if (!curBills.changeBills) curBills.changeBills = [];
+                    for (const cb of curBills.changeBills) {
+                        html.push(`<tr><td>${cb.code}</td><td>${cb.name}</td><td>${cb.pos}</td><td class="text-center">${ cb.is_valuation ? '√' : '' }</td><td class="text-right">${cb.qty}</td></tr>`);
+                    }
+                    $('#tz2d-list').html(html.join(''));
+                    $('#tz2-detail').modal('show');
+                },
+                disabled: function(key, opt) {
+                    const curBills = SpreadJsObj.getSelectObject(slSheet);
+                    return !curBills || !curBills.b_code;
+                }
+            },
             exportSpr: '----',
             exportSelectNodeXlsx: {
                 name: '导出选中节点至Excel',
@@ -2829,7 +2870,6 @@ $(document).ready(() => {
                         icon: 'fa-sort-amount-desc',
                         callback: function (key, opt) {
                             stagePos.sort = [['add_stage_order', 'desc'], ['porder', 'asc']];
-                            const spSheet = spSpread.getActiveSheet();
                             if (spSheet.zh_data) {
                                 spSheet.zh_data.sort((x, y) => { return y.add_stage_order - x.add_stage_order || x.porder - y.porder; });
                                 SpreadJsObj.reLoadSheetData(spSheet);
@@ -2977,7 +3017,30 @@ $(document).ready(() => {
                     $('#shoufang-pos').text('计量单元:' + node.name).show();
                     $('#addshoufang').modal('show');
                 }
-            }
+            },
+            detail: {
+                name: '查看变更后数量明细',
+                callback: function(key, opt, menu, e) {
+                    const curBills = SpreadJsObj.getSelectObject(slSheet);
+                    const curPos = SpreadJsObj.getSelectObject(spSheet);
+                    $('#tz2d-hint').html(`当前清单:${curBills.b_code || ''} ${curBills.name || ''} - [${curPos.name || ''}]`);
+                    $('#tz2d-tz').html(`台账数量:${ curPos.quantity || 0}`);
+                    $('#tz2d-qc').html(`变更数量:${ ZhCalc.sub(curPos.tz2_qty, curPos.quantity) || 0}`);
+                    $('#tz2d-sum').html(`变更后数量:${ curPos.tz2_qty || 0}`);
+                    const html = [];
+                    html.push('<tr class="text-center"><th>变更令编号</th><th>变更令名称</th><th>计价</th><th>批复数量</th></tr>');
+                    if (!curPos.changeBills) curPos.changeBills = [];
+                    for (const cb of curPos.changeBills) {
+                        html.push(`<tr><td>${cb.code}</td><td>${cb.name}</td><td class="text-center">${ cb.is_valuation ? '√' : '' }</td><td class="text-right">${cb.qty}</td></tr>`);
+                    }
+                    $('#tz2d-list').html(html.join(''));
+                    $('#tz2-detail').modal('show');
+                },
+                disabled: function(key, opt) {
+                    const curPos = SpreadJsObj.getSelectObject(spSheet);
+                    return !curPos;
+                }
+            },
         }
     });
     $.subMenu({

+ 26 - 0
app/view/stage/modal.ejs

@@ -701,6 +701,32 @@
         </div>
     </div>
 </div>
+<div class="modal fade" id="tz2-detail" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">变更后数量明细</h5>
+            </div>
+            <div class="modal-body">
+                <div id="tz2d-hint"></div>
+                <div class="row">
+                    <div class="col-4" id="tz2d-tz"></div>
+                    <div class="col-4" id="tz2d-qc"></div>
+                    <div class="col-4" id="tz2d-sum"></div>
+                </div>
+            </div>
+            <div class="modal-body pt-0">
+                <div class="modal-height-300 scroll-y">
+                    <table class="table table-sm table-bordered" id="tz2d-list">
+                    </table>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
 <% include ./audit_modal.ejs %>
 <% include ../shares/merge_peg_modal.ejs %>
 <% include ../shares/check_modal2.ejs %>