zhangweicheng 7 anni fa
parent
commit
a416108664
1 ha cambiato i file con 2 aggiunte e 19 eliminazioni
  1. 2 19
      web/building_saas/main/js/models/project_glj.js

+ 2 - 19
web/building_saas/main/js/models/project_glj.js

@@ -64,25 +64,8 @@ ProjectGLJ.prototype.loadToCache = function (data) {
  * @param {String} code
  * @return {Object}
  */
-ProjectGLJ.prototype.getDataByCode = function (code) {
-    let result = {};
-    if (this.datas === null) {
-        return result;
-    }
-
-    let gljList = this.datas.gljList;
-    if (gljList === undefined) {
-        return result;
-    }
-
-    for (let tmp of gljList) {
-        if (tmp.code === code) {
-            result = tmp;
-            break;
-        }
-    }
-
-    return result;
+ProjectGLJ.prototype.getDataByID = function (ID) {//根据项目工料机ID取工料机信息
+   return _.find(this.datas.gljList, {'id': ID});
 };
 
 /**