Selaa lähdekoodia

feat: 选择工料机库可以跨编办

zhangweicheng 2 vuotta sitten
vanhempi
commit
3471fa009d

+ 30 - 0
modules/common/std/std_glj_lib_map_model.js

@@ -51,6 +51,36 @@ class STDGLJLibMapModel extends BaseModel {
         return result;
     }
 
+      /**
+     * 获取对应的工料机库
+     *
+     * @param {String} compilationId
+     * @return {Promise}
+     */
+       async getAllGLJLibList() {
+        let result = [];
+        let gliLib = await this.findDataByCondition({deleted: false}, null, false);
+
+        if (gliLib.length <= 0) {
+            return result;
+        }
+
+        // 整理数据
+        let gljList = [];
+        for(let tmp of gliLib) {
+            let tmpRation = {id: tmp.ID, name: tmp.dispName};
+            if (gljList.length <= 0) {
+                gljList = [tmpRation];
+            } else {
+                gljList.push(tmpRation);
+            }
+        }
+
+        result = gljList;
+        return result;
+    }
+
+
 }
 
 export default STDGLJLibMapModel;

+ 1 - 1
modules/users/controllers/compilation_controller.js

@@ -216,7 +216,7 @@ class CompilationController extends BaseController {
 
             // 获取工料机库
             let stdGLJLibMapModel = new STDGLJLibMapModel();
-            gljList = await stdGLJLibMapModel.getGLJLibList(selectedCompilation._id);
+            gljList = await stdGLJLibMapModel.getAllGLJLibList();
 
             // 获取费率标准库
             let stdFeeRateLibsModel = new STDFeeRateLibsModel();