engineering_lib.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * 计价规则数据结构
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/8/31
  6. * @version
  7. */
  8. import mongoose from "mongoose";
  9. let Schema = mongoose.Schema;
  10. let collectionName = 'engineering_lib';
  11. let taxGroupSchema = new Schema({
  12. taxType: String,//计税方式
  13. program_lib: { type: Schema.Types.Mixed,default:{}},// 计算程序标准库
  14. template_lib:{ type: Schema.Types.Mixed,default:{}},//清单模板库
  15. col_lib:{ type: Schema.Types.Mixed,default:{}}
  16. },{_id: false});
  17. let modelSchema = {
  18. // 标准清单
  19. bill_lib: {
  20. type: Schema.Types.Mixed,
  21. default: []
  22. },
  23. // 定额库
  24. ration_lib: {
  25. type: Schema.Types.Mixed,
  26. default: []
  27. },
  28. // 工料机库
  29. glj_lib: {
  30. type: Schema.Types.Mixed,
  31. default: []
  32. },
  33. //清单指引库
  34. billsGuidance_lib: {
  35. type: Schema.Types.Mixed,
  36. default: []
  37. },
  38. tax_group :{
  39. type: [taxGroupSchema],
  40. default: []
  41. },
  42. // 费率标准库
  43. fee_lib: {
  44. type: Schema.Types.Mixed,
  45. default: []
  46. },
  47. // 人工系数标准库
  48. artificial_lib: {
  49. type: Schema.Types.Mixed,
  50. default: []
  51. },
  52. //设置人材机显示列
  53. glj_col:{
  54. showAdjustPrice:Boolean//是否显示调整价列
  55. },
  56. //清单或定额计价规则ID
  57. valuationID:{type:String,index: true},
  58. //工程专业名称
  59. name:String,
  60. //前端是否显示
  61. visible:{
  62. type: Boolean,
  63. default: false
  64. },
  65. engineering:Number
  66. };
  67. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));