unit_price.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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},
  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: Number,
  46. // 对应标准库工料机id
  47. glj_id: Number,
  48. //是否新增1为是,0为否
  49. is_add:{
  50. type: Number,
  51. default: 0
  52. },
  53. supplyLocation:String,//供应地点
  54. originalPrice:String,//原价
  55. unitFreight:String,//单价运费
  56. totalLoadingTimes:String,//装卸总次数
  57. offSiteTransportLoss:String,//场外运输损耗
  58. purchaseStorage:String,//采购及保管费
  59. packageRecoverValue:String,//包装品回收价值
  60. calcMaterial:{ type: Number, default: 0},//材料计算标计,1为材料计算
  61. grossWeightCoe_n: Number, //单位毛重
  62. purchaseStorageRate_n: Number, //采购保管费率
  63. offSiteTransportLossRate_n: Number, //场外运输损耗率
  64. handlingLossRate_n: Number, //每增一次装卸损耗率
  65. //----初始计算数据
  66. grossWeightCoe: Number, //单位毛重
  67. purchaseStorageRate: Number, //采购保管费率
  68. offSiteTransportLossRate:Number, //场外运输损耗率
  69. handlingLossRate: Number //每增一次装卸损耗率
  70. };
  71. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));