unit_price.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. infoPrice:Number,//信息价
  51. purchaseFeeRate:Number,//采保费率
  52. //是否新增1为是,0为否
  53. is_add:{
  54. type: Number,
  55. default: 0
  56. }
  57. };
  58. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));