浏览代码

update all models

zhongzewei 7 年之前
父节点
当前提交
37b6368f1e
共有 55 个文件被更改,包括 650 次插入758 次删除
  1. 33 0
      modules/all_models/compleGlj_glj.js
  2. 61 0
      modules/all_models/compleRation_ration.js
  3. 25 0
      modules/all_models/compleRation_section.js
  4. 16 0
      modules/all_models/options.js
  5. 8 12
      modules/pm/models/project_schema.js
  6. 26 0
      modules/all_models/stdBills_bills.js
  7. 17 0
      modules/all_models/stdBills_itemCharacter.js
  8. 17 0
      modules/all_models/stdBills_jobContent.js
  9. 22 0
      modules/all_models/stdBills_lib.js
  10. 25 0
      modules/all_models/stdRation_coe.js
  11. 18 0
      modules/all_models/stdRation_installFeeItem.js
  12. 29 0
      modules/all_models/stdRation_installSection.js
  13. 16 0
      modules/all_models/stdRation_lib.js
  14. 49 0
      modules/all_models/stdRation_ration.js
  15. 20 0
      modules/all_models/stdRation_section.js
  16. 33 0
      modules/all_models/std_glj.js
  17. 16 0
      modules/all_models/std_gljClass.js
  18. 7 10
      modules/pm/models/templates/schemas/bills_template.js
  19. 14 0
      modules/all_schemas/opr_schema.js
  20. 5 5
      modules/bills_lib/models/bills_lib_interfaces.js
  21. 0 34
      modules/bills_lib/models/bills_lib_model.js
  22. 0 84
      modules/bills_lib/models/bills_lib_schemas.js
  23. 1 30
      modules/complementary_glj_lib/controllers/gljController.js
  24. 4 60
      modules/complementary_glj_lib/models/gljModel.js
  25. 0 73
      modules/complementary_glj_lib/models/schemas.js
  26. 7 3
      modules/complementary_ration_lib/models/compleRationModel.js
  27. 0 118
      modules/complementary_ration_lib/models/schemas.js
  28. 5 4
      modules/complementary_ration_lib/models/searchModel.js
  29. 2 2
      modules/complementary_ration_lib/models/sectionTreeModel.js
  30. 1 1
      modules/fee_rates/facade/fee_rates_facade.js
  31. 2 2
      modules/main/facade/bill_facade.js
  32. 2 1
      modules/main/facade/decimal_facade.js
  33. 3 1
      modules/main/facade/installation_facade.js
  34. 1 1
      modules/main/facade/project_facade.js
  35. 1 1
      modules/main/models/bills.js
  36. 1 2
      modules/options/models/optionsModel.js
  37. 0 27
      modules/options/models/schemas.js
  38. 2 1
      modules/pm/controllers/pm_controller.js
  39. 1 1
      modules/pm/models/project_model.js
  40. 2 1
      modules/pm/models/templates/bills_template_model.js
  41. 3 1
      modules/ration_glj/facade/ration_glj_facade.js
  42. 2 21
      modules/ration_repository/models/coe.js
  43. 1 27
      modules/ration_repository/models/glj_repository.js
  44. 2 47
      modules/ration_repository/models/ration_item.js
  45. 1 17
      modules/ration_repository/models/ration_section_tree.js
  46. 1 15
      modules/ration_repository/models/repository_map.js
  47. 85 85
      web/building_saas/css/main.css
  48. 2 2
      web/building_saas/js/global.js
  49. 1 1
      web/building_saas/main/js/views/project_property_basicInfo.js
  50. 60 68
      web/building_saas/pm/html/project-management.html
  51. 二进制
      web/dest/css/img/engineering.png
  52. 二进制
      web/dest/css/img/folder_close.png
  53. 二进制
      web/dest/css/img/folder_open.png
  54. 二进制
      web/dest/css/img/project.png
  55. 二进制
      web/dest/css/img/tender.png

+ 33 - 0
modules/all_models/compleGlj_glj.js

@@ -0,0 +1,33 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*补充工料机*/
+//补充工料机的组成物可能来自标准工料机和补充工料机
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const comple_gljComponent = new Schema(
+    {
+        isStd: Boolean, //组成物里的工料机是否是标准的,否则是补充的
+        ID: Number,
+        consumeAmt: String
+    },
+    {_id: false},
+    {versionKey: false}
+);
+//补充工料机跟用户和编办绑定
+const comple_glj = new Schema({
+    userId: Number,
+    compilationId: String,
+    ID: Number,
+    code: String,
+    name: String,
+    specs: String,
+    unit: String,
+    basePrice: String,
+    gljClass: Number,
+    gljType: Number,
+    shortName: String,
+    component: [comple_gljComponent]
+}, {versionKey: false});
+
+mongoose.model('complementary_glj_lib', comple_glj);

+ 61 - 0
modules/all_models/compleRation_ration.js

@@ -0,0 +1,61 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*补充定额库-定额*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const deleteSchema = require('../all_schemas/delete_schema');
+
+//定额工料机
+const compleRationGljItemSchema = new Schema({
+    gljId: Number,
+    consumeAmt: String,
+    type: String    //std or complementary
+
+}, { _id: false });
+
+//辅助定额调整
+const compleRationAssItemSchema = new Schema({
+    name: String,
+    assistID: Number,
+    assistCode: String,
+    stdValue: String,
+    stepValue: String,
+    decimal: Number,
+    carryBit: String,
+    minValue: String,
+    maxValue: String
+}, { _id: false });
+
+//定额安装增加费用
+const rationInstSchema = new Schema({
+    feeItemId: String,
+    sectionId: String
+},{_id: false});
+
+//补充定额
+const compleRationSchema = new Schema({
+    userId: Number,
+    compilationId: String,
+    rationRepId: Number,
+    ID:Number,
+    code: String,
+    name: String,
+    unit: String,
+    labourPrice: String,
+    materialPrice: String,
+    machinePrice: String,
+    basePrice: String,
+    sectionId: Number,
+    caption: String,
+    feeType: Number,
+    jobContent: String,
+    annotation: String,
+    rationGljList: [compleRationGljItemSchema],
+    rationCoeList: Array,
+    rationAssList: [compleRationAssItemSchema],
+    rationInstList: [rationInstSchema],
+    deleteInfo: deleteSchema
+}, {versionKey: false});
+
+mongoose.model('complementary_ration_items', compleRationSchema);

+ 25 - 0
modules/all_models/compleRation_section.js

@@ -0,0 +1,25 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*补充定额库-章节树*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//补充定额章节树
+const compleRationSectionTreeSchema = new Schema({
+    //用户名
+    userId: Number,
+    //编办
+    compilationId: String,
+    //标准定额库
+    rationRepId: Number,
+    //名称
+    name: String,
+    //是否是同层第一个节点
+    isFirst: Boolean,
+    ID: Number,
+    NextSiblingID: Number,
+    ParentID: Number,
+    deleteInfo: deleteSchema
+}, {versionKey: false});
+
+mongoose.model('complementary_ration_section_tree', compleRationSectionTreeSchema);

+ 16 - 0
modules/all_models/options.js

@@ -0,0 +1,16 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*选项*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const optionSchema = new Schema({
+    user_id: String,
+    compilation_id: String,
+    options: {
+        type: Schema.Types.Mixed,
+        default: {}
+    }
+}, {versionKey: false});
+
+mongoose.model('options', optionSchema);

+ 8 - 12
modules/pm/models/project_schema.js

@@ -1,14 +1,13 @@
 /**
- * Created by Mai on 2017/7/5.
+ * Created by Zhong on 2018/3/22.
  */
