zhongzewei %!s(int64=7) %!d(string=hai) anos
pai
achega
f725b1d9e2

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

@@ -280,7 +280,7 @@ module.exports = {
                 proj.unitPriceFiles = [];
                 proj.feeRateFiles = [];
             }
-            callback(request, response, null, 'success', rst);
+            callback(request, response, 0, 'success', rst);
         }
         catch (error){
             callback(request, response, true, error, null);

+ 1 - 1
modules/pm/models/project_model.js

@@ -456,7 +456,7 @@ ProjectsDAO.prototype.recGC = async function(userID, datas, callback){
     }
     async_c.parallel(functions, function (err, results) {
         if(err) callback(err, 'fail', null);
-        else callback(false, 'success', null);
+        else callback(0, 'success', null);
     });
 };
 

+ 7 - 25
web/building_saas/pm/js/pm_gc.js

@@ -551,37 +551,19 @@ function e_recProj(btn){
 }
 
 function a_getGC(callback){
-    $.ajax({
-        type: 'post',
-        url: '/pm/api/getGCDatas',
-        data: {data: JSON.stringify({user_id: userID})},
-        dataType: 'json',
-        timeout: 5000,
-        success: function (result) {
-            if(!result.error){
-                if(callback){
-                    callback(result.data);
-                }
-            }
+    CommonAjax.post('/pm/api/getGCDatas', {user_id: userID}, function (rstData) {
+        if(callback){
+            callback(rstData);
         }
     });
 }
 
 function a_rec(nodes, callback){
-    $.ajax({
-        type: 'post',
-        url: '/pm/api/recGC',
-        data: {data: JSON.stringify({user_id: userID, nodes: nodes})},
-        dataType: 'json',
-        timeout: 5000,
-        success: function (result) {
-            if(!result.error){
-                if(callback){
-                    callback();
-                }
-            }
+    CommonAjax.post('/pm/api/recGC', {user_id: userID, nodes: nodes}, function (rstData) {
+        if(callback){
+            callback();
         }
-    })
+    });
 }
 
 //去除重名,回收站不处理重名,只保证恢复到项目管理中不出现重名