delivery_line.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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" id="form1">
  58. <input type="hidden" name="c" value="delivery" />
  59. <input type="hidden" name="a" value="delivery_line" />
  60. <div class="layui-form-item">
  61. <div class="layui-input-inline">
  62. <input type="text" class="input-sm form-control layui-input" name='keyword' value="{$gpc['keyword']}" placeholder="输入关键词然后回车">
  63. </div>
  64. <span class="layui-input-inline">
  65. <button class="btn btn-primary" type="submit"> 搜索</button>
  66. </span>
  67. </div>
  68. </form>
  69. <form action="" method="post" class="layui-form" role="form">
  70. <div class="row">
  71. <div class="col-md-12">
  72. <div class="page-table-header">
  73. <!-- <input type='checkbox' value="{$item['id']}" name="checkall" lay-skin="primary" lay-filter="checkboxall"/> -->
  74. <span class="pull-right">
  75. <a href="{:U('delivery/adddeliverylist', array('ok'=>1))}" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 添加配送路线</a>
  76. </span>
  77. <div class="btn-group">
  78. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗?" data-href="{:U('delivery/deldeliverylist')}">
  79. <i class='icow icow-shanchu1'></i> 删除
  80. </button>
  81. </div>
  82. </div>
  83. <table class="layui-table" lay-skin="line" lay-size="lg">
  84. <thead>
  85. <tr>
  86. <th style="width:25px;"><input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" /></th>
  87. <th style="width:80px;">ID</th>
  88. <th style="">线路名称</th>
  89. <th style="">配送司机</th>
  90. <th style="width: 200px;">配送司机手机号</th>
  91. <th style="">配送社区</th>
  92. <th style="width: 200px;">操作</th>
  93. </tr>
  94. </thead>
  95. <tbody>
  96. <?php foreach( $list as $item ){ ?>
  97. <tr>
  98. <td style="width:25px;">
  99. <input type='checkbox' value="{$item['id']}" name="item_checkbox" lay-skin="primary"/>
  100. </td>
  101. <td>
  102. {$item['id']}
  103. </td>
  104. <td>
  105. {$item['name']}
  106. </td>
  107. <td>
  108. <?php if( empty($item['clerk_info']) ){ ?>
  109. --
  110. <?php }else{ ?>
  111. <div style="display: flex">
  112. <img class="img-40" src="{:tomedia($item['clerk_info']['logo'])}" style='border-radius:50%;border:1px solid #efefef;' />
  113. <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
  114. <span class="nickname">
  115. {$item['clerk_info']['name']}
  116. </span>
  117. </span>
  118. </div>
  119. <?php } ?>
  120. </td>
  121. <td>
  122. <?php if( empty($item['clerk_info']) ){ ?>
  123. --
  124. <?php }else{ ?>
  125. {$item['clerk_info']['mobile']}
  126. <?php } ?>
  127. </td>
  128. <td>
  129. {$item['line_to_str']}
  130. </td>
  131. <td style="overflow:visible;position:relative">
  132. <a class='layui-btn layui-btn-xs btn-operation' href="{:U('delivery/adddeliverylist', array('id' => $item['id'],'ok'=>1))}" >
  133. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑">
  134. <i class="layui-icon layui-icon-edit"></i>编辑
  135. </span>
  136. </a>
  137. <a class='layui-btn layui-btn-danger layui-btn-xs deldom deldom' href="javascript:;" data-href="{:U('delivery/deldeliverylist',array('id' => $item['id']))}" data-confirm='确认要删除吗?'>
  138. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">
  139. <i class="layui-icon">&#xe640;</i>删除
  140. </span>
  141. </a>
  142. </td>
  143. </tr>
  144. <?php } ?>
  145. </tbody>
  146. <tfoot>
  147. <tr>
  148. <td colspan="3">
  149. <div class="page-table-header">
  150. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  151. <div class="btn-group">
  152. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗?" data-href="{:U('delivery/deldeliverylist')}">
  153. <i class='icow icow-shanchu1'></i> 删除
  154. </button>
  155. </div>
  156. </div>
  157. </td>
  158. <td colspan="4" style="text-align: right">
  159. {$pager}
  160. </td>
  161. </tr>
  162. </tfoot>
  163. </table>
  164. </div>
  165. </div>
  166. </form>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. <script src="/layuiadmin/layui/layui.js"></script>
  172. <script>
  173. layui.config({
  174. base: '/layuiadmin/' //静态资源所在路径
  175. }).extend({
  176. index: 'lib/index' //主入口模块
  177. }).use('index');
  178. </script>
  179. <script>
  180. var layer = layui.layer;
  181. var $;
  182. layui.use(['jquery', 'layer', 'form'], function(){
  183. $ = layui.$;
  184. var form = layui.form;
  185. $('.deldom').click(function(){
  186. var s_url = $(this).attr('data-href');
  187. layer.confirm($(this).attr('data-confirm'), function(index){
  188. $.ajax({
  189. url:s_url,
  190. type:'post',
  191. dataType:'json',
  192. success:function(info){
  193. if(info.status == 0)
  194. {
  195. layer.msg(info.result.message,{icon: 1,time: 2000});
  196. }else if(info.status == 1){
  197. var go_url = location.href;
  198. if( info.result.hasOwnProperty("url") )
  199. {
  200. go_url = info.result.url;
  201. }
  202. layer.msg('操作成功',{time: 1000,
  203. end:function(){
  204. location.href = info.result.url;
  205. }
  206. });
  207. }
  208. }
  209. })
  210. });
  211. })
  212. $('.btn-operation').click(function(){
  213. var ids_arr = [];
  214. var obj = $(this);
  215. var s_toggle = $(this).attr('data-toggle');
  216. var s_url = $(this).attr('data-href');
  217. $("input[name=item_checkbox]").each(function() {
  218. if( $(this).prop('checked') )
  219. {
  220. ids_arr.push( $(this).val() );
  221. }
  222. })
  223. if(ids_arr.length < 1)
  224. {
  225. layer.msg('请选择要操作的内容');
  226. }else{
  227. var can_sub = true;
  228. if( s_toggle == 'batch-remove' )
  229. {
  230. can_sub = false;
  231. layer.confirm($(obj).attr('data-confirm'), function(index){
  232. $.ajax({
  233. url:s_url,
  234. type:'post',
  235. dataType:'json',
  236. data:{ids:ids_arr},
  237. success:function(info){
  238. if(info.status == 0)
  239. {
  240. layer.msg(info.result.message,{icon: 1,time: 2000});
  241. }else if(info.status == 1){
  242. var go_url = location.href;
  243. if( info.result.hasOwnProperty("url") )
  244. {
  245. go_url = info.result.url;
  246. }
  247. layer.msg('操作成功',{time: 1000,
  248. end:function(){
  249. location.href = info.result.url;
  250. }
  251. });
  252. }
  253. }
  254. })
  255. });
  256. }else{
  257. $.ajax({
  258. url:s_url,
  259. type:'post',
  260. dataType:'json',
  261. data:{ids:ids_arr},
  262. success:function(info){
  263. if(info.status == 0)
  264. {
  265. layer.msg(info.result.message,{icon: 1,time: 2000});
  266. }else if(info.status == 1){
  267. var go_url = location.href;
  268. if( info.result.hasOwnProperty("url") )
  269. {
  270. go_url = info.result.url;
  271. }
  272. layer.msg('操作成功',{time: 1000,
  273. end:function(){
  274. location.href = info.result.url;
  275. }
  276. });
  277. }
  278. }
  279. })
  280. }
  281. }
  282. })
  283. form.on('switch(statewsitch)', function(data){
  284. var s_url = $(this).attr('data-href')
  285. var s_value = 1;
  286. if(data.elem.checked)
  287. {
  288. s_value = 1;
  289. }else{
  290. s_value = 0;
  291. }
  292. $.ajax({
  293. url:s_url,
  294. type:'post',
  295. dataType:'json',
  296. data:{value:s_value},
  297. success:function(info){
  298. if(info.status == 0)
  299. {
  300. layer.msg(info.result.message,{icon: 1,time: 2000});
  301. }else if(info.status == 1){
  302. var go_url = location.href;
  303. if( info.result.hasOwnProperty("url") )
  304. {
  305. go_url = info.result.url;
  306. }
  307. layer.msg('操作成功',{time: 1000,
  308. end:function(){
  309. location.href = info.result.url;
  310. }
  311. });
  312. }
  313. }
  314. })
  315. });
  316. form.on('checkbox(checkboxall)', function(data){
  317. if(data.elem.checked)
  318. {
  319. $("input[name=item_checkbox]").each(function() {
  320. $(this).prop("checked", true);
  321. });
  322. $("input[name=checkall]").each(function() {
  323. $(this).prop("checked", true);
  324. });
  325. }else{
  326. $("input[name=item_checkbox]").each(function() {
  327. $(this).prop("checked", false);
  328. });
  329. $("input[name=checkall]").each(function() {
  330. $(this).prop("checked", false);
  331. });
  332. }
  333. form.render('checkbox');
  334. });
  335. //监听提交
  336. form.on('submit(formDemo)', function(data){
  337. $.ajax({
  338. url: data.form.action,
  339. type: data.form.method,
  340. data: data.field,
  341. dataType:'json',
  342. success: function (info) {
  343. if(info.status == 0)
  344. {
  345. layer.msg(info.result.message,{icon: 1,time: 2000});
  346. }else if(info.status == 1){
  347. var go_url = location.href;
  348. if( info.result.hasOwnProperty("url") )
  349. {
  350. go_url = info.result.url;
  351. }
  352. layer.msg('操作成功',{time: 1000,
  353. end:function(){
  354. location.href = info.result.url;
  355. }
  356. });
  357. }
  358. }
  359. });
  360. return false;
  361. });
  362. })
  363. </script>
  364. </body>
  365. </html>