ration.js 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**
  2. * Created by zhang on 2018/3/22.
  3. */
  4. let mongoose = require("mongoose");
  5. let subSchema = require("../all_schemas/bills_sub_schemas");
  6. let Schema = mongoose.Schema;
  7. let deleteSchema = require('../all_schemas/delete_schema');
  8. var rationAssItemSchema = mongoose.Schema({
  9. name: String,
  10. assistID: Number,
  11. assistCode: String,
  12. stdValue: Number,
  13. actualValue:Number,
  14. stepValue: String,
  15. decimal: Number,
  16. carryBit: String,
  17. minValue: String,
  18. maxValue: String,
  19. paramName:String,//参数名称
  20. param:String,//参数
  21. thirdRationCode:String,//第三定额
  22. isAdjust:Number,//0不调整,1调整
  23. groupList:[Schema.Types.Mixed]//当有分组的时候用这个
  24. }, { _id: false });
  25. // 定额、量价、工料机定额 合并存储
  26. let rationSchema = new Schema({
  27. // 公用属性部分
  28. ID: {type: String, index: true},
  29. projectID: {type: Number, index: true},
  30. billsItemID: String,
  31. serialNo: Number,
  32. code: String,
  33. name: String,
  34. unit: String,
  35. quantity: String,
  36. contain:String,//含量
  37. quantityEXP:String,//工程量表达式
  38. programID: Number,
  39. marketUnitFee: String,
  40. marketTotalFee: String,
  41. fees: [subSchema.feesSchema],
  42. //消耗量调整系数字段
  43. quantityCoe:subSchema.quantityCoeSchema,
  44. //子目工程量调整系数
  45. rationQuantityCoe:String,
  46. tenderQuantity:String,//调整后工程量
  47. // 不调价
  48. is_adjust_price: {type: Number,default: 0},
  49. targetUnitFee:String,//目标单价
  50. targetTotalFee:String,//目标合价
  51. deleteInfo: deleteSchema,
  52. type: Number, // 1 定额、2 量价、3 工料机定额
  53. subType: Number, // 子类型:1人工、201材料、301机械、4主材、5设备
  54. from:{type: String,default:'std'}, //std, cpt 来自标准、补充
  55. isSubcontract: Boolean, // 是否分包
  56. installationKey:String, //用来记录安装增加费的关联字段
  57. // 定额特有属性:
  58. stdID: Number, //来自的标准定额ID
  59. libID: Number,
  60. maskName: String,
  61. caption: String,
  62. evaluationProject:{type: Number,default:0}, // 1 true 0 false 估价项目
  63. isFromDetail:{type: Number,default:0}, // 1 true 0 false
  64. adjustState: String,
  65. rationProjName: String,
  66. comments: String, // 说明
  67. flags: [subSchema.flagsSchema], // 标记字段
  68. rationAssList: [rationAssItemSchema],
  69. content: String, // 工作内容
  70. annotation: String, //附注
  71. ruleText: String, // 计算规则
  72. prefix: {type: String, default: ''}, //定额是补充、借用时用 补 借
  73. referenceRationID:String,//如果是通过模板关联子目生成的定额,这里记录对应的主定额ID
  74. // 工作内容 (选择自清单)
  75. jobContentText: String,
  76. //工料机特有属性
  77. projectGLJID:Number, //项目工料机ID
  78. GLJID:Number,//工料机库ID
  79. original_code:String, //原始编码
  80. specs:String,//规格型号
  81. shortName:String,//缩写
  82. customQuantity:String,//自定义消耗
  83. model: Number,// 机型
  84. adjCoe:Number,
  85. remark:String,
  86. bookmarkBackground:String,//书签背景色
  87. bookmarkAnnotation:String,//批注
  88. overHeight: String // 超高降效
  89. });
  90. let ration = mongoose.model("ration", rationSchema, "ration");