/** * Created by Zhong on 2017/12/21. */ import mongoose from 'mongoose'; let deleteSchema = require('../../../public/models/delete_schema'); let Schema = mongoose.Schema; //补充定额章节树 let compleRationSectionTreeSchema = new Schema({ //用户名 userId: Number, //编办 compilationId: String, //标准定额库 rationRepId: Number, //名称 name: String, //是否是同层第一个节点 isFirst: Boolean, ID: Number, NextSiblingID: Number, ParentID: Number, deleteInfo: deleteSchema }, {versionKey: false}); //定额工料机 let compleRationGljItemSchema = new Schema({ gljId: Number, consumeAmt: String, type: String //std or complementary }, { _id: false }); //辅助定额调整 let compleRationAssItemSchema = new Schema({ name: String, assistID: Number, assistCode: String, stdValue: String, stepValue: String, decimal: Number, carryBit: String, minValue: String, maxValue: String }, { _id: false }); //安装增加费-费用规则 let feeRuleSchema = new Schema({ ID: String, code: String, rule: String, base: String, feeRate: Number, labour: Number, material: Number, machine: Number }); //定额安装增加费用 let rationInstSchema = new Schema({ feeItemId: String, sectionId: String },{_id: false}); //标准安装增加费-分册章节 let installSectionSchema = new Schema({ rationRepId: Number, ID: String, feeItemId: String, name: String, feeRule: [feeRuleSchema], deleted: false }, {versionKey: false}); //标准安装增加费-费用项 let installFeeItemSchema = new Schema({ rationRepId: Number, ID: String, feeItem: String, //费用项 feeType: String, //费用类型 position: String, //记取位置 section: [], deleted: false }, {versionKey: false}); //补充定额 let compleRationSchema = new Schema({ userId: Number, compilationId: String, rationRepId: Number, ID:Number, code: String, name: String, unit: String, labourPrice: String, materialPrice: String, machinePrice: String, basePrice: String, sectionId: Number, caption: String, feeType: Number, jobContent: String, annotation: String, rationGljList: [compleRationGljItemSchema], rationCoeList: Array, rationAssList: [compleRationAssItemSchema], rationInstList: [rationInstSchema], deleteInfo: deleteSchema }, {versionKey: false}); let compleRationSectionTreeModel = mongoose.model('complementary_ration_section_tree', compleRationSectionTreeSchema, 'complementary_ration_section_tree'); let compleRationModel = mongoose.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items'); let installSectionModel = mongoose.model("std_ration_lib_installationSection", installSectionSchema, "std_ration_lib_installationSection"); let installFeeItemModel = mongoose.model("std_ration_lib_installation", installFeeItemSchema, "std_ration_lib_installation"); export {compleRationSectionTreeModel, compleRationModel, installSectionModel, installFeeItemModel};