index.php 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox">
  6. <div class="ibox-title">
  7. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加物流公司</button>
  8. <div class="ibox-tools">
  9. </div>
  10. </div>
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline">
  15. <div class="input-group">
  16. <input type="text" name="keyword" value="{$params.keyword}" placeholder="请输入物流公司名称或者编码" class="input-sm form-control"> <span class="input-group-btn">
  17. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. <div class="table-responsive">
  23. <table class="table table-striped table-bordered">
  24. <thead>
  25. <tr>
  26. <th class="text-center">编号</th>
  27. <th class="text-center">物流公司名称</th>
  28. <th class="text-center">编目</th>
  29. <th class="text-center">排序</th>
  30. <th class="text-center">状态</th>
  31. <th class="text-center">操作</th>
  32. </tr>
  33. </thead>
  34. <tbody class="">
  35. {volist name="list" id="vo"}
  36. <tr>
  37. <td class="text-center">
  38. {$vo.id}
  39. </td>
  40. <td class="text-center">
  41. {$vo.name}
  42. </td>
  43. <td class="text-center" >
  44. {$vo.code}
  45. </td>
  46. <td class="text-center" >
  47. {$vo.sort}
  48. </td>
  49. <td class="text-center">
  50. <i class="fa {eq name='vo.is_show' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  51. </td>
  52. <td class="text-center">
  53. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}')"><i class="fa fa-edit"></i> 编辑</button>
  54. <button class="btn btn-danger btn-xs " data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  55. </button>
  56. </td>
  57. </tr>
  58. {/volist}
  59. </tbody>
  60. </table>
  61. </div>
  62. {include file="public/inner_page"}
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. {/block}
  68. {block name="script"}
  69. <script>
  70. $('.btn-danger').on('click',function(){
  71. window.t = $(this);
  72. var _this = $(this),url =_this.data('url');
  73. $eb.$swal('delete',function(){
  74. $eb.axios.get(url).then(function(res){
  75. console.log(res);
  76. if(res.status == 200 && res.data.code == 200) {
  77. $eb.$swal('success',res.data.msg);
  78. _this.parents('tr').remove();
  79. }else
  80. return Promise.reject(res.data.msg || '删除失败')
  81. }).catch(function(err){
  82. $eb.$swal('error',err);
  83. });
  84. })
  85. });
  86. </script>
  87. {/block}