+/*项目*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const deleteSchema = require('../all_schemas/delete_schema');
 
-let mongoose = require("mongoose");
-let Schema = mongoose.Schema;
-let deleteSchema = require('../../../public/models/delete_schema');
-
-let collectionName = 'projects';
-
-let ProjectSchema = new Schema({
+const collectionName = 'projects';
+const ProjectSchema = new Schema({
     "ID": Number,
     "ParentID": Number,
     "NextSiblingID": Number,
@@ -33,7 +32,4 @@ let ProjectSchema = new Schema({
     "changeMark":String//更新标记  feeRate:费率文件发生了改变,unitFile 单件文件发生了改变
 });
 
-module.exports = mongoose.model(collectionName, ProjectSchema);
-
-
-
+mongoose.model(collectionName, ProjectSchema);

+ 26 - 0
modules/all_models/stdBills_bills.js

@@ -0,0 +1,26 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*清单库编辑器-清单*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const stdBills_bills = new Schema({
+            ID: String,
+            ParentID: String,
+            NextSiblingID: String,
+            code: String,
+            name: String,
+            unit: String,
+            ruleText: String,
+            engineering: Number, //工程专业,填计算程序工程专业ID
+            Expression: String,
+            jobs: [],
+            items: [],
+            recharge:String,
+            billsLibId: Number,
+            deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_bills', stdBills_bills);

+ 17 - 0
modules/all_models/stdBills_itemCharacter.js

@@ -0,0 +1,17 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const stdBills_itemCharacter = new Schema({
+        id: Number,
+        code: Number,
+        content: String,
+        itemValue: Array,
+        billsLibId: Number,
+        deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_itemCharacter', stdBills_itemCharacter);

+ 17 - 0
modules/all_models/stdBills_jobContent.js

@@ -0,0 +1,17 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*清单库编辑器-工作内容*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const stdBills_jobContent = new Schema({
+        id: Number,
+        code: Number,
+        content: String,
+        billsLibId: Number,
+        deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_jobContent', stdBills_jobContent);

+ 22 - 0
modules/all_models/stdBills_lib.js

@@ -0,0 +1,22 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*清单库编辑器-库*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = require('../all_schemas/opr_schema');
+const stdBills_lib = new Schema({
+        creator: String,
+        createDate: String,
+        recentOpr: [oprSchema],
+
+        billsLibId: Number,
+        billsLibName: String,
+        compilationId: String,
+        compilationName: String,
+        deleted: Boolean
+    },
+    {versionKey: false}
+);
+
+mongoose.model('std_bills_lib_list', stdBills_lib);

+ 25 - 0
modules/all_models/stdRation_coe.js

@@ -0,0 +1,25 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*定额库编辑器-附注条件*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const coeSchema = new Schema({
+    coeType: String,                // 系数类型,指作用范围:
+                                    // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
+    gljID: Number,                  // 要调整的工料机ID(当coeType=0时有效)
+    operator: String,               // 运算符(*、+、-、=)
+    amount: String,                 // 调整的量
+    _id: false
+});
+
+const coeListSchema = new Schema({
+    libID: Number,                      // 所属定额定ID
+    ID: Number,                         // 系数ID(流水号ID)
+    serialNo: Number,                  //编号
+    name: String,                       // 名称
+    content: String,                    // 说明
+    coes: [coeSchema]
+}, {versionKey: false});
+
+mongoose.model('std_ration_lib_coe_list', coeListSchema);

+ 18 - 0
modules/all_models/stdRation_installFeeItem.js

@@ -0,0 +1,18 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额库-安装费用项*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//标准安装增加费-费用项
+const installFeeItemSchema = new Schema({
+    rationRepId: Number,
+    ID: String,
+    feeItem: String, //费用项
+    feeType: String, //费用类型
+    position: String, //记取位置
+    section: [],
+    deleted: false
+}, {versionKey: false});
+
+mongoose.model('std_ration_lib_installation', installFeeItemSchema);

+ 29 - 0
modules/all_models/stdRation_installSection.js

@@ -0,0 +1,29 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额库-安装分册章节*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//安装增加费-费用规则
+const feeRuleSchema = new Schema({
+    ID: String,
+    code: String,
+    rule: String,
+    base: String,
+    feeRate: Number,
+    labour: Number,
+    material: Number,
+    machine: Number
+});
+
+//标准安装增加费-分册章节
+const installSectionSchema = new Schema({
+    rationRepId: Number,
+    ID: String,
+    feeItemId: String,
+    name: String,
+    feeRule: [feeRuleSchema],
+    deleted: false
+}, {versionKey: false});
+
+mongoose.model('std_ration_lib_installationSection', installSectionSchema);

+ 16 - 0
modules/all_models/stdRation_lib.js

@@ -0,0 +1,16 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额库*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const RepositoryMapSchema = new Schema({
+    "ID": Number,
+    "dispName" : String,
+    "appType" : String, //如:"建筑" / "公路"
+    "localeType": String, //如 各个省份 / 部颁
+    "descr" : String,
+    "deleted": Boolean
+});
+
+mongoose.model('std_ration_lib_map', RepositoryMapSchema);

+ 49 - 0
modules/all_models/stdRation_ration.js

@@ -0,0 +1,49 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*定额库-定额*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const rationGljItemSchema = new Schema({
+    gljId: Number,
+    consumeAmt: Number,
+    proportion: Number //配合比,暂时无需使用,默认0
+}, { _id: false });
+
+const rationAssItemSchema = new Schema({
+    name: String,
+    assistID: Number,
+    assistCode: String,
+    stdValue: String,
+    stepValue: String,
+    decimal: Number,
+    carryBit: String,
+    minValue: String,
+    maxValue: String
+}, { _id: false });
+
+//定额安装增加费用
+const rationInstSchema = new Schema({
+    feeItemId: String,
+    sectionId: String
+},{_id: false});
+
+const rationItemSchema = new Schema({
+    ID:Number,
+    code: String,
+    name: String,
+    unit: String,
+    basePrice: Number,
+    sectionId: Number,
+    rationRepId: Number,
+    caption: String,
+    feeType: Number,
+    jobContent: String,
+    annotation: String,
+    rationGljList: [rationGljItemSchema],
+    rationCoeList: Array,
+    rationAssList: [rationAssItemSchema],
+    rationInstList: [rationInstSchema]
+});
+
+mongoose.model('std_ration_lib_ration_items', rationItemSchema);

+ 20 - 0
modules/all_models/stdRation_section.js

@@ -0,0 +1,20 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准定额章节树*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const rationChapterTreeSchema = new Schema({//章节树  //生成唯一id改为sectionID  改成string
+    rationRepId: Number,
+    ID:Number,
+    ParentID:Number,
+    NextSiblingID:Number,
+    name: String,
+    explanation: String,//说明
+    ruleText: String,//计算规则,
+    jobContentSituation: String,//工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+    annotationSituation: String,//附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+    isDeleted: Boolean
+});
+
+mongoose.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema);

+ 33 - 0
modules/all_models/std_glj.js

@@ -0,0 +1,33 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准工料机*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//标准工料机的组成物只来自标准工料机
+const std_gljComponent = new Schema(
+    {
+        ID: Number,
+        consumeAmt: Number
+    },
+    {_id: false},
+    {versionKey: false}
+);
+
+const std_glj = new Schema({
+    deleted: Boolean,
+    repositoryId: Number,
+    ID: Number,
+    code: String,
+    name: String,
+    specs: String,
+    basePrice: Number,
+    gljClass: Number,
+    gljType: Number,
+    shortName: String,
+    unit: String,
+    adjCoe: Number,
+    component: [std_gljComponent]
+},{versionKey: false});
+
+mongoose.model('std_glj_lib_gljList', std_glj);

+ 16 - 0
modules/all_models/std_gljClass.js

@@ -0,0 +1,16 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+/*标准工料机分类树*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const std_gljClass = new Schema({
+    repositoryId: Number,
+    ID: Number,
+    ParentID: Number,
+    NextSiblingID: Number,
+    Name: String,
+    deleted: Boolean
+}, {versionKey: false});
+
+mongoose.model('std_glj_lib_gljClass', std_gljClass);

+ 7 - 10
modules/pm/models/templates/schemas/bills_template.js

@@ -1,17 +1,15 @@
 /**
- * Created by Mai on 2017/8/17.
+ * Created by Zhong on 2018/3/22.
  */
-import mongoose from "mongoose";
-let Schema = mongoose.Schema;
-
-let collectionName = 'temp_bills';
-
+/*清单模板*/
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
 // 标记字段
