bills.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. calcBase: String,
  47. calcBaseValue: String, // 计算基数表达式的值
  48. tenderCalcBaseValue: String, // 调价后计算基数表达式的值
  49. baseProgressiveFee: String, // 累进计算中的基准值(报表需要这个中间值)
  50. // 工程量计算规则
  51. ruleText: String,
  52. // 说明
  53. comments: String,
  54. // 调价
  55. xs_Labour: String, // Decimal
  56. xs_Material: String, // Decimal
  57. xs_Machine: String, // Decimal
  58. xs_FeeRate: String, // Decimal
  59. xs_LabourPrice: String, // Decimal
  60. xs_MaterialPrice: String, // Decimal
  61. xs_MachinePrice: String, // Decimal
  62. isTender_Labour: Boolean,
  63. isTender_Material: Boolean,
  64. isTender_Machine: Boolean,
  65. targetUnitFee: String, //目标单价
  66. targetTotalFee: String, //目标合价
  67. //工作内容//zhong 2017-8-31
  68. jobContentText: String, //清单工作内容列显示文本, 减少第一次拉数据时的循环次数
  69. jobContent: [subSchema.jobContentSchema],
  70. //项目特征
  71. itemCharacterText: String, //清单项目特征列显示文本
  72. itemCharacter: [subSchema.itemCharacterSchema],
  73. // 费用字段
  74. fees: [subSchema.feesSchema],
  75. // 标记字段
  76. flags: [subSchema.flagsSchema],
  77. //消耗量调整系数字段
  78. quantityCoe: subSchema.quantityCoeSchema,
  79. //子目工程量调整系数
  80. rationQuantityCoe: String,
  81. // 不调价
  82. is_adjust_price: {
  83. type: Number,
  84. default: 0
  85. },
  86. installationKey: String, //用来记录安装增加费的关联字段
  87. deleteInfo: deleteSchema,
  88. isEstimate: {
  89. type: Number,
  90. default: 0
  91. }, // 1 true 0 false 是否暂估
  92. lockUnitPrice: {
  93. type: Schema.Types.Mixed,
  94. default: false
  95. }, // true false 锁定综合单价,true 为锁定
  96. unitPriceAnalysis: {
  97. type: Number,
  98. default: 0
  99. }, // 1 true 0 false 单价分析
  100. specialProvisional: String,
  101. outPutMaxPrice:{type:Schema.Types.Mixed,default:false},//输出最高限价 true 是,false否,null 不确定,三个状态
  102. outPutLimitPrice:{type:Schema.Types.Mixed,default:false},//输出限价 true 是,false否,null 不确定,三个状态
  103. appraisalBills:{type:Schema.Types.Mixed,default:false},//true 是,false否,null 不确定,三个状态
  104. maxPrice:String,//最高限价
  105. minPrice:String,//最低限价
  106. remark: String,
  107. engineeringContent: String, //工程内容
  108. serviceContent: String, //服务内容
  109. claimVisa: String, //签证及索赔依据
  110. calcFlag: {
  111. type: Number
  112. }, // 叶子清单的计算类型。末定义:按定额计算。1:用户输入金额。2:用户输入单价。3:用户输入设计单价。
  113. bookmarkBackground: String, //书签背景色
  114. bookmarkAnnotation: String //批注
  115. });
  116. mongoose.model("bills", billsSchema);