123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- /**
- * 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};
|