unit_price.js 865 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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: Number,
  14. // 基价单价
  15. base_price: Number,
  16. // 市场单价
  17. market_price: Number,
  18. // 编码
  19. code: {
  20. type: String,
  21. index: true
  22. },
  23. // 名称
  24. name: {
  25. type: String,
  26. index: true
  27. },
  28. // 规格型号
  29. specs: {
  30. type: String,
  31. default: ''
  32. },
  33. // 单位
  34. unit: String,
  35. // 类型
  36. type: Number,
  37. // 单价文件表id
  38. unit_price_file_id: Number,
  39. };
  40. let model = mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));
  41. export {model as default, collectionName as collectionName};