index.html 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap js-check-wrap">
  5. <ul class="nav nav-tabs">
  6. <li class="active"><a>设备列表</a></li>
  7. <li><a href="{:url('/shop/devices/add')}">添加设备</a></li>
  8. </ul>
  9. <form class="well form-inline margin-top-20" method="post" action="{:url('/shop/devices/index')}">
  10. 关键字:
  11. <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
  12. placeholder="设备名称/设备编号">
  13. <input type="submit" class="btn btn-primary" value="搜索"/>
  14. <a class="btn btn-default" href="{:url('/shop/devices/index')}">清空</a>
  15. <a class="btn btn-danger" onclick="doDelete()">批量删除</a>
  16. </form>
  17. <form method="post" class="js-ajax-form">
  18. <table class="table table-hover table-bordered">
  19. <thead>
  20. <tr>
  21. <th width="60"><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  22. <th>设备名称</th>
  23. <!--<th>推广人</th>-->
  24. <th>序列号</th>
  25. <th>编号</th>
  26. <th>设备类型</th>
  27. <th>定位</th>
  28. <th>设备数量</th>
  29. <th>打印纸张数</th>
  30. <th>二维码</th>
  31. <th>{:lang('ACTIONS')}</th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. <php>
  36. $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
  37. </php>
  38. <foreach name="list" item="vo">
  39. <tr>
  40. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>
  41. <td>{$vo['name']?$vo['name']:lang('NOT_FILLED')}</td>
  42. <!--<td>{$vo.real_name|default=''}</td>-->
  43. <td>{$vo.device_code|default=''}</td>
  44. <td>{$vo.number|default=''}</td>
  45. <td><if condition="$vo.color_type == 1">黑白<elseif condition="$vo.color_type == 2"/>彩印<else/>全部</if></td>
  46. <td>{$vo.address|default=''}</td>
  47. <td>{$vo.device_num|default='0'}</td>
  48. <td>{$vo.pages|default='0'}</td>
  49. <td>
  50. <a title="点击放大" href="javascript:imagePreviewDialog('{:cmf_get_image_preview_url($vo.qrcode)}');">
  51. <img src="{:cmf_get_image_preview_url($vo.qrcode)}" alt="" width="48" height="48">
  52. </a>
  53. </td>
  54. <td>
  55. <a class="btn btn-xs btn-primary" href="{:url('/shop/devices/edit',['id'=> $vo.id])}">修改</a>
  56. <a class="btn btn-xs btn-warning js-ajax-dialog-btn" href="{:url('/shop/devices/del',array('id'=>$vo['id']))}" data-msg="确认删除?">删除</a>
  57. </td>
  58. </tr>
  59. </foreach>
  60. </tbody>
  61. </table>
  62. <div class="pagination">{$page}</div>
  63. </form>
  64. </div>
  65. <script src="__STATIC__/js/admin.js"></script>
  66. <script>
  67. function doDelete() {
  68. var ids = [];
  69. $(".js-check:checked").each(function () {
  70. var id = $(this).val();
  71. if (id > 0) {
  72. ids.push(id);
  73. }
  74. });
  75. if (ids.length <= 0) {
  76. showMsg('请先选择操作项');
  77. return false;
  78. }
  79. if(confirm('确定批量删除选择项?不可恢复')){
  80. $.post('/shop/devices/del',{id:ids},function(res){
  81. if(res.code == 1){
  82. showMsg(res.msg);
  83. setTimeout(function () {
  84. location.reload();
  85. }, 800)
  86. }else{
  87. showMsg(res.msg);
  88. }
  89. },"json")
  90. }
  91. }
  92. </script>
  93. </body>
  94. </html>