unit_price.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 = 'unit_price';
  11. let modelSchema = {
  12. // 自增ID
  13. id: {type:Number,unique: true, index: true},
  14. // 基价单价
  15. base_price: String,
  16. // 市场单价
  17. market_price: String,
  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. },
  33. // 规格型号
  34. specs: {
  35. type: String,
  36. default: ''
  37. },
  38. // 单位
  39. unit: String,
  40. // 类型
  41. type: Number,
  42. // 类型简称
  43. short_name: String,
  44. // 单价文件表id
  45. unit_price_file_id: {type: Number, index: true},
  46. // 对应标准库工料机id
  47. glj_id: Number,
  48. //是否新增1为是,0为否
  49. is_add:{
  50. type: Number,
  51. default: 0
  52. }
  53. };
  54. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));