compleGlj_glj.js 900 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Created by Zhong on 2018/3/22.
  3. */
  4. /*补充工料机*/
  5. //补充工料机的组成物可能来自标准工料机和补充工料机
  6. const mongoose = require('mongoose');
  7. const Schema = mongoose.Schema;
  8. const comple_gljComponent = new Schema(
  9. {
  10. isStd: Boolean, //组成物里的工料机是否是标准的,否则是补充的
  11. ID: Number,
  12. consumeAmt: String
  13. },
  14. {_id: false},
  15. {versionKey: false}
  16. );
  17. //补充工料机跟用户和编办绑定
  18. const comple_glj = new Schema({
  19. userId: String,
  20. compilationId: String,
  21. ID: Number,
  22. code: String,
  23. name: String,
  24. specs: String,
  25. unit: String,
  26. basePrice: String,
  27. gljClass: String,
  28. gljType: Number,
  29. model: Number,
  30. shortName: String,
  31. component: [comple_gljComponent]
  32. }, {versionKey: false});
  33. mongoose.model('complementary_glj_lib', comple_glj, 'complementary_glj_lib');