/** * Created by zhang on 2018/3/22. */ let mongoose = require("mongoose"); let subSchema = require("../all_schemas/bills_sub_schemas"); let Schema = mongoose.Schema; let deleteSchema = require('../all_schemas/delete_schema'); var rationAssItemSchema = mongoose.Schema({ name: String, assistID: Number, assistCode: String, stdValue: Number, actualValue:Number, stepValue: String, decimal: Number, carryBit: String, minValue: String, maxValue: String }, { _id: false }); // 定额、量价、工料机定额 合并存储 let rationSchema = new Schema({ // 公用属性部分 ID: String, projectID: Number, billsItemID: String, serialNo: Number, code: String, name: String, unit: String, quantity: String, contain:String,//含量 quantityEXP:String,//工程量表达式 programID: Number, marketUnitFee: String, marketTotalFee: String, fees: [subSchema.feesSchema], //消耗量调整系数字段 quantityCoe:subSchema.quantityCoeSchema, //子目工程量调整系数 rationQuantityCoe:String, tenderQuantity:String,//调整后工程量 // 不调价 is_adjust_price: {type: Number,default: 0}, targetUnitFee:String,//目标单价 targetTotalFee:String,//目标合价 deleteInfo: deleteSchema, type: Number, // 1 定额、2 量价、3 工料机定额 subType: Number, // 子类型:1人工、201材料、301机械、4主材、5设备 from:{type: String,default:'std'}, //std, cpt 来自标准、补充 isSubcontract: Boolean, // 是否分包 installationKey:String, //用来记录安装增加费的关联字段 // 定额特有属性: libID: Number, maskName: String, caption: String, isFromDetail:{type: Number,default:0}, // 1 true 2 false adjustState: String, rationProjName: String, comments: String, // 说明 flags: [subSchema.flagsSchema], // 标记字段 rationAssList: [rationAssItemSchema], content: String, // 工作内容 annotation: String, //附注 ruleText: String, // 计算规则 prefix: {type: String, default: ''}, //定额是补充、借用时用 补 借 //工料机特有属性 projectGLJID:Number, //项目工料机ID GLJID:Number,//工料机库ID original_code:String, //原始编码 specs:String,//规格型号 shortName:String,//缩写 customQuantity:String,//自定义消耗 adjCoe:Number, remark:String }); let ration = mongoose.model("ration", rationSchema, "ration");