achieve_apply.js 4.3 KB

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