devices.html 4.3 KB

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