Explorar el Código

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

Tony Kang hace 3 meses
padre
commit
34a7dd5083

+ 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},

+ 8 - 0
app/const/sp_page_show.js

@@ -97,6 +97,14 @@ const defaultSetting = {
     openStageAudit: 0,
     stageAuditEarly: 3,
     stageAuditWorry: 8,
+    openMaterialChecklist: 0,
+    openMaterialSelf: 0,
+    openMaterialEditForAudit: 0,
+    openChangeProject: 0,
+    openChangeApply: 0,
+    openChangePlan: 0,
+    openChangeWhiteList: 0,
+    openChangeState: 0,
 };
 
 module.exports = {

+ 1 - 1
app/controller/project_controller.js

@@ -108,7 +108,7 @@ module.exports = app => {
                 }
                 const result = await ctx.service.project.switchProject(projectId);
                 if (!result) {
-                    throw '切换项目失败!';
+                    throw '切换系统失败!';
                 }
             } catch (error) {
                 this.setMessage(error.toString(), this.messageType.ERROR);

+ 1 - 1
app/controller/sub_proj_setting_controller.js

@@ -558,7 +558,7 @@ module.exports = app => {
                 }).filter(x => { return x.groupList.length > 0; });
 
                 // 获取项目列表
-                const subProjects = await ctx.service.subProject.getAllDataByCondition({ where: { project_id: projectId, is_delete: 0 } });
+                const subProjects = await ctx.service.subProject.getAllDataByCondition({ where: { project_id: projectId, is_folder: 0, is_delete: 0 } });
                 const renderData = {
                     projectData,
                     tenderList,

+ 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 });

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

@@ -696,7 +696,7 @@ $(document).ready(() => {
                 : true;
         }
         _matchBillsParent(match, change) {
-            return match ? (!change.b_bwmx || change.b_bwmx === this.callData.leafXmj.name) : true;
+            return match ? (!change.b_bwmx || change.b_bwmx === (this.callData.leafXmj ? this.callData.leafXmj.name : '')) : true;
         }
         _filterChange(filterEmpty, matchPosName) {
             this.displayChanges = [];

+ 2 - 2
app/service/financial_pay_tender_audit.js

@@ -89,7 +89,7 @@ module.exports = app => {
                                 fund_pay_permission: subProjPermission.fund_pay_permission.push(1).join(','),
                             };
                             if (!financialPermission.transfer_show) {
-                                upPermission.fund_tran_permission = subProjPermission.fund_trans_permission.push(1).join(',');
+                                upPermission.fund_trans_permission = subProjPermission.fund_trans_permission.push(1).join(',');
                             }
                             updateSubProjPermissionData.push(upPermission);
                         }
@@ -203,7 +203,7 @@ module.exports = app => {
                             };
                             if (!financialPermission.transfer_show) {
                                 fAudit.fund_trans_permission.push(1);
-                                upPermission.fund_tran_permission = fAudit.fund_trans_permission.join(',');
+                                upPermission.fund_trans_permission = fAudit.fund_trans_permission.join(',');
                             }
                             await transaction.update(this.ctx.service.subProjPermission.tableName, upPermission);
                         }

+ 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':

+ 1 - 1
app/service/stage_pos.js

@@ -566,7 +566,7 @@ module.exports = app => {
                     qc_minus_qty: noValue ? qty : (orgPos ? orgPos.qc_minus_qty : 0),
                     positive_qc_qty: !noValue ? positiveQty : (orgPos ? orgPos.positive_qc_qty : 0),
                     negative_qc_qty: !noValue ? negativeQty : (orgPos ? orgPos.negative_qc_qty : 0),
-                    ex_stage_qty1: orgPos ? orgPos.ex_stage_qty1 : 0,
+                    ex_stage_qty1: orgPos ? orgPos.ex_stage_qty1 || 0 : 0,
                 });
             }
             await this.ctx.service.stageBills.calc(this.ctx.tender.id, this.ctx.stage.id, pos.lid, transaction);

+ 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;

+ 1 - 1
app/view/dashboard/workspace.ejs

@@ -753,7 +753,7 @@
                                         break;
                                     case 'revise':
                                         html.push(`<li class="list-group-item">
-                                            <span class="${acRevise.auditStringClass[n.status]}">${acRevise.auditString[n.status]}</span> <a href="/tender/${n.id}/revise/${n.rid}/info" target="_blank">${n.name}</a> 台账修订 第${n.corder}次<span class="float-right">${moment(new Date(n.shenpi_time)).format('HH:mm:ss')}</span></li>`);
+                                            <span class="${acRevise.auditStringClass[n.status]}">${acRevise.auditString[n.status]}</span> <a href="/tender/${n.id}/revise${ n.status === acRevise.status.checked || n.status === acRevise.status.checkNo ? '/history' : ''}/${n.rid}/info" target="_blank">${n.name}</a> 台账修订 第${n.corder}次<span class="float-right">${moment(new Date(n.shenpi_time)).format('HH:mm:ss')}</span></li>`);
                                         break;
                                     case 'change':
                                         html.push(`<li class="list-group-item">

+ 1 - 1
app/view/login/login.ejs

@@ -67,7 +67,7 @@
                 <div class="form-group <% if (projectData) { %>mb-5<% } else { %>mb-4<% } %>">
                     <div class="form-check d-flex justify-content-start pl-0">
                         <label class="form-check-label" for="exampleCheck1"><a href="#fg-password" data-toggle="modal" data-target="#fg-password">忘记密码?</a></label>
-                        <% if (projectData) { %><label class="form-check-label ml-auto" for="exampleCheck1"><a href="/">切换项目</a></label><% } %>
+                        <% if (projectData) { %><label class="form-check-label ml-auto" for="exampleCheck1"><a href="/">切换系统</a></label><% } %>
                     </div>
                 </div>
                 <button type="submit" class="btn btn-primary btn-block">登&nbsp;&nbsp;录</button>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 2108
sql/update.sql


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2124 - 0
sql/update20250404.sql