project_solic.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 项目征集表
  7. const projectsolic = {
  8. name: { type: String, required: false, maxLength: 500 }, // 项目名称
  9. pro_user: { type: String, required: true, maxLength: 500 }, // 项目负责人
  10. pro_phone: { type: String, required: true, maxLength: 500 }, // 项目负责人电话
  11. field: { type: String, required: false, maxLength: 500 }, // 领域分类
  12. scale: { type: String, required: false, maxLength: 500 }, // 市场预估
  13. techol_stage: { type: String, required: false, maxLength: 500 }, // 技术阶段
  14. techol_level: { type: String, required: false, maxLength: 500 }, // 技术水平
  15. proposal_company: { type: String, required: false, maxLength: 500 }, // 建议单位名称
  16. proposal_user: { type: String, required: false, maxLength: 500 }, // 建议单位联系人
  17. proposal_phone: { type: String, required: false, maxLength: 500 }, // 建议单位联系电话
  18. coopera_company: { type: String, required: false, maxLength: 500 }, // 合作单位名称
  19. coopera_user: { type: String, required: false, maxLength: 500 }, // 合作单位联系人
  20. coopera_phone: { type: String, required: false, maxLength: 500 }, // 合作单位联系电话
  21. project_back: { type: String, required: false, maxLength: 500 }, // 项目背景
  22. sign: { type: String, required: false, maxLength: 500 }, // 立项意义
  23. work_basics: { type: String, required: false, maxLength: 500 }, // 前期基础
  24. content: { type: String, required: false, maxLength: 500 }, // 研究内容
  25. route: { type: String, required: false, maxLength: 500 }, // 技术路线
  26. quota: { type: String, required: false, maxLength: 500 }, // 核心指标
  27. influence: { type: String, required: false, maxLength: 500 }, // 经济效益
  28. question_id: { type: ObjectId, required: true, maxLength: 500 }, // 调研调查表id
  29. user_id: { type: ObjectId, required: true, maxLength: 500 }, // 用户id
  30. remark: { type: String, maxLength: 200 },
  31. status: { type: String, default: '0' }, // 0-可修改;1-不可修改
  32. create_time: {
  33. type: String,
  34. default: moment().format('YYYY-MM-DD HH:mm:ss'),
  35. },
  36. };
  37. const schema = new Schema(projectsolic, { toJSON: { virtuals: true } });
  38. schema.index({ id: 1 });
  39. schema.index({ question_id: 1 });
  40. schema.index({ user_id: 1 });
  41. schema.index({ pro_user: 1 });
  42. schema.index({ 'meta.createdAt': 1 });
  43. schema.plugin(metaPlugin);
  44. module.exports = app => {
  45. const { mongoose } = app;
  46. return mongoose.model('Project_solic', schema, 'project_solic');
  47. };