glj.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. // 调整系数ID
  65. adjCoe: Number,
  66. // 规格型号
  67. specs: {
  68. type: String,
  69. default: ''
  70. },
  71. // 类型
  72. type: Number,
  73. // 单位
  74. unit: String,
  75. // 显示调整基价
  76. adjust_price: String,
  77. // 显示关联单价文件的字段
  78. unit_price: Schema.Types.Mixed,
  79. // 显示关联的消耗量
  80. quantity: String,
  81. // 显示组成物的消耗量
  82. consumption: String,
  83. // 显示关联配合比的id
  84. mix_ratio_id: Number,
  85. // 显示关联父级工料机code(组合物用)
  86. connect_code: String,
  87. ratio_data: Schema.Types.Mixed
  88. };
  89. let model = mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false}));
  90. export { model as default, collectionName as collectionName} ;