Browse Source

章级识别调整

MaiXinRong 2 months ago
parent
commit
78e6f00af6

+ 18 - 18
app/const/deal_pay.js

@@ -54,15 +54,15 @@ const materialCalcBase = [
     {name: '本期一般变更计量', code: 'ybbqbg', limit: true, sort: 5},
     {name: '本期较大变更计量', code: 'jdbqbg', limit: true, sort: 5},
     {name: '本期重大变更计量', code: 'zdbqbg', limit: true, sort: 5},
-    {name: '100章本期完成计量', code: 'yib', code2: 'ybbqwc', cType: 1, filter: '^[^0-9]*1[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '200章本期完成计量', code: 'erb', cType: 1, filter: '^[^0-9]*2[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '300章本期完成计量', code: 'sanb', cType: 1, filter: '^[^0-9]*3[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '400章本期完成计量', code: 'sib', cType: 1, filter: '^[^0-9]*4[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '500章本期完成计量', code: 'wub', cType: 1, filter: '^[^0-9]*5[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '600章本期完成计量', code: 'liub', cType: 1, filter: '^[^0-9]*6[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '700章本期完成计量', code: 'qib', cType: 1, filter: '^[^0-9]*7[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '800章本期完成计量', code: 'bab', cType: 1, filter: '^[^0-9]*8[0-9]{2}(-|$)', limit: true, sort: 1},
-    {name: '900章本期完成计量', code: 'jiub', cType: 1, filter: '^[^0-9]*9[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '100章本期完成计量', code: 'yib', code2: 'ybbqwc', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '200章本期完成计量', code: 'erb', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?2[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '300章本期完成计量', code: 'sanb', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?3[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '400章本期完成计量', code: 'sib', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?4[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '500章本期完成计量', code: 'wub', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?5[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '600章本期完成计量', code: 'liub', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?6[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '700章本期完成计量', code: 'qib', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?7[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '800章本期完成计量', code: 'bab', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?8[0-9]{2}(-|$)', limit: true, sort: 1},
+    {name: '900章本期完成计量', code: 'jiub', cType: 1, filter: '^[^0-9]*([0-9]{0,2}-)?9[0-9]{2}(-|$)', limit: true, sort: 1},
     {name: '本期应付', code: 'bqyf', limit: true, ptNormalLimit: true, sort: 20},
 ];
 
@@ -88,15 +88,15 @@ const deadlineType = {
 };
 
 const chapterDetail = [
-    {name: '清单 第100章 总则', cType: 1, serialNo: 1, filter: '^[^0-9]*1[0-9]{2}(-|$)'},
-    {name: '清单 第200章 路基', cType: 1, serialNo: 2, filter: '^[^0-9]*2[0-9]{2}(-|$)'},
-    {name: '清单 第300章 路面', cType: 1, serialNo: 3, filter: '^[^0-9]*3[0-9]{2}(-|$)'},
-    {name: '清单 第400章 桥梁、涵洞', cType: 1, serialNo: 4, filter: '^[^0-9]*4[0-9]{2}(-|$)'},
-    {name: '清单 第500章 隧道', cType: 1, serialNo: 5, filter: '^[^0-9]*5[0-9]{2}(-|$)'},
-    {name: '清单 第600章 安全设施及预埋管线', cType: 1, serialNo: 6, filter: '^[^0-9]*6[0-9]{2}(-|$)'},
-    {name: '清单 第700章 绿化及环境保护', cType: 1, serialNo: 7, filter: '^[^0-9]*7[0-9]{2}(-|$)'},
-    {name: '清单 第800章 机电工程', cType: 1, serialNo: 6, filter: '^[^0-9]*8[0-9]{2}(-|$)'},
-    {name: '清单 第900章 房建工程', cType: 1, serialNo: 7, filter: '^[^0-9]*9[0-9]{2}(-|$)'},
+    {name: '清单 第100章 总则', cType: 1, serialNo: 1, filter: '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)'},
+    {name: '清单 第200章 路基', cType: 1, serialNo: 2, filter: '^[^0-9]*([0-9]{0,2}-)?2[0-9]{2}(-|$)'},
+    {name: '清单 第300章 路面', cType: 1, serialNo: 3, filter: '^[^0-9]*([0-9]{0,2}-)?3[0-9]{2}(-|$)'},
+    {name: '清单 第400章 桥梁、涵洞', cType: 1, serialNo: 4, filter: '^[^0-9]*([0-9]{0,2}-)?4[0-9]{2}(-|$)'},
+    {name: '清单 第500章 隧道', cType: 1, serialNo: 5, filter: '^[^0-9]*([0-9]{0,2}-)?5[0-9]{2}(-|$)'},
+    {name: '清单 第600章 安全设施及预埋管线', cType: 1, serialNo: 6, filter: '^[^0-9]*([0-9]{0,2}-)?6[0-9]{2}(-|$)'},
+    {name: '清单 第700章 绿化及环境保护', cType: 1, serialNo: 7, filter: '^[^0-9]*([0-9]{0,2}-)?7[0-9]{2}(-|$)'},
+    {name: '清单 第800章 机电工程', cType: 1, serialNo: 6, filter: '^[^0-9]*([0-9]{0,2}-)?8[0-9]{2}(-|$)'},
+    {name: '清单 第900章 房建工程', cType: 1, serialNo: 7, filter: '^[^0-9]*([0-9]{0,2}-)?9[0-9]{2}(-|$)'},
     {name: '未计入章节清单合计', cType: 21, serialNo: 8},
     {name: '清单小计(A)', cType: 11, serialNo: 9},
     {name: '非清单项费用(B)', cType: 31, serialNo: 10},

+ 5 - 0
app/extend/helper.js

@@ -488,6 +488,11 @@ module.exports = {
             const result = codePath[0].match(numReg);
             const num = parseInt(result[0]);
             return this.mul(this.div(num, 100, 0), 100) + '';
+        } else if (codePath.length > 2 && reg.test(codePath[1])) {
+            const numReg = /[0-9]{3,4}$/;
+            const result = codePath[1].match(numReg);
+            const num = parseInt(result[0]);
+            return this.mul(this.div(num, 100, 0), 100) + '';
         }
         return '10000';
     },

+ 1 - 1
app/lib/rpt_data_analysis.js

@@ -407,7 +407,7 @@ const gatherChapter = {
         for (const c of chapter) {
             const cc = { code: c.code, name: c.name, cType: 1 };
             cc.serialNo = serialNo++;
-            cc.filter = '^[\\D]*' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
+            cc.filter = '^[^0-9]*([0-9]{0,2}-)?' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
             // cc.visible = true;
             gclChapter.push(cc);
 

+ 1 - 1
app/lib/tender_info.js

@@ -60,7 +60,7 @@ class TenderInfo {
         const gclChapter = [];
         for (const c of this.ctx.tender.info.chapter) {
             const cc = { code: c.code, name: c.name, cType: 1 };
-            const filter = '^[\\D]*' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
+            const filter = '^[^0-9]*([0-9]{0,2}-)?' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
             cc.reg = new RegExp(filter);
             gclChapter.push(cc);
         }

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

@@ -416,7 +416,6 @@ const gclGatherModel = (function () {
                 gcb.c_qty = ZhCalc.add(gcb.c_qty, cb.checked_amount);
                 gcb.c_tp = ZhCalc.add(gcb.c_tp, cb.checked_price);
 
-                console.log(cb.code, cb.pre_qty, cb.pre_qty_minus);
                 gcb.cur_qty = ZhCalc.add(gcb.cur_qty, cb.cur_qty);
                 gcb.cur_qty_minus = ZhCalc.add(gcb.cur_qty_minus, cb.cur_qty_minus);
                 gcb.pre_qty = ZhCalc.add(gcb.pre_qty, cb.pre_qty);
@@ -563,7 +562,7 @@ const gclGatherModel = (function () {
         for (const c of chapter) {
             const cc = { code: c.code, name: c.name, cType: 1 };
             cc.serialNo = serialNo++;
-            cc.filter = '^[^0-9]*' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
+            cc.filter = '^[^0-9]*([0-9]{0,2}-)?' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
             gclChapter.push(cc);
         }
         gclChapter.push({ name: '未计入章节清单合计', cType: 21, serialNo: serialNo+1 });

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

@@ -266,7 +266,7 @@ const gclCompareModel = (function () {
         for (const c of chapter) {
             const cc = { code: c.code, name: c.name, cType: 1 };
             cc.serialNo = serialNo++;
-            cc.filter = '^[^0-9]*' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
+            cc.filter = '^[^0-9]*([0-9]{0,2}-)?' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}(-|$)';
             gclChapter.push(cc);
         }
         gclChapter.push({ name: '未计入章节清单合计', cType: 21, serialNo: serialNo+1 });

+ 2 - 2
app/service/phase_pay.js

@@ -127,8 +127,8 @@ module.exports = app => {
                 result.qd_qc_tp = qdSum.qc_tp || 0;
                 result.qd_pc_tp = qdSum.pc_tp || 0;
 
-                const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*1[0-9]{2}(-|$)');
-                const sumPc = await this.ctx.service.stageBillsPc.getSumTotalPriceGcl(stage, '^[^0-9]*1[0-9]{2}(-|$)');
+                const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
+                const sumPc = await this.ctx.service.stageBillsPc.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
                 result.gather_100_tp = this.ctx.helper.sum([sumGcl.contract_tp, sumGcl.qc_tp, sumPc.pc_tp]);
 
                 const bg = await this.ctx.service.stage.getChangeSubtotal(stage);

+ 2 - 2
app/service/stage.js

@@ -707,8 +707,8 @@ module.exports = app => {
                         cb.value = qdSum.qc_tp;
                         break;
                     case 'ybbqwc':
-                        const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*1[0-9]{2}(-|$)');
-                        const sumPc = await this.ctx.service.stageBillsPc.getSumTotalPriceGcl(stage, '^[^0-9]*1[0-9]{2}(-|$)');
+                        const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
+                        const sumPc = await this.ctx.service.stageBillsPc.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
                         cb.value = this.ctx.helper.sum([sumGcl.contract_tp, sumGcl.qc_tp, sumPc.pc_tp]);
                         break;
                     case 'ybbqbg':

+ 4 - 4
app/service/stage_rela.js

@@ -20,7 +20,7 @@ class srCache {
 
     async _getCacheOrgTp() {
         const bg = await this.ctx.service.stageChange.getSubtotal(this.stage);
-        const gcl100 = await this.ctx.service.stageBills.getSumTotalPriceGcl(this.stage, '^[^0-9]*1[0-9]{2}(-|$)');
+        const gcl100 = await this.ctx.service.stageBills.getSumTotalPriceGcl(this.stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
         return {
             contract_tp: this.stage.contract_tp, qc_tp: this.stage.qc_tp,
             gather_tp: this.ctx.helper.add(this.stage.contract_tp, this.stage.qc_tp),
@@ -132,7 +132,7 @@ class srCache {
     _getCacheBills() {
         this.stageBills = [];
         this.stageBillsFinal = [];
-        const gcl = {}, gcl100 = {}, gcl100reg = /^[^0-9]*1[0-9]{2}(-|$)/;
+        const gcl = {}, gcl100 = {}, gcl100reg = /^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)/;
         for (const t of this.billsTree.nodes) {
             if (t.children && t.children.length > 0) continue;
             if (!t.b_code) continue;
@@ -293,7 +293,7 @@ module.exports = app => {
 
         // async _getCacheOrgTp(stage) {
         //     const bg = await this.ctx.service.stageChange.getSubtotal(stage);
-        //     const gcl100 = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*1[0-9]{2}(-|$)');
+        //     const gcl100 = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
         //     return {
         //         contract_tp: stage.contract_tp, qc_tp: stage.qc_tp,
         //         gather_tp: this.ctx.helper.add(stage.contract_tp, stage.qc_tp),
@@ -311,7 +311,7 @@ module.exports = app => {
         //     ]);
         //     const dealBills = await this.ctx.service.dealBills.getAllDataByCondition({ where: { tender_id: this.ctx.stage.tid } });
         //
-        //     const gcl = {}, gcl100 = {}, gcl100reg = /^[^0-9]*1[0-9]{2}(-|$)/;
+        //     const gcl = {}, gcl100 = {}, gcl100reg = /^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)/;
         //     for (const t of ledger) {
         //         const db = dealBills.find(x => {
         //             return x.code === t.b_code && x.name === t.name && x.unit === t.unit;