delivery_clerk.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module': {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie': {'pre': ''},
  33. 'account': {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style type="text/css">
  45. .img-40 {
  46. width: 40px;
  47. height: 40px;
  48. }
  49. </style>
  50. </head>
  51. <body layadmin-themealias="default">
  52. <div class="layui-fluid">
  53. <div class="layui-card">
  54. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">配送司机管理</span></div>
  55. <div class="layui-card-body" style="padding:15px;">
  56. <div class="page-content">
  57. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  58. <input type="hidden" name="c" value="delivery" />
  59. <input type="hidden" name="a" value="delivery_clerk" />
  60. <div class="layui-form-item">
  61. <span class="layui-input-inline">
  62. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  63. <option value=''>一键打印筛选时间</option>
  64. <option value='create_time' <?php if( $gpc['searchtime']=='create_time'){ ?>selected<?php } ?>>创建清单时间</option>
  65. <option value='express_time' <?php if( $gpc['searchtime']=='express_time'){ ?>selected<?php } ?>>配送时间</option>
  66. <option value='head_get_time' <?php if( $gpc['searchtime']=='head_get_time'){ ?>selected<?php } ?>>送达时间</option>
  67. </select>
  68. </span>
  69. <span class="layui-input-inline" style="width: 285px;">
  70. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i'),'endtime'=>date('Y-m-d H:i')),true);}
  71. </span>
  72. <div class="layui-input-inline">
  73. <input type="text" class="input-sm form-control layui-input" name='keyword' value="{$gpc['keyword']}" placeholder="输入关键词然后回车">
  74. </div>
  75. <span class="layui-input-inline">
  76. <button class="btn btn-primary" type="submit"> 搜索</button>
  77. </span>
  78. </div>
  79. </form>
  80. <form action="" method="post" class="layui-form" role="form">
  81. <div class="row">
  82. <div class="col-md-12">
  83. <div class="page-table-header">
  84. <!-- <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" /> -->
  85. <span class="pull-right">
  86. <a href="{:U('delivery/adddelivery_clerk',array('ok'=>1))}" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 添加配送司机</a>
  87. <a class='btn layui-btn layui-btn-sm' id="clerk_allprint" data-href="{:U('delivery/clerk_allprint', array('id' => $item['id'],'ok'=>1))}" >
  88. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="打印配送单">
  89. 一键打印配送单
  90. </span>
  91. </a>
  92. <a class='btn layui-btn layui-btn-sm' style="display:none;" id="clerk_allprint_order" data-href="{:U('delivery/clerk_allprint_order')}" >
  93. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="一键打印所有相关订单">
  94. 一键打印所有相关订单
  95. </span>
  96. </a>
  97. </span>
  98. <div class="btn-group">
  99. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗,删除后商品将进入回收站?" data-href="{:U('delivery/deldelivery_clerk')}">
  100. <i class='icow icow-shanchu1'></i> 删除
  101. </button>
  102. </div>
  103. </div>
  104. <table class="layui-table" lay-skin="line" lay-size="lg">
  105. <thead>
  106. <tr>
  107. <th style="width:25px;"><input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" /></th>
  108. <th style="width:80px;">ID</th>
  109. <th style="">姓名</th>
  110. <th style="width: 200px;">手机号</th>
  111. <th style="width: 300px;">操作</th>
  112. </tr>
  113. </thead>
  114. <tbody>
  115. <?php foreach( $list as $item ){ ?>
  116. <tr>
  117. <td style="width:25px;">
  118. <input type='checkbox' value="{$item['id']}" name="item_checkbox" lay-skin="primary"/>
  119. </td>
  120. <td>
  121. {$item['id']}
  122. </td>
  123. <td>
  124. <div style="display: flex">
  125. <img class="img-40" src="{:tomedia($item['logo'])}" style='border-radius:50%;border:1px solid #efefef;' />
  126. <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
  127. <span class="nickname">
  128. {$item['name']}
  129. </span>
  130. </span>
  131. </div>
  132. </td>
  133. <td>
  134. {$item['mobile']}
  135. </td>
  136. <td style="overflow:visible;position:relative">
  137. <a class='layui-btn layui-btn-xs' href="{:U('delivery/adddelivery_clerk', array('id' => $item['id'],'ok'=>1))}" >
  138. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑">
  139. <i class="layui-icon layui-icon-edit"></i>编辑
  140. </span>
  141. </a>
  142. <a class='layui-btn layui-btn-danger layui-btn-xs deldom' href="javascript:;" data-href="{:U('delivery/deldelivery_clerk',array('id' => $item['id']))}" data-confirm='确认要删除吗?'>
  143. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">
  144. <i class="layui-icon">&#xe640;</i>删除
  145. </span>
  146. </a>
  147. </td>
  148. </tr>
  149. <?php } ?>
  150. </tbody>
  151. <tfoot>
  152. <tr>
  153. <td colspan="3">
  154. <div class="page-table-header">
  155. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  156. <div class="btn-group">
  157. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗,删除后商品将进入回收站?" data-href="{:U('delivery/deldelivery_clerk')}">
  158. <i class='icow icow-shanchu1'></i> 删除
  159. </button>
  160. </div>
  161. </div>
  162. </td>
  163. <td colspan="2" style="text-align: right">
  164. {$pager}
  165. </td>
  166. </tr>
  167. </tfoot>
  168. </table>
  169. </div>
  170. </div>
  171. </form>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <script src="/layuiadmin/layui/layui.js"></script>
  177. <script>
  178. layui.config({
  179. base: '/layuiadmin/' //静态资源所在路径
  180. }).extend({
  181. index: 'lib/index' //主入口模块
  182. }).use('index');
  183. </script>
  184. <script>
  185. var layer = layui.layer;
  186. var $;
  187. layui.use(['jquery', 'layer', 'form'], function(){
  188. $ = layui.$;
  189. var form = layui.form;
  190. $('#clerk_allprint,#clerk_allprint_order').click(function(){
  191. var searchtime = $('#searchtime').val();
  192. var start = $('input[name="time[start]"]').val();
  193. var end = $('input[name="time[end]"]').val();
  194. var s_url= $(this).attr('data-href');
  195. s_url += '&searchtime='+searchtime+"&start="+start+"&end="+end;
  196. window.open(s_url);
  197. //console.log( start );
  198. //console.log(searchtime);
  199. //name="time[start]"
  200. //time[end]
  201. })
  202. $('.deldom').click(function(){
  203. var s_url = $(this).attr('data-href');
  204. layer.confirm($(this).attr('data-confirm'), function(index){
  205. $.ajax({
  206. url:s_url,
  207. type:'post',
  208. dataType:'json',
  209. success:function(info){
  210. if(info.status == 0)
  211. {
  212. layer.msg(info.result.message,{icon: 1,time: 2000});
  213. }else if(info.status == 1){
  214. var go_url = location.href;
  215. if( info.result.hasOwnProperty("url") )
  216. {
  217. go_url = info.result.url;
  218. }
  219. layer.msg('操作成功',{time: 1000,
  220. end:function(){
  221. location.href = info.result.url;
  222. }
  223. });
  224. }
  225. }
  226. })
  227. });
  228. })
  229. $('.btn-operation').click(function(){
  230. var ids_arr = [];
  231. var obj = $(this);
  232. var s_toggle = $(this).attr('data-toggle');
  233. var s_url = $(this).attr('data-href');
  234. $("input[name=item_checkbox]").each(function() {
  235. if( $(this).prop('checked') )
  236. {
  237. ids_arr.push( $(this).val() );
  238. }
  239. })
  240. if(ids_arr.length < 1)
  241. {
  242. layer.msg('请选择要操作的内容');
  243. }else{
  244. var can_sub = true;
  245. if( s_toggle == 'batch-remove' )
  246. {
  247. can_sub = false;
  248. layer.confirm($(obj).attr('data-confirm'), function(index){
  249. $.ajax({
  250. url:s_url,
  251. type:'post',
  252. dataType:'json',
  253. data:{ids:ids_arr},
  254. success:function(info){
  255. if(info.status == 0)
  256. {
  257. layer.msg(info.result.message,{icon: 1,time: 2000});
  258. }else if(info.status == 1){
  259. var go_url = location.href;
  260. if( info.result.hasOwnProperty("url") )
  261. {
  262. go_url = info.result.url;
  263. }
  264. layer.msg('操作成功',{time: 1000,
  265. end:function(){
  266. location.href = info.result.url;
  267. }
  268. });
  269. }
  270. }
  271. })
  272. });
  273. }else{
  274. $.ajax({
  275. url:s_url,
  276. type:'post',
  277. dataType:'json',
  278. data:{ids:ids_arr},
  279. success:function(info){
  280. if(info.status == 0)
  281. {
  282. layer.msg(info.result.message,{icon: 1,time: 2000});
  283. }else if(info.status == 1){
  284. var go_url = location.href;
  285. if( info.result.hasOwnProperty("url") )
  286. {
  287. go_url = info.result.url;
  288. }
  289. layer.msg('操作成功',{time: 1000,
  290. end:function(){
  291. location.href = info.result.url;
  292. }
  293. });
  294. }
  295. }
  296. })
  297. }
  298. }
  299. })
  300. form.on('switch(statewsitch)', function(data){
  301. var s_url = $(this).attr('data-href')
  302. var s_value = 1;
  303. if(data.elem.checked)
  304. {
  305. s_value = 1;
  306. }else{
  307. s_value = 0;
  308. }
  309. $.ajax({
  310. url:s_url,
  311. type:'post',
  312. dataType:'json',
  313. data:{value:s_value},
  314. success:function(info){
  315. if(info.status == 0)
  316. {
  317. layer.msg(info.result.message,{icon: 1,time: 2000});
  318. }else if(info.status == 1){
  319. var go_url = location.href;
  320. if( info.result.hasOwnProperty("url") )
  321. {
  322. go_url = info.result.url;
  323. }
  324. layer.msg('操作成功',{time: 1000,
  325. end:function(){
  326. location.href = info.result.url;
  327. }
  328. });
  329. }
  330. }
  331. })
  332. });
  333. form.on('checkbox(checkboxall)', function(data){
  334. if(data.elem.checked)
  335. {
  336. $("input[name=item_checkbox]").each(function() {
  337. $(this).prop("checked", true);
  338. });
  339. $("input[name=checkall]").each(function() {
  340. $(this).prop("checked", true);
  341. });
  342. }else{
  343. $("input[name=item_checkbox]").each(function() {
  344. $(this).prop("checked", false);
  345. });
  346. $("input[name=checkall]").each(function() {
  347. $(this).prop("checked", false);
  348. });
  349. }
  350. form.render('checkbox');
  351. });
  352. //监听提交
  353. form.on('submit(formDemo)', function(data){
  354. $.ajax({
  355. url: data.form.action,
  356. type: data.form.method,
  357. data: data.field,
  358. dataType:'json',
  359. success: function (info) {
  360. if(info.status == 0)
  361. {
  362. layer.msg(info.result.message,{icon: 1,time: 2000});
  363. }else if(info.status == 1){
  364. var go_url = location.href;
  365. if( info.result.hasOwnProperty("url") )
  366. {
  367. go_url = info.result.url;
  368. }
  369. layer.msg('操作成功',{time: 1000,
  370. end:function(){
  371. location.href = info.result.url;
  372. }
  373. });
  374. }
  375. }
  376. });
  377. return false;
  378. });
  379. })
  380. </script>
  381. </body>
  382. </html>