bills.js 3.2 KB

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