/**
 * Created by zhang on 2019/9/6.
 */
/**
 * Created by zhang on 2019/3/18.
 */
import mongoose from "mongoose";

let Schema = mongoose.Schema;
let evaluateSchema = {
    ID:{type:String,  index: true},
    projectID: {type:Number,index: true},
    is_related:{type: Number, default: 0},//关联，1关，0不关
    projectGLJID:Number,//关联工料机ID
    seq:String,//序号
    code:String,
    name:String,
    specs:String,
    unit:String,
    type:Number,
    market_price:String,
    quantity:String,
    locked:{type: Number, default: 0},//锁定，1锁，0不锁
    remark:String,
    originPlace:String,//产地
    vender:String //厂家
};
mongoose.model("evaluate_list", new Schema(evaluateSchema, {versionKey: false, collection: "evaluate_list"}));

let bidEvaluationSchema = {
    ID:{type:String,  index: true},
    projectID: {type:Number,index: true},
    is_related:{type: Number, default: 0},//关联，1关，0不关
    projectGLJID:Number,//关联工料机ID
    seq:String,//序号
    code:String,
    name:String,
    specs:String,
    unit:String,
    type:Number,
    market_price:String,
    quantity:String,
    remark:String,
    originPlace:String,//产地
    vender:String //厂家
};

mongoose.model("bid_evaluation_list", new Schema(bidEvaluationSchema, {versionKey: false, collection: "bid_evaluation_list"}));


let contractorSchema = {
    ID:{type:String,  index: true},
    projectID: {type:Number,index: true},
    is_related:{type: Number, default: 0},//关联，1关，0不关
    projectGLJID:Number,//关联工料机ID
    seq:String,//序号
    code:String,
    name:String,
    specs:String,
    unit:String,
    type:Number,
    riskCoe:String,//风险系数
    standardPrice:String,//基准单价
    FO:String,//基本价格指数
    FI:String,//现行价格指数
    market_price:String,
    quantity:String,
    remark:String,
    supply: {type: Number, default: 0},
    originPlace:String,//产地
    vender:String //厂家
};

mongoose.model("contractor_list", new Schema(contractorSchema, {versionKey: false, collection: "contractor_list"}));