compleRation_ration.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. paramName:String,//参数名称
  26. param:String,//参数
  27. thirdRationCode:String//第三定额
  28. }, { _id: false });
  29. //定额安装增加费用
  30. const rationInstSchema = new Schema({
  31. feeItemId: String,
  32. sectionId: String
  33. },{_id: false});
  34. //补充定额
  35. const compleRationSchema = new Schema({
  36. userId: String,
  37. compilationId: String,
  38. rationRepId: Number,
  39. ID:Number,
  40. code: String,
  41. name: String,
  42. unit: String,
  43. labourPrice: String,
  44. materialPrice: String,
  45. machinePrice: String,
  46. basePrice: String,
  47. sectionId: String,
  48. caption: String,
  49. feeType: Number,
  50. jobContent: String,
  51. annotation: String,
  52. rationGljList: [compleRationGljItemSchema],
  53. rationCoeList: Array,
  54. rationAssList: [compleRationAssItemSchema],
  55. rationInstList: [rationInstSchema],
  56. rationTemplateList : [new Schema({
  57. rationID:Number,
  58. type: String,
  59. billsLocation: String
  60. }, { _id: false })],
  61. deleteInfo: deleteSchema
  62. }, {versionKey: false});
  63. mongoose.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');