compleRation_ration.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*补充定额库-定额*/
  5. const mongoose = require('mongoose');
  6. const Schema = mongoose.Schema;
  7. const deleteSchema = require('../all_schemas/delete_schema');
  8. //定额工料机
  9. const compleRationGljItemSchema = new Schema({
  10. gljId: Number,
  11. consumeAmt: String,
  12. type: String //std or complementary
  13. }, { _id: false });
  14. //辅助定额调整
  15. const compleRationAssItemSchema = new Schema({
  16. name: String,
  17. assistID: Number,
  18. assistCode: String,
  19. stdValue: String,
  20. stepValue: String,
  21. decimal: Number,
  22. carryBit: String,
  23. minValue: String,
  24. maxValue: String
  25. }, { _id: false });
  26. //定额安装增加费用
  27. const rationInstSchema = new Schema({
  28. feeItemId: String,
  29. sectionId: String
  30. },{_id: false});
  31. //补充定额
  32. const compleRationSchema = new Schema({
  33. userId: String,
  34. compilationId: String,
  35. rationRepId: Number,
  36. ID:Number,
  37. code: String,
  38. name: String,
  39. unit: String,
  40. labourPrice: String,
  41. materialPrice: String,
  42. machinePrice: String,
  43. basePrice: String,
  44. sectionId: Number,
  45. caption: String,
  46. feeType: Number,
  47. jobContent: String,
  48. annotation: String,
  49. rationGljList: [compleRationGljItemSchema],
  50. rationCoeList: Array,
  51. rationAssList: [compleRationAssItemSchema],
  52. rationInstList: [rationInstSchema],
  53. deleteInfo: deleteSchema
  54. }, {versionKey: false});
  55. mongoose.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');