glj.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. name: {
  25. type: String,
  26. index: true,
  27. default: ''
  28. },
  29. // 是否暂估 (0为否 1为是)
  30. is_evaluate: {
  31. type: Number,
  32. default: 0
  33. },
  34. // 供货方式
  35. supply: {
  36. type: String,
  37. default: ''
  38. },
  39. // 甲供数量
  40. supply_quantity: {
  41. type: Number,
  42. default: 0
  43. },
  44. // 交货方式
  45. delivery: {
  46. type: String,
  47. default: ''
  48. },
  49. // 送达地点
  50. delivery_address: {
  51. type: String,
  52. default: ''
  53. },
  54. // 不调价
  55. is_adjust_price: {
  56. type: Number,
  57. default: 0
  58. },
  59. // 调整系数
  60. adjustment: {
  61. type: Number,
  62. default: 1
  63. },
  64. // 显示调整基价
  65. adjust_price: Number,
  66. // 显示关联单价文件的字段
  67. unit_price: Schema.Types.Mixed,
  68. // 显示关联的消耗量
  69. quantity: Number,
  70. // 显示组成物的消耗量
  71. consumption: Number,
  72. // 显示关联配合比的id
  73. mix_ratio_id: Number,
  74. // 显示关联父级工料机code(组合物用)
  75. connect_code: String,
  76. ratio_data: Schema.Types.Mixed
  77. };
  78. let model = mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false}));
  79. export { model as default, collectionName as collectionName} ;