Explorar o código

1. 本期补差只读
2. 台账修订,清单对比,加载单价调整
3. 报表,材差清单汇总-工料,数据问题

MaiXinRong %!s(int64=2) %!d(string=hai) anos
pai
achega
303df0a343

+ 6 - 6
app/const/spread.js

@@ -204,8 +204,8 @@ const stageTz = {
             {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
             {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
-            { title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number' },
-            { title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number' },
+            { title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', readOnly: true },
+            { title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true },
             {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
@@ -287,8 +287,8 @@ const stageCl = {
             {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number',},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
             {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
-            { title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number' },
-            { title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number' },
+            { title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', readOnly: true },
+            { title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true },
             {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
@@ -370,8 +370,8 @@ const stageNoCl = {
             {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number',},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
             {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
-            {title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number' },
-            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number'},
+            {title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', readOnly: true },
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
             {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},

+ 2 - 4
app/lib/rm/material.js

@@ -345,7 +345,7 @@ class ReportMemoryMaterial {
             }
             this.materialGatherBase.materialNotJoin = await this.ctx.service.materialListNotjoin.getAllDataByCondition({ where: { mid: material.id } });
 
-            const mem_material_gather_bills = [], mem_material_gather_xmj = [], mem_material_gather_gl = [];
+            const mem_material_gather_bills = [], mem_material_gather_xmj = [];
             if (material.is_stage_self) {
                 const stageIds = material.stage_id.split(',');
                 const stageOrders = material.s_order.split(',');
@@ -353,15 +353,13 @@ class ReportMemoryMaterial {
                     const [gclList, leafXmjs] = await this._getMaterialStageGatherBills(tender_id, sid, stageOrders[i], true);
                     mem_material_gather_bills.push(...gclList);
                     mem_material_gather_xmj.push(...leafXmjs);
-                    mem_material_gather_gl.push(this.materialGatherBase.materialGl);
                 }
             } else {
                 const [gclList, leafXmjs] = await this._getMaterialStageGatherBills(tender_id, material.stage_id, material.stage_order, false);
                 mem_material_gather_bills.push(...gclList);
                 mem_material_gather_xmj.push(...leafXmjs);
-                mem_material_gather_gl.push(this.materialGatherBase.materialGl);
             }
-            return {mem_material_gather_bills, mem_material_gather_xmj, mem_material_gather_gl};
+            return {mem_material_gather_bills, mem_material_gather_xmj, mem_material_gather_gl: this.materialGatherBase.materialGl};
         } catch (err) {
             this.ctx.log(err);
             return {};

+ 2 - 2
app/public/js/revise_gcl_compare.js

@@ -150,7 +150,7 @@ $(document).ready(() => {
         $('#chapter-list').html(html.join(''));
     }
 
-    postData('load', {filter: 'bills;pos;reviseBills;revisePos;dealBills;spec'}, function (data) {
+    postData('load', {filter: 'bills;pos;reviseBills;revisePos;dealBills;spec;price'}, function (data) {
         const setting = {
             tree: {
                 id: 'ledger_id',
@@ -168,7 +168,7 @@ $(document).ready(() => {
         };
         gclCompareModel.init(gclData, chapter, data.spec);
         setting.prefix = 'new_';
-        gclCompareModel.gatherLedgerData(data.reviseBills, data.revisePos, setting);
+        gclCompareModel.gatherReviseLedgerData(data.reviseBills, data.revisePos, setting, data.price, decimal);
         setting.prefix = 'org_';
         gclCompareModel.gatherLedgerData(data.bills, data.pos, setting);
         gclCompareModel.gatherDealBills(data.dealBills);

+ 18 - 1
app/public/js/shares/gcl_gather_compare.js

@@ -397,6 +397,23 @@ const gclCompareModel = (function () {
         ledgerSetting = null;
     }
 
+    function gatherReviseLedgerData(bills, pos, setting, price, decimal) {
+        ledgerSetting = setting;
+        try {
+            if (leafXmjs.length > 0) leafXmjs.length = 0;
+            gsTree = createNewPathTree('revise', setting.tree);
+            gsTree.loadRevisePrice(price, decimal);
+            gsTree.loadDatas(bills);
+            const gsPos = new PosData(setting.pos);
+            gsPos.loadDatas(pos);
+            recursiveGatherGclData(gsTree.children, null, gsPos);
+            _gatherChapter();
+        } catch(err) {
+            console.log(err);
+        }
+        ledgerSetting = null;
+    }
+
     function compareCode(str1, str2, symbol = '-') {
         if (!str1) {
             return 1;
@@ -483,7 +500,7 @@ const gclCompareModel = (function () {
 
     return {
         init,
-        gatherLedgerData, gatherDealBills, checkDiffer,
+        gatherLedgerData, gatherReviseLedgerData, gatherDealBills, checkDiffer,
         chapterData
     };
 })();

+ 7 - 7
app/public/js/stage.js

@@ -1504,13 +1504,13 @@ $(document).ready(() => {
             return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
         },
         items: {
-            copyDisplay: {
-                name: '仅复制可见数据',
-                callback: function (key, opt) {
-
-                }
-            },
-            copySpr: '----',
+            // copyDisplay: {
+            //     name: '仅复制可见数据',
+            //     callback: function (key, opt) {
+            //         SpreadJsObj.Copy
+            //     }
+            // },
+            // copySpr: '----',
             'locateZjjl': {
                 name: '定位至中间计量',
                 icon: 'fa-sign-in',

+ 1 - 0
app/view/revise/gcl_compare.ejs

@@ -77,4 +77,5 @@
     const isTz = <%- ctx.tender.data.measure_type === measureType.tz.value %>;
     const chapter = JSON.parse('<%- JSON.stringify(ctx.tender.info.chapter) %>');
     const thousandth = <%- ctx.tender.info.display.thousandth %>;
+    const decimal = JSON.parse('<%- JSON.stringify(ctx.tender.info.decimal) %>');
 </script>