type.htm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ##tlayout("admin/layout.htm"){
  2. <div class="breadcrumbs" style="padding-top:10px;height: 50px;">
  3. <div class="col-xs-12">
  4. <a class="btn btn-info btn-sm" style="margin-top: -12px;margin-left: 10px;" href="javascript:showAlert('/admin/bottle/addType?id=${bottle.id!}')">+添加水源</a>
  5. </div>
  6. </div>
  7. <div class="page-content">
  8. <div class="row" style="margin-top:10px;">
  9. <div class="col-xs-12">
  10. <div class="table-responsive">
  11. <table class="table table-striped table-bordered table-hover">
  12. <thead>
  13. <tr>
  14. <th>名称</th>
  15. <th>价格/箱</th>
  16. <th>状态</th>
  17. <th>添加时间</th>
  18. <th>操作</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. ##for(_item in type_list!){
  23. <tr>
  24. <td>${_item.title!}</td>
  25. <td>${_item.price!}</td>
  26. <td>
  27. ##if(_item.status==1){
  28. 启用
  29. ##}else{
  30. 禁用
  31. ##}
  32. </td>
  33. <td>${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</td>
  34. <td style="width:100px;">
  35. <div class="btn-group">
  36. <button class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
  37. 操作<span class="icon-caret-down icon-on-right"></span>
  38. </button>
  39. <ul class="dropdown-menu dropdown-info pull-right">
  40. <li><a href="javascript:showAlert('/admin/bottle/editType?id=${_item.id!}')">编辑</a></li>
  41. ##if(_item.status==1){
  42. <li><a href="javascript:changeTypeStatus(${_item.id!}, 0, '禁用')">禁用</a></li>
  43. ##}else{
  44. <li><a href="javascript:changeTypeStatus(${_item.id!}, 1, '启用')">启用</a></li>
  45. ##}
  46. <li><a href="javascript:changeTypeStatus(${_item.id!}, 9, '删除')">删除</a></li>
  47. </ul>
  48. </div>
  49. </td>
  50. </tr>
  51. ##}
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <script>
  59. function changeTypeStatus(id, status, msg){
  60. if(confirm("确定要" + msg + "该记录吗?")){
  61. $.post("/admin/bottle/changeTypeStatus",{id:id,status:status},function(data){
  62. alert(data.msg);
  63. if(data.success){
  64. location.reload();
  65. }
  66. });
  67. }
  68. }
  69. </script>
  70. ##}