ration.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. isAdjust:Number //0不调整,1调整
  20. }, { _id: false });
  21. // 定额、量价、工料机定额 合并存储
  22. let rationSchema = new Schema({
  23. // 公用属性部分
  24. ID: String,
  25. projectID: Number,
  26. billsItemID: String,
  27. serialNo: Number,
  28. code: String,
  29. name: String,
  30. unit: String,
  31. quantity: String,
  32. contain:String,//含量
  33. quantityEXP:String,//工程量表达式
  34. programID: Number,
  35. marketUnitFee: String,
  36. marketTotalFee: String,
  37. fees: [subSchema.feesSchema],
  38. //消耗量调整系数字段
  39. quantityCoe:subSchema.quantityCoeSchema,
  40. //子目工程量调整系数
  41. rationQuantityCoe:String,
  42. tenderQuantity:String,//调整后工程量
  43. // 不调价
  44. is_adjust_price: {type: Number,default: 0},
  45. targetUnitFee:String,//目标单价
  46. targetTotalFee:String,//目标合价
  47. deleteInfo: deleteSchema,
  48. type: Number, // 1 定额、2 量价、3 工料机定额
  49. subType: Number, // 子类型:1人工、201材料、301机械、4主材、5设备
  50. from:{type: String,default:'std'}, //std, cpt 来自标准、补充
  51. isSubcontract: Boolean, // 是否分包
  52. installationKey:String, //用来记录安装增加费的关联字段
  53. // 定额特有属性:
  54. stdID: Number, //来自的标准定额ID
  55. libID: Number,
  56. maskName: String,
  57. caption: String,
  58. evaluationProject:{type: Number,default:0}, // 1 true 0 false 估价项目
  59. isFromDetail:{type: Number,default:0}, // 1 true 0 false
  60. adjustState: String,
  61. rationProjName: String,
  62. comments: String, // 说明
  63. flags: [subSchema.flagsSchema], // 标记字段
  64. rationAssList: [rationAssItemSchema],
  65. content: String, // 工作内容
  66. annotation: String, //附注
  67. ruleText: String, // 计算规则
  68. prefix: {type: String, default: ''}, //定额是补充、借用时用 补 借
  69. referenceRationID:String,//如果是通过模板关联子目生成的定额,这里记录对应的主定额ID
  70. //工料机特有属性
  71. projectGLJID:Number, //项目工料机ID
  72. GLJID:Number,//工料机库对应的ID
  73. original_code:String, //原始编码
  74. specs:String,//规格型号
  75. shortName:String,//缩写
  76. customQuantity:String,//自定义消耗
  77. model: Number,// 机型
  78. adjCoe:Number,
  79. remark:String
  80. });
  81. let ration = mongoose.model("ration", rationSchema, "ration");