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_repository_id: Number,
  16. // 项目ID
  17. project_id: Number,
  18. // 标段ID
  19. tender_id: Number,
  20. // 编码
  21. code: String,
  22. // 名称
  23. name: String,
  24. unit: String,
  25. // 规格型号
  26. specs: {
  27. type: String,
  28. default: ''
  29. },
  30. // 类型
  31. type: Number,
  32. // 人工工种
  33. type_of_work: Number,
  34. // 是否暂估 (0为否 1为是)
  35. is_evaluate: {
  36. type: Number,
  37. default: 0
  38. },
  39. // 供货方式
  40. supply: {
  41. type: String,
  42. default: ''
  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. adjust_price: String,
  71. // 显示关联单价文件的字段
  72. unit_price: Schema.Types.Mixed
  73. };
  74. let model = mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false}));
  75. export { model as default, collectionName as collectionName} ;