Explorar o código

1#完成率相关
报表提供不计价数据&1#完成率等

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

+ 3 - 4
app/const/spread.js

@@ -207,7 +207,7 @@ const stageTz = {
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
-            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
+            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
             {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
             {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
@@ -215,7 +215,6 @@ const stageTz = {
             {title: '经济指标',  colSpan: '1', rowSpan: '2', field: 'final_dgn_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil', hAlign: 0, width: 100, formatter: '@', cellType: 'autoTip'},
             {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
-            //{title: '累计完成率(%)', colSpan: '1', rowSpan: '2', field: 'percent', hAlign: 0, width: 100, readOnly: true, type: 'Number'},
             {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
             {title: 'ex_memo2', colSpan: '1', rowSpan: '2', field: 'ex_memo2', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
             {title: 'ex_memo3', colSpan: '1', rowSpan: '2', field: 'ex_memo3', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
@@ -289,7 +288,7 @@ const stageCl = {
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
-            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
+            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
             {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
             {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
@@ -370,7 +369,7 @@ const stageNoCl = {
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
-            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
+            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
             {title: '合同|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'deal_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},
             {title: '|项目节数量2',  colSpan: '|1', rowSpan: '|1', field: 'deal_dgn_qty2', hAlign: 2, width: 60, type: 'Number'},
             {title: '变更|项目节数量1',  colSpan: '2|1', rowSpan: '1|1', field: 'c_dgn_qty1', hAlign: 2, width: 60, type: 'Number'},

+ 10 - 0
app/controller/stage_controller.js

@@ -410,9 +410,19 @@ module.exports = app => {
 
         async check(ctx) {
             try {
+                const helper = this.ctx.helper;
                 this._getLedgerColumn();
                 const ledgerData = await this._getStageLedgerData(ctx);
+                ledgerData.forEach(x => {
+                    x.end_qc_minus_qty = helper.add(x.pre_qc_minus_qty, x.qc_minus_qty);
+                    x.final_1_qty = helper.add(x.quantity, x.end_qc_minus_qty);
+                    x.deal_final_1_qty = helper.add(x.deal_qty, x.end_qc_minus_qty);
+                });
                 const posData = await this._getStagePosData(ctx);
+                posData.forEach(x => {
+                    x.end_qc_minus_qty = helper.add(x.pre_qc_minus_qty, x.qc_minus_qty);
+                    x.final_1_qty = helper.add(x.quantity, x.end_qc_minus_qty);
+                });
 
                 const projRela = await this.ctx.service.project.getFunRela(this.ctx.session.sessionProject.id);
                 const checkDataModel = require('../lib/ledger').checkData;

+ 16 - 0
app/lib/bills_pos_convert.js

@@ -98,6 +98,9 @@ class BillsPosConvert {
         node.pre_gather_qty = this.ctx.helper.add(node.pre_gather_qty, data.pre_gather_qty);
 
         node.real_qty = this.ctx.helper.add(node.real_qty, data.real_qty);
+
+        node.qc_minus_qty = this.ctx.helper.add(node.qc_minus_qty, data.qc_minus_qty);
+        node.pre_qc_minus_qty = this.ctx.helper.add(node.pre_qc_minus_qty, data.pre_qc_minus_qty);
     }
     _loadBillsCalcFields(node, data) {
         node.quantity = this.ctx.helper.add(node.quantity, data.quantity);
@@ -114,6 +117,9 @@ class BillsPosConvert {
         node.pre_qc_qty = this.ctx.helper.add(node.pre_qc_qty, data.pre_qc_qty);
         node.pre_qc_tp = this.ctx.helper.add(node.pre_qc_tp, data.pre_qc_tp);
         node.pre_gather_qty = this.ctx.helper.add(node.pre_gather_qty, data.pre_gather_qty);
+
+        node.qc_minus_qty = this.ctx.helper.add(node.qc_minus_qty, data.qc_minus_qty);
+        node.pre_qc_minus_qty = this.ctx.helper.add(node.pre_qc_minus_qty, data.pre_qc_minus_qty);
     }
     _convertGcl(node, xmj) {
         if (!xmj) return;
@@ -235,6 +241,13 @@ class BillsPosConvert {
         child.estimate_tp = this.ctx.helper.mul(child.estimate_qty, child.unit_price, tpDecimal);
 
         child.bgl_code = this.ctx.helper._.uniq(this.ctx.helper._.map(child.changes, 'c_code')).join(';');
+
+        // !#台账相关
+        child.end_qc_minus_qty = this.ctx.helper.add(child.pre_qc_minus_qty, child.qc_minus_qty); // 1#台账
+        child.final_1_qty = this.ctx.helper.add(child.end_qc_minus_qty, child.quantity); // 1#台账 = 台账+负变更
+        child.final_1_tp = this.ctx.helper.mul(child.unit_price, child.final_1_qty, tpDecimal);
+        child.end_final_1_tp = this.ctx.helper.add(child.final_1_tp, child.end_qc_tp);
+        child.end_final_1_percent = this.ctx.helper.mul(this.ctx.helper.div(child.end_gather_tp, child.end_final_1_tp, 4), 100);
     }
     _calculateNode(node, children) {
         for (const child of children) {
@@ -250,11 +263,14 @@ class BillsPosConvert {
             node.end_gather_tp = this.ctx.helper.add(node.end_gather_tp, child.end_gather_tp);
             node.real_tp = this.ctx.helper.add(node.real_tp, child.real_tp);
             node.estimate_tp = this.ctx.helper.add(node.estimate_tp, child.estimate_tp);
+            node.final_1_tp = this.ctx.helper.add(node.final_1_tp, child.final_1_tp);
         }
         if (node.dgn_qty1)
             node.dgn_price = this.ctx.helper.div(node.total_price, node.dgn_qty1, this.ctx.tender.info.decimal.up);
         node.final_tp = this.ctx.helper.add(node.total_price, node.end_qc_tp);
+        node.end_final_1_tp = this.ctx.helper.add(node.final_1_tp, node.end_qc_tp);
         node.end_gather_percent = this.ctx.helper.mul(this.ctx.helper.div(node.end_gather_tp, node.final_tp, 4), 100);
+        node.end_final_1_percent = this.ctx.helper.mul(this.ctx.helper.div(node.end_gather_tp, node.end_final_1_tp, 4), 100);
     }
     _recursiveCalcUnitNodes(nodes) {
         if (!nodes || !nodes instanceof Array || nodes.length === 0) return;

+ 4 - 4
app/lib/ledger.js

@@ -633,7 +633,7 @@ class checkData {
                 if (!data.contract_qty && !data.qc_qty && !data.pre_contract_qty && !data.pre_qc_qty) return 2; // 漏计
             } else {
                 const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, unit);
-                const checkQty = this.ctx.helper.mul(data.quantity, this.ctx.helper.div(ratio, 100, 4), precision.value);
+                const checkQty = this.ctx.helper.mul(data.final_1_qty, this.ctx.helper.div(ratio, 100, 4), precision.value);
                 const qty = this.ctx.helper.add(data.contract_qty, data.pre_contract_qty);
                 if (qty > checkQty) return 1; // 违规
                 if (qty < checkQty) return 2; // 漏计
@@ -901,9 +901,9 @@ class checkData {
                     const end_contract_qty = this.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
                     if (!p.quantity && !!end_contract_qty) return true;
                     if (p.quantity > 0) {
-                        if (end_contract_qty > p.quantity) return true;
+                        if (end_contract_qty > p.final_1_qty) return true;
                     } else {
-                        if (end_contract_qty < p.quantity || end_contract_qty > 0) return true;
+                        if (end_contract_qty < p.final_1_qty || end_contract_qty > 0) return true;
                     }
                 }
                 return false;
@@ -916,7 +916,7 @@ class checkData {
                 if (!compare_tp) return !!end_contract_tp;
                 return compare_tp >= 0 ? end_contract_tp > compare_tp : end_contract_tp < compare_tp || end_contract_tp > 0;
             } else {
-                const compare_qty = isTz ? bills.quantity : bills.deal_qty;
+                const compare_qty = isTz ? bills.final_1_qty : bills.deal_final_1_qty;
                 if (!compare_qty) return !!end_contract_qty;
                 return compare_qty >= 0 ? end_contract_qty > compare_qty : end_contract_qty < compare_qty || end_contract_qty > 0;
             }

+ 59 - 52
app/lib/stage_im.js

@@ -34,6 +34,7 @@ class StageIm {
                     node.gather_qty = self.ctx.helper.add(node.contract_qty, node.qc_qty);
                     node.end_contract_qty = self.ctx.helper.add(node.pre_contract_qty, node.contract_qty);
                     node.end_qc_qty = self.ctx.helper.add(node.pre_qc_qty, node.qc_qty);
+                    node.end_qc_minus_qty = self.ctx.helper.add(node.pre_qc_minus_qty, node.qc_minus_qty);
                     node.end_gather_qty = self.ctx.helper.add(node.pre_gather_qty, node.gather_qty);
                 }
                 node.pre_gather_tp = self.ctx.helper.add(node.pre_contract_tp, node.pre_qc_tp);
@@ -45,12 +46,13 @@ class StageIm {
         });
         this.pos = new Ledger.pos({
             id: 'id', ledgerId: 'lid',
-            updateFields: ['contract_qty', 'qc_qty', 'postil'],
+            updateFields: ['contract_qty', 'qc_qty', 'qc_minus_qty', 'postil'],
             calc(p) {
                 p.pre_gather_qty = self.ctx.helper.add(p.pre_contract_qty, p.pre_qc_qty);
                 p.gather_qty = self.ctx.helper.add(p.contract_qty, p.qc_qty);
                 p.end_contract_qty = self.ctx.helper.add(p.pre_contract_qty, p.contract_qty);
                 p.end_qc_qty = self.ctx.helper.add(p.pre_qc_qty, p.qc_qty);
+                p.end_qc_minus_qty = self.ctx.helper.add(p.pre_qc_minus_qty, p.qc_minus_qty);
                 p.end_gather_qty = self.ctx.helper.add(p.pre_gather_qty, p.gather_qty);
             },
         });
@@ -69,42 +71,28 @@ class StageIm {
     // 加载数据
     async _loadMainData() {
         const billsData = await this.ctx.service.ledger.getData(this.ctx.tender.id);
-        if (this.ctx.stage.readOnly) {
-            const curStage = await this.ctx.service.stageBills.getAuditorStageData2(this.ctx.tender.id,
-                this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder);
-            this.ctx.helper.assignRelaData(billsData, [
-                { data: curStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: '', relaId: 'lid' },
-            ]);
-        } else {
-            const curStage = await this.ctx.service.stageBills.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id);
-            this.ctx.helper.assignRelaData(billsData, [
-                { data: curStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: '', relaId: 'lid' },
-            ]);
-        }
+        const curStage = this.ctx.stage.readOnly
+            ? await this.ctx.service.stageBills.getAuditorStageData2(this.ctx.tender.id,
+                this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder)
+            : await this.ctx.service.stageBills.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id);
         const preStage = this.ctx.stage.order > 1 ? await this.ctx.service.stageBillsFinal.getFinalData(this.ctx.tender, this.ctx.stage.order - 1) : [];
 
         this.ctx.helper.assignRelaData(billsData, [
-            { data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: 'pre_', relaId: 'lid' },
+            { data: curStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'], prefix: '', relaId: 'lid' },
+            { data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'], prefix: 'pre_', relaId: 'lid' },
         ]);
         this.billsTree.loadDatas(billsData);
         this.billsTree.calculateAll();
 
         const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: this.ctx.tender.id } });
-        if (this.ctx.stage.readOnly) {
-            const curPosStage = await this.ctx.service.stagePos.getAuditorStageData2(this.ctx.tender.id,
-                this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder);
-            this.ctx.helper.assignRelaData(posData, [
-                { data: curPosStage, fields: ['contract_qty', 'qc_qty'], prefix: '', relaId: 'pid' },
-            ]);
-        } else {
-            const curPosStage = await this.ctx.service.stagePos.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id);
-            this.ctx.helper.assignRelaData(posData, [
-                { data: curPosStage, fields: ['contract_qty', 'qc_qty'], prefix: '', relaId: 'pid' },
-            ]);
-        }
+        const curPosStage = this.ctx.stage.readOnly
+            ? await this.ctx.service.stagePos.getAuditorStageData2(this.ctx.tender.id,
+                this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder)
+            : await this.ctx.service.stagePos.getLastestStageData2(this.ctx.tender.id, this.ctx.stage.id);
         const prePosStage = this.ctx.stage.order > 1 ? await this.ctx.service.stagePosFinal.getFinalData(this.ctx.tender, this.ctx.stage.order - 1) : [];
         this.ctx.helper.assignRelaData(posData, [
-            { data: prePosStage, fields: ['contract_qty', 'qc_qty'], prefix: 'pre_', relaId: 'pid' },
+            { data: curPosStage, fields: ['contract_qty', 'qc_qty', 'qc_minus_qty'], prefix: '', relaId: 'pid' },
+            { data: prePosStage, fields: ['contract_qty', 'qc_qty', 'qc_minus_qty'], prefix: 'pre_', relaId: 'pid' },
         ]);
         this.pos.loadDatas(posData);
         this.pos.calculateAll();
@@ -376,10 +364,10 @@ class StageIm {
         if (im.calc_memo !== undefined && im.calc_memo !== null && im.calc_memo !== '') return;
 
         if (im.leafXmjs && im.leafXmjs.length > 0) {
-            const memo = ['本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit];
+            const memo = ['本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit];
             for (const lx of im.leafXmjs) {
                 for (const p of lx.pos) {
-                    memo.push(p.name + ':' + p.jl + ' ' + im.unit);
+                    memo.push(p.name + ':' + p.jl + (p.qc_minus_jl ? (` (不计价 ${p.qc_minus_jl}) `) : ' ') + im.unit);
                 }
             }
             im.calc_memo = memo.join('\n');
@@ -389,10 +377,10 @@ class StageIm {
                 if (b.pos && b.pos.length > 0) {
                     memo.push('清单' + (i + 1) + ':' + b.b_code + ' ' + b.name);
                     for (const p of b.pos) {
-                        memo.push(p.name + ':' + p.jl + ' ' + b.unit);
+                        memo.push(p.name + ':' + p.jl + (p.qc_minus_jl ? (` (不计价 ${p.qc_minus_jl}) `) : ' ') + b.unit);
                     }
                 } else {
-                    memo.push('清单' + (i + 1) + ':' + b.b_code + ' ' + b.name + ':' + (this.ctx.helper.checkZero(b.jl) ? 0 : b.jl) + ' ' + b.unit);
+                    memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name + ':' + (checkZero(b.jl) ? 0 : b.jl) + (b.qc_minus_jl ? (` (不计价 ${b.qc_minus_jl}) `) : ' ') + b.unit);
                 }
             }
             im.calc_memo = memo.join('\n');
@@ -425,6 +413,7 @@ class StageIm {
             lp.jl = this.ctx.helper.add(lp.jl, p.gather_qty);
             lp.contract_jl = this.ctx.helper.add(lp.contract_jl, p.contract_qty);
             lp.qc_jl = this.ctx.helper.add(lp.qc_jl, p.qc_qty);
+            lp.qc_minus_jl = this.ctx.helper.add(lp.qc_minus_jl, p.qc_minus_qty);
         }
     }
     _recursiveGenerateTzGclBills(node, im) {
@@ -435,7 +424,7 @@ class StageIm {
                 if ((!p.b_code || p.b_code === '') || (p.children && p.children.length > 0)) continue;
 
                 if (this.ctx.helper.checkZero(p.contract_qty) && this.ctx.helper.checkZero(p.contract_tp) &&
-                    this.ctx.helper.checkZero(p.qc_qty) && this.ctx.helper.checkZero(p.qc_tp)) {
+                    this.ctx.helper.checkZero(p.qc_qty) && this.ctx.helper.checkZero(p.qc_tp) && this.ctx.helper.checkZero(p.qc_minus_qty)) {
                     continue;
                 }
                 let b = this._.find(im.gclBills, { bid: p.id });
@@ -449,6 +438,7 @@ class StageIm {
                 b.jl = this.ctx.helper.add(b.jl, p.gather_qty);
                 b.contract_jl = this.ctx.helper.add(b.contract_jl, p.contract_qty);
                 b.qc_jl = this.ctx.helper.add(b.qc_jl, p.qc_qty);
+                b.qc_minus_jl = this.ctx.helper.add(b.qc_minus_jl, p.qc_minus_qty);
 
                 b.tp = this.ctx.helper.add(b.tp, p.gather_tp);
                 b.contract_tp = this.ctx.helper.add(b.contract_tp, p.contract_tp);
@@ -457,6 +447,7 @@ class StageIm {
                 b.pre_jl = this.ctx.helper.add(b.pre_jl, p.pre_gather_qty);
                 b.pre_contract_jl = this.ctx.helper.add(b.pre_contract_jl, p.pre_contract_qty);
                 b.pre_qc_jl = this.ctx.helper.add(b.pre_qc_jl, p.pre_qc_qty);
+                b.pre_qc_minus_jl = this.ctx.helper.add(b.pre_qc_minus_jl, p.pre_qc_minus_qty);
 
                 b.pre_tp = this.ctx.helper.add(b.pre_tp, p.pre_gather_tp);
                 b.pre_contract_tp = this.ctx.helper.add(b.pre_contract_tp, p.pre_contract_tp);
@@ -465,6 +456,7 @@ class StageIm {
                 b.end_jl = this.ctx.helper.add(b.end_jl, p.end_gather_qty);
                 b.end_contract_jl = this.ctx.helper.add(b.end_contract_jl, p.end_contract_qty);
                 b.end_qc_jl = this.ctx.helper.add(b.end_qc_jl, p.end_qc_qty);
+                b.end_qc_minus_jl = this.ctx.helper.add(b.end_qc_minus_jl, p.end_qc_minus_qty);
 
                 b.end_tp = this.ctx.helper.add(b.end_tp, p.end_gather_tp);
                 b.end_contract_tp = this.ctx.helper.add(b.end_contract_tp, p.end_contract_tp);
@@ -515,23 +507,23 @@ class StageIm {
             for (const p of posterity) {
                 if (p.children && p.children.length > 0) continue;
                 if (!helper.checkZero(p.contract_qty) || !helper.checkZero(p.contract_tp) ||
-                    !helper.checkZero(p.qc_qty) || !helper.checkZero(p.qc_tp))
+                    !helper.checkZero(p.qc_qty) || !helper.checkZero(p.qc_tp) || !helper.checkZero(p.qc_minus_qty))
                     return true;
                 const pPos = this.pos.getLedgerPos(p.id);
                 if (!pPos || pPos.length === 0) continue;
                 for (const pp of pPos) {
-                    if (!helper.checkZero(pp.contract_qty) || !helper.checkZero(pp.qc_qty)) return true;
+                    if (!helper.checkZero(pp.contract_qty) || !helper.checkZero(pp.qc_qty) || !helper.checkZero(pp.qc_minus_qty)) return true;
                 }
             }
             return false;
         } else {
             if (!helper.checkZero(node.contract_qty) || !helper.checkZero(node.contract_tp) ||
-                !helper.checkZero(node.qc_qty) || !helper.checkZero(node.qc_tp))
+                !helper.checkZero(node.qc_qty) || !helper.checkZero(node.qc_tp) || !helper.checkZero(node.qc_minus_qty))
                 return true;
             const pPos = this.pos.getLedgerPos(node.id);
             if (!pPos || pPos.length === 0) return false;
             for (const pp of pPos) {
-                if (!helper.checkZero(pp.contract_qty) || !helper.checkZero(pp.qc_qty)) return true;
+                if (!helper.checkZero(pp.contract_qty) || !helper.checkZero(pp.qc_qty) || !helper.checkZero(pp.qc_minus_qty)) return true;
             }
         }
     }
@@ -548,7 +540,7 @@ class StageIm {
         const im = {
             id: this.ImData.length + 1,
             lid: node.id, pid: '', code: node.code,
-            jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
+            jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp, qc_minus_jl: 0,
             pre_jl: node.pre_gather_tp, pre_contract_jl: node.pre_contract_tp, pre_qc_jl: node.pre_qc_tp,
             end_jl: node.end_gather_tp, end_contract_jl: node.end_contract_tp, end_qc_jl: node.end_qc_tp,
             peg: peg ? this._getPegStr(peg.name) : '', drawing_code: this._getDrawingCode(node),
@@ -591,6 +583,7 @@ class StageIm {
             gcl.jl = helper.add(gcl.jl, pos.gather_qty);
             gcl.contract_jl = helper.add(gcl.contract_jl, pos.contract_qty);
             gcl.qc_jl = helper.add(gcl.qc_jl, pos.qc_qty);
+            gcl.qc_minus_jl = helper.add(gcl.qc_minus_jl, pos.qc_minus_jl);
 
             gcl.tp = helper.mul(gcl.unit_price, gcl.jl, tp_decimal);
             gcl.contract_tp = helper.mul(gcl.unit_price, gcl.contract_jl, tp_decimal);
@@ -599,6 +592,7 @@ class StageIm {
             gcl.pre_jl = helper.add(gcl.pre_jl, pos.pre_gather_qty);
             gcl.pre_contract_jl = helper.add(gcl.pre_contract_jl, pos.pre_contract_qty);
             gcl.pre_qc_jl = helper.add(gcl.pre_qc_jl, pos.pre_qc_qty);
+            gcl.pre_qc_minus_jl = helper.add(gcl.pre_qc_minus_jl, pos.pre_qc_minus_jl);
 
             gcl.pre_tp = helper.mul(gcl.unit_price, gcl.pre_jl, tp_decimal);
             gcl.pre_contract_tp = helper.mul(gcl.unit_price, gcl.pre_contract_jl, tp_decimal);
@@ -607,6 +601,7 @@ class StageIm {
             gcl.end_jl = helper.add(gcl.end_jl, pos.end_gather_qty);
             gcl.end_contract_jl = helper.add(gcl.end_contract_jl, pos.end_contract_qty);
             gcl.end_qc_jl = helper.add(gcl.end_qc_jl, pos.end_qc_qty);
+            gcl.end_qc_minus_jl = helper.add(gcl.end_qc_minus_jl, pos.end_qc_minus_jl);
 
             gcl.end_tp = helper.mul(gcl.unit_price, gcl.end_jl, tp_decimal);
             gcl.end_contract_tp = helper.mul(gcl.unit_price, gcl.end_contract_jl, tp_decimal);
@@ -618,6 +613,7 @@ class StageIm {
             gcl.jl = helper.add(gcl.jl, bills.gather_qty);
             gcl.contract_jl = helper.add(gcl.contract_jl, bills.contract_qty);
             gcl.qc_jl = helper.add(gcl.qc_jl, bills.qc_qty);
+            gcl.qc_minus_jl = helper.add(gcl.qc_minus_jl, bills.qc_minus_jl);
 
             gcl.tp = helper.add(gcl.tp, bills.gather_tp);
             gcl.contract_tp = helper.add(gcl.contract_tp, bills.contract_tp);
@@ -626,6 +622,7 @@ class StageIm {
             gcl.pre_jl = helper.add(gcl.pre_jl, bills.pre_gather_qty);
             gcl.pre_contract_jl = helper.add(gcl.pre_contract_jl, bills.pre_contract_qty);
             gcl.pre_qc_jl = helper.add(gcl.pre_qc_jl, bills.pre_qc_qty);
+            gcl.pre_qc_minus_jl = helper.add(gcl.pre_qc_minus_jl, bills.pre_qc_minus_jl);
 
             gcl.pre_tp = helper.add(gcl.pre_tp, bills.pre_gather_tp);
             gcl.pre_contract_tp = helper.add(gcl.pre_contract_tp, bills.pre_contract_tp);
@@ -634,6 +631,7 @@ class StageIm {
             gcl.end_jl = helper.add(gcl.end_jl, bills.end_gather_qty);
             gcl.end_contract_jl = helper.add(gcl.end_contract_jl, bills.end_contract_qty);
             gcl.end_qc_jl = helper.add(gcl.end_qc_jl, bills.end_qc_qty);
+            gcl.end_qc_minus_jl = helper.add(gcl.end_qc_minus_jl, bills.end_qc_minus_jl);
 
             gcl.end_tp = helper.add(gcl.end_tp, bills.end_gather_tp);
             gcl.end_contract_tp = helper.add(gcl.end_contract_tp, bills.end_contract_tp);
@@ -644,6 +642,7 @@ class StageIm {
         const tp_decimal = this.ctx.tender.info.decimal.tp;
         im.contract_jl = 0;
         im.qc_jl = 0;
+        im.qc_minus_jl = 0;
         for (const b of im.gclBills) {
             im.contract_jl = this.ctx.helper.add(im.contract_jl, this.ctx.helper.mul(b.contract_jl, b.unit_price, tp_decimal));
             im.pre_contract_jl = this.ctx.helper.add(im.pre_contract_jl, this.ctx.helper.mul(b.pre_contract_jl, b.unit_price, tp_decimal));
@@ -703,7 +702,7 @@ class StageIm {
             const pPos = this.pos.getLedgerPos(p.id);
             if (pPos && pPos.length > 0) {
                 for (const pp of pPos) {
-                    if (!pp.gather_qty && !pp.contract_qty && !pp.qc_qty) continue;
+                    if (!pp.gather_qty && !pp.contract_qty && !pp.qc_qty && !pp.qc_minus_qty) continue;
 
                     const im = this._getBwBillsPosIm(nodeImData, node, peg, nodeIndex, bw, pp.name);
 
@@ -728,10 +727,13 @@ class StageIm {
 
                 imDefault.contract_jl = this.ctx.helper.add(imDefault.contract_jl, p.contract_qty);
                 imDefault.qc_jl = this.ctx.helper.add(imDefault.qc_jl, p.qc_qty);
+                imDefault.qc_minus_jl = this.ctx.helper.add(imDefault.qc_minus_jl, p.qc_minus_qty);
                 imDefault.pre_contract_jl = this.ctx.helper.add(imDefault.pre_contract_jl, p.pre_contract_qty);
                 imDefault.pre_qc_jl = this.ctx.helper.add(imDefault.pre_qc_jl, p.pre_qc_qty);
+                imDefault.pre_qc_minus_jl = this.ctx.helper.add(imDefault.pre_qc_minus_jl, p.pre_qc_minus_qty);
                 imDefault.end_contract_jl = this.ctx.helper.add(imDefault.end_contract_jl, p.end_contract_qty);
                 imDefault.end_qc_jl = this.ctx.helper.add(imDefault.end_qc_jl, p.end_qc_qty);
+                imDefault.end_qc_minus_jl = this.ctx.helper.add(imDefault.end_qc_minus_jl, p.end_qc_minus_qty);
                 imDefault.used = true;
 
                 this._addBwBillsGclBills(imDefault, p);
@@ -762,7 +764,7 @@ class StageIm {
         const posRange = this.pos.getLedgerPos(node.id);
         if (!posRange) { return; }
         for (const p of posRange) {
-            if (!p.gather_qty || this.ctx.helper.checkZero(p.gather_qty)) { continue; }
+            if (!p.contract_qty && !p.qc_qty && !p.qc_minus_qty) { continue; }
             let lp = this._.find(lx.pos, { name: p.name });
             if (!lp) {
                 lp = { name: p.name };
@@ -771,6 +773,7 @@ class StageIm {
             lp.jl = this.ctx.helper.add(lp.jl, p.gather_qty);
             lp.contract_jl = this.ctx.helper.add(lp.contract_jl, p.contract_qty);
             lp.qc_jl = this.ctx.helper.add(lp.qc_jl, p.qc_qty);
+            lp.qc_minus_jl = this.ctx.helper.add(lp.qc_minus_jl, p.qc_minus_qty);
         }
     }
     _generateZlLeafXmjData(node, im) {
@@ -791,6 +794,7 @@ class StageIm {
         lx.jl = this.ctx.helper.add(lx.jl, node.gather_qty);
         lx.contract_jl = this.ctx.helper.add(lx.contract_jl, node.contract_qty);
         lx.qc_jl = this.ctx.helper.add(lx.qc_jl, node.qc_qty);
+        lx.qc_minus_jl = this.ctx.helper.add(lx.qc_minus_jl, node.qc_minus_qty);
         this._generateZlPosData(node, lx);
     }
     _generateZlChangeData(node, im) {
@@ -839,9 +843,9 @@ class StageIm {
                     id: this.ImData.length + 1,
                     lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, org_unit_price: p.org_unit_price,
                     quantity: 0, total_price: 0,
-                    jl: 0, contract_jl: 0, qc_jl: 0,
-                    pre_jl: 0, pre_contract_jl: 0, pre_qc_jl: 0,
-                    end_jl: 0, end_contract_jl: 0, end_qc_jl: 0,
+                    jl: 0, contract_jl: 0, qc_jl: 0, qc_minus_jl: 0,
+                    pre_jl: 0, pre_contract_jl: 0, pre_qc_jl: 0, pre_qc_minus_jl: 0,
+                    end_jl: 0, end_contract_jl: 0, end_qc_jl: 0, end_qc_minus_jl: 0,
                     tp: 0, contract_tp: 0, qc_tp: 0,
                     pre_tp: 0, pre_contract_tp: 0, pre_qc_tp: 0,
                     end_tp: 0, end_contract_tp: 0, end_qc_tp: 0,
@@ -874,6 +878,7 @@ class StageIm {
             im.jl = this.ctx.helper.add(im.jl, p.gather_qty);
             im.contract_jl = this.ctx.helper.add(im.contract_jl, p.contract_qty);
             im.qc_jl = this.ctx.helper.add(im.qc_jl, p.qc_qty);
+            im.qc_minus_jl = this.ctx.helper.add(im.qc_minus_jl, p.qc_minus_qty);
 
             im.tp = this.ctx.helper.add(im.tp, p.gather_tp);
             im.contract_tp = this.ctx.helper.add(im.contract_tp, p.contract_tp);
@@ -882,6 +887,7 @@ class StageIm {
             im.pre_jl = this.ctx.helper.add(im.pre_jl, p.pre_gather_qty);
             im.pre_contract_jl = this.ctx.helper.add(im.pre_contract_jl, p.pre_contract_qty);
             im.pre_qc_jl = this.ctx.helper.add(im.pre_qc_jl, p.pre_qc_qty);
+            im.pre_qc_minus_jl = this.ctx.helper.add(im.pre_qc_minus_jl, p.pre_qc_minus_qty);
 
             im.pre_tp = this.ctx.helper.add(im.pre_tp, p.pre_gather_tp);
             im.pre_contract_tp = this.ctx.helper.add(im.pre_contract_tp, p.pre_contract_tp);
@@ -890,6 +896,7 @@ class StageIm {
             im.end_jl = this.ctx.helper.add(im.end_jl, p.end_gather_qty);
             im.end_contract_jl = this.ctx.helper.add(im.end_contract_jl, p.end_contract_qty);
             im.end_qc_jl = this.ctx.helper.add(im.end_qc_jl, p.end_qc_qty);
+            im.end_qc_minus_jl = this.ctx.helper.add(im.end_qc_minus_jl, p.end_qc_minus_qty);
 
             im.end_tp = this.ctx.helper.add(im.end_tp, p.end_gather_tp);
             im.end_contract_tp = this.ctx.helper.add(im.end_contract_tp, p.end_contract_tp);
@@ -909,14 +916,14 @@ class StageIm {
             if (pPos && pPos.length > 0) {
                 const nodeIndex = this.billsTree.getNodeSerialNo(node);
                 for (const pp of pPos) {
-                    if (this.ctx.helper.checkZero(pp.contract_qty) && this.ctx.helper.checkZero(pp.qc_qty)) { continue; }
+                    if (this.ctx.helper.checkZero(pp.contract_qty) && this.ctx.helper.checkZero(pp.qc_qty) && this.ctx.helper.checkZero(pp.qc_minus_qty)) { continue; }
                     const im = {
                         id: this.ImData.length + 1,
                         lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, org_unit_price: p.org_unit_price, pid: pp.id,
                         quantity: pp.quantity,
-                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty,
-                        pre_jl: pp.pre_gather_qty, pre_contract_jl: pp.pre_contract_qty, pre_qc_jl: pp.pre_qc_qty,
-                        end_jl: pp.end_gather_qty, end_contract_jl: pp.end_contract_qty, end_qc_jl: pp.end_qc_qty,
+                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_qty,
+                        pre_jl: pp.pre_gather_qty, pre_contract_jl: pp.pre_contract_qty, pre_qc_jl: pp.pre_qc_qty, pre_qc_minus_jl: pp.pre_qc_minus_qty,
+                        end_jl: pp.end_gather_qty, end_contract_jl: pp.end_contract_qty, end_qc_jl: pp.end_qc_qty, end_qc_minus_jl: pp.end_qc_minus_qty,
                         bw,
                         peg: this._checkPeg(pp.name) ? this._getPegStr(pp.name) : (peg ? this._getPegStr(peg.name) : ''),
                         dwgc: this._getDwgc(peg, node), fbgc: this._getFbgc(peg, node), fxgc: this._getFxgc(peg, node),
@@ -936,7 +943,7 @@ class StageIm {
                     im.end_tp = this.ctx.helper.mul(im.end_jl, im.unit_price, tp_decimal);
                     im.end_contract_tp = this.ctx.helper.mul(im.end_contract_jl, im.unit_price, tp_decimal);
                     im.end_qc_tp = this.ctx.helper.mul(im.end_qc_jl, im.unit_price, tp_decimal);
-                    im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
+                    im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit;
                     this.ImData.push(im);
                     for (const c of this.changes) {
                         if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
@@ -945,15 +952,15 @@ class StageIm {
                     }
                 }
             } else {
-                if (this.ctx.helper.checkZero(p.gather_qty) && this.ctx.helper.checkZero(p.gather_tp)) { continue; }
+                if (this.ctx.helper.checkZero(p.gather_qty) && this.ctx.helper.checkZero(p.gather_tp) && this.ctx.helper.checkZero(p.qc_minus_qty)) { continue; }
 
                 const im = {
                     id: this.ImData.length + 1,
                     lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price, org_unit_price: p.org_unit_price, pid: '',
                     quantity: p.quantity, total_price: p.total_price,
-                    jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty,
-                    pre_jl: p.pre_gather_qty, pre_contract_jl: p.pre_contract_qty, pre_qc_jl: p.pre_qc_qty,
-                    end_jl: p.end_gather_qty, end_contract_jl: p.end_contract_qty, end_qc_jl: p.end_qc_qty,
+                    jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty, qc_minus_jl: p.qc_minus_qty,
+                    pre_jl: p.pre_gather_qty, pre_contract_jl: p.pre_contract_qty, pre_qc_jl: p.pre_qc_qty, pre_qc_minus_jl: p.pre_qc_minus_qty,
+                    end_jl: p.end_gather_qty, end_contract_jl: p.end_contract_qty, end_qc_jl: p.end_qc_qty, end_qc_minus_jl: p.end_qc_minus_qty,
                     tp: p.gather_tp, contract_tp: p.contract_tp, qc_tp: p.qc_tp,
                     pre_tp: p.pre_gather_tp, pre_contract_tp: p.pre_contract_tp, pre_qc_tp: p.pre_qc_tp,
                     end_tp: p.end_gather_tp, end_contract_tp: p.end_contract_tp, end_qc_tp: p.end_qc_tp,
@@ -966,7 +973,7 @@ class StageIm {
                     position: '',
                     lIndex: this.billsTree.getNodeSerialNo(node),
                 };
-                im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
+                im.calc_memo = '本期计量:' + (this.ctx.helper.checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit;
                 this.ImData.push(im);
                 for (const c of this.changes) {
                     if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {

+ 24 - 8
app/public/js/gcl_gather.js

@@ -12,11 +12,12 @@
 const gclGatherModel = (function () {
     // 需要汇总计算的字段
     const ledgerGatherFields = ['quantity', 'total_price', 'deal_qty', 'deal_tp',
-        'contract_qty', 'contract_tp', 'qc_qty', 'qc_tp',
-        'pre_contract_qty', 'pre_contract_tp', 'pre_qc_qty', 'pre_qc_tp',
-        'end_contract_qty', 'end_contract_tp', 'end_qc_qty', 'end_qc_tp'];
-    const posGatherFields = ['quantity', 'contract_qty', 'qc_qty', 'gather_qty',
-        'pre_contract_qty', 'pre_qc_qty', 'pre_gather_qty', 'end_contract_qty', 'end_qc_qty', 'end_gather_qty'];
+        'contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty',
+        'pre_contract_qty', 'pre_contract_tp', 'pre_qc_qty', 'pre_qc_tp', 'pre_qc_minus_qty',
+        'end_contract_qty', 'end_contract_tp', 'end_qc_qty', 'end_qc_tp', 'end_qc_minus_qty'];
+    const posGatherFields = ['quantity', 'contract_qty', 'qc_qty', 'gather_qty','qc_minus_qty',
+        'pre_contract_qty', 'pre_qc_qty', 'pre_gather_qty', 'pre_qc_minus_qty',
+        'end_contract_qty', 'end_qc_qty', 'end_gather_qty', 'end_qc_minus_qty'];
     // 初始化 清单树
     const gsTreeSetting = {
         id: 'ledger_id',
@@ -41,6 +42,10 @@ const gclGatherModel = (function () {
     const mergeChar = ';';
     let tpDecimal = 0;
 
+    function loadDecimal(decimal) {
+        tpDecimal = decimal.tp;
+    }
+
     /**
      * 将所有数据加载至树结构
      *
@@ -49,7 +54,7 @@ const gclGatherModel = (function () {
      * @param preStage - 截止上期计量数据
      * @param bgl - 变更令数据
      */
-    function loadLedgerData (ledger, curStage, preStage, bgl) {
+    function loadLedgerData (ledger, curStage, preStage) {
         // 加载树结构数据
         gsTree.loadDatas(ledger);
         // 加载本期计量数据
@@ -71,9 +76,8 @@ const gclGatherModel = (function () {
         deal = dealBills;
     }
 
-    function loadChangeBillsData(data, decimal) {
+    function loadChangeBillsData(data) {
         change = data;
-        tpDecimal = decimal;
     }
 
     function gatherfields(obj, src, fields) {
@@ -350,6 +354,8 @@ const gclGatherModel = (function () {
             gcl.end_qc_qty = ZhCalc.add(gcl.pre_qc_qty, gcl.qc_qty);
             gcl.end_gather_qty = ZhCalc.add(gcl.pre_gather_qty, gcl.gather_qty);
             gcl.gather_tp = ZhCalc.add(gcl.contract_tp, gcl.qc_tp);
+            gcl.end_qc_minus_qty = ZhCalc.add(gcl.pre_qc_minus_qty, gcl.qc_minus_qty);
+
             gcl.end_contract_tp = ZhCalc.add(gcl.pre_contract_tp, gcl.contract_tp);
             gcl.end_qc_tp = ZhCalc.add(gcl.pre_qc_tp, gcl.qc_tp);
             gcl.end_gather_tp = ZhCalc.add(gcl.pre_gather_tp, gcl.gather_tp);
@@ -358,6 +364,13 @@ const gclGatherModel = (function () {
             gcl.end_final_tp = ZhCalc.add(gcl.end_qc_tp, gcl.total_price);
             gcl.final_qty = ZhCalc.add(gcl.quantity, gcl.change_bills_qty);
             gcl.final_tp = ZhCalc.add(gcl.total_price, gcl.change_bills_tp);
+            gcl.deal_final_qty = ZhCalc.add(gcl.deal_qty, gcl.change_bills_qty);
+            gcl.deal_final_tp = ZhCalc.add(gcl.deal_tp, gcl.change_bills_tp);
+            gcl.final_1_qty = ZhCalc.add(gcl.quantity, gcl.end_qc_minus_qty);
+            gcl.final_1_tp = ZhCalc.mul(gcl.unit_price, gcl.final_1_qty, tpDecimal);
+            gcl.deal_final_1_qty = ZhCalc.add(gcl.deal_qty, gcl.end_qc_minus_qty);
+            gcl.deal_final_1_tp = ZhCalc.add(gcl.unit_price, gcl.deal_final_1_qty, tpDecimal);
+
             gcl.end_gather_percent = gcl.end_final_qty && gcl.end_gather_qty
                 ? ZhCalc.mul(ZhCalc.div(gcl.end_gather_qty, gcl.end_final_qty), 100, 2)
                 : ZhCalc.mul(ZhCalc.div(gcl.end_gather_tp, gcl.end_final_tp), 100, 2);
@@ -371,6 +384,8 @@ const gclGatherModel = (function () {
                 xmj.end_qc_qty = ZhCalc.add(xmj.pre_qc_qty, xmj.qc_qty);
                 xmj.end_gather_qty = ZhCalc.add(xmj.pre_gather_qty, xmj.gather_qty);
                 xmj.end_final_qty = ZhCalc.add(xmj.end_qc_qty, xmj.quantity);
+                xmj.end_qc_minus_qty = ZhCalc.add(xmj.pre_qc_minus_qty, xmj.qc_minus_qty);
+                xmj.final_1_qty = ZhCalc.add(xmj.quantity, xmj.end_qc_minus_qty);
                 xmj.end_gather_percent = ZhCalc.mul(ZhCalc.div(xmj.end_gather_qty, xmj.end_final_qty), 100, 2);
             }
         }
@@ -551,6 +566,7 @@ const gclGatherModel = (function () {
     }
 
     return {
+        loadDecimal,
         loadLedgerData,
         loadPosData,
         loadDealBillsData,

+ 6 - 6
app/public/js/global.js

@@ -1019,8 +1019,8 @@ const checkUtils = {
         if (!data) return false;
         if (!data.quantity) return !!data.end_contract_qty;
         return data.quantity > 0
-            ? data.end_contract_qty > data.quantity
-            : data.end_contract_qty < data.quantity || data.end_contract_qty > 0;
+            ? data.end_contract_qty > data.final_1_qty
+            : data.end_contract_qty < data.final_1_qty || data.end_contract_qty > 0;
     },
     billsOver(data, isTz, relaPos) {
         if (!data) return false;
@@ -1039,8 +1039,8 @@ const checkUtils = {
             } else {
                 if (!data.quantity) return !!data.end_contract_qty;
                 return data.quantity > 0
-                    ? data.end_contract_qty > data.quantity
-                    : data.end_contract_qty < data.quantity || data.end_contract_qty > 0;
+                    ? data.end_contract_qty > data.final_1_qty
+                    : data.end_contract_qty < data.final_1_qty || data.end_contract_qty > 0;
             }
         } else {
             if (data.is_tp) {
@@ -1051,8 +1051,8 @@ const checkUtils = {
             } else {
                 if (!data.deal_qty) return !!data.end_contract_qty;
                 return data.deal_qty > 0
-                    ? data.end_contract_qty > data.deal_qty
-                    : data.end_contract_qty < data.deal_qty || data.end_contract_qty > 0;
+                    ? data.end_contract_qty > data.deal_final_1_qty
+                    : data.end_contract_qty < data.deal_final_1_qty || data.end_contract_qty > 0;
             }
         }
     }

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

@@ -219,7 +219,7 @@ const ledgerCheckUtil = {
                     if (!data.contract_qty && !data.qc_qty && !data.pre_contract_qty && !data.pre_qc_qty) return 2; // 漏计
                 } else {
                     const precision = findPrecision(tenderInfo.precision, unit);
-                    const checkQty = ZhCalc.mul(data.quantity, ZhCalc.div(ratio, 100, 4), precision.value);
+                    const checkQty = ZhCalc.mul(data.final_1_qty, ZhCalc.div(ratio, 100, 4), precision.value);
                     const qty = ZhCalc.add(data.contract_qty, data.pre_contract_qty) || 0;
                     if (qty > checkQty) return 1; // 违规
                     if (qty < checkQty) return 2; // 漏计

+ 18 - 9
app/public/js/stage.js

@@ -36,7 +36,7 @@ function customColDisplay () {
         { title: '本期完成计量', fields: ['gather_qty', 'gather_tp'], visible: true },
         { title: '截止本期计量合同', fields: ['end_contract_qty', 'end_contract_tp'], visible: true },
         { title: '截止本期数量变更', fields: ['end_qc_qty', 'end_qc_tp', 'end_qc_bgl'], visible: true },
-        { title: '截止本期完成计量', fields: ['end_gather_qty', 'end_gather_tp', 'end_gather_percent'], visible: true },
+        { title: '截止本期完成计量', fields: ['end_gather_qty', 'end_gather_tp', 'end_gather_percent', 'end_final_1_precent'], visible: true },
         { title: '本期批注', fields: ['postil'], visible: true },
         { title: '图册号', fields: ['drawing_code'], visible: true },
         { title: '备注', fields: ['memo'], visible: true },
@@ -269,15 +269,19 @@ $(document).ready(() => {
     // 台账树结构计算相关设置
     stageTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'postil', 'used', 'contract_expr'];
     stageTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp',
-        'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp'];
+        'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp', 'end_correct_tp', 'final_1_tp', 'end_final_1_tp'];
     stageTreeSetting.calcFun = function (node) {
         if (!node.children || node.children.length === 0) {
             node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
             node.gather_qty = ZhCalc.add(node.contract_qty, node.qc_qty);
             node.end_contract_qty = ZhCalc.add(node.pre_contract_qty, node.contract_qty);
+            node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_qty);
             node.end_qc_qty = ZhCalc.add(node.pre_qc_qty, node.qc_qty);
             node.end_qc_minus_qty = ZhCalc.add(node.pre_qc_minus_qty, node.qc_minus_qty);
-            node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_qty);
+            node.final_1_qty = ZhCalc.add(node.end_qc_minus_qty, node.quantity);
+            node.final_1_tp = ZhCalc.mul(node.final_1_qty, node.unit_price, tenderInfo.decimal.tp);
+            node.deal_final_1_qty = ZhCalc.add(node.end_qc_minus_qty, node.deal_qty);
+            node.end_final_1_qty = ZhCalc.add(node.end_qc_qty, node.final_1_qty);
         }
         node.pre_gather_tp = ZhCalc.add(node.pre_contract_tp, node.pre_qc_tp);
         node.gather_tp = ZhCalc.add(node.contract_tp, node.qc_tp);
@@ -296,6 +300,8 @@ $(document).ready(() => {
         node.end_gather_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_tp), 100, 2);
         node.end_correct_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_tp), 100, 2);
         node.final_dgn_price = ZhCalc.round(ZhCalc.div(node.end_gather_tp, ZhCalc.add(node.deal_dgn_qty1, node.c_dgn_qty1)), tenderInfo.decimal.up);
+        node.end_final_1_percent = ZhCalc.mul(ZhCalc.div(node.end_gather_tp, node.end_final_1_tp), 100, 2);
+        node.end_correct_1_percent = ZhCalc.mul(ZhCalc.div(node.end_correct_tp, node.end_final_1_tp), 100, 2);
     };
     const stageTree = createNewPathTree('stage', stageTreeSetting);
     // 初始化 计量单元 数据结构
@@ -650,8 +656,10 @@ $(document).ready(() => {
         {field: 'qc_qty', showImage: qcColShowImage},
         {field: 'qc_minus_qty', showImage: qcColShowImage},
     ]);
-    const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
-    if (ratioCol) ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_percent' : 'end_gather_percent';
+    // const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_gather_percent' || x.field === 'end_correct_percent'});
+    // if (ratioCol) ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_percent' : 'end_gather_percent';
+    const ratioCol = ledgerSpreadSetting.cols.find(x => {return x.field === 'end_final_1_percent' || x.field === 'end_correct_1_percent'});
+    if (ratioCol) ratioCol.field = tenderInfo.display.stage.correct ? 'end_correct_1_percent' : 'end_final_1_percent';
     ledgerSpreadSetting.imageClick = function (data, hitinfo) {
         const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
         switch (col.field) {
@@ -975,6 +983,7 @@ $(document).ready(() => {
             if (posSearch) posSearch.search();
         },
         selectionChanged: function (e, info) {
+            console.log(SpreadJsObj.getSelectObject(info.sheet));
             if (!info.oldSelections || !info.oldSelections[0] || info.newSelections[0].row !== info.oldSelections[0].row) {
                 stageTreeSpreadObj.loadRelaData();
                 // 全选去除
@@ -991,7 +1000,7 @@ $(document).ready(() => {
                 const validCols = [];
                 for (let iCol = sel.col; iCol < sel.col + sel.colCount; iCol++) {
                     const colSetting = sheet.zh_setting.cols[iCol];
-                    if (!colSetting.readOnly && colSetting.field !== 'qc_qty' && colSetting.field !== 'minus_qc_qty') {
+                    if (!colSetting.readOnly && colSetting.field !== 'qc_qty' && colSetting.field !== 'qc_minus_qty') {
                         validCols.push(iCol);
                     }
                 }
@@ -1067,7 +1076,7 @@ $(document).ready(() => {
             if (info.sheet.zh_setting) {
                 const setting = info.sheet.zh_setting;
                 const range = info.cellRange;
-                const validField = ['contract_qty', 'contract_tp', 'qc_qty', 'minus_qc_qty', 'postil'].concat(['memo', 'ex_memo1', 'ex_memo2', 'ex_memo3'], setting.dgnUpFields);
+                const validField = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_minus_qty', 'postil'].concat(['memo', 'ex_memo1', 'ex_memo2', 'ex_memo3'], setting.dgnUpFields);
                 for (let iCol = range.col; iCol < range.col + range.colCount; iCol++) {
                     const col = info.sheet.zh_setting.cols[iCol];
                     if ((validField.indexOf(col.field) === -1)) {
@@ -1772,7 +1781,7 @@ $(document).ready(() => {
             if (info.sheet.zh_setting) {
                 const sortData = info.sheet.zh_data;
                 const range = info.cellRange;
-                const validField = ['contract_qty', 'qc_qty', 'minus_qc_qty', 'postil', 'real_qty', 'ex_memo1', 'ex_memo2', 'ex_memo3'];
+                const validField = ['contract_qty', 'qc_qty', 'qc_minus_qty', 'postil', 'real_qty', 'ex_memo1', 'ex_memo2', 'ex_memo3'];
                 if (!checkTzMeasureType()) {
                     validField.push('name', 'sgfh_qty', 'sjcl_qty', 'qtcl_qty', 'position', 'drawing_code');
                 }
@@ -1931,7 +1940,7 @@ $(document).ready(() => {
                 const validCols = [];
                 for (let iCol = sel.col; iCol < sel.col + sel.colCount; iCol++) {
                     const colSetting = sheet.zh_setting.cols[iCol];
-                    if (!colSetting.readOnly && colSetting.field !== 'qc_qty' && colSetting.field !== 'minus_qc_qty') {
+                    if (!colSetting.readOnly && colSetting.field !== 'qc_qty' && colSetting.field !== 'qc_minus_qty') {
                         validCols.push(iCol);
                     }
                 }

+ 4 - 3
app/public/js/stage_gather.js

@@ -97,8 +97,8 @@ $(document).ready(function () {
         const nPercent = Math.min(Math.max(ZhCalc.div(parseFloat($('#over-percent').val()), 100), 0.5), 1);
         for (const node of data) {
             if (node) {
-                const bOverRangeTz = billsGatherOver(node, 'quantity', 'total_price', nPercent);
-                const bOverRangeDeal = billsGatherOver(node, 'deal_bills_qty', 'deal_bills_tp', nPercent);
+                const bOverRangeTz = billsGatherOver(node, 'final_1_qty', 'final_1_tp', nPercent);
+                const bOverRangeDeal = billsGatherOver(node, 'deal_final_1_qty', 'deal_final_1_tp', nPercent);
                 node.overRange = bQty ? bOverRangeTz : (bDealQty ? bOverRangeDeal : bOverRangeTz || bOverRangeDeal);
             }
         }
@@ -126,10 +126,11 @@ $(document).ready(function () {
 
     postData(preUrl + '/load', { filter: 'ledger;pos;dealBills;spec;changeBills' }, function (result) {
         // 解析清单汇总数据
+        gclGatherModel.loadDecimal(tenderDecimal);
         gclGatherModel.loadLedgerData(result.ledgerData);
         gclGatherModel.loadPosData(result.posData);
         gclGatherModel.loadDealBillsData(result.dealBills);
-        gclGatherModel.loadChangeBillsData(result.changeBills, tenderDecimal.tp);
+        gclGatherModel.loadChangeBillsData(result.changeBills);
         gclGatherData = gclGatherModel.gatherGclData();
         gclGatherModel.checkDiffer(gclGatherData);
         checkOverRange(gclGatherData);

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

@@ -25,7 +25,7 @@ const stageIm = (function () {
         stageId: 'id',
     };
     gsTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'];
-    gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'qc_minus_qty', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
+    gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
     gsTreeSetting.calcFun = function (node) {
         if (node.children && node.children.length === 0) {
             node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);

+ 17 - 17
app/service/report_memory.js

@@ -25,11 +25,11 @@ const stageImVersion = '1.3';
 const Ledger = require('../lib/ledger');
 
 const billsFields = (function () {
-    const cur = ['contract_qty', 'contract_tp', 'contract_expr', 'qc_qty', 'qc_tp', 'gather_qty', 'gather_tp', 'postil'];
-    const pre = ['pre_contract_qty', 'pre_contract_tp', 'pre_qc_qty', 'pre_qc_tp', 'pre_gather_qty', 'pre_gather_tp'];
-    const end = ['end_contract_qty', 'end_contract_tp', 'end_qc_qty', 'end_qc_tp', 'end_gather_qty', 'end_gather_tp'];
+    const cur = ['contract_qty', 'contract_tp', 'contract_expr', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'qc_minus_tp', 'gather_qty', 'gather_tp', 'postil'];
+    const pre = ['pre_contract_qty', 'pre_contract_tp', 'pre_qc_qty', 'pre_qc_tp', 'pre_qc_minus_qty', 'pre_qc_minus_tp', 'pre_gather_qty', 'pre_gather_tp'];
+    const end = ['end_contract_qty', 'end_contract_tp', 'end_qc_qty', 'end_qc_tp', 'end_qc_minus_qty', 'end_qc_minus_tp', 'end_gather_qty', 'end_gather_tp'];
     const final = ['final_tp', 'final_ratio'];
-    const final1 = ['minus_qc_qty', 'pre_minus_qc_qty', 'end_minus_qc_qty', 'final_1_qty', 'final_1_tp', 'final_1_ratio'];
+    const final1 = [ 'final_1_qty', 'final_1_tp', 'final_1_ratio'];
     const stageDgn = ['deal_dgn_qty1', 'deal_dgn_qty2', 'c_dgn_qty1', 'c_dgn_qty2'];
 
     const stage = cur.concat(pre, end, final);
@@ -40,11 +40,11 @@ const billsFields = (function () {
     return {cur, pre, end, final, final1, stageDgn, stage, stageEnd, bgl, leafXmj};
 })();
 const posFields = (function () {
-    const cur = ['contract_qty', 'qc_qty', 'gather_qty', 'postil'];
-    const pre = ['pre_contract_qty', 'pre_qc_qty', 'pre_gather_qty'];
-    const end = ['end_contract_qty', 'end_qc_qty', 'end_gather_qty'];
+    const cur = ['contract_qty', 'qc_qty', 'qc_minus_qty', 'gather_qty', 'postil'];
+    const pre = ['pre_contract_qty', 'pre_qc_qty', 'pre_qc_minus_qty', 'pre_gather_qty'];
+    const end = ['end_contract_qty', 'end_qc_qty', 'end_qc_minus_qty', 'end_gather_qty'];
     const final = ['final_ratio'];
-    const final1 = ['minus_qc_qty', 'pre_minus_qc_qty', 'end_minus_qc_qty', 'final_1_qty', 'final_1_ratio'];
+    const final1 = ['final_1_qty', 'final_1_ratio'];
 
     const stage = cur.concat(pre, end, final);
     const stageEnd = pre.concat(end, final);
@@ -83,9 +83,9 @@ module.exports = app => {
                     p.final_qty = ctx.helper.add(p.end_qc_qty, p.quantity);
                     p.final_ratio = ctx.helper.mul(ctx.helper.div(p.end_gather_qty, p.final_qty, 4), 100);
 
-                    p.end_minus_qc_qty = ctx.helper.add(p.pre_minus_qc_qty, p.minus_qc_qty);
-                    p.final_1_qty = ctx.helper.add(p.end_minus_qc_qty, p.quantity);
-                    p.end_final_1_qty = ctx.helper.add(p.final_1_qty, p.end_qc_qty);
+                    p.end_qc_minus_qty = ctx.helper.add(p.pre_qc_minus_qty, p.qc_minus_qty);
+                    p.final_1_qty = ctx.helper.add(p.end_qc_minus_qty, p.quantity);
+                    p.end_final_1_qty = ctx.helper.add(p.end_qc_qty, p.final_1_qty);
                     p.final_1_ratio = ctx.helper.mul(ctx.helper.div(p.end_gather_qty, p.end_final_1_qty, 4), 100);
                 }
             });
@@ -114,8 +114,8 @@ module.exports = app => {
                         node.end_contract_qty = helper.add(node.pre_contract_qty, node.contract_qty);
                         node.end_qc_qty = helper.add(node.pre_qc_qty, node.qc_qty);
                         node.end_gather_qty = helper.add(node.pre_gather_qty, node.gather_qty);
-                        node.end_minus_qc_qty = helper.add(node.pre_minus_qc_qty, node.minus_qc_qty);
-                        node.final_1_qty = helper.add(node.quantity, node.end_minus_qc_qty);
+                        node.end_qc_minus_qty = helper.add(node.pre_qc_minus_qty, node.qc_minus_qty);
+                        node.final_1_qty = helper.add(node.quantity, node.end_qc_minus_qty);
                         node.end_final_1_qty = helper.add(node.final_1_qty, node.end_qc_qty);
                     }
                     node.pre_gather_tp = helper.add(node.pre_contract_tp, node.pre_qc_tp);
@@ -544,14 +544,14 @@ module.exports = app => {
                         filterStageBills.push(stageBillsIndex[prop]);
                     }
                     this.ctx.helper.assignRelaData(billsData, [
-                        {data: filterStageBills, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: 'r' + role.flowOrder + '_', relaId: 'lid'}
+                        {data: filterStageBills, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'], prefix: 'r' + role.flowOrder + '_', relaId: 'lid'}
                     ]);
                 }
 
                 if (this._checkFieldsExist(fields, billsFields.stageEnd)) {
                     const preStage = this.ctx.stage.order > 1 ? await this.ctx.service.stageBillsFinal.getFinalData(this.ctx.tender, this.ctx.stage.order - 1) : [];
                     this.ctx.helper.assignRelaData(billsData, [
-                        {data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'], prefix: 'pre_', relaId: 'lid'}
+                        {data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'], prefix: 'pre_', relaId: 'lid'}
                     ]);
                 }
                 const billsTree = this._getNewBillsTree();
@@ -620,7 +620,7 @@ module.exports = app => {
                 const posData = await this.ctx.service.pos.getAllDataByCondition({ where: {tid: this.ctx.tender.id }});
                 const prePosStage = this.ctx.stage.order > 1 ? await this.ctx.service.stagePosFinal.getFinalData(this.ctx.tender, this.ctx.stage.order - 1) : [];
                 this.ctx.helper.assignRelaData(posData, [
-                    {data: prePosStage, fields: ['contract_qty', 'qc_qty'], prefix: 'pre_', relaId: 'pid'}
+                    {data: prePosStage, fields: ['contract_qty', 'qc_qty', 'qc_minus_qty'], prefix: 'pre_', relaId: 'pid'}
                 ]);
                 const stagePosIndex = {}, timesLen = 100;
                 for (const role of validRole) {
@@ -642,7 +642,7 @@ module.exports = app => {
                         filterStagePos.push(stagePosIndex[prop]);
                     }
                     this.ctx.helper.assignRelaData(posData, [
-                        {data: filterStagePos, fields: ['contract_qty', 'qc_qty'], prefix: 'r' + role.flowOrder + '_', relaId: 'pid'}
+                        {data: filterStagePos, fields: ['contract_qty', 'qc_qty', 'qc_minus_qty'], prefix: 'r' + role.flowOrder + '_', relaId: 'pid'}
                     ]);
                 }
                 this.pos.loadDatas(posData);

+ 4 - 1
app/view/stage/bwtz.ejs

@@ -244,7 +244,10 @@
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 80, readOnly: true, type: 'Number'},
+            {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, type: 'Number'},
+            {title: '截止本期负变更', colSpan: '1', rowSpan: '2', field: 'end_qc_minus_qty', hAlign: 0, width: 80, formatter: '@'},
+            {title: '截止本期负变更', colSpan: '1', rowSpan: '2', field: 'final_1_tp', hAlign: 0, width: 80, formatter: '@'},
+            {title: '截止本期负变更', colSpan: '1', rowSpan: '2', field: 'end_final_1_tp', hAlign: 0, width: 80, formatter: '@'},
             {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code_merge', hAlign: 0, width: 80, formatter: '@'},
             {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'postil_merge', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},
             {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo_merge', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'},

+ 191 - 195
builder_report_index_define.js

@@ -19,10 +19,6 @@ const dataType = {
     time: 'string',
     arr: 'array',
 };
-const tag = {
-    tp: { type: 'tp' },
-    up: { type: 'up' },
-};
 
 // 预付款
 const advance_pay = {
@@ -115,7 +111,7 @@ const stage_bonus = {
         { name: '所属第几期', field: 'sorder', type: dataType.int },
         { name: '新增人id', field: 'uid', type: dataType.int },
         { name: '名称', field: 'name', type: dataType.str },
-        { name: '金额', field: 'tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '金额', field: 'tp', type: dataType.currency },
         { name: '证明材料', field: 'proof', type: dataType.str },
         { name: '创建时间', field: 'create_time', type: dataType.time },
         { name: '时间', field: 'real_time', type: dataType.time },
@@ -244,18 +240,18 @@ const change = {
         { name: '变更性质', field: 'quality', type: dataType.int },
         { name: '变更提出单位', field: 'company', type: dataType.str },
         { name: '费用承担方', field: 'charge', type: dataType.int },
-        { name: '金额', field: 'total_price', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '金额', field: 'total_price', type: dataType.currency },
         { name: '变更状态发生时间(时间戳)', field: 'cin_time', type: dataType.str },
         { name: '完成审批时间(时间戳)', field: 'sin_time', type: dataType.str },
-        { name: '金额_1', field: 'tp_1', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_2', field: 'tp_2', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_3', field: 'tp_3', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_4', field: 'tp_4', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_5', field: 'tp_5', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_6', field: 'tp_6', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_7', field: 'tp_7', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_8', field: 'tp_8', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_9', field: 'tp_9', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '金额_1', field: 'tp_1', type: dataType.currency },
+        { name: '金额_2', field: 'tp_2', type: dataType.currency },
+        { name: '金额_3', field: 'tp_3', type: dataType.currency },
+        { name: '金额_4', field: 'tp_4', type: dataType.currency },
+        { name: '金额_5', field: 'tp_5', type: dataType.currency },
+        { name: '金额_6', field: 'tp_6', type: dataType.currency },
+        { name: '金额_7', field: 'tp_7', type: dataType.currency },
+        { name: '金额_8', field: 'tp_8', type: dataType.currency },
+        { name: '金额_9', field: 'tp_9', type: dataType.currency },
         { name: '附件名称列表', field: 'attNames', type: dataType.currency },
         { name: '报表用,是否选择', field: 'selected', type: dataType.int },
     ],
@@ -272,33 +268,33 @@ const change_bills = {
         { name: '清单编号', field: 'code', type: dataType.str },
         { name: '名称', field: 'name', type: dataType.str },
         { name: '单位', field: 'unit', type: dataType.str },
-        { name: '单价', field: 'unit_price', type: dataType.currency, tag: { type: 'up' } },
-        { name: '原-数量', field: 'o_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '原-金额', field: 'o_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '变更-数量', field: 'c_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '变更-金额', field: 'c_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '审批变更后-数量', field: 's_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '审批变更后-金额', field: 's_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '单价', field: 'unit_price', type: dataType.currency },
+        { name: '原-数量', field: 'o_qty', type: dataType.currency },
+        { name: '原-金额', field: 'o_tp', type: dataType.currency },
+        { name: '变更-数量', field: 'c_qty', type: dataType.currency },
+        { name: '变更-金额', field: 'c_tp', type: dataType.currency },
+        { name: '审批变更后-数量', field: 's_qty', type: dataType.currency },
+        { name: '审批变更后-金额', field: 's_tp', type: dataType.currency },
         { name: '部位明细', field: 'bwmx', type: dataType.str },
         { name: '变更详情', field: 'detail', type: dataType.str },
-        { name: '数量_1', field: 'qty_1', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_1', field: 'tp_1', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_2', field: 'qty_2', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_2', field: 'tp_2', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_3', field: 'qty_3', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_3', field: 'tp_3', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_4', field: 'qty_4', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_4', field: 'tp_4', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_5', field: 'qty_5', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_5', field: 'tp_5', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_6', field: 'qty_6', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_6', field: 'tp_6', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_7', field: 'qty_7', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_7', field: 'tp_7', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_8', field: 'qty_8', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_8', field: 'tp_8', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '数量_9', field: 'qty_9', type: dataType.currency, tag: { type: 'qty', unitKey: 5 } },
-        { name: '金额_9', field: 'tp_9', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '数量_1', field: 'qty_1', type: dataType.currency },
+        { name: '金额_1', field: 'tp_1', type: dataType.currency },
+        { name: '数量_2', field: 'qty_2', type: dataType.currency },
+        { name: '金额_2', field: 'tp_2', type: dataType.currency },
+        { name: '数量_3', field: 'qty_3', type: dataType.currency },
+        { name: '金额_3', field: 'tp_3', type: dataType.currency },
+        { name: '数量_4', field: 'qty_4', type: dataType.currency },
+        { name: '金额_4', field: 'tp_4', type: dataType.currency },
+        { name: '数量_5', field: 'qty_5', type: dataType.currency },
+        { name: '金额_5', field: 'tp_5', type: dataType.currency },
+        { name: '数量_6', field: 'qty_6', type: dataType.currency },
+        { name: '金额_6', field: 'tp_6', type: dataType.currency },
+        { name: '数量_7', field: 'qty_7', type: dataType.currency },
+        { name: '金额_7', field: 'tp_7', type: dataType.currency },
+        { name: '数量_8', field: 'qty_8', type: dataType.currency },
+        { name: '金额_8', field: 'tp_8', type: dataType.currency },
+        { name: '数量_9', field: 'qty_9', type: dataType.currency },
+        { name: '金额_9', field: 'tp_9', type: dataType.currency },
         { name: '项目节编号', field: 'xmj_code', type: dataType.str },
         { name: '细目', field: 'xmj_jldy', type: dataType.str },
         { name: '单位工程', field: 'xmj_dwgc', type: dataType.str },
@@ -633,19 +629,19 @@ const stage_bills = {
         { name: '清单编号', field: 'b_code', type: dataType.str },
         { name: '名称', field: 'name', type: dataType.str },
         { name: '单位', field: 'unit', type: dataType.str }, // 12
-        { name: '单价', field: 'unit_price', type: dataType.currency, tag: { type: 'up' } },
+        { name: '单价', field: 'unit_price', type: dataType.currency },
 
-        { name: '签约-数量', field: 'deal_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '签约-金额', field: 'deal_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '签约-数量', field: 'deal_qty', type: dataType.currency },
+        { name: '签约-金额', field: 'deal_tp', type: dataType.currency },
 
-        { name: '施工复核-数量', field: 'sgfh_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '施工复核-金额', field: 'sgfh_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '设计错漏-数量', field: 'sjcl_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '设计错漏-金额', field: 'sjcl_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '其他错漏-数量', field: 'qtcl_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '其他错漏-金额', field: 'qtcl_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '台账-数量', field: 'quantity', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '台账-金额', field: 'total_price', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '施工复核-数量', field: 'sgfh_qty', type: dataType.currency },
+        { name: '施工复核-金额', field: 'sgfh_tp', type: dataType.currency },
+        { name: '设计错漏-数量', field: 'sjcl_qty', type: dataType.currency },
+        { name: '设计错漏-金额', field: 'sjcl_tp', type: dataType.currency },
+        { name: '其他错漏-数量', field: 'qtcl_qty', type: dataType.currency },
+        { name: '其他错漏-金额', field: 'qtcl_tp', type: dataType.currency },
+        { name: '台账-数量', field: 'quantity', type: dataType.currency },
+        { name: '台账-金额', field: 'total_price', type: dataType.currency },
 
         { name: '项目节-数量1', field: 'dgn_qty1', type: dataType.currency },
         { name: '项目节-数量2', field: 'dgn_qty2', type: dataType.currency },
@@ -655,29 +651,29 @@ const stage_bills = {
         { name: '节点类型', field: 'node_type', type: dataType.int },
         { name: '总额计量', field: 'is_tp', type: dataType.int },
 
-        { name: '本期-合同-数量', field: 'contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额', field: 'contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量', field: 'qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额', field: 'qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量', field: 'gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额', field: 'gather_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '本期-合同-数量', field: 'contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额', field: 'contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量', field: 'qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额', field: 'qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量', field: 'gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额', field: 'gather_tp', type: dataType.currency },
         { name: '本期批注', field: 'postil', type: dataType.str },
 
-        { name: '截止上期-合同-数量', field: 'pre_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止上期-合同-金额', field: 'pre_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '截止上期-数量变更-数量', field: 'pre_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止上期-数量变更-金额', field: 'pre_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '截止上期-完成-数量', field: 'pre_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止上期-完成-金额', field: 'pre_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '截止本期-合同-数量', field: 'end_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止本期-合同-金额', field: 'end_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '截止本期-数量变更-数量', field: 'end_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止本期-数量变更-金额', field: 'end_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '截止本期-完成-数量', field: 'end_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止本期-完成-金额', field: 'end_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '(台账 + 截止本期变更)-金额', field: 'final_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '截止上期-合同-数量', field: 'pre_contract_qty', type: dataType.currency },
+        { name: '截止上期-合同-金额', field: 'pre_contract_tp', type: dataType.currency },
+        { name: '截止上期-数量变更-数量', field: 'pre_qc_qty', type: dataType.currency },
+        { name: '截止上期-数量变更-金额', field: 'pre_qc_tp', type: dataType.currency },
+        { name: '截止上期-完成-数量', field: 'pre_gather_qty', type: dataType.currency },
+        { name: '截止上期-完成-金额', field: 'pre_gather_tp', type: dataType.currency },
+
+        { name: '截止本期-合同-数量', field: 'end_contract_qty', type: dataType.currency },
+        { name: '截止本期-合同-金额', field: 'end_contract_tp', type: dataType.currency },
+        { name: '截止本期-数量变更-数量', field: 'end_qc_qty', type: dataType.currency },
+        { name: '截止本期-数量变更-金额', field: 'end_qc_tp', type: dataType.currency },
+        { name: '截止本期-完成-数量', field: 'end_gather_qty', type: dataType.currency },
+        { name: '截止本期-完成-金额', field: 'end_gather_tp', type: dataType.currency },
+
+        { name: '(台账 + 截止本期变更)-金额', field: 'final_tp', type: dataType.currency },
         { name: '截止本期完成率(%)', field: 'final_ratio', type: dataType.double },
 
         { name: '本期-数量变更-变更令', field: 'qc_bgl_code', type: dataType.str },
@@ -710,9 +706,9 @@ const stage_bills = {
         { name: '备注2', field: 'ex_memo2', type: dataType.str },
         { name: '备注3', field: 'ex_memo3', type: dataType.str },
 
-        { name: '本期负变更', field: 'minus_qc_qty', type: dataType.double },
-        { name: '截止上期负变更', field: 'pre_minus_qc_qty', type: dataType.double },
-        { name: '截止本期负变更', field: 'pre_minus_qc_qty', type: dataType.double },
+        { name: '本期负变更', field: 'qc_minus_qty', type: dataType.double },
+        { name: '截止上期负变更', field: 'pre_qc_minus_qty', type: dataType.double },
+        { name: '截止本期负变更', field: 'end_qc_minus_qty', type: dataType.double },
         { name: '1#台账(台账+截止本期负变更)-数量', field: 'final_1_qty', type: dataType.double },
         { name: '1#台账(台账+截止本期负变更)-金额', field: 'final_1_tp', type: dataType.double },
         { name: '1#台账+截止本期变更-数量', field: 'end_final_1_qty', type: dataType.double },
@@ -740,19 +736,19 @@ const stage_bills_compare = {
         { name: '清单编号', field: 'b_code', type: dataType.str },
         { name: '名称', field: 'name', type: dataType.str },
         { name: '单位', field: 'unit', type: dataType.str }, // 12
-        { name: '单价', field: 'unit_price', type: dataType.currency, tag: { type: 'up' } },
+        { name: '单价', field: 'unit_price', type: dataType.currency },
 
-        { name: '签约-数量', field: 'deal_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '签约-金额', field: 'deal_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '签约-数量', field: 'deal_qty', type: dataType.currency },
+        { name: '签约-金额', field: 'deal_tp', type: dataType.currency },
 
-        { name: '施工复核-数量', field: 'sgfh_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '施工复核-金额', field: 'sgfh_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '设计错漏-数量', field: 'sjcl_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '设计错漏-金额', field: 'sjcl_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '其他错漏-数量', field: 'qtcl_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '其他错漏-金额', field: 'qtcl_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '台账-数量', field: 'quantity', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '台账-金额', field: 'total_price', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '施工复核-数量', field: 'sgfh_qty', type: dataType.currency },
+        { name: '施工复核-金额', field: 'sgfh_tp', type: dataType.currency },
+        { name: '设计错漏-数量', field: 'sjcl_qty', type: dataType.currency },
+        { name: '设计错漏-金额', field: 'sjcl_tp', type: dataType.currency },
+        { name: '其他错漏-数量', field: 'qtcl_qty', type: dataType.currency },
+        { name: '其他错漏-金额', field: 'qtcl_tp', type: dataType.currency },
+        { name: '台账-数量', field: 'quantity', type: dataType.currency },
+        { name: '台账-金额', field: 'total_price', type: dataType.currency },
 
         { name: '项目节-数量1', field: 'dgn_qty1', type: dataType.currency },
         { name: '项目节-数量2', field: 'dgn_qty2', type: dataType.currency },
@@ -762,82 +758,82 @@ const stage_bills_compare = {
         { name: '节点类型', field: 'node_type', type: dataType.int },
         { name: '总额计量', field: 'is_tp', type: dataType.int },
 
-        { name: '截止上期-合同-数量', field: 'pre_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止上期-合同-金额', field: 'pre_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '截止上期-数量变更-数量', field: 'pre_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止上期-数量变更-金额', field: 'pre_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '截止上期-完成-数量', field: 'pre_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '截止上期-完成-金额', field: 'pre_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_0', field: 'r0_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_0', field: 'r0_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_0', field: 'r0_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_0', field: 'r0_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_0', field: 'r0_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_0', field: 'r0_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_1', field: 'r1_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_1', field: 'r1_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_1', field: 'r1_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_1', field: 'r1_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_1', field: 'r1_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_1', field: 'r1_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_2', field: 'r2_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_2', field: 'r2_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_2', field: 'r2_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_2', field: 'r2_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_2', field: 'r2_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_2', field: 'r2_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_3', field: 'r3_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_3', field: 'r3_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_3', field: 'r3_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_3', field: 'r3_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_3', field: 'r3_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_3', field: 'r3_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_4', field: 'r4_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_4', field: 'r4_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_4', field: 'r4_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_4', field: 'r4_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_4', field: 'r4_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_4', field: 'r4_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_5', field: 'r5_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_5', field: 'r5_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_5', field: 'r5_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_5', field: 'r5_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_5', field: 'r5_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_5', field: 'r5_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_6', field: 'r6_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_6', field: 'r6_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_6', field: 'r6_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_6', field: 'r6_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_6', field: 'r6_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_6', field: 'r6_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_7', field: 'r7_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_7', field: 'r7_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_7', field: 'r7_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_7', field: 'r7_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_7', field: 'r7_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_7', field: 'r7_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_8', field: 'r8_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_8', field: 'r8_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_8', field: 'r8_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_8', field: 'r8_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_8', field: 'r8_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_8', field: 'r8_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
-
-        { name: '本期-合同-数量_9', field: 'r9_contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额_9', field: 'r9_contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量_9', field: 'r9_qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额_9', field: 'r9_qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量_9', field: 'r9_gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额_9', field: 'r9_gather_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '截止上期-合同-数量', field: 'pre_contract_qty', type: dataType.currency },
+        { name: '截止上期-合同-金额', field: 'pre_contract_tp', type: dataType.currency },
+        { name: '截止上期-数量变更-数量', field: 'pre_qc_qty', type: dataType.currency },
+        { name: '截止上期-数量变更-金额', field: 'pre_qc_tp', type: dataType.currency },
+        { name: '截止上期-完成-数量', field: 'pre_gather_qty', type: dataType.currency },
+        { name: '截止上期-完成-金额', field: 'pre_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_0', field: 'r0_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_0', field: 'r0_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_0', field: 'r0_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_0', field: 'r0_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_0', field: 'r0_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_0', field: 'r0_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_1', field: 'r1_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_1', field: 'r1_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_1', field: 'r1_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_1', field: 'r1_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_1', field: 'r1_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_1', field: 'r1_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_2', field: 'r2_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_2', field: 'r2_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_2', field: 'r2_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_2', field: 'r2_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_2', field: 'r2_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_2', field: 'r2_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_3', field: 'r3_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_3', field: 'r3_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_3', field: 'r3_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_3', field: 'r3_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_3', field: 'r3_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_3', field: 'r3_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_4', field: 'r4_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_4', field: 'r4_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_4', field: 'r4_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_4', field: 'r4_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_4', field: 'r4_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_4', field: 'r4_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_5', field: 'r5_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_5', field: 'r5_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_5', field: 'r5_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_5', field: 'r5_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_5', field: 'r5_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_5', field: 'r5_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_6', field: 'r6_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_6', field: 'r6_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_6', field: 'r6_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_6', field: 'r6_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_6', field: 'r6_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_6', field: 'r6_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_7', field: 'r7_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_7', field: 'r7_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_7', field: 'r7_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_7', field: 'r7_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_7', field: 'r7_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_7', field: 'r7_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_8', field: 'r8_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_8', field: 'r8_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_8', field: 'r8_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_8', field: 'r8_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_8', field: 'r8_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_8', field: 'r8_gather_tp', type: dataType.currency },
+
+        { name: '本期-合同-数量_9', field: 'r9_contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额_9', field: 'r9_contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量_9', field: 'r9_qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额_9', field: 'r9_qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量_9', field: 'r9_gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额_9', field: 'r9_gather_tp', type: dataType.currency },
 
         { name: '章节编号', field: 'chapter', type: dataType.str },
         { name: '最底层项目节id', field: 'leaf_xmj_id', type: dataType.str },
@@ -893,9 +889,9 @@ const stage_pos = {
 
         { name: '现场实际数量', field: 'real_qty', type: dataType.currency },
 
-        { name: '本期负变更', field: 'minus_qc_qty', type: dataType.double },
-        { name: '截止上期负变更', field: 'pre_minus_qc_qty', type: dataType.double },
-        { name: '截止本期负变更', field: 'pre_minus_qc_qty', type: dataType.double },
+        { name: '本期负变更', field: 'qc_minus_qty', type: dataType.double },
+        { name: '截止上期负变更', field: 'pre_qc_minus_qty', type: dataType.double },
+        { name: '截止本期负变更', field: 'end_qc_minus_qty', type: dataType.double },
         { name: '1#台账(台账+截止本期负变更)-数量', field: 'final_1_qty', type: dataType.double },
         { name: '1#台账+截止本期变更-数量', field: 'end_final_1_qty', type: dataType.double },
         { name: '1#完成率(%)', field: 'final_1_ratio', type: dataType.double },
@@ -963,9 +959,9 @@ const month_progress = {
     prefix: '工程进度',
     cols: [
         { name: '计量年月', field: 'month', type: dataType.str },
-        { name: '本月计量', field: 'tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '本月计量', field: 'tp', type: dataType.currency },
         { name: '本月完成度', field: 'ratio', type: dataType.double },
-        { name: '累计计量', field: 'end_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '累计计量', field: 'end_tp', type: dataType.currency },
         { name: '累计完成度', field: 'end_ratio', type: dataType.double },
     ],
 };
@@ -1733,19 +1729,19 @@ const material_bills = {
         { name: '清单编号', field: 'b_code', type: dataType.str },
         { name: '名称', field: 'name', type: dataType.str },
         { name: '单位', field: 'unit', type: dataType.str }, // 12
-        { name: '单价', field: 'unit_price', type: dataType.currency, tag: { type: 'up' } },
+        { name: '单价', field: 'unit_price', type: dataType.currency },
 
-        { name: '签约-数量', field: 'deal_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '签约-金额', field: 'deal_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '签约-数量', field: 'deal_qty', type: dataType.currency },
+        { name: '签约-金额', field: 'deal_tp', type: dataType.currency },
 
-        { name: '施工复核-数量', field: 'sgfh_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '施工复核-金额', field: 'sgfh_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '设计错漏-数量', field: 'sjcl_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '设计错漏-金额', field: 'sjcl_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '其他错漏-数量', field: 'qtcl_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '其他错漏-金额', field: 'qtcl_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '台账-数量', field: 'quantity', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '台账-金额', field: 'total_price', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '施工复核-数量', field: 'sgfh_qty', type: dataType.currency },
+        { name: '施工复核-金额', field: 'sgfh_tp', type: dataType.currency },
+        { name: '设计错漏-数量', field: 'sjcl_qty', type: dataType.currency },
+        { name: '设计错漏-金额', field: 'sjcl_tp', type: dataType.currency },
+        { name: '其他错漏-数量', field: 'qtcl_qty', type: dataType.currency },
+        { name: '其他错漏-金额', field: 'qtcl_tp', type: dataType.currency },
+        { name: '台账-数量', field: 'quantity', type: dataType.currency },
+        { name: '台账-金额', field: 'total_price', type: dataType.currency },
 
         { name: '项目节-数量1', field: 'dgn_qty1', type: dataType.currency },
         { name: '项目节-数量2', field: 'dgn_qty2', type: dataType.currency },
@@ -1755,12 +1751,12 @@ const material_bills = {
         { name: '节点类型', field: 'node_type', type: dataType.int },
         { name: '总额计量', field: 'is_tp', type: dataType.int },
 
-        { name: '本期-合同-数量', field: 'contract_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-合同-金额', field: 'contract_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-数量变更-数量', field: 'qc_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-数量变更-金额', field: 'qc_tp', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '本期-完成-数量', field: 'gather_qty', type: dataType.currency, tag: { type: 'qty', unitKey: 12 } },
-        { name: '本期-完成-金额', field: 'gather_tp', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '本期-合同-数量', field: 'contract_qty', type: dataType.currency },
+        { name: '本期-合同-金额', field: 'contract_tp', type: dataType.currency },
+        { name: '本期-数量变更-数量', field: 'qc_qty', type: dataType.currency },
+        { name: '本期-数量变更-金额', field: 'qc_tp', type: dataType.currency },
+        { name: '本期-完成-数量', field: 'gather_qty', type: dataType.currency },
+        { name: '本期-完成-金额', field: 'gather_tp', type: dataType.currency },
         { name: '本期批注', field: 'postil', type: dataType.str },
 
         { name: '预留扩展字段_1', field: 'ex_value1', type: dataType.currency },
@@ -2334,18 +2330,18 @@ const stage_change_info = {
         { name: '变更性质', field: 'quality', type: dataType.int },
         { name: '变更提出单位', field: 'company', type: dataType.str },
         { name: '费用承担方', field: 'charge', type: dataType.int },
-        { name: '金额', field: 'total_price', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '金额', field: 'total_price', type: dataType.currency },
         { name: '变更状态发生时间(时间戳)', field: 'cin_time', type: dataType.str },
         { name: '完成审批时间(时间戳)', field: 'sin_time', type: dataType.str },
-        { name: '金额_1', field: 'tp_1', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_2', field: 'tp_2', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_3', field: 'tp_3', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_4', field: 'tp_4', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_5', field: 'tp_5', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_6', field: 'tp_6', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_7', field: 'tp_7', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_8', field: 'tp_8', type: dataType.currency, tag: { type: 'tp' } },
-        { name: '金额_9', field: 'tp_9', type: dataType.currency, tag: { type: 'tp' } },
+        { name: '金额_1', field: 'tp_1', type: dataType.currency },
+        { name: '金额_2', field: 'tp_2', type: dataType.currency },
+        { name: '金额_3', field: 'tp_3', type: dataType.currency },
+        { name: '金额_4', field: 'tp_4', type: dataType.currency },
+        { name: '金额_5', field: 'tp_5', type: dataType.currency },
+        { name: '金额_6', field: 'tp_6', type: dataType.currency },
+        { name: '金额_7', field: 'tp_7', type: dataType.currency },
+        { name: '金额_8', field: 'tp_8', type: dataType.currency },
+        { name: '金额_9', field: 'tp_9', type: dataType.currency },
         { name: '附件名称列表', field: 'attNames', type: dataType.currency },
         { name: '截止本期-已执行(%)', field: 'used_ratio', type: dataType.currency },
         { name: '本期使用', field: 'cur_used', type: dataType.int },
@@ -2370,7 +2366,7 @@ const stage_change_info_bills = {
         { name: '清单编号', field: 'code', type: dataType.str },
         { name: '名称', field: 'name', type: dataType.str },
         { name: '单位', field: 'unit', type: dataType.str },
-        { name: '单价', field: 'unit_price', type: dataType.currency, tag: { type: 'up' } },
+        { name: '单价', field: 'unit_price', type: dataType.currency },
         { name: '变更详情', field: 'detail', type: dataType.str },
         { name: '变更部位', field: 'bwmx', type: dataType.str },
         { name: '数量', field: 'qty', type: dataType.currency },