|
@@ -2,9 +2,10 @@
|
|
|
* Created by Zhong on 2018/3/22.
|
|
|
*/
|
|
|
/*定额库-定额*/
|
|
|
-const mongoose = require('mongoose');
|
|
|
+const mongoose = require("mongoose");
|
|
|
const Schema = mongoose.Schema;
|
|
|
-const rationGljItemSchema = new Schema({
|
|
|
+const rationGljItemSchema = new Schema(
|
|
|
+ {
|
|
|
gljId: Number,
|
|
|
consumeAmt: Number,
|
|
|
proportion: { type: Number, default: 0 }, //配合比,暂时无需使用,默认0
|
|
@@ -12,9 +13,12 @@ const rationGljItemSchema = new Schema({
|
|
|
lossRateNo: Number,
|
|
|
lossRateName: String,
|
|
|
lossRate: Number,
|
|
|
-}, { _id: false });
|
|
|
+ },
|
|
|
+ { _id: false }
|
|
|
+);
|
|
|
|
|
|
-const rationAssItemSchema = new Schema({
|
|
|
+const rationAssItemSchema = new Schema(
|
|
|
+ {
|
|
|
name: String,
|
|
|
assistID: Number,
|
|
|
assistCode: String,
|
|
@@ -24,39 +28,53 @@ const rationAssItemSchema = new Schema({
|
|
|
carryBit: String,
|
|
|
minValue: String,
|
|
|
maxValue: String,
|
|
|
- paramName: String,//参数名称
|
|
|
- param: String,//参数
|
|
|
- thirdRationCode: String//第三定额
|
|
|
-}, { _id: false });
|
|
|
+ paramName: String, //参数名称
|
|
|
+ param: String, //参数
|
|
|
+ thirdRationCode: String, //第三定额
|
|
|
+ },
|
|
|
+ { _id: false }
|
|
|
+);
|
|
|
|
|
|
//定额安装增加费用
|
|
|
-const rationInstSchema = new Schema({
|
|
|
+const rationInstSchema = new Schema(
|
|
|
+ {
|
|
|
feeItemId: String,
|
|
|
- sectionId: String
|
|
|
-}, { _id: false });
|
|
|
+ sectionId: String,
|
|
|
+ },
|
|
|
+ { _id: false }
|
|
|
+);
|
|
|
|
|
|
const rationItemSchema = new Schema({
|
|
|
- ID: Number,
|
|
|
- code: String,
|
|
|
- name: String,
|
|
|
- unit: String,
|
|
|
- basePrice: Number,
|
|
|
- sectionId: Number,
|
|
|
- rationRepId: { type: Number, index: true },
|
|
|
- caption: String,
|
|
|
- feeType: String,
|
|
|
- jobContent: String,
|
|
|
- annotation: String,
|
|
|
- rationGljList: [rationGljItemSchema],
|
|
|
- rationCoeList: Array,
|
|
|
- rationAssList: [rationAssItemSchema],
|
|
|
- rationInstList: [rationInstSchema],
|
|
|
- rationTemplateList: {
|
|
|
- type: Array,
|
|
|
- default: []
|
|
|
- },
|
|
|
- isDeleted: { type: Boolean, default: false }
|
|
|
+ ID: Number,
|
|
|
+ code: String,
|
|
|
+ name: String,
|
|
|
+ unit: String,
|
|
|
+ basePrice: Number,
|
|
|
+ sectionId: Number,
|
|
|
+ rationRepId: { type: Number, index: true },
|
|
|
+ caption: String,
|
|
|
+ feeType: String,
|
|
|
+ oilStoneRatio: Number, // 油石比
|
|
|
+ jobContent: String,
|
|
|
+ annotation: String,
|
|
|
+ rationGljList: [rationGljItemSchema],
|
|
|
+ rationCoeList: Array,
|
|
|
+ rationAssList: [rationAssItemSchema],
|
|
|
+ rationInstList: [rationInstSchema],
|
|
|
+ rationTemplateList: {
|
|
|
+ type: Array,
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
+ isDeleted: { type: Boolean, default: false },
|
|
|
});
|
|
|
|
|
|
-mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');
|
|
|
-mongoose.model('std_ration_lib_ration_items_backup', rationItemSchema, 'std_ration_lib_ration_items_backup');
|
|
|
+mongoose.model(
|
|
|
+ "std_ration_lib_ration_items",
|
|
|
+ rationItemSchema,
|
|
|
+ "std_ration_lib_ration_items"
|
|
|
+);
|
|
|
+mongoose.model(
|
|
|
+ "std_ration_lib_ration_items_backup",
|
|
|
+ rationItemSchema,
|
|
|
+ "std_ration_lib_ration_items_backup"
|
|
|
+);
|