unit_price.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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},
  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. supplyLocation:String,//供应地点
  54. originalPrice:String,//原价
  55. priceHeightFee:String,//自采高原增加费
  56. unitFreight:String,//单价运费
  57. freightHeightFee:String,//自办运输高原增加费
  58. totalLoadingTimes:String,//装卸总次数
  59. offSiteTransportLoss:String,//场外运输损耗
  60. purchaseStorage:String,//采购及保管费
  61. packageRecoverValue:String,//包装品回收价值
  62. calcMaterial:{ type: Number, default: 0},//材料计算标计,1为材料计算
  63. grossWeightCoe_n: Number, //单位毛重
  64. purchaseStorageRate_n: Number, //采购保管费率
  65. offSiteTransportLossRate_n: Number, //场外运输损耗率
  66. handlingLossRate_n: Number, //每增一次装卸损耗率
  67. //----初始计算数据
  68. grossWeightCoe: Number, //单位毛重
  69. purchaseStorageRate: Number, //采购保管费率
  70. offSiteTransportLossRate:Number, //场外运输损耗率
  71. handlingLossRate: Number //每增一次装卸损耗率
  72. };
  73. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));