installation_fee.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * Created by Zhong on 2017/9/13.
  3. */
  4. import mongoose from "mongoose";
  5. let Schema = mongoose.Schema;
  6. //安装增加费-费用规则
  7. let feeRuleSchema = new Schema(
  8. {
  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. },
  22. { versionKey: false, _id: false }
  23. );
  24. //安装增加费-分册章节
  25. let installSectionSchema = new Schema(
  26. {
  27. ID: String,
  28. feeItemId: String,
  29. feeRuleId: String,
  30. name: String,
  31. seq: Number,
  32. },
  33. { versionKey: false, _id: false }
  34. );
  35. //安装增加费-费用项
  36. let installFeeItemSchema = new Schema(
  37. {
  38. ID: String,
  39. feeItem: String, //费用项
  40. feeType: String, //费用类型
  41. position: String, //记取位置
  42. billID: String, //记取位置对应的清单ID
  43. isCal: { type: Number, default: 0 }, //是否记取0:false 1:true
  44. seq: Number,
  45. },
  46. { versionKey: false, _id: false }
  47. );
  48. let installationFeeSchema = new Schema(
  49. {
  50. ID: String,
  51. libID: Number,
  52. libName: String,
  53. projectID: String,
  54. installFeeItem: [installFeeItemSchema],
  55. installSection: [installSectionSchema],
  56. feeRule: [feeRuleSchema],
  57. },
  58. { versionKey: false }
  59. );
  60. mongoose.model("installation_fee", installationFeeSchema, "installation_fee");