compleRation_ration.js 1.8 KB

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