-let flagsSchema = new Schema({
+const flagsSchema = new Schema({
     fieldName: String,
     flag: Number
 });
-let BillsTemplateSchema = {
+const BillsTemplateSchema = {
     // 树结构所需ID
     ID: Number,
     ParentID: Number,
@@ -35,5 +33,4 @@ let BillsTemplateSchema = {
     calcBase: String
 };
 
-let model = mongoose.model(collectionName, new Schema(BillsTemplateSchema, {versionKey: false, collection: collectionName}));
-export {model as default, collectionName as collectionName};
+mongoose.model('temp_bills', BillsTemplateSchema);

+ 14 - 0
modules/all_schemas/opr_schema.js

@@ -0,0 +1,14 @@
+/**
+ * Created by Zhong on 2018/3/22.
+ */
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = new Schema({
+        operateDate: String,
+        operator: String
+    },
+    {_id: false},
+    {versionKey: false}
+);
+
+module.exports = oprSchema;

+ 5 - 5
modules/bills_lib/models/bills_lib_interfaces.js

@@ -1,13 +1,13 @@
 /**
  * Created by vian on 2017/3/20.
  */
-let model = require("./bills_lib_model");
+let mongoose = require('mongoose');
 let counter = require("../../../public/counter/counter");
 let async = require("async");
-let StdBillsLib = model.stdBillsLibMod;
-let Bills = model.billsMod;
-let JobContent = model.jobContentMod;
-let ItemCharacter = model.itemCharacterMod;
+let StdBillsLib = mongoose.model('std_bills_lib_list');
+let Bills = mongoose.model('std_bills_lib_bills');
+let JobContent = mongoose.model('std_bills_lib_jobContent');
+let ItemCharacter = mongoose.model('std_bills_lib_itemCharacter');
 let moment = require("moment");
 let billsLibDao = function(){};
 

+ 0 - 34
modules/bills_lib/models/bills_lib_model.js

@@ -1,34 +0,0 @@
-/**
- * Created by vian on 2017/3/17.
- */
-/*
-var dbm = require("../../../config/db/db_manager");
-var schemas = require("./bills_lib_schemas.js");
-//var db = dbm.getLocalConnection("stdBillsEditor");
-var db = dbm.getCfgConnection("stdBillsEditor");
-var stdBillsLibMod = db.model("stdBillsLib", schemas.stdBillsLibSchema);
-var billsMod = db.model("billsLib", schemas.billsSchema);
-var jobContentMod = db.model("jobContent", schemas.jobContentSchema);
-var itemCharacterMod = db.model("itemCharacter", schemas.itemCharacterSchema);
-
-module.exports = {
-    stdBillsLibMod: stdBillsLibMod,
-    billsMod: billsMod,
-    jobContentMod: jobContentMod,
-    itemCharacterMod: itemCharacterMod,
-}*/
-let dbm = require("../../../config/db/db_manager");
-let schemas = require("./bills_lib_schemas.js");
-let db = dbm.getCfgConnection("scConstruct");
-//let db = dbm.getLocalConnection("stdBillsEditor");
-let stdBillsLibMod = db.model("std_bills_lib_list", schemas.stdBillsLibSchema);
-let billsMod = db.model("std_bills_lib_bills", schemas.billsSchema);
-let jobContentMod = db.model("std_bills_lib_jobContent", schemas.jobContentSchema);
-let itemCharacterMod = db.model("std_bills_lib_itemCharacter", schemas.itemCharacterSchema);
-
-module.exports = {
-    stdBillsLibMod: stdBillsLibMod,
-    billsMod: billsMod,
-    jobContentMod: jobContentMod,
-    itemCharacterMod: itemCharacterMod,
-}

+ 0 - 84
modules/bills_lib/models/bills_lib_schemas.js

@@ -1,84 +0,0 @@
-let mongoose = require('mongoose');
-
-let oprSchema = mongoose.Schema({
-        operateDate: String,
-        operator: String
-    },
-    {_id: false},
-    {versionKey: false});
-
-let stdBillsLibSchema =mongoose.Schema({
-        creator: String,
-        createDate: String,
-        recentOpr: [oprSchema],
-        /* lastOperator: String,
-         lastOperateDate: Date,*/
-        billsLibId: Number,
-        billsLibName: String,
-        compilationId: String,
-        compilationName: String,
-        deleted: Boolean
-    },
-    {versionKey: false}
-);
-
-let jobsSchema = mongoose.Schema({
-        id: Number,
-        serialNo: Number
-    },
-    {_id: false},
-    {versionKey: false});
-
-let itemsSchema = mongoose.Schema({
-        id: Number,
-        serialNo: Number
-    },
-    {_id: false},
-    {versionKey: false});
-
-let billsSchema = mongoose.Schema({
-        ID: String,
-        ParentID: String,
-        NextSiblingID: String,
-        code: String,
-        name: String,
-        unit: String,
-        ruleText: String,
-        engineering: Number, //工程专业,填计算程序工程专业ID
-        Expression: String,
-        jobs: [],
-        items: [],
-        recharge:String,
-        billsLibId: Number,
-        deleted: Boolean
-    },
-    {versionKey: false}
-);
-
-let jobContentSchema = mongoose.Schema({
-        id: Number,
-        code: Number,
-        content: String,
-        billsLibId: Number,
-        deleted: Boolean
-    },
-    {versionKey: false}
-);
-
-let itemCharacterSchema = mongoose.Schema({
-        id: Number,
-        code: Number,
-        content: String,
-        itemValue: Array,
-        billsLibId: Number,
-        deleted: Boolean
-    },
-    {versionKey: false}
-);
-
-module.exports = {
-    stdBillsLibSchema: stdBillsLibSchema,
-    billsSchema: billsSchema,
-    jobContentSchema: jobContentSchema,
-    itemCharacterSchema: itemCharacterSchema
-}

+ 1 - 30
modules/complementary_glj_lib/controllers/gljController.js

@@ -51,24 +51,7 @@ class GljController extends BaseController{
             callback(req,res,err, 'Get Tree', data)
         });
     }
-   /* updateRationBasePrc(req, res){
-        let basePrcArr = JSON.parse(req.body.basePrcArr);
-        rationItemDao.updateRationBasePrc(basePrcArr, function (err, message) {
-            if(err){
-                callback(req, res, err, message, null);
-            }
-            else{
-                callback(req, res, err, message, null);
-            }
-        });
-    }*/
 
-   /* getRationGljIds(req, res){
-        let rationLibs = req.body.rationLibs;
-        gljDao.getRationGljIds(rationLibs, function (err, msg, data) {
-            callback(req, res, err, msg, data);
-        })
-    }*/
     createNewGljTypeNode(req, res) {
         let repId = req.body.repositoryId;
         let lastNodeId = req.body.lastNodeId;
@@ -104,19 +87,7 @@ class GljController extends BaseController{
                 callback(req,res,err,'Get Items',data)
             });
     }
-   /* getGljItemsByIds(req, res) {
-        let gljIds = JSON.parse(req.body.gljIds);
-        gljDao.getGljItems(gljIds, function(err, data){
-            callback(req,res,err,'Get Items',data)
-        });
-    }
-    getGljItemsByCodes(req, res) {
-        let gljCodes = JSON.parse(req.body.gljCodes),
-            repId = req.body.repId;
-        gljDao.getGljItemsByCode(repId, gljCodes, function(err, data){
-            callback(req,res,err,'Get Items',data)
-        });
-    }*/
+
     updateComponent(req, res){
         let userId = req.body.userId;
         let updateArr = JSON.parse(req.body.updateArr);

+ 4 - 60
modules/complementary_glj_lib/models/gljModel.js

@@ -1,7 +1,10 @@
 /**
  * Created by Zhong on 2017/8/22.
  */
-import {complementaryGljModel, stdGljModel, gljClassModel} from "./schemas";
+const mongoose = require('mongoose');
+const complementaryGljModel = mongoose.model('complementary_glj_lib');
+const stdGljModel = mongoose.model('std_glj_lib_gljList');
+const gljClassModel = mongoose.model('std_glj_lib_gljClass');
 import counter from "../../../public/counter/counter";
 import async from "async";
 import STDGLJLibGLJListModel from "../../common/std/std_glj_lib_glj_list_model";
@@ -16,27 +19,6 @@ class GljDao {
         })
     }
 
