list.htm 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/freight/add')">+添加运费模板</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>首重500g运费</th>
  16. <th>续重500g运费</th>
  17. <th>状态</th>
  18. <th>添加时间</th>
  19. <th>操作</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. ##if(results!=null && results.list.~size!=0){
  24. ##for(_item in results.list!){
  25. <tr>
  26. <td>
  27. ##if(_item.area_name!=null && _item.area_name!=""){
  28. ${_item.area_name!}
  29. ##}else{
  30. 默认运费
  31. ##}
  32. </td>
  33. <td>${_item.price!}</td>
  34. <td>${_item.price_ext!}</td>
  35. <td>
  36. ##if(_item.status==1){
  37. 启用
  38. ##}else{
  39. 禁用
  40. ##}
  41. </td>
  42. <td>${_item.create_date!,dateFormat='yyyy-MM-dd HH:mm'}</td>
  43. <td style="width:100px;">
  44. <div class="btn-group">
  45. <button class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
  46. 操作<span class="icon-caret-down icon-on-right"></span>
  47. </button>
  48. <ul class="dropdown-menu dropdown-info pull-right">
  49. <li><a href="javascript:showAlert('/admin/freight/edit?id=${_item.id!}')">编辑</a></li>
  50. ##if(_item.area_name!=null && _item.area_name!=""){
  51. ##if(_item.status==1){
  52. <li><a href="javascript:changeStatus(${_item.id!}, 0, '禁用')">禁用</a></li>
  53. ##}else{
  54. <li><a href="javascript:changeStatus(${_item.id!}, 1, '启用')">启用</a></li>
  55. ##}
  56. <li><a href="javascript:changeStatus(${_item.id!}, 9, '删除')">删除</a></li>
  57. ##}
  58. </ul>
  59. </div>
  60. </td>
  61. </tr>
  62. ##}
  63. ##}
  64. </tbody>
  65. </table>
  66. ##if(totalPage>1){
  67. <div class="fenye">
  68. <#_pagination page="${results!}">
  69. <ul id="Pagination"></ul>
  70. </#_pagination>
  71. </div>
  72. ##}
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <script>
  78. function changeStatus(id, status, msg){
  79. if(confirm("确定要" + msg + "该记录吗?")){
  80. $.post("/admin/freight/changeStatus",{id:id,status:status},function(data){
  81. alert(data.msg);
  82. if(data.success){
  83. location.reload();
  84. }
  85. });
  86. }
  87. }
  88. </script>
  89. ##}