bills.js 3.8 KB

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