bills_template_items.js 861 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Created by zhang on 2018/7/13.
  3. */
  4. const mongoose = require('mongoose');
  5. let Schema = mongoose.Schema;
  6. let collectionName = 'std_bills_template_items';
  7. // 标记字段
  8. let flagsSchema = new Schema({
  9. fieldName: String,
  10. flag: Number
  11. });
  12. let BillsTemplateSchema = {
  13. // 树结构所需ID
  14. ID: Number,
  15. ParentID: Number,
  16. NextSiblingID: Number,
  17. // 编号
  18. code: String,
  19. // 名称
  20. name: String,
  21. // 单位
  22. unit: String,
  23. // 类别
  24. type: Number,
  25. // 标记
  26. flags:{
  27. type: [flagsSchema],
  28. default: []
  29. },
  30. // 所属模板库ID
  31. libID: {type:String,index:true},
  32. //计算基数
  33. calcBase: String,
  34. //费率ID
  35. feeRateID:Number,
  36. quantity: String,
  37. };
  38. mongoose.model(collectionName, new Schema(BillsTemplateSchema, {versionKey: false, collection: collectionName}));