schemas.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * Created by Zhong on 2017/12/21.
  3. */
  4. import mongoose from 'mongoose';
  5. let deleteSchema = require('../../../public/models/delete_schema');
  6. let Schema = mongoose.Schema;
  7. //补充定额章节树
  8. let compleRationSectionTreeSchema = new Schema({
  9. //用户名
  10. userId: Number,
  11. //编办
  12. compilationId: String,
  13. //标准定额库
  14. rationRepId: Number,
  15. //名称
  16. name: String,
  17. //是否是同层第一个节点
  18. isFirst: Boolean,
  19. ID: Number,
  20. NextSiblingID: Number,
  21. ParentID: Number,
  22. deleteInfo: deleteSchema
  23. }, {versionKey: false});
  24. //定额工料机
  25. let compleRationGljItemSchema = new Schema({
  26. gljId: Number,
  27. consumeAmt: String,
  28. type: String //std or complementary
  29. }, { _id: false });
  30. //辅助定额调整
  31. let compleRationAssItemSchema = new Schema({
  32. name: String,
  33. assistID: Number,
  34. assistCode: String,
  35. stdValue: String,
  36. stepValue: String,
  37. decimal: Number,
  38. carryBit: String,
  39. minValue: String,
  40. maxValue: String
  41. }, { _id: false });
  42. //补充定额
  43. let compleRationSchema = new Schema({
  44. userId: Number,
  45. compilationId: String,
  46. rationRepId: Number,
  47. ID:Number,
  48. code: String,
  49. name: String,
  50. unit: String,
  51. labourPrice: String,
  52. materialPrice: String,
  53. machinePrice: String,
  54. basePrice: String,
  55. sectionId: Number,
  56. caption: String,
  57. feeType: Number,
  58. jobContent: String,
  59. annotation: String,
  60. rationGljList: [compleRationGljItemSchema],
  61. rationCoeList: Array,
  62. rationAssList: [compleRationAssItemSchema],
  63. deleteInfo: deleteSchema
  64. }, {versionKey: false});
  65. let compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree', compleRationSectionTreeSchema, 'complementary_ration_section_tree');
  66. let compleRationModel = mongoose.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');
  67. export {compleRationSectionTreeModel, compleRationModel};