-
-    getGljItemsByRep(repositoryId,callback){
-        gljModel.find({"repositoryId": repositoryId},function(err,data){
-            if(err) callback(true, "")
-            else callback(false,data);
-        })
-    }
-
-    getGljItemByType (repositoryId, type, callback){
-        gljModel.find({"repositoryId": repositoryId, "gljType": type},function(err,data){
-            if(err) callback(true, "")
-            else callback(false, data);
-        })
-    };
-
-    getGljItem (repositoryId, code, callback){
-        gljModel.find({"repositoryId": repositoryId, "code": code},function(err,data){
-            if(err) callback(true, "")
-            else callback(false, data);
-        })
-    };
     _exist(data, attr){
         return data && data[attr] !== 'undefined' && data[attr];
     }
@@ -85,16 +67,6 @@ class GljDao {
         });*/
         async.parallel([
            async function (cb) {
-               /* stdGljModel.find({repositoryId: stdGljLibId}, function (err, stdGljs) {
-                    if(err){
-                        cb(err);
-                    }
-                    else{
-                        me.sortToNumber(stdGljs);
-                        rst.stdGljs = stdGljs;
-                        cb(null);
-                    }
-                });*/
                try{
                    let stdGljs = [];
                    let first = await stdGljModel.find({repositoryId: stdGljLibId}).sort({ID: 1}).limit(1);
@@ -121,13 +93,6 @@ class GljDao {
                            stdGljs = stdGljs.concat(tempStdGlj);
                        }
                    }
-               /*    for(let i = 0, len = findCount; i < len; i++){
-                       let tempStdGlj = await stdGljModel.find({repositoryId: stdGljLibId, deleted: null}).skip(flag).sort({ID: 1}).limit(500);
-                       if(tempStdGlj.length > 0){
-                           flag = flag + 500;
-                           stdGljs = stdGljs.concat(tempStdGlj);
-                       }
-                   }*/
                    me.sortToNumber(stdGljs);
                    rst.stdGljs = stdGljs;
                    cb(null);
@@ -235,27 +200,6 @@ class GljDao {
         }
     }
 
-    /*mixUpdateGljItems (repId, lastOpr, updateItems, addItems, rIds, callback) {
-     if (updateItems.length == 0 && rIds.length == 0) {
-     GljDao.addGljItems(repId, lastOpr, addItems, callback);
-     } else if (rIds.length > 0) {
-     GljDao.removeGljItems(repId, lastOpr, rIds, function(err, message, docs) {
-     });
-     }else{
-     GljDao.updateGljItems(repId, lastOpr, updateItems, function(err, results){
-     if (err) {
-     callback(true, "Fail to update", false);
-     } else {
-     if (addItems && addItems.length > 0) {
-     GljDao.addGljItems(repId, lastOpr, addItems, callback);
-     } else {
-     callback(false, "Save successfully", results);
-     }
-     }
-     });
-     }
-     };*/
-
     static removeGljItems (rIds, callback) {
         if (rIds && rIds.length > 0) {
             complementaryGljModel.collection.remove({ID: {$in: rIds}}, null, function(err, docs){

+ 0 - 73
modules/complementary_glj_lib/models/schemas.js

@@ -1,73 +0,0 @@
-/**
- * Created by Zhong on 2017/8/22.
- */
-import mongoose from "mongoose";
-
-let Schema = mongoose.Schema;
-//补充工料机的组成物可能来自标准工料机和补充工料机
-let comGjlComponentSchema = new Schema(
-    {
-        isStd: Boolean, //组成物里的工料机是否是标准的,否则是补充的
-        ID: Number,
-        consumeAmt: String
-    },
-    {_id: false},
-    {versionKey: false}
-);
-//标准工料机的组成物只来自标准工料机
-let stdGjlComponentSchema = new Schema(
-    {
-        ID: Number,
-        consumeAmt: Number
-    },
-    {_id: false},
-    {versionKey: false}
-);
-//补充工料机跟用户和编办绑定
-let complementaryGljSchema = new Schema({
-    userId: Number,
-    compilationId: String,
-    ID: Number,
-    code: String,
-    name: String,
-    specs: String,
-    unit: String,
-    basePrice: String,
-    gljClass: Number,
-    gljType: Number,
-    shortName: String,
-    component: [comGjlComponentSchema]
-}, {versionKey: false});
-
-//标准工料机
-let stdGljSchema = new Schema({
-    deleted: Boolean,
-    repositoryId: Number,
-    ID: Number,
-    code: String,
-    name: String,
-    specs: String,
-    basePrice: Number,
-    gljClass: Number,
-    gljType: Number,
-    shortName: String,
-    unit: String,
-    adjCoe: Number,
-    component: [stdGjlComponentSchema]
-},{versionKey: false});
-
-//标准工料机分类树
-let gljClassSchema = mongoose.Schema({
-    repositoryId: Number,
-    ID: Number,
-    ParentID: Number,
-    NextSiblingID: Number,
-    Name: String,
-    deleted: Boolean
-}, {versionKey: false});
-
-let complementaryGljModel = mongoose.model('complementary_glj_lib', complementaryGljSchema, 'complementary_glj_lib');
-let stdGljModel = mongoose.model('std_glj_lib_gljList', stdGljSchema, 'std_glj_lib_gljList');
-let gljClassModel = mongoose.model('std_glj_lib_gljClass', gljClassSchema, 'std_glj_lib_gljClass');
-
-export {complementaryGljModel, stdGljModel, gljClassModel};

+ 7 - 3
modules/complementary_ration_lib/models/compleRationModel.js

@@ -1,9 +1,13 @@
 /**
  * Created by Zhong on 2017/12/21.
  */
-
-import {compleRationModel, installSectionModel, installFeeItemModel} from './schemas';
-import {complementaryGljModel, stdGljModel} from '../../complementary_glj_lib/models/schemas';
+const mongoose = require('mongoose');
+const compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree');
+const compleRationModel = mongoose.model('complementary_ration_items');
+const installSectionModel = mongoose.model("std_ration_lib_installationSection");
+const installFeeItemModel = mongoose.model("std_ration_lib_installation");
+const complementaryGljModel = mongoose.model('complementary_glj_lib');
+const stdGljModel = mongoose.model('std_glj_lib_gljList');
 import async from 'async';
 let stdRationModel = require ('../../ration_repository/models/ration_item').Model;
 let counter = require('../../../public/counter/counter');

+ 0 - 118
modules/complementary_ration_lib/models/schemas.js

@@ -1,118 +0,0 @@
-/**
- * Created by Zhong on 2017/12/21.
- */
-
-import mongoose from 'mongoose';
-
-let deleteSchema = require('../../../public/models/delete_schema');
-let Schema = mongoose.Schema;
-
-//补充定额章节树
-let compleRationSectionTreeSchema = new Schema({
-    //用户名
-    userId: Number,
-    //编办
-    compilationId: String,
-    //标准定额库
-    rationRepId: Number,
-    //名称
-    name: String,
-    //是否是同层第一个节点
-    isFirst: Boolean,
-    ID: Number,
-    NextSiblingID: Number,
-    ParentID: Number,
-    deleteInfo: deleteSchema
-}, {versionKey: false});
-
-//定额工料机
-let compleRationGljItemSchema = new Schema({
-    gljId: Number,
-    consumeAmt: String,
-    type: String    //std or complementary
-
-}, { _id: false });
-
-//辅助定额调整
-let compleRationAssItemSchema = new Schema({
-    name: String,
-    assistID: Number,
-    assistCode: String,
-    stdValue: String,
-    stepValue: String,
-    decimal: Number,
-    carryBit: String,
-    minValue: String,
-    maxValue: String
-}, { _id: false });
-
-//安装增加费-费用规则
-let feeRuleSchema = new Schema({
-    ID: String,
-    code: String,
-    rule: String,
-    base: String,
-    feeRate: Number,
-    labour: Number,
-    material: Number,
-    machine: Number
-});
-
-//定额安装增加费用
-let rationInstSchema = new Schema({
-    feeItemId: String,
-    sectionId: String
-},{_id: false});
-
-//标准安装增加费-分册章节
-let installSectionSchema = new Schema({
-    rationRepId: Number,
-    ID: String,
-    feeItemId: String,
-    name: String,
-    feeRule: [feeRuleSchema],
-    deleted: false
-}, {versionKey: false});
-
-//标准安装增加费-费用项
-let installFeeItemSchema = new Schema({
-    rationRepId: Number,
-    ID: String,
-    feeItem: String, //费用项
-    feeType: String, //费用类型
-    position: String, //记取位置
-    section: [],
-    deleted: false
-}, {versionKey: false});
-
-//补充定额
-let compleRationSchema = new Schema({
-    userId: Number,
-    compilationId: String,
-    rationRepId: Number,
-    ID:Number,
-    code: String,
-    name: String,
-    unit: String,
-    labourPrice: String,
-    materialPrice: String,
-    machinePrice: String,
-    basePrice: String,
-    sectionId: Number,
-    caption: String,
-    feeType: Number,
-    jobContent: String,
-    annotation: String,
-    rationGljList: [compleRationGljItemSchema],
-    rationCoeList: Array,
-    rationAssList: [compleRationAssItemSchema],
-    rationInstList: [rationInstSchema],
-    deleteInfo: deleteSchema
-}, {versionKey: false});
-
-let compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree', compleRationSectionTreeSchema, 'complementary_ration_section_tree');
-let compleRationModel = mongoose.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');
-let installSectionModel = mongoose.model("std_ration_lib_installationSection", installSectionSchema, "std_ration_lib_installationSection");
-let installFeeItemModel = mongoose.model("std_ration_lib_installation", installFeeItemSchema, "std_ration_lib_installation");
-
-export {compleRationSectionTreeModel, compleRationModel, installSectionModel, installFeeItemModel};

+ 5 - 4
modules/complementary_ration_lib/models/searchModel.js

@@ -1,10 +1,11 @@
 /**
  * Created by Zhong on 2018/1/9.
  */
-
-import {compleRationModel} from './schemas';
-import {complementaryGljModel, stdGljModel} from '../../complementary_glj_lib/models/schemas';
-import {compleRationSectionTreeModel} from './schemas';
+const mongoose = require('mongoose');
+const compleRationModel = mongoose.model('complementary_ration_items');
+const complementaryGljModel = mongoose.model('complementary_glj_lib');
+const stdGljModel = mongoose.model('std_glj_lib_gljList');
+const compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree');
 let stdSectionTreeModel = require ('../../ration_repository/models/ration_section_tree').Model;
 let stdRationModel = require ('../../ration_repository/models/ration_item').Model;
 

+ 2 - 2
modules/complementary_ration_lib/models/sectionTreeModel.js

@@ -2,8 +2,8 @@
  * Created by Zhong on 2017/12/21.
  */
 
-import {compleRationSectionTreeModel} from './schemas';
-
+const mongoose = require('mongoose');
+const compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree');
 let counter = require('../../../public/counter/counter');
 let stdSectionTreeModel = require ('../../ration_repository/models/ration_section_tree').Model;
 

+ 1 - 1
modules/fee_rates/facade/fee_rates_facade.js

@@ -8,7 +8,7 @@ let feeRateModel = mongoose.model('fee_rates');
 let feeRateFileModel = mongoose.model('fee_rate_file');
 let std_fee_rate_lib_model = mongoose.model('std_fee_rate_libs');
 let billModel=require('../../main/models/bills');//mongoose.model('bills');
-let projectsModel = require("../../pm/models/project_schema");
+let projectsModel = mongoose.model('projects');
 let consts = require('../../main/models/project_consts');
 let _=require("lodash");
 let template = require('../controllers/feerate_template');

+ 2 - 2
modules/main/facade/bill_facade.js

@@ -1,9 +1,9 @@
 /**
  * Created by zhang on 2018/1/22.
  */
+let mongoose = require('mongoose');
 let quantity_detail = require("./quantity_detail_facade");
-let model = require("../../bills_lib/models/bills_lib_model");
-let Bills_Lib = model.billsMod;
+let Bills_Lib = mongoose.model('std_bills_lib_list');
 let bill_Model = require('../models/bills').model;
 let _ = require("lodash");
 module.exports={

+ 2 - 1
modules/main/facade/decimal_facade.js

@@ -1,7 +1,8 @@
 /**
  * Created by zhang on 2017/11/22.
  */
-let projectsModel = require("../../pm/models/project_schema");
+let mongoose = require('mongoose');
+let projectsModel = mongoose.model('projects');
 let _ = require('lodash');
 
 module.exports ={

+ 3 - 1
modules/main/facade/installation_facade.js

@@ -1,7 +1,9 @@
 /**
  * Created by zhang on 2018/1/31.
  */
-import {installSectionModel,installFeeItemModel} from "../../complementary_ration_lib/models/schemas";
+const mongoose = require('mongoose');
+const installSectionModel = mongoose.model("std_ration_lib_installationSection");
+const installFeeItemModel = mongoose.model("std_ration_lib_installation");
 import installationFeeModel from "../models/installation_fee";
 import engineeringModel from "../../users/models/schema/engineering_lib";
 const uuidV1 = require('uuid/v1');

+ 1 - 1
modules/main/facade/project_facade.js

@@ -2,7 +2,7 @@
  * Created by zhang on 2018/1/26.
  */
 let mongoose = require('mongoose');
-let  projectsModel = require("../../pm/models/project_schema");
+let  projectsModel = mongoose.model('projects');
 let async_n = require("async");
 let _ = require('lodash');
 let ration_model = require('../models/ration');

+ 1 - 1
modules/main/models/bills.js

@@ -12,7 +12,7 @@ let consts = require('./project_consts');
 let projectConsts = consts.projectConst;
 let commonConsts = consts.commonConst;
 let quantity_detial = require('../facade/quantity_detail_facade');
-let projectModel = require('../../pm/models/project_schema');
+let projectModel = mongoose.model('projects');
 
 
 let billsSchema = new Schema({

+ 1 - 2
modules/options/models/optionsModel.js

@@ -2,8 +2,7 @@
  * Created by Zhong on 2017/9/28.
  */
 
-import optionsModel from '../models/schemas';
-
+const optionsModel = mongoose.model('options');
 class OptionsDao {
     async getOptions(user_id, compilation_id){
         let rst = await optionsModel.find({user_id: user_id, compilation_id: compilation_id});

+ 0 - 27
modules/options/models/schemas.js

@@ -1,27 +0,0 @@
-/**
- * Created by Zhong on 2017/9/28.
- */
-import mongoose from 'mongoose';
-
-/*
-* 此选项设置针对绑定用户,对用户该编办下所有项目有效的全局选项
-* */
-let Schema = mongoose.Schema;
-let optionSchema = new Schema({
-    user_id: String,
-    compilation_id: String,
-    options: {
-        type: Schema.Types.Mixed,
-        default: {}
-    }
-}, {versionKey: false});
-
-/*let optionSchema = new Schema({
-    user_id: String,
-    compilation_id: String,
-    options: Array
-}, {versionKey: false});*/
-
-let optionsModel = mongoose.model('options', optionSchema);
-
-export default optionsModel;

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

@@ -2,6 +2,7 @@
  * Created by Mai on 2017/1/18.
  */
 import UnitPriceFileModel from "../../glj/models/unit_price_file_model";
+let mongoose = require('mongoose');
 let ProjectsData = require('../models/project_model').project;
 let labourCoe = require('../../main/facade/labour_coe_facade');
 let projType = require('../models/project_model').projType;
@@ -11,7 +12,7 @@ let EngineeringLibModel = require("../../users/models/engineering_lib_model");
 let fee_rate_facade = require("../../fee_rates/facade/fee_rates_facade");
 let billsModel = require('../../main/models/bills').model;
 let rationsModel = require('../../main/models/ration').model;
-let projectModel = require("../models/project_schema");
+let projectModel = mongoose.model('projects');
 let asyncTool = require('async');
 
 //统一回调函数

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

@@ -26,7 +26,7 @@ let installationFacade = require('../../main/facade/installation_facade');
 let logger = require("../../../logs/log_helper").logger;
 let BillsModel = require("../../main/models/bills").model;
 
-let Projects = require("./project_schema");
+let Projects = mongoose.model('projects');
 let projectType = {
     folder: 'Folder',
     tender: 'Tender',

+ 2 - 1
modules/pm/models/templates/bills_template_model.js

@@ -3,7 +3,8 @@
  * 清单模板,新建项目使用
  */
 import BaseModel from "../../../common/base/base_model";
-import BillsTemplateSchema from "./schemas/bills_template";
+const mongoose = require('mongoose');
+const BillsTemplateSchema = mongoose.model('temp_bills');
 
 class BillsTemplateModel extends BaseModel {
     /**

+ 3 - 1
modules/ration_glj/facade/ration_glj_facade.js

@@ -23,7 +23,9 @@ let logger = require("../../../logs/log_helper").logger;
 import stdgljutil  from "../../../public/cache/std_glj_type_util";
 import EngineeringLibModel from "../../users/models/engineering_lib_model";
 import GljDao from "../../complementary_glj_lib/models/gljModel";
-import {complementaryGljModel, stdGljModel, gljClassModel} from "../../complementary_glj_lib/models/schemas";
+const complementaryGljModel = mongoose.model('complementary_glj_lib');
+const stdGljModel = mongoose.model('std_glj_lib_gljList');
+const gljClassModel = mongoose.model('std_glj_lib_gljClass');
 import  projCounter from '../../main/models/proj_counter_model';
 
 

+ 2 - 21
modules/ration_repository/models/coe.js

@@ -4,29 +4,10 @@
  */
 
 var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("scConstruct");
+
 var counter = require('../../../public/counter/counter');
 
-var coeSchema = mongoose.Schema({
-    coeType: String,                // 系数类型,指作用范围:
-                                    // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
-    gljID: Number,                  // 要调整的工料机ID(当coeType=0时有效)
-    operator: String,               // 运算符(*、+、-、=)
-    amount: String,                 // 调整的量
-    _id: false
-});
-
-var coeListSchema = mongoose.Schema({
-    libID: Number,                      // 所属定额定ID
-    ID: Number,                         // 系数ID(流水号ID)
-    serialNo: Number,                  //编号
-    name: String,                       // 名称
-    content: String,                    // 说明
-    coes: [coeSchema]
-}, {versionKey: false});
-
-var coeListModel = db.model("std_ration_lib_coe_list",coeListSchema, "std_ration_lib_coe_list")
+var coeListModel = mongoose.model("std_ration_lib_coe_list");
 
 var coeListDAO = function(){};
 

+ 1 - 27
modules/ration_repository/models/glj_repository.js

@@ -4,34 +4,8 @@
  */
 
 var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("scConstruct");
 var async = require("async");
-var Schema = mongoose.Schema;
-
-var gljTypeSchema = mongoose.Schema({
-    repositoryId: Number,
-    ID: Number,
-    ParentID: Number,
-    NextSiblingID: Number,
-    Name: String,
-    isDeleted: Boolean
-});
-
-var gljSchema = mongoose.Schema({
-    repositoryId: Number,
-    ID:Number,
-    //以下是基于已有access库
-    code: String,
-    name: String,
-    specs: String,
-    unit: String,
-    basePrice: Number,
-    gljType: Number, //这个是UI显示上的详细分类,对应gljTypeSchema
-    shortName: String,  //人工,材料,机械
-    gljClass:Number
-});
-var gljTypeModel = db.model("std_ration_lib_glj_type",gljTypeSchema, "std_ration_lib_glj_type");
+var gljTypeModel = mongoose.model("std_glj_lib_gljClass");
 var gljItemModel = mongoose.model("std_glj_lib_gljList");
 var repositoryMap = require('./repository_map').Dao;
 var counter = require('../../../public/counter/counter');

+ 2 - 47
modules/ration_repository/models/ration_item.js

@@ -2,55 +2,10 @@
  * Created by Tony on 2017/4/28.
  */
 var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("scConstruct");
 var async = require("async");
-var Schema = mongoose.Schema;
-
-var rationGljItemSchema = mongoose.Schema({
-    gljId: Number,
-    consumeAmt: Number,
-    proportion: Number //配合比,暂时无需使用,默认0
-}, { _id: false });
-
-var rationAssItemSchema = mongoose.Schema({
-    name: String,
-    assistID: Number,
-    assistCode: String,
-    stdValue: String,
-    stepValue: String,
-    decimal: Number,
-    carryBit: String,
-    minValue: String,
-    maxValue: String
-}, { _id: false });
-
-//定额安装增加费用
-let rationInstSchema = mongoose.Schema({
-    feeItemId: String,
-    sectionId: String
-},{_id: false});
-
-var rationItemSchema = mongoose.Schema({
-    ID:Number,
-    code: String,
-    name: String,
-    unit: String,
-    basePrice: Number,
-    sectionId: Number,
-    rationRepId: Number,
-    caption: String,
-    feeType: Number,
-    jobContent: String,
-    annotation: String,
-    rationGljList: [rationGljItemSchema],
-    rationCoeList: Array,
-    rationAssList: [rationAssItemSchema],
-    rationInstList: [rationInstSchema]
-});
-var rationItemModel = db.model("std_ration_lib_ration_items",rationItemSchema, "std_ration_lib_ration_items")
+var rationItemModel = mongoose.model("std_ration_lib_ration_items");
 var counter = require('../../../public/counter/counter');
-import stdGljListModel from '../../common/std/schemas/std_ration_lib_glj_list';
+const stdGljListModel = mongoose.model('std_glj_lib_gljList');
 
 var rationItemDAO = function(){};
 

+ 1 - 17
modules/ration_repository/models/ration_section_tree.js

@@ -3,24 +3,8 @@
  */
 
 var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var chapterTreeDb = dbm.getCfgConnection("scConstruct");
 var async = require("async");
-var Schema = mongoose.Schema;
-
-var rationChapterTreeSchema = new Schema({//章节树  //生成唯一id改为sectionID  改成string
-    rationRepId: Number,
-    ID:Number,
-    ParentID:Number,
-    NextSiblingID:Number,
-    name: String,
-    explanation: String,//说明
-    ruleText: String,//计算规则,
-    jobContentSituation: String,//工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
-    annotationSituation: String,//附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
-    isDeleted: Boolean
-});
-var rationChapterTreeModel = chapterTreeDb.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, "std_ration_lib_ration_chapter_trees");
+var rationChapterTreeModel = mongoose.model("std_ration_lib_ration_chapter_trees");
 var counter = require('../../../public/counter/counter');
 
 var rationChapterTreeDAO = function(){};

+ 1 - 15
modules/ration_repository/models/repository_map.js

@@ -3,21 +3,8 @@
  * 重新构造,不适宜生成多个定额库db,还是得统一在一个表
  */
 var mongoose = require('mongoose');
-var dbm = require("../../../config/db/db_manager");
-//var stringUtil = require('../../../public/stringUtil');
-var rationLibdb = dbm.getCfgConnection("scConstruct");
-var Schema = mongoose.Schema;
-var RepositoryMapSchema = new Schema({
-    "ID": Number,
-    "dispName" : String,
-    "appType" : String, //如:"建筑" / "公路"
-    "localeType": String, //如 各个省份 / 部颁
-    "descr" : String,
-    "deleted": Boolean
-});
 var counter = require('../../../public/counter/counter');
-
-var rationRepository = rationLibdb.model("std_ration_lib_map", RepositoryMapSchema, "std_ration_lib_map");
+var rationRepository = mongoose.model("std_ration_lib_map");
 
 function createNewLibModel(rationLibObj){
     var rst = {};
@@ -121,4 +108,3 @@ module.exports = {
     Dao: new rationRepositoryDao(),
     Model: rationRepository
 }
-//module.exports = new rationRepositoryDao();

+ 85 - 85
web/building_saas/css/main.css

@@ -2,16 +2,16 @@
 /*bootstrap 初始化*/
 body {
     font-size: 0.9rem;
-    overflow: hidden;
+    overflow: hidden
 }
 .dropdown-menu {
     font-size: 0.9rem
 }
 .btn.disabled, .btn:disabled {
-  color:#999
+    color:#999
 }
 .btn-link:focus, .btn-link:hover{
-  text-decoration: none
+    text-decoration: none
 }
 /*自定义css*/
 .header {
@@ -28,17 +28,11 @@ body {
     line-height: inherit
 }
 .top-msg{
-  position: fixed;
-  top:0;
-  width:100%;
-  z-index: 999
-}
-.in-1{padding-left:0px!important}
-.in-2{padding-left:21px!important}
-.in-3{padding-left:42px!important}
-.in-4{padding-left:63px!important}
-.in-5{padding-left:84px!important}
-.in-6{padding-left:105px!important}
+    position: fixed;
+    top:0;
+    width:100%;
+    z-index: 999
+}
 .main {
     position: relative;
     background: #f7f7f9;
@@ -70,7 +64,32 @@ body {
     color: #333
 }
 .main-nav .nav-tabs{
-  border-bottom: none
+    border-bottom: none
+}
+.poj-manage .col-auto{
+    background:#f7f7f9
+}
+.poj-cate {
+    width:58px
+}
+.poj-cate .nav-pills .nav-link{
+    border-radius: 0;
+    font-size: 24px;
+    color: #6c757d
+}
+.poj-cate .nav-pills .nav-link:hover{
+    color:#007bff
+}
+.poj-cate .nav-pills .nav-link.active, .nav-pills .show > .nav-link{
+    background-color: #6c757d;
+    color:#fff
+}
+.pm-side{
+    position: fixed;
+    left:0
+}
+.pm-content{
+    padding-left:58px
 }
 .content {
     border-left: 1px solid #ccc;
@@ -78,7 +97,7 @@ body {
     background: #fff
 }
 .toolsbar,.toolsbar-f {
-  border-bottom: 1px solid #ccc
+    border-bottom: 1px solid #ccc
 }
 .tools-btn {
     height: 30px;
@@ -92,23 +111,23 @@ body {
     overflow-y: hidden;
 }
 .main-data-top,.main-data-full{
-  overflow: hidden;
-  width:100%
+    overflow: hidden;
+    width:100%
 }
 .main-content.col-lg-8{
-  width:66.666667%
+    width:66.666667%
 }
 .main-content.col-lg-12{
-  width:100%
+    width:100%
 }
 .main-side.col-lg-4{
-  width: 33.333333%;
+    width: 33.333333%;
 }
 .main-side.col-lg-0{
-  width:0%;
+    width:0%;
 }
 .sidebar-bottom,.sidebar-bottom .col-lg-6,.sidebar-bottom .col-lg-12 {
-  height:300px
+    height:300px
 }
 .top-content, .fluid-content {
     overflow: auto;
@@ -124,7 +143,7 @@ body {
     padding: 0.2em 0.5em
 }
 .side-tabs .nav-tabs .nav-item {
-  z-index: 999
+    z-index: 999
 }
 .side-tabs .nav-tabs {
     border-bottom: none;
@@ -250,99 +269,80 @@ body {
 .poj-list, .side-content ,.form-view{
     overflow: auto;
 }
-.poj-list span.poj-icon {
-  padding-right:7px;
-  color:#ccc
-}
-.poj-list a.tree-open,.poj-list a.tree-close{
-  width:15px;
-  display: inline-block;
-}
 .print-toolsbar{
-  padding:5px
+    padding:5px
 }
 .print-toolsbar .panel {
-  display:inline-block;
-  vertical-align:top;
-  background:#f7f7f9
+    display:inline-block;
+    vertical-align:top;
+    background:#f7f7f9
 }
 .print-toolsbar .panel .panel-foot{
-  text-align: center;
-  font-size: 12px
+    text-align: center;
+    font-size: 12px
 }
 .print-list {
-  border-right:1px solid #ccc
+    border-right:1px solid #ccc
 }
 .print-list .form-list {
-  overflow: auto
+    overflow: auto
 }
 .print-list .list-tools{
-  height:50px;
-  padding:10px 0;
-  border-bottom:1px solid #f2f2f2
+    height:50px;
+    padding:10px 0;
+    border-bottom:1px solid #f2f2f2
 }
 .pageContainer {
-  background: #ededed;
-  text-align: center
+    background: #ededed;
+    text-align: center
 }
 .pageContainer .page{
-  border:9px solid transparent;
-  display: inline-block;
+    border:9px solid transparent;
+    display: inline-block;
 }
 .pageContainer .page img{
-  width:inherit;
-  height: inherit;
+    width:inherit;
+    height: inherit;
 }
 .modal-auto-height {
-  height: 400px;
-  overflow-y: auto;
+    height: 400px;
+    overflow-y: auto;
 }
 .modal-fixed-height {
-  height: 400px;
-  overflow-y: hidden;
+    height: 400px;
+    overflow-y: hidden;
 }
 .sidebar-tools-bar {
-  background:#fff
+    background:#fff
 }
 .side-search-box{
-  background:#fff;
-  border-bottom:1px solid #ddd
+    background:#fff;
+    border-bottom:1px solid #ddd
 }
 .navbar-crumb span{
-  max-width: 200px
+    max-width: 200px
 }
 .dropdown-item{
-  color:#007bff
+    color:#007bff
+}
+.dropdown-item:hover{
+    color:#0056b3
 }
 .dropdown-item.disabled, .dropdown-item:disabled{
-  pointer-events:none
+    pointer-events:none
 }
-.text-green{
-    color: #172a30
+.tools-symbol{
+    width:450px
 }
-label.title{
-    display: inline-block;
-    width: 100px;
+.tools-symbol p{
+    margin: 0
 }
-.modal-feeRate {max-width: 550px}
-
-.gc-column-header-cell{
-    text-align: center!important;
+.tools-symbol a.btn{
+    font-size: .95rem;
+    width:26px;
+    padding: 0;
+    height:26px;
+}
+.custom-file-input:lang(zh) ~ .custom-file-label::after {
+    content: "浏览";
 }
-div.resize{
-    height: 4px;
-    background: #f7f7f9;
-    width: 100%;
-    cursor: s-resize;
-}
-.zlfb-check{
-    margin-left: 0;
-}
-
-legend.legend{
-    display:block;
-    width:auto;
-    font-size:0.9rem;
-    top:-15px;
-    background: white;
-}

+ 2 - 2
web/building_saas/js/global.js

@@ -23,7 +23,7 @@ $(window).resize(autoFlashHeight);
 /*全局自适应高度结束*/
 $(function () {
     /*侧滑*/
-    $(".open-sidebar").click(function () {
+  /*  $(".open-sidebar").click(function () {
         $(".slide-sidebar").animate({width: "800"}).addClass("open");
     });
     $("body").click(function (event) {
@@ -39,7 +39,7 @@ $(function () {
             $(".slide-sidebar").animate({width: "0"}).removeClass("open")// 关闭处理
         }
 
-    });
+    });*/
     /*侧滑*/
     /*工具提示*/
     $(function () {

+ 1 - 1
web/building_saas/main/js/views/project_property_basicInfo.js

@@ -91,7 +91,7 @@ let basicInfoView = {
             sheet.setFormatter(-1, 1, '@');
             for(let col = 0, cLen = cols.length; col < cLen; col++){
                 sheet.getRange(-1, col, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[cols[col]['hAlign']]);
-                sheet.getRange(-1, col, -1, 1).hAlign(GC.Spread.Sheets.VerticalAlign[cols[col]['vAlign']]);
+                sheet.getRange(-1, col, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[cols[col]['vAlign']]);
                 for(let row = 0, rLen = datas.length; row < rLen; row++){
                     sheet.setValue(row, col, datas[row][cols[col]['dataCode']]);
                 }

+ 60 - 68
web/building_saas/pm/html/project-management.html

@@ -10,6 +10,7 @@
     <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
     <link rel="stylesheet" href="/web/building_saas/css/main.css">
     <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
+    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.excel2013lightGray.10.0.1.css">
     <!--zTree-->
     <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
     <!-- endinject -->
@@ -30,6 +31,11 @@
 </head>
 
 <body>
+<img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
+<img src="/web/dest/css/img/folder_close.png" id="folder_close_pic" style="display: none">
+<img src="/web/dest/css/img/project.png" id="proj_pic" style="display: none">
+<img src="/web/dest/css/img/engineering.png" id="eng_pic" style="display: none">
+<img src="/web/dest/css/img/tender.png" id="tender_pic" style="display: none">
 <div class="header">
     <div class="top-msg clearfix">
         <div class="alert alert-warning mb-0 py-0" role="alert" style="display: none;">
@@ -43,35 +49,43 @@
 </div>
     <div class="main">
         <div class="poj-manage container-fluid">
-            <div class="row">
-                <div class="col-auto">
-                    <div class="poj-cate">
-                        <input type="text" class="my-2 form-control form-control-sm" placeholder="搜索所有工程">
-                        <ul class="nav nav-pills flex-column">
-                            <li class="nav-item">
-                                <a class="nav-link active" data-toggle="tab" href="#pm_all" role="tab" id="tab_pm_all">全部</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" href="#">最近使用</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" href="#">共享</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" href="#">协同工作</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" href="#">归档</a>
-                            </li>
-                            <li class="nav-item">
-                                <a class="nav-link" data-toggle="tab" role="tab" href="#pm_gc" id="tab_pm_gc">回收站</a>
-                            </li>
-                        </ul>
+            <div class="pm-side">
+                <div class="poj-cate">
+                    <div class="dropdown">
+                        <a class="btn btn-light dropdown-toggle" data-toggle="dropdown">
+                            <i class="fa fa-search"></i>
+                        </a>
+                        <div class="dropdown-menu p-3" aria-labelledby="dropdownMenuButton">
+                            <div class="form-group m-0">
+                                <input type="text" class="form-control form-control-sm" placeholder="搜索所有工程"style="width:300px">
+                            </div>
+                        </div>
                     </div>
+                    <ul class="nav nav-pills flex-column">
+                        <li class="nav-item">
+                            <a class="nav-link active" href="#pm_all" role="tab" id="tab_pm_all" data-toggle="tooltip" data-placement="right" data-original-title="全部"><i class="fa fa-bars"></i></a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="#"  data-toggle="tooltip" data-placement="right" data-original-title="最近使用"><i class="fa fa-bookmark"></i></a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="project-management-share.html"  data-toggle="tooltip" data-placement="right" data-original-title="共享"><i class="fa fa-share-alt"></i></a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="project-management-synergy.html"  data-toggle="tooltip" data-placement="right" data-original-title="协同工作"><i class="fa fa-users"></i></a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="#"  data-toggle="tooltip" data-placement="right" data-original-title="归档"><i class="fa fa-book"></i></a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link" href="#pm_gc" id="tab_pm_gc" data-toggle="tooltip" data-placement="right" data-original-title="回收站"><i class="fa fa-trash"></i></a>
+                        </li>
+                    </ul>
                 </div>
-                <div class="col">
-                    <div class="tab-content">
-                        <div class="tab-pane active" id="pm_all" role="tabpanel">
+            </div>
+            <div class="pm-content">
+                <div class="tab-content">
+                    <div class="tab-pane active">
                         <div class="toolsbar">
                             <div class="tools-btn btn-group align-top">
                                 <a href="javascript:void(0);"  id="add-tender-btn" class="btn btn-sm"><i class="fa fa-sticky-note-o"></i>新建单位工程</a>
@@ -90,53 +104,24 @@
                                 <a href="" class="btn btn-sm" id="share-btn">共享</a>
                                 <a href="" class="btn btn-sm" id="cooperate-btn">协同</a>
                             </div>
+                            <legend class="m-0 pb-1">全部</legend>
                         </div>
-                        <div class="poj-list">
-                            <legend>全部</legend>
-                            <table class="table table-hover table-sm" id="ProjTree">
-                                <thead>
-                                <tr>
-                                    <th width="40"></th>
-                                    <th width="78%">工程列表</th>
-                                    <th width="10%">最近使用</th>
-                                    <th width="10%">创建日期</th>
-                                </tr>
-                                </thead>
-                                <tbody>
-                                </tbody>
-                            </table>
-                        </div>
+                        <div class="poj-list" id="projSpread">
                         </div>
                         <div class="tab-pane" role="tabpanel" id="pm_gc">
                             <%include project-management-Recycle.html %>
                         </div>
                     </div>
                 </div>
-        </div>
+            </div>
     </div>
     <div class="slide-sidebar">
         <div class="side-content">
             <!--建设项目汇总-->
             <div class="p-3" id="summary-project">
-                <legend><span id="summary-project-name">船体生产车间</span> 汇总</legend>
-                <table class="table table-bordered table-hover table-sm" id="summary-project-table">
-                    <thead>
-                    <tr>
-                        <th rowspan="2" style="text-align:center;vertical-align:middle;">序号</th>
-                        <th rowspan="2" style="text-align:center;vertical-align:middle;">单位工程名称</th>
-                        <th rowspan="2" style="text-align:center;vertical-align:middle;">金额(元)</th>
-                        <th colspan="3" style="text-align:center;vertical-align:middle;">其中</th>
-                    </tr>
-                    <tr>
-                        <th style="text-align:center;vertical-align:middle;">暂估价(元)</th>
-                        <th style="text-align:center;vertical-align:middle;">安全文明施工费(元)</th>
-                        <th style="text-align:center;vertical-align:middle;">规费(元)</th>
-                    </tr>
-                    </thead>
-                    <tbody></tbody>
-                </table>
-                <div class="row">
-                    <div class="col-md-6">
+
+
+
                         <legend>单价文件</legend>
                         <table class="table table-bordered table-hover table-sm" id="summary-project-unit-price-table">
                             <thead><th></th><th>名称</th><th width="50">使用</th></thead>
@@ -146,8 +131,8 @@
                             <tr><td>3</td><td>C单价文件</td></tr>
                             </tbody>
                         </table>
-                    </div>
-                    <div class="col-md-6">
+
+
                         <legend>费率文件</legend>
                         <table class="table table-bordered table-hover table-sm" id="summary-project-fee-table">
                             <thead><th></th><th>名称</th><th width="50">使用</th></thead>
@@ -157,8 +142,8 @@
                             <tr><td>3</td><td>C费率文件</td></tr>
                             </tbody>
                         </table>
-                    </div>
-                </div>
+
+
             </div>
             <!--单项工程汇总-->
             <div class="p-3" id="summary-engineering">
@@ -316,6 +301,7 @@
                         </div>
                         <span class="form-text text-info" id="eng-name-info" style="display: none;">新建 “左2号生产车间2”</span>
                     </div>
+
                     <div class="form-group">
                         <label>单位工程</label>
                         <input type="text" class="form-control" placeholder="输入单位工程名称" id="tender-name" autocomplete="off">
@@ -499,17 +485,23 @@
     </div>
 </div>
 <!-- JS. -->
-<!-- inject:js -->
 <script src="/lib/jquery/jquery-3.2.1.min.js"></script>
+<script src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
+<script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
+<!-- inject:js -->
 <script src="/lib/popper/popper.min.js"></script>
 <script src="/lib/bootstrap/bootstrap.min.js"></script>
 <script src="/web/building_saas/js/global.js"></script>
 <script src="/public/web/date_util.js"></script>
 <script src="/public/web/tree_table/tree_table.js"></script>
+<script src="/public/web/id_tree.js"></script>
+<script src="/web/building_saas/pm/js/pm_tree.js"></script>
+<script src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
 <script type="text/javascript" src="/public/web/common_ajax.js"></script>
 <script src="/lib/JSExpressionEval_src/Date.js"></script>
 <script src="/web/building_saas/pm/js/pm_ajax.js"></script>
-<script src="/web/building_saas/pm/js/pm_main.js" charset="UTF-8"></script>
+<!--<script src="/web/building_saas/pm/js/pm_main.js" charset="UTF-8"></script>-->
+<script src="/web/building_saas/pm/js/pm_newMain.js"></script>
 <script src="/web/building_saas/pm/js/pm_gc.js"></script>
 <!-- zTree -->
 <script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>

二进制
web/dest/css/img/engineering.png


二进制
web/dest/css/img/folder_close.png


二进制
web/dest/css/img/folder_open.png


二进制
web/dest/css/img/project.png


二进制
web/dest/css/img/tender.png