/** * 具体单价数据结构 * * @author CaiAoLin * @date 2017/6/29 * @version */ import mongoose from "mongoose"; let Schema = mongoose.Schema; let collectionName = 'unit_price'; let modelSchema = { // 自增ID id: {type:Number,unique: true}, // 基价单价 base_price: String, // 市场单价 market_price: String, // 编码 code: { type: String, index: true }, //原始的编码 original_code: { type: String, index: true }, // 名称 name: { type: String, index: true }, // 规格型号 specs: { type: String, default: '' }, // 单位 unit: String, // 类型 type: Number, // 类型简称 short_name: String, // 单价文件表id unit_price_file_id: {type: Number, index: true}, // 对应标准库工料机id glj_id: Number, //是否新增1为是,0为否 is_add:{ type: Number, default: 0 }, supplyLocation:String,//供应地点 originalPrice:String,//原价 priceHeightFee:String,//自采高原增加费 unitFreight:String,//单价运费 freightHeightFee:String,//自办运输高原增加费 totalLoadingTimes:String,//装卸总次数 offSiteTransportLoss:String,//场外运输损耗 purchaseStorage:String,//采购及保管费 packageRecoverValue:String,//包装品回收价值 calcMaterial:{ type: Number, default: 0},//材料计算标计,1为材料计算 grossWeightCoe_n: Number, //单位毛重 purchaseStorageRate_n: Number, //采购保管费率 offSiteTransportLossRate_n: Number, //场外运输损耗率 handlingLossRate_n: Number, //每增一次装卸损耗率 //----初始计算数据 grossWeightCoe: Number, //单位毛重 purchaseStorageRate: Number, //采购保管费率 offSiteTransportLossRate:Number, //场外运输损耗率 handlingLossRate: Number //每增一次装卸损耗率 }; mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));