瀏覽代碼

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang 2 年之前
父節點
當前提交
159c84a8b4

+ 1 - 1
app/controller/measure_controller.js

@@ -254,7 +254,7 @@ module.exports = app => {
                         data.bills = await ctx.service.stageBills.getLastestStageData2(ctx.tender.id, stage.id);
                         const bpcData = await ctx.service.stageBillsPc.getAllDataByCondition({ where: { sid: stage.id } });
                         this.joinData(data.bills, 'lid', [
-                            { data: bpcData, fields: ['pc_tp'], prefix: '', relaId: 'lid' },
+                            { data: bpcData, fields: ['contract_pc_tp', 'qc_pc_tp', 'pc_tp'], prefix: '', relaId: 'lid' },
                         ]);
                         data.pos = await ctx.service.stagePos.getLastestStageData2(ctx.tender.id, stage.id);
                         result.stages.push(data);

+ 21 - 6
app/lib/bills_pos_convert.js

@@ -19,7 +19,7 @@ class BillsPosConvert {
         this.ctx = ctx;
         this._ = this.ctx.helper._;
 
-        this.tpFields = ['total_price', 'contract_tp', 'qc_tp', 'gather_tp',
+        this.tpFields = ['total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp',
             'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'end_contract_tp', 'end_qc_tp'];
         this.baseCalcFields = ['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'];
@@ -85,6 +85,8 @@ class BillsPosConvert {
         node.quantity = this.ctx.helper.add(node.quantity, data.quantity);
         node.total_price = this.ctx.helper.add(node.total_price, this.ctx.helper.mul(node.unit_price, data.quantity, tpDecimal));
 
+        const org_price = node.org_price || node.unit_price;
+
         node.contract_qty = this.ctx.helper.add(node.contract_qty, data.contract_qty);
         node.contract_tp = this.ctx.helper.add(node.contract_tp, this.ctx.helper.mul(node.unit_price, data.contract_qty, tpDecimal));
         node.qc_qty = this.ctx.helper.add(node.qc_qty, data.qc_qty);
@@ -92,9 +94,9 @@ class BillsPosConvert {
         node.gather_qty = this.ctx.helper.add(node.gather_qty, data.gather_qty);
 
         node.pre_contract_qty = this.ctx.helper.add(node.pre_contract_qty, data.pre_contract_qty);
-        node.pre_contract_tp = this.ctx.helper.add(node.pre_contract_tp, this.ctx.helper.mul(node.unit_price, data.pre_contract_qty, tpDecimal));
+        node.pre_contract_tp = this.ctx.helper.add(node.pre_contract_tp, this.ctx.helper.mul(org_price, data.pre_contract_qty, tpDecimal));
         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, this.ctx.helper.mul(node.unit_price, data.pre_qc_qty, tpDecimal));
+        node.pre_qc_tp = this.ctx.helper.add(node.pre_qc_tp, this.ctx.helper.mul(org_price, data.pre_qc_qty, tpDecimal));
         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);
@@ -111,6 +113,7 @@ class BillsPosConvert {
         node.qc_qty = this.ctx.helper.add(node.qc_qty, data.qc_qty);
         node.qc_tp = this.ctx.helper.add(node.qc_tp, data.qc_tp);
         node.gather_qty = this.ctx.helper.add(node.gather_qty, data.gather_qty);
+        node.gather_tp = this.ctx.helper.add(node.gather_tp, data.gather_tp);
 
         node.pre_contract_qty = this.ctx.helper.add(node.pre_contract_qty, data.pre_contract_qty);
         node.pre_contract_tp = this.ctx.helper.add(node.pre_contract_tp, data.pre_contract_tp);
@@ -142,7 +145,7 @@ class BillsPosConvert {
                 if (p.ex_memo3) posUnit.ex_memo3.push(p.ex_memo3);
 
                 const gclUnit = xmj.unitTree.addNode({pos_name: '',
-                    b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price
+                    b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price, org_price: node.org_price,
                 }, posUnit);
                 if (node.drawing_code && gclUnit.drawing_code.indexOf(node.drawing_code) < 0)
                     gclUnit.drawing_code.push(node.drawing_code);
@@ -164,7 +167,7 @@ class BillsPosConvert {
         } else {
             const unit = xmj.unitTree.addNode({
                 pos_name: '',
-                b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price,
+                b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price, org_price: node.org_price,
             });
             if (node.drawing_code && unit.drawing_code.indexOf(node.drawing_code) < 0)
                 unit.drawing_code.push(node.drawing_code);
@@ -248,12 +251,24 @@ class BillsPosConvert {
         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);
+
+        const priceDiff = child.org_price ? this.ctx.helper.sub(child.unit_price, child.org_price) : 0;
+        if (priceDiff && (child.pre_contract_qty || child.pre_qc_qty)) {
+            child.contract_pc_tp = this.ctx.helper.sub(this.ctx.helper.mul(child.unit_price, child.pre_contract_qty, this.ctx.tender.info.decimal.tp), child.pre_contract_tp);
+            child.qc_pc_tp = this.ctx.helper.sub(this.ctx.helper.mul(child.unit_price, child.pre_qc_qty, this.ctx.tender.info.decimal.tp), child.pre_qc_tp);
+            child.pc_tp = this.ctx.helper.add(child.contract_pc_tp, child.qc_pc_tp);
+            child.gather_tp = this.ctx.helper.add(child.gather_tp, child.pc_tp);
+            child.end_contract_tp = this.ctx.helper.add(child.end_contract_tp, child.contract_pc_tp);
+            child.end_qc_tp = this.ctx.helper.add(child.end_qc_tp, child.qc_pc_tp);
+            child.end_gather_tp = this.ctx.helper.add(child.end_contract_tp, child.end_qc_tp);
+        }
     }
     _calculateNode(node, children) {
         for (const child of children) {
             node.total_price = this.ctx.helper.add(node.total_price, child.total_price);
             node.contract_tp = this.ctx.helper.add(node.contract_tp, child.contract_tp);
             node.qc_tp = this.ctx.helper.add(node.qc_tp, child.qc_tp);
+            node.pc_tp = this.ctx.helper.add(node.pc_tp, child.pc_tp);
             node.gather_tp = this.ctx.helper.add(node.gather_tp, child.gather_tp);
             node.pre_contract_tp = this.ctx.helper.add(node.pre_contract_tp, child.pre_contract_tp);
             node.pre_qc_tp = this.ctx.helper.add(node.pre_qc_tp, child.pre_qc_tp);
@@ -372,7 +387,7 @@ class BillsPosConvert {
         switch (filter) {
             case 'cur':
                 return this._getResultData(function (node) {
-                    for (const field of ['contract_tp', 'qc_tp', 'gather_tp']) {
+                    for (const field of ['contract_tp', 'qc_tp', 'gather_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp']) {
                         if (node[field]) {
                             return false;
                         }

+ 3 - 1
app/lib/budget_final.js

@@ -162,13 +162,15 @@ class BudgetFinal {
                 ? await this.ctx.service.stageBills.getAuditorStageData2(id, stage.id, stage.curTimes, stage.curOrder)
                 : await this.ctx.service.stageBills.getLastestStageData2(id, stage.id);
             const preBills = stage.order > 1 ? await this.ctx.service.stageBillsFinal.getFinalData({id}, stage.order - 1) : [];
+            const bpcData = await ctx.service.stageBillsPc.getAllDataByCondition({ where: { sid: ctx.stage.id } });
             helper.assignRelaData(bills, [
                 { data: curBills, fields: ['contract_tp', 'qc_tp'], prefix: '', relaId: 'lid' },
                 { data: preBills, fields: ['contract_tp', 'qc_tp'], prefix: 'pre_', relaId: 'lid' },
                 { data: dgnData, fields: ['deal_dgn_qty1', 'deal_dgn_qty2', 'c_dgn_qty1', 'c_dgn_qty2'], prefix: '', relaId: 'id' },
+                { data: bpcData, fields: ['pc_tp', 'org_price'], prefix: '', relaId: 'lid' },
             ]);
             bills.forEach(b => {
-                b.end_gather_tp = helper.sum([b.qc_tp, b.contract_tp, b.pre_qc_tp, b.pre_contract_tp]);
+                b.end_gather_tp = helper.sum([b.qc_tp, b.contract_tp, b.pre_qc_tp, b.pre_contract_tp, b.pc_tp]);
             });
             this.final.tender_info.push({ id, stageOrder: stage.order, stageStatus: stage.status, stageFlow: stage.curTimes + '-' + stage.curOrder });
         }

+ 2 - 1
app/public/js/gcl_gather.js

@@ -12,7 +12,7 @@
 const gclGatherModel = (function () {
     // 需要汇总计算的字段
     let ledgerGatherFields = ['quantity', 'total_price', 'deal_qty', 'deal_tp',
-        'contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty',
+        'contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp',
         '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'];
     let posGatherFields = ['quantity', 'contract_qty', 'qc_qty', 'gather_qty','qc_minus_qty',
@@ -112,6 +112,7 @@ const gclGatherModel = (function () {
             name: node.name,
             unit: node.unit,
             unit_price: node.unit_price,
+            org_price: node.org_price,
             leafXmjs: [],
         };
         gclList.push(gcl);

+ 8 - 5
app/public/js/measure_compare.js

@@ -137,7 +137,9 @@ function initSpreadSettingWithRoles(compareRoles) {
 function calculateStageLedgerData(datas) {
     for (const d of datas) {
         d.gather_qty = ZhCalc.add(d.contract_qty, d.qc_qty);
-        d.gather_tp = ZhCalc.add(d.contract_tp, d.qc_tp);
+        d.gather_tp = ZhCalc.sum([d.contract_tp, d.qc_tp, d.pc_tp]);
+        // d.pc_tp = ZhCalc.add(d.qc_tp, d.qc_pc_tp);
+        // d.contract_tp = ZhCalc.add(d.contract_tp, d.contract_pc_tp);
     }
 }
 function calculateStagePosData(datas) {
@@ -264,6 +266,7 @@ $(document).ready(() => {
         SpreadJsObj.resetTopAndSelect(leafXmjSheet);
     }
     billsSheet.bind(spreadNS.Events.SelectionChanged, function (e, info) {
+        console.log(SpreadJsObj.getSelectObject(info.sheet));
         if (info.newSelections) {
             const iNewRow = info.newSelections[0].row;
             if (info.oldSelections) {
@@ -392,14 +395,14 @@ $(document).ready(() => {
     $('[name=compare-data]').click(function () {
         initSpreadSettingWithRoles(compareStages);
         SpreadJsObj.reLoadSheetHeader(billsSheet);
-        SpreadJsObj.reloadColData(billsSheet, billsSpreadSetting.baseCols.length - 1, compareStages.length * billsSpreadSetting.extraCols.length);
+        SpreadJsObj.reloadColData(billsSheet, billsSpreadSetting.baseCols.length, compareStages.length * billsSpreadSetting.extraCols.length);
         SpreadJsObj.reLoadSheetHeader(posSheet);
-        SpreadJsObj.reloadColData(posSheet, posSpreadSetting.baseCols.length - 1, compareStages.length * posSpreadSetting.extraCols.length);
+        SpreadJsObj.reloadColData(posSheet, posSpreadSetting.baseCols.length, compareStages.length * posSpreadSetting.extraCols.length);
 
         SpreadJsObj.reLoadSheetHeader(gclSheet);
-        SpreadJsObj.reloadColData(gclSheet, gclSpreadSetting.baseCols.length - 1, compareStages.length * gclSpreadSetting.extraCols.length);
+        SpreadJsObj.reloadColData(gclSheet, gclSpreadSetting.baseCols.length, compareStages.length * gclSpreadSetting.extraCols.length);
         SpreadJsObj.reLoadSheetHeader(leafXmjSheet);
-        SpreadJsObj.reloadColData(leafXmjSheet, leafXmjSpreadSetting.baseCols.length - 1, compareStages.length * leafXmjSpreadSetting.extraCols.length);
+        SpreadJsObj.reloadColData(leafXmjSheet, leafXmjSpreadSetting.baseCols.length, compareStages.length * leafXmjSpreadSetting.extraCols.length);
     });
     $('[name=compareType]').click(function () {
         $('[name=compareType]').removeClass('active');

+ 1 - 1
app/public/js/shares/sjs_setting.js

@@ -96,7 +96,7 @@ const sjsSettingObj = (function () {
         for (const r of rela) {
             const col = _.find(cols, {field: r.field});
             if (col) {
-                col.getValue = function (data) { return data.contract_pc_tp || data.qc_pc_tp ? data.org_price : null; };
+                col.getValue = function (data) { return data.contract_pc_tp || data.qc_pc_tp || data.pc_tp ? data.org_price : null; };
             }
         }
     };

+ 5 - 4
app/public/js/stage_im.js

@@ -25,7 +25,8 @@ 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', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
+    gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_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);
@@ -35,9 +36,9 @@ const stageIm = (function () {
             node.end_gather_qty = ZhCalc.add(node.pre_gather_qty, node.gather_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);
-        node.end_contract_tp = ZhCalc.add(node.pre_contract_tp, node.contract_tp);
-        node.end_qc_tp = ZhCalc.add(node.pre_qc_tp, node.qc_tp);
+        node.gather_tp = ZhCalc.sum([node.contract_tp, node.qc_tp, node.pc_tp]);
+        node.end_contract_tp = ZhCalc.sum([node.pre_contract_tp, node.contract_tp, node.contract_pc_tp]);
+        node.end_qc_tp = ZhCalc.sum([node.pre_qc_tp, node.qc_tp, node.qc_pc_tp]);
         node.end_gather_tp = ZhCalc.add(node.pre_gather_tp, node.gather_tp);
     };
     const gsTree = createNewPathTree('stage', gsTreeSetting);

+ 3 - 3
app/public/js/tender_list_info.js

@@ -267,9 +267,9 @@ function initTenderTree () {
     }
     function calculateTender(tender) {
         if (tender.lastStage) {
-            tender.gather_tp = ZhCalc.add(tender.lastStage.contract_tp, tender.lastStage.qc_tp);
-            tender.end_contract_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.contract_tp);
-            tender.end_qc_tp = ZhCalc.add(tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp);
+            tender.gather_tp = ZhCalc.sum([tender.lastStage.contract_tp, tender.lastStage.qc_tp, tender.lastStage.pc_tp]);
+            tender.end_contract_tp = ZhCalc.sum([tender.lastStage.pre_contract_tp, tender.lastStage.contract_tp, tender.lastStage.contract_pc_tp]);
+            tender.end_qc_tp = ZhCalc.sum([tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp, tender.lastStage.qc_pc_tp]);
             tender.end_gather_tp = ZhCalc.add(tender.end_contract_tp, tender.end_qc_tp);
             tender.pre_gather_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.pre_qc_tp);
             tender.yf_tp = ZhCalc.add(tender.lastStage.yf_tp);

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

@@ -262,9 +262,9 @@ function initTenderTree () {
     }
     function calculateTender(tender) {
         if (tender.lastStage) {
-            tender.end_qc_tp = ZhCalc.add(tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp);
+            tender.end_qc_tp = ZhCalc.sum([tender.lastStage.pre_qc_tp, tender.lastStage.qc_tp, tender.lastStage.qc_pc_tp]);
             tender.pre_gather_tp = ZhCalc.add(tender.lastStage.pre_contract_tp, tender.lastStage.pre_qc_tp);
-            tender.gather_tp = ZhCalc.add(tender.lastStage.contract_tp, tender.lastStage.qc_tp);
+            tender.gather_tp = ZhCalc.sum([tender.lastStage.contract_tp, tender.lastStage.qc_tp, tender.lastStage.pc_tp]);
             tender.sum_tp = ZhCalc.add(tender.total_price, tender.end_qc_tp);
         } else {
             tender.sum_tp = tender.total_price;

+ 8 - 3
app/service/stage.js

@@ -226,8 +226,12 @@ module.exports = app => {
                 await this.doCheckStage(stage, force);
                 if (!stage.readOnly && stage.check_calc) {
                     const tpData = await this.ctx.service.stageBills.getSumTotalPrice(stage);
+                    const pcSum = await this.ctx.service.stageBillsPc.getSumTotalPrice(stage);
                     stage.contract_tp = tpData.contract_tp;
                     stage.qc_tp = tpData.qc_tp;
+                    stage.contract_pc_tp = pcSum.contract_pc_tp;
+                    stage.qc_pc_tp = pcSum.qc_pc_tp;
+                    stage.pc_tp = pcSum.pc_tp;
                     stage.tp =this.ctx.helper.add(stage.contract_tp, stage.qc_tp);
                     const tp = await this.ctx.service.stagePay.getSpecialTotalPrice(stage);
                     stage.yf_tp = tp.yf;
@@ -236,6 +240,7 @@ module.exports = app => {
                     await this.update({
                         check_calc: false,
                         contract_tp: stage.contract_tp, qc_tp: stage.qc_tp,
+                        contract_pc_tp: stage.contract_pc_tp || 0, qc_pc_tp: stage.qc_pc_tp || 0, pc_tp: stage.pc_tp || 0,
                         yf_tp: stage.yf_tp, sf_tp: stage.sf_tp,
                     }, { id: stage.id });
                 } else if (stage.tp_history) {
@@ -263,7 +268,7 @@ module.exports = app => {
                 orders: [['order', 'desc']],
             });
             for (const s of stages) {
-                s.tp = this.ctx.helper.add(s.contract_tp, s.qc_tp);
+                s.tp = this.ctx.helper.sum([s.contract_tp, s.qc_tp, s.pc_tp]);
                 s.pre_tp = this.ctx.helper.add(s.pre_contract_tp, s.pre_qc_tp);
                 s.end_tp = this.ctx.helper.add(s.pre_tp, s.tp);
                 s.tp_history = s.tp_history ? JSON.parse(s.tp_history) : [];
@@ -336,8 +341,8 @@ module.exports = app => {
                 newStage.im_pre = preStage.im_pre;
                 newStage.im_gather = preStage.im_gather;
                 newStage.im_gather_node = preStage.im_gather_node;
-                newStage.pre_contract_tp = this.ctx.helper.add(preStage.pre_contract_tp, preStage.contract_tp);
-                newStage.pre_qc_tp = this.ctx.helper.add(preStage.pre_qc_tp, preStage.qc_tp);
+                newStage.pre_contract_tp = this.ctx.helper.sum([preStage.pre_contract_tp, preStage.contract_tp, preStage.contract_pc_tp]);
+                newStage.pre_qc_tp = this.ctx.helper.sum([preStage.pre_qc_tp, preStage.qc_tp, preStage.qc_pc_tp]);
                 newStage.pre_yf_tp = this.ctx.helper.add(preStage.pre_yf_tp, preStage.yf_tp);
                 if (preStage.order === 1 || preStage.pre_sf_tp) {
                     newStage.pre_sf_tp = this.ctx.helper.add(preStage.pre_sf_tp, preStage.sf_tp);

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

@@ -163,8 +163,9 @@
             {title: '现场实际金额', colSpan: '1', rowSpan: '2', field: 'real_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '预计变更金额', colSpan: '1', rowSpan: '2', field: 'estimate_tp', hAlign: 2, width: 60, type: 'Number'},
             <% } %>
-            {title: '本期计量金额|合同计量', colSpan: '3|1', rowSpan: '1|1', field: 'contract_tp', hAlign: 2, width: 70, type: 'Number'},
+            {title: '本期计量金额|合同计量', colSpan: '4|1', rowSpan: '1|1', field: 'contract_tp', hAlign: 2, width: 70, type: 'Number'},
             {title: '|数量变更', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 70, type: 'Number'},
+            {title: '|补差', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 70, type: 'Number', visible: <%- ctx.tender.info.display.stage.priceDiff %> },
             {title: '|完成计量', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 70, type: 'Number'},
             {title: '截止本期计量金额|合同计量', colSpan: '4|1', rowSpan: '1|1', field: 'end_contract_tp', hAlign: 2, width: 70, type: 'Number'},
             {title: '|数量变更', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 70, type: 'Number'},
@@ -236,6 +237,10 @@
             {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '|变更令', colSpan: '|1', rowSpan: '|1', field: 'bgl_code', hAlign: 2, width: 60, formatter: '@', cellType: 'ellipsisAutoTip'},
+            <% if ( ctx.tender.info.display.stage.priceDiff ) { %>
+            { title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', getValue(data) { return data.pc_tp ? data.org_price : null},  },
+            { title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number' },
+            <% } %>
             {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, type: 'Number'},
             {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},