unit_price.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * 具体单价数据结构
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/6/29
  6. * @version
  7. */
  8. const mongoose = require('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. taxRate:String,//税率
  19. // 编码
  20. code: {
  21. type: String,
  22. index: true
  23. },
  24. //原始的编码
  25. original_code: {
  26. type: String,
  27. index: true
  28. },
  29. // 名称
  30. name: {
  31. type: String,
  32. index: true
  33. },
  34. // 规格型号
  35. specs: {
  36. type: String,
  37. default: ''
  38. },
  39. // 单位
  40. unit: String,
  41. // 类型
  42. type: Number,
  43. // 类型简称
  44. short_name: String,
  45. // 单价文件表id
  46. unit_price_file_id: {type: Number, index: true},
  47. // 对应标准库工料机id
  48. glj_id: Number,
  49. priceFrom:String,//价格来源
  50. //是否新增1为是,0为否
  51. is_add:{
  52. type: Number,
  53. default: 0
  54. }
  55. };
  56. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));