achieve_apply.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. // 2021-04-13添加
  28. cert_jfh: { type: String }, // 吉发号
  29. cert_num: { type: String }, // 第几号
  30. cert_sign: { type: String }, // 签字
  31. szd: { type: String }, // 所在地
  32. yb: { type: String }, // 邮编
  33. ls: { type: String }, // 隶属
  34. oneCom_name: { type: String }, // 参加单位1——名称
  35. oneCom_szd: { type: String }, // 参加单位1——所在地
  36. twoCom_name: { type: String }, // 参加单位2——名称
  37. twoCom_szd: { type: String }, // 参加单位2——所在地
  38. shxy: { type: String }, // 社会效益
  39. // 国家奖励
  40. gjjl_num: { type: String }, // 国家奖励项
  41. gjjl_name: { type: String }, // 国家奖励名称
  42. gjjl_grade: { type: String }, // 国家奖励等级
  43. sjjl_num: { type: String }, // 省级奖励项
  44. sjjl_name: { type: String }, // 省级奖励名称
  45. sjjl_grade: { type: String }, // 省级奖励等级
  46. // 计划支持
  47. gjjh_num: { type: String }, // 国家计划项
  48. gjjh_money: { type: String }, // 国家计划经费
  49. sjsj_num: { type: String }, // 省级计划项
  50. sjjh_money: { type: String }, // 省级计划经费
  51. });
  52. basic.index({ id: 1 });
  53. basic.index({ achieve_num: 1 });
  54. // 内容简介
  55. const brief = new Schema({
  56. achieve_brief: { type: String }, // 成果简介
  57. field: { type: String }, // 应用领域和技术原理
  58. kpi_index: { type: String }, // 性能指标
  59. compare: { type: String }, // 与国内外同类技术比较
  60. advanced: { type: String }, // 成果的创造性,先进性
  61. sense: { type: String }, // 作用意义
  62. prospect: { type: String }, // 推广应用的范围,条件和前景
  63. opinion: { type: String }, // 存在的问题和改进意见
  64. });
  65. brief.index({ id: 1 });
  66. // 主研人员名单
  67. const research = new Schema({
  68. research_name: { type: String }, // 姓名
  69. card: { type: String }, // 证件号码
  70. gender: { type: String }, // 性别
  71. position: { type: String }, // 技术职称
  72. education: { type: String }, // 文化程度
  73. degree: { type: String }, // 学位
  74. abroad: { type: String }, // 是否留学归国
  75. research_company: { type: String }, // 工作单位
  76. devote: { type: String }, // 对成果创造性贡献
  77. birth: { type: String }, // 出生
  78. zw: { type: String }, // 职务
  79. phone: { type: String }, // 电话
  80. email: { type: String }, // 邮箱
  81. });
  82. research.index({ id: 1 });
  83. // 委托方提供资料清单
  84. const datalist = new Schema({
  85. work_report: { type: Object }, // 研究工作报告(必备)
  86. techol_report: { type: Object }, // 研究技术报告(必备)
  87. benefit: { type: Object }, // 经济效益分析(必备)
  88. science_report: { type: Object }, // 科技查新报告(科技项目成果,必备)
  89. assess_report: { type: Object }, // 法律价值评估报告(专利成果,必备)
  90. app_prove: { type: Object }, // 推广应用证明(两家以上应用单位,必备)
  91. techol_ppt: { type: Object }, // 成果技术汇报PPT(必备)
  92. testing_report: { type: Object }, // 检测报告(根据项目需要提供)
  93. quality: { type: Object }, // 质量标准(检测报告所依据的标准,企业标准,行业标准,国家标准,国际标准)
  94. patent: { type: Object }, // 与本成果相关的授权专利证书
  95. special: { type: Object }, // 特殊行业需要提供的相应证明材料
  96. budget: { type: Object }, // 项目经费预算书
  97. final: { type: Object }, // 项目经费决算书
  98. });
  99. datalist.index({ id: 1 });
  100. // 成果评价申请表
  101. const achieve_apply = {
  102. user_id: { type: ObjectId }, // 关联用户
  103. status: { type: String, default: '0' }, // 状态
  104. // 1=>初审通过(待评分);-1=>初审失败
  105. // 2=>评分通过(待缴费);-2=>评分失败
  106. // 3=>已缴费(状态)
  107. // 4=>补充资料
  108. // 5=>会审通过;-5=>会审失败(不能改了,没机会了)
  109. // 6=>证书发放
  110. basic: { type: basic },
  111. brief: { type: brief },
  112. research: { type: [ research ] },
  113. datalist: { type: datalist },
  114. file: { type: Object }, // 上传文件
  115. remark: { type: String, maxLength: 200 },
  116. create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
  117. };
  118. const schema = new Schema(achieve_apply, { toJSON: { virtuals: true } });
  119. schema.index({ id: 1 });
  120. schema.index({ 'meta.createdAt': 1 });
  121. schema.plugin(metaPlugin);
  122. module.exports = app => {
  123. const { mongoose } = app;
  124. return mongoose.model('Achieve_apply', schema, 'achieve_apply');
  125. };