a_patent_edit.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. {% extends 'admin/a_admindefault.html' %}
  2. {% block mycss%}
  3. <script src="//cdn.ckeditor.com/4.4.6/full/ckeditor.js"></script>
  4. <script type="text/javascript" src="/static/js/jquery-1.7.2.min.js"></script>
  5. <script type="text/javascript">
  6. //选择图片
  7. $(function(){
  8. $("#file_proimg").change(function(){
  9. //alert($(this).val());
  10. $("#txt_RTImage").val($(this).val());
  11. var objUrl=getObjectURL(this.files[0]);
  12. //console.log("objUrl="+objUrl);
  13. if(objUrl){
  14. $("#img_proimg").attr("src",objUrl);
  15. $("#file_proimg").attr("src",objUrl);
  16. }
  17. })
  18. //建立一個可存取到該file的url
  19. function getObjectURL(file) {
  20. var url = null ;
  21. if (window.createObjectURL!=undefined) {
  22. url = window.createObjectURL(file) ;
  23. } else if (window.URL!=undefined) {
  24. url = window.URL.createObjectURL(file) ;
  25. } else if (window.webkitURL!=undefined) {
  26. url = window.webkitURL.createObjectURL(file) ;
  27. }
  28. return url ;
  29. }
  30. })
  31. </script>
  32. {% endblock %}
  33. {% block middle %}
  34. <div class="content">
  35. <div class="page-inner">
  36. <div class="page-header">
  37. <h4 class="page-title">
  38. {% if status=='add' %}
  39. 添加专利信息
  40. {% elif status=='edit' %}
  41. 编辑专利信息
  42. {% endif %}</h4>
  43. </div>
  44. <div class="row">
  45. <div class="col-md-12">
  46. {% with messages = get_flashed_messages() %}
  47. {% if messages %}
  48. {% for message in messages %}
  49. <p>{{ message }}</p>
  50. {% endfor %}
  51. {% endif %}
  52. {% endwith %}
  53. <form action="/editpatentinfo.do" method="post" enctype="multipart/form-data">
  54. <div class="modal-body">
  55. <input type="hidden" name="lbl_status" value="{{ status }}"/>
  56. <input type="hidden" name="lbl_PatentID" {% if status=='edit' %} value="{{patentinfo[0]}}"
  57. {%endif%}/>
  58. <div class="row">
  59. <div class="col-sm-6">
  60. <div class="form-group form-group-default">
  61. <label>
  62. 所属课题</label>
  63. {% if status=='add' %}
  64. <select name="txt_RTID" class="form-control">
  65. {% for row in researchtopic %}
  66. <option value="{{row[0]}}">{{row[2]}}</option>
  67. {% endfor %}
  68. </select>
  69. {% elif status=='edit' %}
  70. <select name="txt_RTID" class="form-control">
  71. {% for row in researchtopic %}
  72. <option value="{{row[0]}}" {% if patentinfo[1]== row[0] %} selected {% else%}
  73. {%endif%}>{{row[2]}}
  74. </option>
  75. {% endfor %}
  76. </select>
  77. {% endif %}
  78. </div>
  79. </div>
  80. <div class="col-sm-6">
  81. <div class="form-group form-group-default">
  82. <label>
  83. 专利名称: </label>
  84. <input name="txt_PatentName" type="text" class="form-control" placeholder="填写专利名称" {% if
  85. status=='edit' %} value="{{patentinfo[2]}}" {%endif%}>
  86. </div>
  87. </div>
  88. <div class="col-sm-6">
  89. <div class="form-group form-group-default">
  90. <label>专利类型</label>
  91. <input name="txt_PatentType" type="radio" value="1" checked {% if status=='edit' %} {%
  92. if patentinfo[8]==1 %} checked {%endif %} {%endif %}>发明专利
  93. <input name="txt_PatentType" type="radio" value="2" {% if status=='edit' %} {% if
  94. patentinfo[8]==2 %} checked {%endif %} {%endif %}>实用新型专利
  95. </div>
  96. </div>
  97. <div class="col-sm-6">
  98. <div class="form-group form-group-default">
  99. <label>申请进度:</label>
  100. <select id="txt_PatentStatus" name="txt_PatentStatus" class="form-control">
  101. <option value="1" {% if status=='edit' %} {% if patentinfo[13]==1 %} selected {%
  102. else %} {% endif%} {% endif%}>进入实审
  103. </option>
  104. <option value="2" {% if status=='edit' %} {% if patentinfo[13]==2 %} selected {%
  105. else %} {% endif%} {% endif%}>已公开
  106. </option>
  107. </select>
  108. </div>
  109. </div>
  110. <div class="col-sm-6">
  111. <div class="form-group form-group-default">
  112. <label>
  113. 申请号: </label>
  114. <input name="txt_AppNo" type="text" class="form-control" placeholder="填写申请号" {%
  115. if status=='edit' %} value="{{patentinfo[3]}}" {%endif%}>
  116. </div>
  117. </div>
  118. <div class="col-sm-6">
  119. <div class="form-group form-group-default">
  120. <label>
  121. 公开号: </label>
  122. <input name="txt_PubNo" type="text" class="form-control" placeholder="填写公开号"
  123. {% if status=='edit' %} value="{{patentinfo[4]}}" {%endif%}>
  124. </div>
  125. </div>
  126. <div class="col-sm-6">
  127. <div class="form-group form-group-default">
  128. <label>
  129. 申请日期: </label>
  130. <input name="txt_AppDate" type="text" class="form-control"
  131. placeholder="请填写申请日期,格式为YYYY-MM-DD" {% if status=='edit' %}
  132. value="{{patentinfo[9]}}" {%endif%}>
  133. </div>
  134. </div>
  135. <div class="col-sm-6">
  136. <div class="form-group form-group-default">
  137. <label>
  138. 公开日期: </label>
  139. <input name="txt_PubDate" type="text" class="form-control" placeholder="请填写公开日期,格式为YYYY-MM-DD"
  140. {% if status=='edit' %} value="{{patentinfo[10]}}" {%endif%}>
  141. </div>
  142. </div>
  143. <div class="col-sm-6">
  144. <div class="form-group form-group-default">
  145. <label>
  146. 发明人: </label>
  147. <input name="txt_Patentee" type="text" class="form-control"
  148. placeholder="请填写发明人" {% if status=='edit' %} value="{{patentinfo[11]}}"
  149. {%endif%}>
  150. </div>
  151. </div>
  152. <div class="col-sm-6">
  153. <div class="form-group form-group-default">
  154. <label>
  155. 作者列表: </label>
  156. <input name="txt_Authors" type="text" class="form-control" placeholder="填写作者列表,用英文逗号隔开"
  157. {% if status=='edit' %} value="{{patentinfo[12]}}" {%endif%}>
  158. </div>
  159. </div>
  160. <div class="col-sm-12">
  161. <div class="form-group form-group-default">
  162. <label>
  163. 摘要: </label>
  164. <textarea name="txt_PatentAbstract" rows="5" cols="20" style="width: 100%">{% if status=='edit' %} {{patentinfo[5]}} {%endif%}</textarea>
  165. </div>
  166. </div>
  167. <div class="col-sm-12">
  168. <div class="form-group form-group-default">
  169. <label>
  170. 专利封面图片: </label>
  171. <input id="file_proimg" name="file_proimg" type="file" size="30"/>
  172. <input id="txt_PatentImage" name="txt_PatentImage" type="text" class="form-control" placeholder="请上传专利图片"
  173. {% if status =='add' %} value="" {% else %} value="{{patentinfo[6]}}" {% endif %}/>
  174. <img id="img_proimg" name="img_proimg" style="height:100px; width:200px" {% if status =='add' %} src="" {% else %} src="/{{patentinfo[6]}}"{% endif %}/>
  175. </div>
  176. </div>
  177. <div class="col-sm-12">
  178. <div class="form-group form-group-default">
  179. <label>
  180. 专利内容: </label>
  181. <textarea name="txt_PatentConent" id="txt_PConent" class="ckeditor" rows="10" cols="80">
  182. {% if status=='edit' %} {{patentinfo[7]}} {%endif%}
  183. </textarea>
  184. </div>
  185. </div>
  186. <div class="col-sm-6">
  187. <div class="form-group form-group-default">
  188. <label>显示状态:</label>
  189. <select id="txt_PStatus" name="txt_PStatus" class="form-control">
  190. <option value="1" {% if status=='edit' %} {% if patentinfo[14]==1 %} selected {%
  191. else %} {% endif%} {% endif%}>显示
  192. </option>
  193. <option value="0" {% if status=='edit' %} {% if patentinfo[14]==0 %} selected {%
  194. else %} {% endif%} {% endif%}>不显示
  195. </option>
  196. </select>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div class="modal-footer no-bd">
  202. <button type="submit" class="btn btn-primary">
  203. 保存
  204. </button>
  205. <a href="/patentinfomanage">
  206. <button type="button" class="btn btn-danger" data-dismiss="modal">
  207. 返回
  208. </button>
  209. </a>
  210. </div>
  211. </form>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. {% endblock %}