achieve_apply.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 basic = new Schema({
  8. achieve_name: { type: String }, // 成果名称
  9. achieve_type: { type: String }, // 成果类别
  10. achieve_num: { type: String }, // 成果编号
  11. achieve_date: { type: String }, // 成果取得时间
  12. achieve_form: { type: String }, // 成果形式
  13. apply_personal: { type: String }, // 申请人
  14. apply_company: { type: String }, // 申请单位
  15. address: { type: String }, // 地址
  16. apply_nature: { type: String }, // 申请单位/申请人属性
  17. contacts: { type: String }, // 联系人
  18. phone: { type: String }, // 联系电话
  19. email: { type: String }, // 邮箱
  20. fax: { type: String }, // 传真
  21. objective: { type: String }, // 评价目的
  22. stage: { type: String }, // 成果所处阶段
  23. output: { type: String }, // 经济效益产值
  24. profit: { type: String }, // 经济效益利润
  25. revenue: { type: String }, // 经济效益税收
  26. });
  27. basic.index({ id: 1 });
  28. basic.index({ achieve_num: 1 });
  29. // 内容简介
  30. const brief = new Schema({
  31. achieve_brief: { type: String }, // 成果简介
  32. field: { type: String }, // 应用领域和技术原理
  33. kpi_index: { type: String }, // 性能指标
  34. compare: { type: String }, // 与国内外同类技术比较
  35. advanced: { type: String }, // 成果的创造性,先进性
  36. sense: { type: String }, // 作用意义
  37. prospect: { type: String }, // 推广应用的范围,条件和前景
  38. opinion: { type: String }, // 存在的问题和改进意见
  39. });
  40. brief.index({ id: 1 });
  41. // 主研人员名单
  42. const research = new Schema({
  43. research_name: { type: String }, // 姓名
  44. card: { type: String }, // 证件号码
  45. gender: { type: String }, // 性别
  46. position: { type: String }, // 技术职称
  47. education: { type: String }, // 文化程度
  48. degree: { type: String }, // 学位
  49. abroad: { type: String }, // 是否留学归国
  50. research_company: { type: String }, // 工作单位
  51. devote: { type: String }, // 对成果创造性贡献
  52. });
  53. research.index({ id: 1 });
  54. // 委托方提供资料清单
  55. const datalist = new Schema({
  56. work_report: { type: String, required: true }, // 研究工作报告(必备)
  57. techol_report: { type: String, required: true }, // 研究技术报告(必备)
  58. benefit: { type: String, required: true }, // 经济效益分析(必备)
  59. science_report: { type: String, required: true }, // 科技查新报告(科技项目成果,必备)
  60. assess_report: { type: String, required: true }, // 法律价值评估报告(专利成果,必备)
  61. app_prove: { type: String, required: true }, // 推广应用证明(两家以上应用单位,必备)
  62. techol_ppt: { type: String, required: true }, // 成果技术汇报PPT(必备)
  63. testing_report: { type: String }, // 检测报告(根据项目需要提供)
  64. quality: { type: String }, // 质量标准(检测报告所依据的标准,企业标准,行业标准,国家标准,国际标准)
  65. patent: { type: String }, // 与本成果相关的授权专利证书
  66. special: { type: String }, // 特殊行业需要提供的相应证明材料
  67. budget: { type: String }, // 项目经费预算书
  68. final: { type: String }, // 项目经费决算书
  69. });
  70. datalist.index({ id: 1 });
  71. // 成果评价申请表
  72. const achieve_apply = {
  73. user_id: { type: ObjectId }, // 关联用户
  74. status: { type: String, default: '0' }, // 状态
  75. // 1=>初审通过(待评分);-1=>初审失败
  76. // 2=>评分通过(待缴费);-2=>评分失败
  77. // 3=>已缴费
  78. // 4=>补充资料
  79. // 5=>会审通过;-5=>会审失败(不能改了,没机会了)
  80. // 6=>证书发放
  81. basic: { type: basic },
  82. brief: { type: brief },
  83. research: { type: [ research ] },
  84. datalist: { type: datalist },
  85. experts: { type: [ Object ] }, // 专家列表
  86. remark: { type: String, maxLength: 200 },
  87. create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
  88. };
  89. const schema = new Schema(achieve_apply, { toJSON: { virtuals: true } });
  90. schema.index({ id: 1 });
  91. schema.index({ 'meta.createdAt': 1 });
  92. schema.plugin(metaPlugin);
  93. module.exports = app => {
  94. const { mongoose } = app;
  95. return mongoose.model('Achieve_apply', schema, 'achieve_apply');
  96. };