/** * 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 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], 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'); export {compleRationSectionTreeModel, compleRationModel};