glj.js 1.5 KB

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