Browse Source

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

vian 5 years atrás
parent
commit
233d34d269

+ 11 - 8
modules/users/models/log_model.js

@@ -59,10 +59,10 @@ class LogModel extends BaseModel {
      * @return {Promise}
      */
     async addLoginLog(userId, request) {
-        let ip = request.connection.remoteAddress;
-        ip = ip?ip.split(':'):[];
-        ip = ip[3] === undefined ? '' : ip[3];
-
+        //let ip = request.connection.remoteAddress;
+        // ip = ip?ip.split(':'):[];
+        // ip = ip[3] === undefined ? '' : ip[3];
+        let ip = request.headers["x-real-ip"]? request.headers["x-real-ip"]:"";
         // let ipInfo = '127.0.0.1';//await this.getIpInfoFromApi(ip);
         let ipInfo = await this.getIpInfoFromApi(ip);
 
@@ -119,15 +119,18 @@ class LogModel extends BaseModel {
         if (ip === '127.0.0.1') {
             return '服务器本机访问';
         }
-        let getData = {
-            url: 'http://ip.taobao.com/service/getIpInfo.php?ip=' + ip,
+        let option = {
+            url: 'https://api01.aliyun.venuscn.com/ip?ip=' + ip,
             encoding: 'utf8',
-            timeout:2000
+            timeout:2000,
+            headers: {
+                Authorization: 'APPCODE ' + '85c64bffe70445c4af9df7ae31c7bfcc',
+            }
         };
         return new Promise(function (resolve, reject) {
             try {
                 // 请求接口
-                Request.get(getData, function (err, getResponse, body) {
+                Request(option, function (err, getResponse, body) {
                     if (err) {
                         //throw '请求错误';
                         resolve("请求错误");

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

@@ -327,9 +327,9 @@ projectGljObject={
             if(rg.projectGLJID == projectGLJData.id) rationIDMap[rg.rationID] = true;
          } 
          for(let r of projectObj.project.Ration.datas){
-            if(rationIDMap[r.ID] || (r.subType == rationType.gljRation && r.projectGLJID== projectGLJData.id)){
+            if(rationIDMap[r.ID] || (r.type == rationType.gljRation && r.projectGLJID== projectGLJData.id)){
               rations.push(r);
-            }
+            } 
          } 
       }
       this.relatedRationSheetData = rations;

+ 87 - 1
web/over_write/hunan_2020.js

@@ -1,3 +1,81 @@
+/**
+ * Created by CSL on 2020/07/13.  湖南计算程序、基数 等覆盖。
+ */
+
+let isHN2020 = true;
+
+// 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
+function overwriteRationCalcBases (taxType){
+    if (typeof rationCalcBases == 'undefined') return;
+    for (let key in rationCalcBases) delete rationCalcBases[key];
+    // let isJY = taxType == '2';
+
+    rationCalcBases['人工费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
+    };
+    rationCalcBases['材料费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
+    };
+    rationCalcBases['施工机械使用费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
+    };
+    rationCalcBases['施工机械人工费'] = function (node, isTender) {
+        return calcTools.machineDetailFee(node, node.data.gljList, [], gljType.MACHINE_LABOUR, isTender);
+    };
+    rationCalcBases['设备购置费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptMarketPrice, isTender);
+    };
+    rationCalcBases['定额人工费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额材料费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额施工机械使用费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额商品砼费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.COMMERCIAL_CONCRETE, gljType.COMMERCIAL_MORTAR], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额设备费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.EQUIPMENT], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额外购砼构件费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.PURCHASE_COMPONENT], priceTypes.ptBasePrice, isTender);
+    };
+    rationCalcBases['定额绿化苗木费'] = function (node, isTender) {
+        return calcTools.rationBaseFee(node, [gljType.GREEN_SEEDLING], priceTypes.ptBasePrice, isTender);
+    }
+};
+
+(function overwriteFeeTypes() {
+    if (typeof cpFeeTypes == 'undefined') return;
+    cpFeeTypes = [
+        {type: 'marketLabour', name: '人工费'},
+        {type: 'marketMaterial', name: '材料费'},
+        {type: 'marketMachine', name: '施工机械使用费'},
+        {type: 'marketMachineLabour', name: '施工机械人工费'},
+        {type: 'marketEquipment', name: '设备购置费'},
+        {type: 'marketDirect', name: '直接费'},
+
+        {type: 'labour', name: '定额人工费'},
+        {type: 'material', name: '定额材料费'},
+        {type: 'machine', name: '定额施工机械使用费'},
+        {type: 'equipment', name: '定额设备费'},
+        {type: 'direct', name: '定额直接费'},
+
+        {type: 'measure', name: '措施费'},
+        {type: 'measure1', name: '措施费I'},
+        {type: 'measure2', name: '措施费II'},
+        {type: 'manage', name: '企业管理费'},
+        {type: 'forceFee', name: '规费'},
+        {type: 'profit', name: '利润'},
+        {type: 'tax', name: '税金'},
+        {type: 'common', name: '建安费'},
+        {type: 'rationCommon', name: '定额建安费'}
+    ];
+})();
+
 // 清单基数
 const progression = ['施工场地建设费', '养护单位项目管理费', '养护单位项目管理费(未单独设置项目部)', '工程监理费', '工程监理费(未实行社会监理)', '设计文件审查费', '工程设计费'];
 const deficiency = {};
@@ -311,10 +389,18 @@ if (typeof baseFigureTemplate !== 'undefined') {
     };
 }
 
+if (typeof projectObj !== 'undefined') {
+  projectObj.isInsertEquipmentVisable = function (selected) {
+      return true;   //湖南不管是预算或者工程量清单,都显示   
+  }
+}
+
 // CommonJS module
 if (typeof module !== 'undefined' && !module.nodeType) { // 防止module是前端的一个html标签
     module.exports = {
         progression,
         deficiency
     };
-}
+}
+
+