stdRation_ration.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*定额库-定额*/
  5. const mongoose = require('mongoose');
  6. const Schema = mongoose.Schema;
  7. const rationGljItemSchema = new Schema({
  8. gljId: Number,
  9. consumeAmt: Number,
  10. proportion: {type: Number, default: 0} //配合比,暂时无需使用,默认0
  11. }, { _id: false });
  12. const rationAssItemSchema = new Schema({
  13. name: String,
  14. assistID: Number,
  15. assistCode: String,
  16. stdValue: String,
  17. stepValue: String,
  18. decimal: Number,
  19. carryBit: String,
  20. minValue: String,
  21. maxValue: String,
  22. paramName:String,//参数名称
  23. param:String,//参数
  24. thirdRationCode:String//第三定额
  25. }, { _id: false });
  26. //定额安装增加费用
  27. const rationInstSchema = new Schema({
  28. feeItemId: String,
  29. sectionId: String
  30. },{_id: false});
  31. const rationItemSchema = new Schema({
  32. ID:Number,
  33. code: String,
  34. name: String,
  35. unit: String,
  36. basePrice: Number,
  37. sectionId: Number,
  38. rationRepId: {type: Number, index: true},
  39. caption: String,
  40. feeType: String,
  41. jobContent: String,
  42. annotation: String,
  43. rationGljList: [rationGljItemSchema],
  44. rationCoeList: Array,
  45. rationAssList: [rationAssItemSchema],
  46. rationInstList: [rationInstSchema],
  47. rationTemplateList: {
  48. type: Array,
  49. default: []
  50. },
  51. isDeleted: {type: Boolean, default: false}
  52. });
  53. mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');