glj.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /**
  2. * 工料机数据模型
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/6/29
  6. * @version
  7. */
  8. import mongoose from "mongoose";
  9. let Schema = mongoose.Schema;
  10. let collectionName = 'glj_list';
  11. let modelSchema = {
  12. // 自增id
  13. id: Number,
  14. // 工料机总库ID
  15. glj_id: Number,
  16. // 标段ID
  17. project_id: Number,
  18. // 编码
  19. code: {
  20. type: String,
  21. index: true
  22. },
  23. //原始的编码
  24. original_code: {
  25. type: String,
  26. index: true
  27. },
  28. // 名称
  29. name: {
  30. type: String,
  31. index: true,
  32. default: ''
  33. },
  34. // 是否暂估 (0为否 1为是)
  35. is_evaluate: {
  36. type: Number,
  37. default: 0
  38. },
  39. // 供货方式
  40. supply: {
  41. type: Number,
  42. default: 0
  43. },
  44. // 甲供数量
  45. supply_quantity: {
  46. type: Number,
  47. default: 0
  48. },
  49. // 交货方式
  50. delivery: {
  51. type: String,
  52. default: ''
  53. },
  54. // 送达地点
  55. delivery_address: {
  56. type: String,
  57. default: ''
  58. },
  59. // 不调价
  60. is_adjust_price: {
  61. type: Number,
  62. default: 0
  63. },
  64. // 调整系数
  65. adjustment: {
  66. type: Number,
  67. default: 1
  68. },
  69. // 规格型号
  70. specs: {
  71. type: String,
  72. default: ''
  73. },
  74. // 类型
  75. type: Number,
  76. // 单位
  77. unit: String,
  78. // 显示调整基价
  79. adjust_price: String,
  80. // 显示关联单价文件的字段
  81. unit_price: Schema.Types.Mixed,
  82. // 显示关联的消耗量
  83. quantity: String,
  84. // 显示组成物的消耗量
  85. consumption: String,
  86. // 显示关联配合比的id
  87. mix_ratio_id: Number,
  88. // 显示关联父级工料机code(组合物用)
  89. connect_code: String,
  90. ratio_data: Schema.Types.Mixed
  91. };
  92. let model = mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false}));
  93. export { model as default, collectionName as collectionName} ;