installation_fee.js 1.4 KB

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