bills.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 deleteSchema = require('../all_schemas/delete_schema');
  7. let Schema = mongoose.Schema;
  8. let billsSchema = new Schema({
  9. ID: {
  10. type: String,
  11. index: true
  12. },
  13. ParentID: String,
  14. NextSiblingID: String,
  15. projectID: {
  16. type: Number,
  17. index: true
  18. },
  19. serialNo: Number,
  20. chapterID: Number,
  21. billsLibId: Number,
  22. code: String,
  23. sectionCode: String, // 清单章节号,池州接口需要
  24. fullCode: String,
  25. type: {
  26. type: Number,
  27. default: 4
  28. }, //1 :大项费用 2:分部 3分项 4清单;5补项
  29. isAdd: {
  30. type: Number,
  31. default: 0
  32. }, //1 true 0 false是否新增
  33. name: String,
  34. unit: String,
  35. quantity: String, // Decimal
  36. quantity2: String, //预算项目中的数量2
  37. quantityEXP: String, //工程量表达式
  38. feeRateID: Number,
  39. feeRate: String,
  40. isFromDetail: {
  41. type: Number,
  42. default: 0
  43. }, //1 true 0 false
  44. programID: Number,
  45. calcBase: String,
  46. calcBaseValue: String, // 计算基数表达式的值
  47. tenderCalcBaseValue: String, // 调价后计算基数表达式的值
  48. baseProgressiveFee: String, // 累进计算中的基准值(报表需要这个中间值)
  49. // 工程量计算规则
  50. ruleText: String,
  51. // 说明
  52. comments: String,
  53. // 调价
  54. xs_Labour: String, // Decimal
  55. xs_Material: String, // Decimal
  56. xs_Machine: String, // Decimal
  57. xs_FeeRate: String, // Decimal
  58. xs_LabourPrice: String, // Decimal
  59. xs_MaterialPrice: String, // Decimal
  60. xs_MachinePrice: String, // Decimal
  61. isTender_Labour: Boolean,
  62. isTender_Material: Boolean,
  63. isTender_Machine: Boolean,
  64. targetUnitFee: String, //目标单价
  65. targetTotalFee: String, //目标合价
  66. //工作内容//zhong 2017-8-31
  67. jobContentText: String, //清单工作内容列显示文本, 减少第一次拉数据时的循环次数
  68. jobContent: [subSchema.jobContentSchema],
  69. //项目特征
  70. itemCharacterText: String, //清单项目特征列显示文本
  71. itemCharacter: [subSchema.itemCharacterSchema],
  72. // 费用字段
  73. fees: [subSchema.feesSchema],
  74. // 标记字段
  75. flags: [subSchema.flagsSchema],
  76. //消耗量调整系数字段
  77. quantityCoe: subSchema.quantityCoeSchema,
  78. //子目工程量调整系数
  79. rationQuantityCoe: String,
  80. // 不调价
  81. is_adjust_price: {
  82. type: Number,
  83. default: 0
  84. },
  85. installationKey: String, //用来记录安装增加费的关联字段
  86. deleteInfo: deleteSchema,
  87. isEstimate: {
  88. type: Number,
  89. default: 0
  90. }, // 1 true 0 false 是否暂估
  91. lockUnitPrice: {
  92. type: Schema.Types.Mixed,
  93. default: false
  94. }, // true false 锁定综合单价,true 为锁定
  95. unitPriceAnalysis: {
  96. type: Number,
  97. default: 0
  98. }, // 1 true 0 false 单价分析
  99. specialProvisional: String,
  100. outPutMaxPrice:{type:Schema.Types.Mixed,default:false},//输出最高限价 true 是,false否,null 不确定,三个状态
  101. outPutLimitPrice:{type:Schema.Types.Mixed,default:false},//输出限价 true 是,false否,null 不确定,三个状态
  102. maxPrice:String,//最高限价
  103. minPrice:String,//最低限价
  104. remark: String,
  105. engineeringContent: String, //工程内容
  106. serviceContent: String, //服务内容
  107. claimVisa: String, //签证及索赔依据
  108. calcFlag: {
  109. type: Number
  110. }, // 叶子清单的计算类型。末定义:按定额计算。1:用户输入金额。2:用户输入单价。3:用户输入设计单价。
  111. bookmarkBackground: String, //书签背景色
  112. bookmarkAnnotation: String //批注
  113. });
  114. mongoose.model("bills", billsSchema);