zhangweicheng 7 年之前
父节点
当前提交
a416108664
共有 1 个文件被更改,包括 2 次插入19 次删除
  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});
 };
 
 /**