bills_template_items.js 870 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. itemCharacterText: String,
  31. jobContentText: String,
  32. // 所属模板库ID
  33. libID: { type: String, index: true },
  34. //计算基数
  35. calcBase: String,
  36. //费率ID
  37. feeRateID: Number,
  38. quantity: String,
  39. };
  40. mongoose.model(collectionName, new Schema(BillsTemplateSchema, { versionKey: false, collection: collectionName }));