main.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <div class="main">
  2. <div class="content">
  3. <div class="container-fluid">
  4. <div class="row">
  5. <div class="col-md-2">
  6. <div class="list-group mt-3">
  7. <% for (let compilation of compilationList) { %>
  8. <% if (compilation._id === 'all') { %>
  9. <a href="/priceInfo/main"
  10. class="list-group-item list-group-item-action <%= compilation.active %>">
  11. 所有
  12. </a>
  13. <% } else { %>
  14. <a id="<%= compilation._id %>" href="/priceInfo/main?filter=<%= compilation._id %>"
  15. class="list-group-item list-group-item-action <%= compilation.active %>">
  16. <%= compilation.name %>
  17. </a>
  18. <% }} %>
  19. </div>
  20. </div>
  21. <div class="col-md-10">
  22. <div class="warp-p2 mt-3">
  23. <table class="table table-hover table-bordered">
  24. <thead>
  25. <tr>
  26. <th>材料信息价库名称</th>
  27. <th width="160">期数</th>
  28. <th width="160">费用定额</th>
  29. <th width="160">添加时间</th>
  30. <th width="70">操作</th>
  31. <th width="150">原始数据</th>
  32. <th width="70">关键字</th>
  33. </tr>
  34. </thead>
  35. <tbody id="showArea">
  36. <% for(let lib of libs){ %>
  37. <tr class="libTr">
  38. <td id="<%= lib.ID%>"><a
  39. href="/priceInfo/edit/?libID=<%= lib.ID%>&locked=true"><%= lib.name%></a>
  40. </td>
  41. <td><%= lib.period %></td>
  42. <td><%= lib.compilationName%></td>
  43. <td><%= moment(lib.createDate).format('YYYY-MM-DD')%></td>
  44. <td>
  45. <a class="lock-btn-control disabled" href="javascript:void(0);"
  46. style="color: #0275d8" onclick='handleEditClick("<%= lib.ID%>")'
  47. title="编辑"><i class="fa fa-pencil-square-o"></i></a>
  48. <a class="text-danger lock-btn-control disabled" href="javascript:void(0);"
  49. onclick='handleDeleteClick("<%= lib.ID%>")' title="删除"><i
  50. class="fa fa-remove"></i></a>
  51. <a class="lock" data-locked="true" href="javascript:void(0);" title="解锁"><i
  52. class="fa fa-unlock-alt"></i></a>
  53. </td>
  54. <td>
  55. <a class="btn btn-success btn-sm export-data lock-btn-control disabled" href="javascript:void(0);" onclick='handleExportClick("<%= lib.ID%>")' title="导出数据"><i class="fa fa-sign-out fa-rotate-270"></i>导出</a>
  56. <a class="btn btn-secondary btn-sm import-data lock-btn-control disabled"
  57. onclick='handleImportClick("<%= lib.ID%>", "originalData")' href="javacript:void(0);"
  58. title="导入数据"><i class="fa fa-sign-in fa-rotate-90"></i>导入</a>
  59. </td>
  60. <td>
  61. <a class="btn btn-secondary btn-sm import-data lock-btn-control disabled"
  62. onclick='handleImportClick("<%= lib.ID%>", "keys")' href="javacript:void(0);"
  63. title="导入关键字"><i class="fa fa-sign-in fa-rotate-90"></i>导入</a>
  64. </td>
  65. </tr>
  66. <% } %>
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <!--弹出添加-->
  76. <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
  77. <div class="modal-dialog" role="document">
  78. <div class="modal-content">
  79. <div class="modal-header">
  80. <h5 class="modal-title">添加材料信息价库</h5>
  81. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  82. <span aria-hidden="true">×</span>
  83. </button>
  84. </div>
  85. <div class="modal-body">
  86. <form id="add-lib-form" method="post" action="/priceInfo/addLib"
  87. enctype="application/x-www-form-urlencoded">
  88. <div class="form-group">
  89. <label>材料信息价库名称</label>
  90. <input id="name" name="name" class="form-control" placeholder="请输入库名称" type="text">
  91. <small class="form-text text-danger" id="name-error" style="display: none">请输入库名称。</small>
  92. </div>
  93. <div class="form-group">
  94. <label>编办名称</label>
  95. <select class="form-control" name="compilationID">
  96. <% for (let compilation of compilationList) { %>
  97. <% if (compilation.name !== '所有') { %>
  98. <option value="<%= compilation._id %>"><%= compilation.name %></option>
  99. <% }} %>
  100. </select>
  101. </div>
  102. <div class="form-group">
  103. <label>期数</label>
  104. <input id="period" name="period" class="form-control" placeholder="请输入期数" type="text">
  105. <small class="form-text text-danger" id="period-error" style="display: none">请输入有效期数(eg:
  106. 2020-01)。</small>
  107. </div>
  108. <input type="hidden" name="userAccount" value="<%= userAccount%>">
  109. </form>
  110. </div>
  111. <div class="modal-footer">
  112. <button id="add-lib" class="btn btn-primary">新建</button>
  113. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <!--弹出编辑-->
  119. <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
  120. <div class="modal-dialog" role="document">
  121. <div class="modal-content">
  122. <div class="modal-header">
  123. <h5 class="modal-title">材料信息价库</h5>
  124. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  125. <span aria-hidden="true">×</span>
  126. </button>
  127. </div>
  128. <div class="modal-body">
  129. <form>
  130. <div class="form-group">
  131. <label>材料信息价库名称</label>
  132. <input id="rename-text" class="form-control" placeholder="输入名称" type="text" value="">
  133. <small class="form-text text-danger" id="rename-error" style="display: none">请输入名称。</small>
  134. </div>
  135. </form>
  136. </div>
  137. <div class="modal-footer">
  138. <a id="rename" href="javascript: void(0);" class="btn btn-primary">确定</a>
  139. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <!--弹出导入-->
  145. <div class="modal fade" id="crawl" data-backdrop="static" style="display: none;" aria-hidden="true">
  146. <div class="modal-dialog" role="document">
  147. <div class="modal-content">
  148. <div class="modal-header">
  149. <h5 class="modal-title">材料信息价库</h5>
  150. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  151. <span aria-hidden="true">×</span>
  152. </button>
  153. </div>
  154. <div class="modal-body">
  155. <div class="row">
  156. <div class="col-5 form-group">
  157. <input id="period-start" class="form-control" name="from" placeholder="起始期数" type="text"
  158. value="" autocomplete="off">
  159. </div>
  160. <div class="col-2 form-group">
  161. <label class="split">——</label>
  162. </div>
  163. <div class="col-5 form-group">
  164. <input id="period-end" class="form-control" name="to" placeholder="结束期数" type="text" value=""
  165. autocomplete="off">
  166. </div>
  167. </div>
  168. <small class="form-text text-danger" id="crawl-error" style="display: none">请输入有效期数。</small>
  169. <small>期数格式:2020-01</label>
  170. </div>
  171. <div class="modal-footer">
  172. <a id="crawl-confirm" href="javascript: void(0);" class="btn btn-primary">确定</a>
  173. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <!--弹出删除-->
  179. <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
  180. <div class="modal-dialog" role="document">
  181. <div class="modal-content">
  182. <div class="modal-header">
  183. <h5 class="modal-title">删除确认</h5>
  184. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  185. <span aria-hidden="true">×</span>
  186. </button>
  187. </div>
  188. <div class="modal-body">
  189. <h5 class="text-danger">删除后无法恢复,确认是否删除?(需确认三次)</h5>
  190. </div>
  191. <div class="modal-footer">
  192. <a id="delete" href="javascript:void(0);" class="btn btn-danger">确认</a>
  193. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <!--弹出导入数据-->
  199. <div class="modal fade" id="import" data-backdrop="static" style="display: none;" aria-hidden="true">
  200. <div class="modal-dialog" role="document">
  201. <div class="modal-content">
  202. <div class="modal-header">
  203. <h5 class="modal-title">导入数据</h5>
  204. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  205. <span aria-hidden="true">×</span>
  206. </button>
  207. </div>
  208. <div class="modal-body">
  209. <div class="alert alert-warning" role="alert">
  210. 导入操作会覆盖数据,请谨慎操作!!
  211. </div>
  212. <form>
  213. <div class="form-group">
  214. <label>请选择Excel格式文件</label>
  215. <input class="form-control-file" type="file" accept=".xlsx,.xls" name="import_data" />
  216. </div>
  217. </form>
  218. </div>
  219. <div class="modal-footer">
  220. <button type="button" class="btn btn-primary" id="import-confirm">确定导入</button>
  221. <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. <script src="/public/web/lock_util.js"></script>
  227. <script src="/public/web/PerfectLoad.js"></script>
  228. <script src="/public/constants/price_info_constant.js"></script>
  229. <script src="/web/maintain/price_info_lib/js/main.js"></script>