| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /**
- * Created by Zhong on 2017/9/13.
- */
- import mongoose from "mongoose";
- let Schema = mongoose.Schema;
- //安装增加费-费用规则
- let feeRuleSchema = new Schema(
- {
- ID: String,
- sectionId: String, //分册章节id
- feeItemId: String,
- code: String,
- rule: String,
- base: String,
- feeRate: Number,
- labour: Number,
- material: Number,
- machine: Number,
- position: String, //记取位置
- billID: String, //记取位置对应的清单ID
- },
- { versionKey: false, _id: false }
- );
- //安装增加费-分册章节
- let installSectionSchema = new Schema(
- {
- ID: String,
- feeItemId: String,
- feeRuleId: String,
- name: String,
- seq: Number,
- },
- { versionKey: false, _id: false }
- );
- //安装增加费-费用项
- let installFeeItemSchema = new Schema(
- {
- ID: String,
- feeItem: String, //费用项
- feeType: String, //费用类型
- position: String, //记取位置
- position24: String, //24记取位置
- billID: String, //记取位置对应的清单ID
- isCal: { type: Number, default: 0 }, //是否记取0:false 1:true
- seq: Number,
- reductionRate: Number, //降效比例(%)
- measureRate: Number, //措施比例(%)
- showIn24: Boolean, //24是否显示
- },
- { versionKey: false, _id: false }
- );
- let installationFeeSchema = new Schema(
- {
- ID: String,
- libID: Number,
- libName: String,
- projectID: String,
- installFeeItem: [installFeeItemSchema],
- installSection: [installSectionSchema],
- feeRule: [feeRuleSchema],
- },
- { versionKey: false }
- );
- mongoose.model("installation_fee", installationFeeSchema, "installation_fee");
|