bills_template_items.js 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * Created by zhang on 2018/7/13.
  3. */
  4. import mongoose from "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. itemCharacterText: String,
  35. jobContentText: String,
  36. cantDelete: Boolean,
  37. //费率ID
  38. feeRateID: Number,
  39. quantity: String,
  40. };
  41. mongoose.model(collectionName, new Schema(BillsTemplateSchema, { versionKey: false, collection: collectionName }));