Преглед на файлове

IP信息超时设置,取消删除时安装增加费计算

zhangweicheng преди 6 години
родител
ревизия
6ede3b514f
променени са 2 файла, в които са добавени 8 реда и са изтрити 6 реда
  1. 4 3
      modules/users/models/log_model.js
  2. 4 3
      web/building_saas/main/js/models/bills.js

+ 4 - 3
modules/users/models/log_model.js

@@ -64,7 +64,7 @@ class LogModel extends BaseModel {
         ip = ip[3] === undefined ? '' : ip[3];
 
         // let ipInfo = '127.0.0.1';//await this.getIpInfoFromApi(ip);
-       // let ipInfo = await this.getIpInfoFromApi(ip);
+        let ipInfo = await this.getIpInfoFromApi(ip);
 
         let userAgentObject = new UAParser(request.headers['user-agent']);
         let osInfo = userAgentObject.getOS();
@@ -74,7 +74,7 @@ class LogModel extends BaseModel {
             os: osInfo.name + ' ' + osInfo.version + ' ' + cpuInfo.architecture,
             browser: browserInfo.name + ' ' + browserInfo.version,
             ip: ip,
-            ip_info: ""//ipInfo
+            ip_info: ipInfo
         };
 
         return this.addLog(userId, LogType.LOGIN_LOG, message);
@@ -121,7 +121,8 @@ class LogModel extends BaseModel {
         }
         let getData = {
             url: 'http://ip.taobao.com/service/getIpInfo.php?ip=' + ip,
-            encoding: 'utf8'
+            encoding: 'utf8',
+            timeout:2000
         };
         return new Promise(function (resolve, reject) {
             try {

+ 4 - 3
web/building_saas/main/js/models/bills.js

@@ -801,14 +801,15 @@ var Bills = {
                 me.tree.m_delete(idTreeNodes);
                 $.bootstrapLoading.end();
                 //重新计算
-                project.installation_fee.calcInstallationFee(function (isChange) {
+            /*    project.installation_fee.calcInstallationFee(function (isChange) { 养护没有安装增加费,同时计算安装增加费的clone 那里性能很低
                     project.calcProgram.calcAllNodesAndSave();
                     if(!isChange) {
                         project.projectGLJ.loadData();
                     }
                     gljOprObj.refreshView();
-                });
-
+                });*/
+                project.calcProgram.calcNodesAndSave(parentNodes);
+                gljOprObj.refreshView();
                 if (isDeleteChild){
                     calcTools.forceSelect(parentNode);
                 }