Browse Source

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

chenshilong 5 năm trước cách đây
mục cha
commit
bc92a30307

+ 13 - 12
config/config.js

@@ -103,18 +103,19 @@ module.exports = {
   qa_sc: {
     title: "纵横公路云造价",
     startPort: 3060,
-    server: "192.168.1.90",
-    port: "60666",
-    dbname: 'smartcost',
-    options: {
-      user: 'smartcost',
-      pass: 'smartcost3850888',
-      auth: {
-        "authdb": "admin"
-      },
-      connectTimeoutMS: 60000,
-      useMongoClient: true
-    },
+    dbURL:"mongodb://smartcost:smartcost3850888@192.168.1.90:60666,192.168.1.90:60667/smartcost?authSource=admin;replicaSet=sc",
+    // server: "192.168.1.90",
+    // port: "60666",
+    // dbname: 'smartcost',
+    // options: {
+    //   user: 'smartcost',
+    //   pass: 'smartcost3850888',
+    //   auth: {
+    //     "authdb": "admin"
+    //   },
+    //   connectTimeoutMS: 60000,
+    //   useMongoClient: true
+    // },
     importURL: "192.168.1.90:3050",
     importPort: 3050,
     socketPort: 2200

+ 1 - 1
modules/main/middleware/index.js

@@ -54,7 +54,7 @@ function isAjax(req) {
 // 登录状态全局判断
 async function stateChecking(req, res, next) {
     const url = req.originalUrl;
-    if (url == "\/" || /^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url) || /^\/captcha/.test(url)) {
+    if (url == "\/" || /^\/login/.test(url) || /\.map|\.ico$/.test(url) || /^\/sms/.test(url) || /^\/cld\/[^getCategoryStaff]/.test(url) || /^\/captcha/.test(url)) {
         // 如果是登录页面或短信接口或cld接口则忽略判断数据
         next();
     } else {

+ 1 - 0
modules/pm/controllers/pm_controller.js

@@ -772,6 +772,7 @@ module.exports = {
                             } else if (projC.projType === projType.tender) {
                                 // 设置项目类别
                                 projC.valuationType = projC.property.valuationType === 'bill' ? '预算' : '工程量清单';
+                                projC._valuationType = projC.property.valuationType;
                                 //设置工程专业
                                 projC.feeStandardName = projC.property.feeStandardName || '';
                             }

+ 2 - 2
web/building_saas/main/js/views/main_tree_col.js

@@ -361,8 +361,8 @@ let MainTreeCol = {
       },
       lockUnitPrice: function (node) {
         //仅未使用基数计算的清单有效
-        if(!(node.data.calcBase&&node.data.calcBase!="")) return sheetCommonObj.getCheckBox();
-    },
+        if(node.sourceType == ModuleNames.bills&& !(node.data.calcBase&&node.data.calcBase!="")) return sheetCommonObj.getCheckBox();
+       },
         evaluationProject:function (node) {
             if(node.sourceType == ModuleNames.ration) return new GC.Spread.Sheets.CellTypes.CheckBox();
         },

+ 1 - 0
web/building_saas/main/js/views/project_view.js

@@ -3431,6 +3431,7 @@ $('#calcBaseFeeRateConf').click(function () {
     if(calcBaseValue !== selected.data.calcBase){
         needToSave = true;
         selected.data.userCalcBase = calcBaseValue;
+        selected.updateData.lockUnitPrice = null;
         projectObj.project.calcBase.calculate(selected);
     }
     if(validateFeeRate){

+ 1 - 4
web/building_saas/report/js/rpt_print.js

@@ -75,8 +75,6 @@ let rptPrintHelper = {
                 if (pixelSize[0] > pixelSize[1]) {
                     //引用了padding,这里要处理下了
                 }
-                // console.log('actAreaOffsetX: ' + actAreaOffsetX);
-                // console.log('actAreaOffsetY: ' + actAreaOffsetY);
             }
             let svgPageArr = [];
             // console.log(pixelSize);
@@ -137,8 +135,7 @@ function buildCellSvg(cell, fonts, styles, controls, pageMergeBorder, rptMergeBo
     if (isHtoV) {
         // HtoVStr = ` transform="translate(`+ (actArea.Bottom - actArea.Top + 5) + `,` + (actArea.Left - actArea.Top ) + `) rotate(90)"`;
         //引用了padding后,top坐标不用考虑offset了
-        HtoVStr = ` transform="translate(${(actArea.Bottom - actArea.Top)},0) rotate(90)"`;
-        //console.log(actArea);
+        HtoVStr = ` transform="translate(${(actArea.Bottom - actArea.Top + 2)},0) rotate(90)"`;
     }
     if (style) {
         let leftBS = getActualBorderStyle(cell, styles, mergeBandStyle, (pageMergeBorder)?pageMergeBorder:rptMergeBorder[JV.PROP_AREA], JV.PROP_LEFT);

+ 6 - 6
web/building_saas/standard_interface/config.js

@@ -27,9 +27,9 @@ const INTERFACE_CONFIG = (() => {
     '安徽@淮北': {
       scriptName: 'anhui_maanshan.js',
       fileSuffix: {
-        [BID_INVITATION]: '.HBGLZB',
-        [BID_SUBMISSION]: '.HBGLTB',
-        [CONTROL]: '.HBGLKZJ',
+        [BID_INVITATION]: '.AHHBGLZB',
+        [BID_SUBMISSION]: '.AHHBGLTB',
+        [CONTROL]: '.AHHBGLKZJ',
       },
     },
     '安徽@铜陵': {
@@ -51,9 +51,9 @@ const INTERFACE_CONFIG = (() => {
     '安徽@黄山': {
       scriptName: 'anhui_maanshan.js',
       fileSuffix: {
-        [BID_INVITATION]: '.HSGLZB',
-        [BID_SUBMISSION]: '.HSGLTB',
-        [CONTROL]: '.HSGLKZJ',
+        [BID_INVITATION]: '.GLZ',
+        [BID_SUBMISSION]: '.GLT',
+        [CONTROL]: '.GLX',
       },
     },
     '安徽@宣城': {

+ 25 - 11
web/building_saas/standard_interface/export/anhui_maanshan.js

@@ -317,8 +317,14 @@ INTERFACE_EXPORT = (() => {
     // 清单标题 造价书的第一层数据。
     function QdBt(node, allNodes) {
       const row = node.row();
-      const fee = isBidInvitation ? '0' : getFee(node.data.fees, 'common.tenderTotalFee')
-      const calcBase = node.data.calcBase ? cbParser.toFExpr(node.data.calcBase, allNodes) : '';
+      const orgFee = getFee(node.data.fees, 'common.tenderTotalFee');
+      const fee = isBidInvitation ? '0' : orgFee;
+      const titleType = BillsTitleType[node.getFlag()];
+      const calcBase = titleType === '5'
+        ? orgFee
+        : node.data.calcBase
+          ? cbParser.toFExpr(node.data.calcBase, allNodes)
+          : '';
       const attrs = [
         { name: 'Xh', value: row, type: TYPE.INT }, // 序号
         { name: 'Bm', value: node.data.code }, // 编码
@@ -326,15 +332,23 @@ INTERFACE_EXPORT = (() => {
         { name: 'Je', value: fee, type: TYPE.DECIMAL }, // 金额
         { name: 'Code', value: `F${row}` }, // 行引用
         { name: 'Jsgs', value: calcBase }, // 计算基数
-        { name: 'Lb', value: BillsTitleType[node.getFlag()], type: TYPE.INT }, // 类别
+        { name: 'Lb', value: titleType, type: TYPE.INT }, // 类别
         { name: 'Bz', value: node.data.remark }, // 备注
       ];
       Element.call(this, 'QdBt', attrs);
     }
 
     // 清单明细 (只有100-700章清单标题输出)
-    function QdMx(node) {
+    function QdMx(node, allNodes) {
       const row = node.row();
+      const iszg = node.data.specialProvisional === '专业工程';
+      const calcBaseBeFee = iszg || node.getFlag() === fixedFlag.PROVISIONAL;
+      const orgFee = getFee(node.data.fees, 'common.tenderTotalFee');
+      const calcBase = calcBaseBeFee
+        ? orgFee
+        : node.data.calcBase
+          ? cbParser.toFExpr(node.data.calcBase, allNodes)
+          : '';
       const attrs = [
         { name: 'Xh', value: row, type: TYPE.INT }, // 序号
         { name: 'Qdbm', value: node.data.code, minLen: 1 }, // 编码
@@ -352,11 +366,11 @@ INTERFACE_EXPORT = (() => {
         { name: 'Lr', value: isBidInvitation ? '0' : getFee(node.data.fees, 'profit.tenderTotalFee'), type: TYPE.DECIMAL }, // 利润
         { name: 'Sj', value: isBidInvitation ? '0' : getFee(node.data.fees, 'tax.tenderTotalFee'), type: TYPE.DECIMAL }, // 税金
         { name: 'Zhdj', value: isBidInvitation ? '0' : getFee(node.data.fees, 'common.tenderUnitFee'), type: TYPE.DECIMAL }, // 单价
-        { name: 'Zhhj', value: isBidInvitation ? '0' : getFee(node.data.fees, 'common.tenderTotalFee'), type: TYPE.DECIMAL }, // 合价
+        { name: 'Zhhj', value: isBidInvitation ? '0' : orgFee, type: TYPE.DECIMAL }, // 合价
         { name: 'Zgj', value: isBidInvitation ? '0' : getFee(node.data.fees, 'estimate.tenderTotalFee'), type: TYPE.DECIMAL }, // 暂估价
-        { name: 'Iszg', value: node.data.specialProvisional === '专业工程', type: TYPE.BOOL }, // 是否暂定 如果专项暂定列选择了“专业工程”,则输出true,否则是false。
+        { name: 'Iszg', value: iszg, type: TYPE.BOOL }, // 是否暂定 如果专项暂定列选择了“专业工程”,则输出true,否则是false。
         { name: 'Djfx', value: !!node.data.unitPriceAnalysis, type: TYPE.BOOL }, // 单价分析
-        { name: 'Jsgs', value: node.data.calcBase }, // 计算基数
+        { name: 'Jsgs', value: calcBase }, // 计算基数
         { name: 'Bl', value: '' }, // 变量
         { name: 'Bz', value: node.data.remark }, // 备注
       ];
@@ -655,24 +669,24 @@ INTERFACE_EXPORT = (() => {
         const flag = node.getFlag();
         const qdbt = new QdBt(node, mainTree.items);
         if (flag === fixedFlag.ONE_SEVEN_BILLS) { // 100章到700章清单需要输出详细数据
-          qdbt.children.push(...setupSubBills(node.children));
+          qdbt.children.push(...setupSubBills(node.children, mainTree.items));
         } else if (flag === fixedFlag.DAYWORK_LABOR) {
           qdbt.children.push(setupDaywork(node.children));
         }
         qdxm.children.push(qdbt);
       });
 
-      function setupSubBills(nodes) {
+      function setupSubBills(nodes, allNodes) {
         const rst = [];
         nodes.forEach(node => {
-          const qdmx = new QdMx(node);
+          const qdmx = new QdMx(node, allNodes);
           rst.push(qdmx);
           const subIsRations = node.children.length && !node.source.children.length;
           if (subIsRations) {
             qdmx.children.push(...setupRations(node.children));
             qdmx.children.push(...setupBillsContain(node.data));
           } else {
-            qdmx.children.push(...setupSubBills(node.children));
+            qdmx.children.push(...setupSubBills(node.children, allNodes));
           }
         });
         return rst;

+ 27 - 1
web/building_saas/standard_interface/export/guangdong_zhongshan.js

@@ -116,6 +116,28 @@ INTERFACE_EXPORT = (() => {
     "清单 第900章 附属区房建工程":true
   }
 
+  const ListCodeMap = {
+    "第100章至900章清单":"1",
+    "清单 第100章 总则": "一",
+    "清单 第200章 路基": "二",
+    "清单 第300章 路面": "三",
+    "清单 第400章 桥梁、涵洞工程": "四",
+    "清单 第500章 隧道": "五",
+    "清单 第600章 交通安全设施": "六",
+    "清单 第700章 绿化及环境保护设施": "七",
+    "清单 第800章 机电工程": "八",
+    "清单 第900章 附属区房建工程": "九",
+    "已包含在清单合计中的材料、工程设备、专业工程暂估价合计": "10",
+    "清单合计减去材料、工程设备、专业工程暂估价合计": "11",
+    "计日工合计": "12",
+    "劳务": "12.1",
+    "材料": "12.2",
+    "机械": "12.3",
+    "暂列金额(不含计日工总额)": "13",
+    "投标报价": "14"
+  } 
+
+
   const ratioCodeMap = { 
     "01ZJF":"0",
     "02JXF":"1",
@@ -1051,9 +1073,13 @@ INTERFACE_EXPORT = (() => {
           }
           let fail = billNameChecking(bNode,tenderProject.projectInfo.name,fixedFlag)
           //fail: { hint: '错误提示', type: '提示所属(基本就是单位工程名称)' }
+          let ListCode = "";
+          if (ListCodeMap[data.name]) ListCode = ListCodeMap[data.name];
+          if (data.code && data.code != "") ListCode = data.code;
+
           const attrs = [{
               name: "ListCode",
-              value: data.code,
+              value: ListCode,
             },
             {
               name: "ListName",

+ 7 - 3
web/building_saas/standard_interface/import/anhui_maanshan.js

@@ -180,14 +180,18 @@ INTERFACE_IMPORT = (() => {
         if (curField === qdbt) {
           item.code = getValue(src, ['_Bm']);
           item.rowCode = getValue(src, ['_Code']); // 注意:行号标记,用于后续(通用处理)清单基数进行转换(行引用转换为ID引用) 
-          item.calcBase = getValue(src, ['_Jsgs']);
+          if (getValue(src, ['_Lb']) === '5') { // 暂列金额才导入计算基数
+            item.calcBase = getValue(src, ['_Jsgs']);
+          }
         } else if (curField === qdmx) {
           item.code = getValue(src, ['_Qdbm']);
           item.unit = getValue(src, ['_Dw']);
           item.quantity = getValue(src, ['_Sl']);
-          item.calcBase = getValue(src, ['_Jsgs']);
-          item.specialProvisional = getBool(src, ['_Iszg']) ? '专业工程' : ''; // 是否暂定
           item.unitPriceAnalysis = +getBool(src, ['_Djfx']); // 单价分析
+          item.specialProvisional = getBool(src, ['_Iszg']) ? '专业工程' : ''; // 是否暂定
+          if (item.specialProvisional) {
+            item.calcBase = getValue(src, ['_Jsgs']);
+          }
         }
         return item;
       });

+ 2 - 1
web/building_saas/standard_interface/import/base.js

@@ -307,7 +307,8 @@ const INTERFACE_EXPORT_BASE = (() => {
           preChild.NextSiblingID = child.ID;
         }
         if (child.rowCode) {
-          rowCodeData.push({ reg: new RegExp(`\\b${child.rowCode}\\b`, 'g'), ID: child.ID });
+          const regStr = /{[^{}]+}/.test(child.rowCode) ? child.rowCode : `\\b${child.rowCode}\\b`;
+          rowCodeData.push({ reg: new RegExp(regStr, 'g'), ID: child.ID });
         }
         if (child.calcBase) {
           toBeTransformBills.push(child);

+ 5 - 1
web/common/html/header.html

@@ -68,7 +68,11 @@
                     <!--<a class="dropdown-item" href="/web/common/html/pdfViewer.html?type=userGuide" target="_blank">用户手册</a>
                     <a class="dropdown-item" href="/web/common/html/pdfViewer.html?type=upgradeGuide" target="_blank">升级说明</a>-->
                     <a class="dropdown-item" href="http://doc.zhzdwd.com/docs/yh_yhsc/yh_yhsc-1bup3dm7iacsg" target="_blank">用户手册</a>
-                    <a class="dropdown-item" href="http://doc.zhzdwd.com/docs/yanghuUpdate" target="_blank">升级说明</a>
+                    <% if (compilationName === '公路造价(2018)') { %>
+                        <a class="dropdown-item" href="http://doc.zhzdwd.com/docs/glyun/glyun-1cfge2jui6nh9" target="_blank">升级说明</a>
+                    <% } else { %>
+                        <a class="dropdown-item" href="http://doc.zhzdwd.com/docs/yanghuUpdate" target="_blank">升级说明</a>
+                    <% } %>
                     <a class="dropdown-item" href="https://smartcost.com.cn/" target="_blank">纵横官网</a>
                     <!--  <a class="dropdown-item" href="#">动画教程</a>-->
                     <% if (compilationName === '公路造价(2018)') { %>