stdRation_ration.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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: Number //配合比,暂时无需使用,默认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. }, { _id: false });
  23. //定额安装增加费用
  24. const rationInstSchema = new Schema({
  25. feeItemId: String,
  26. sectionId: String
  27. },{_id: false});
  28. const rationItemSchema = new Schema({
  29. ID:Number,
  30. code: String,
  31. name: String,
  32. unit: String,
  33. basePrice: Number,
  34. labourPrice: Number,
  35. materialPrice: Number,
  36. machinePrice: Number,
  37. sectionId: Number,
  38. rationRepId: {type: Number, index: true},
  39. caption: String,
  40. feeType: Number,
  41. jobContent: String,
  42. annotation: String,
  43. rationGljList: [rationGljItemSchema],
  44. rationCoeList: Array,
  45. rationAssList: [rationAssItemSchema],
  46. rationInstList: [rationInstSchema],
  47. isDeleted: {type: Boolean, default: false}
  48. });
  49. mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');