installation_fee.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Created by Zhong on 2017/9/13.
  3. */
  4. const mongoose = require('mongoose');
  5. let Schema = mongoose.Schema;
  6. //安装增加费-费用规则
  7. let feeRuleSchema = new Schema({
  8. ID: String,
  9. sectionId: String, //分册章节id
  10. feeItemId:String,
  11. code: String,
  12. rule: String,
  13. base: String,
  14. feeRate: Number,
  15. labour: Number,
  16. material: Number,
  17. machine: Number,
  18. position: String,//记取位置
  19. billID:String//记取位置对应的清单ID
  20. },{versionKey:false,_id: false});
  21. //安装增加费-分册章节
  22. let installSectionSchema = new Schema({
  23. ID: String,
  24. feeItemId: String,
  25. feeRuleId: String,
  26. name: String
  27. },{versionKey:false,_id: false});
  28. //安装增加费-费用项
  29. let installFeeItemSchema = new Schema({
  30. ID: String,
  31. feeItem: String, //费用项
  32. feeType: String, //费用类型
  33. position: String,//记取位置
  34. billID:String,//记取位置对应的清单ID
  35. isCal: {type: Number,default:0}//是否记取0:false 1:true
  36. },{versionKey:false,_id: false});
  37. let installationFeeSchema = new Schema({
  38. ID:String,
  39. libID:Number,
  40. libName:String,
  41. projectID:String,
  42. installFeeItem:[installFeeItemSchema],
  43. installSection:[installSectionSchema],
  44. feeRule:[feeRuleSchema]
  45. },{versionKey:false});
  46. mongoose.model("installation_fee",installationFeeSchema,"installation_fee");