| 1234567891011121314151617181920212223242526272829303132333435 | /** * Created by chen on 2017/6/29. */var mongoose = require('mongoose'),    Schema = mongoose.Schema;var coeSchema = mongoose.Schema({    coeType: String,                // 系数类型,指作用范围:// 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。    gljCode: String,                  // 要调整的工料机ID(当coeType=0时有效)    gljName: String,    operator: String,               // 运算符(*、+、-、=)    amount: Number,                 // 调整的量    replaceCode:String,    replaceName:String,    _id: false});var coeListSchema = mongoose.Schema({    libID: Number,                      // 所属定额库ID    ID: String,                         // 系数ID(流水号ID)    name: String,                       // 名称    content: String,                    // 说明    original_code:String,               //原人材机编码    option_codes:String,                //可选人材机编码    option_list:[Schema.Types.Mixed],//下拉列表选项    select_code:String,    rationID:{type: String, index: true},    projectID:{type: Number, index: true},    coeID:Number,    isAdjust:Number, //0不调整,1调整    seq:Number,//序数,排序用    coes: [coeSchema]}, {versionKey: false});mongoose.model('ration_coe', coeListSchema);
 |