ordersendall.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:
  49. <span class="line-text">批量发货</span>
  50. </div>
  51. <div class="layui-tab layui-tab-brief" >
  52. <ul class="layui-tab-title">
  53. <li <?php if( empty($type) || $type=='normal'){ ?>class="layui-this"<?php } ?>><a href="{:U('order/ordersendall', array('type' => 'normal','ok' => 1))}">批量发货到团长</a></li>
  54. <li <?php if( $type=='mult'){ ?>class="layui-this"<?php } ?> ><a href="{:U('order/ordersendall', array('type' => 'mult','ok' => 1))}">快递导入方式</a></li>
  55. <li <?php if( $type=='mult_send_tuanz'){ ?>class="layui-this"<?php } ?> ><a href="{:U('order/ordersendall', array('type' => 'mult_send_tuanz','ok' => 1))}">订单批量团长签收</a></li>
  56. <li <?php if( $type=='mult_member_receive_order'){ ?>class="layui-this"<?php } ?> ><a href="{:U('order/ordersendall', array('type' => 'mult_member_receive_order','ok' => 1))}">订单批量确认收货</a></li>
  57. </ul>
  58. </div>
  59. <div class="layui-card-body" style="padding:15px;">
  60. <div class="summary_box">
  61. <?php if( empty($type) || $type=='normal'){ ?>
  62. <div class="summary_title">
  63. <span class=" title_inner">批量发货到团长</span>
  64. </div>
  65. <div class="summary_lg">
  66. 功能介绍: 使用excel快速导入进行订单发货
  67. <p>如重复导入数据将以最新导入数据为准,请谨慎使用</p>
  68. <p>数据导入订单状态自动修改为配送中</p>
  69. <p>一次导入的数据不要太多,大量数据请分批导入,建议在服务器负载低的时候进行</p>
  70. <!--<p>导入订单包含 “同城配送” 订单的时候,同城配送订单状态自动修改为配送中</p>-->
  71. 使用方法:
  72. <p>1. 下载Excel模板文件并录入信息</p>
  73. <p>2. 上传Excel导入</p>
  74. 格式要求: Excel第一列必须为订单编号
  75. </div>
  76. <?php } ?>
  77. <?php if( $type=='mult_send_tuanz'){ ?>
  78. <div class="summary_title">
  79. <span class=" title_inner">订单批量团长签收</span>
  80. </div>
  81. <div class="summary_lg">
  82. 功能介绍: 使用excel快速导入配送中订单进行团长批量签收
  83. <p>如重复导入数据将以最新导入数据为准,请谨慎使用</p>
  84. <p>数据导入订单状态自动修改为已送达团长</p>
  85. <p>一次导入的数据不要太多,大量数据请分批导入,建议在服务器负载低的时候进行</p>
  86. <!--<p>导入订单包含 “同城配送” 订单的时候,同城配送订单状态自动修改为配送中</p>-->
  87. 使用方法:
  88. <p>1. 下载Excel模板文件并录入信息</p>
  89. <p>2. 上传Excel导入</p>
  90. 格式要求: Excel第一列必须为订单编号
  91. </div>
  92. <?php } ?>
  93. <?php if( $type=='mult_member_receive_order'){ ?>
  94. <div class="summary_title">
  95. <span class=" title_inner">订单批量确认收货</span>
  96. </div>
  97. <div class="summary_lg">
  98. 功能介绍: 使用excel快速导入 <span class="text-primary">待收货的订单</span>进行批量用户确认收货
  99. <p>如重复导入数据将以最新导入数据为准,请谨慎使用</p>
  100. <p>数据导入订单状态自动修改为确认收货,并进行<span class="text-primary">团长佣金结算</span></p>
  101. <p>一次导入的数据不要太多,大量数据请分批导入,建议在服务器负载低的时候进行</p>
  102. <!--<p>导入订单包含 “同城配送” 订单的时候,同城配送订单状态自动修改为确认收货,配送员默认系统配送员配送完成</p>-->
  103. 使用方法:
  104. <p>1. 下载Excel模板文件并录入信息</p>
  105. <p>2. 上传Excel导入</p>
  106. 格式要求: Excel第一列必须为订单编号
  107. </div>
  108. <?php } ?>
  109. <?php if( $type=='mult'){ ?>
  110. <div class="summary_title">
  111. <span class=" title_inner">批量快递发货到会员</span>
  112. </div>
  113. <div class="summary_lg" >
  114. 功能介绍: 使用excel快速导入进行订单发货
  115. <p>如重复导入数据将以最新导入数据为准,请谨慎使用</p>
  116. <p>数据导入订单状态自动修改为已发货</p>
  117. <p>一次导入的数据不要太多,大量数据请分批导入,建议在服务器负载低的时候进行</p>
  118. <!--<p>导入订单包含 “同城配送” 订单的时候,同城配送订单状态自动修改为配送中</p>-->
  119. 使用方法:
  120. <p>1. 下载Excel模板文件并录入信息</p>
  121. <p>2. 选择快递公司</p>
  122. <p>3. 上传Excel导入</p>
  123. 格式要求: Excel第一列必须为订单编号,第二列必须为快递单号
  124. </div>
  125. <?php } ?>
  126. </div>
  127. <form action="" id="importform" class="layui-form" lay-filter="example" method="post" enctype="multipart/form-data">
  128. <input type="hidden" name="type" id="type" value="{$type}"/>
  129. <div class='layui-row'>
  130. <?php if( !empty($type) && $type=='mult'){ ?>
  131. <div class="layui-row" >
  132. <label class="layui-col-lg control-label">快递公司</label>
  133. <div class="layui-col-sm-5 goodsname" style="padding-right:0;" >
  134. <select class="form-control" name="express" id="express">
  135. <option value="" data-name="">请选择快递公司</option>
  136. <?php foreach( $express_list as $value ){ ?>
  137. <option value="{$value['id']}" data-name="{$value['name']}">{$value['name']}</option>
  138. <?php } ?>
  139. </select>
  140. <input type='hidden' name='expresscom' id='expresscom' value=""/>
  141. </div>
  142. </div>
  143. <?php } ?>
  144. <div class="layui-row">
  145. <label class="layui-col-lg control-label">EXCEL</label>
  146. <div class="layui-col-sm-5 goodsname" style="padding-right:0;" >
  147. <input type="file" name="excelfile" class="form-control" />
  148. <span class="help-block">如果遇到数据重复则将进行数据更新</span>
  149. </div>
  150. </div>
  151. </div>
  152. <div class='layui-row'>
  153. <div class="layui-col-sm-12">
  154. <?php if( empty($type) || $type=='normal' || $type=='mult_send_tuanz' || $type=='mult_member_receive_order'){ ?>
  155. <div class="modal-footer" style="text-align: left">
  156. <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button>
  157. <a class="btn btn-primary" href="{:U('order/batchsend_import', array('type' => 'normal'))}" >
  158. <i class="fa fa-download" title=""></i> 下载Excel模板文件
  159. </a>
  160. </div>
  161. <?php } ?>
  162. <?php if( $type=='mult'){ ?>
  163. <div class="modal-footer" style="text-align: left">
  164. <button type="submit" class="btn btn-primary" name="cancelsend" value="yes">确认导入</button>
  165. <a class="btn btn-primary" href="{:U('order/batchsend_import', array('type' => 'mult'))}" >
  166. <i class="fa fa-download" title=""></i> 下载Excel模板文件
  167. </a>
  168. </div>
  169. <?php } ?>
  170. </div>
  171. </div>
  172. </form>
  173. </div>
  174. <div class="layui-card-body" style="padding:15px;">
  175. <?php if(empty($_GPC['type']) || $_GPC['type']=='normal'){ ?>
  176. <div class='layui-row'>
  177. <div class="layui-col-sm-12">
  178. <a class='btn btn-default btn-sm btn-op ' data-sec="1" data-confirm='此操作将对所有配送方式为“到点自提”,“团长配送”的待发货订单发货,进入下一环节待团长签收(待确认送达团长)?' data-toggle="ajaxModal" href="javascript:;" data-href="{:U('delivery/onekey_tosendallorder', array('sec' => 1) )}" >
  179. <i class="icow icow-yibiaoji" style="color: #999;display: inline-block;vertical-align: middle" title="此操作将对所有配送方式为“到点自提”,“团长配送”的待发货订单发货,进入下一环节待团长签收(待确认送达团长) " ></i>
  180. 一键发货到团长
  181. </a>
  182. </div>
  183. </div>
  184. <?php } ?>
  185. <?php if(!empty($_GPC['type']) && $_GPC['type']=='mult_send_tuanz'){ ?>
  186. <div class='layui-row'>
  187. <div class="layui-col-sm-12">
  188. <a class='btn btn-default btn-sm btn-op ' data-sec="1" data-confirm='对所有待团长签收(待确认送达团长)进行签收,进入下一环节待用户确认收货(待团长核销)' data-toggle="ajaxModal" href="javascript:;" data-href="{:U('delivery/onekey_opsend_tuanz_over', array('sec' => 1) )}" >
  189. <i class="icow icow-yibiaoji" style="color: #999;display: inline-block;vertical-align: middle" title="对所有待团长签收(待确认送达团长)进行签收,进入下一环节待用户确认收货(待团长核销)" ></i>
  190. 一键团长签收
  191. </a>
  192. </div>
  193. </div>
  194. <?php } ?>
  195. <?php if(!empty($_GPC['type']) && $_GPC['type']=='mult_member_receive_order'){ ?>
  196. <div class='layui-row'>
  197. <div class="layui-col-sm-12">
  198. <a class='btn btn-default btn-sm btn-op ' data-sec="1" data-confirm='对所有的配送方式的订单进行确认收货(团长核销/快递的收货)' data-toggle="ajaxModal" href="javascript:;" data-href="{:U('delivery/onekey_opreceive', array('sec' => 1) )}" >
  199. <i class="icow icow-yibiaoji" style="color: #999;display: inline-block;vertical-align: middle" title="对所有的配送方式的订单进行确认收货(团长核销/快递的收货)" ></i>
  200. 一键确认收货
  201. </a>
  202. </div>
  203. </div>
  204. <?php } ?>
  205. </div>
  206. </div>
  207. </div>
  208. <script src="/layuiadmin/layui/layui.js"></script>
  209. <script>
  210. layui.config({
  211. base: '/layuiadmin/' //静态资源所在路径
  212. }).extend({
  213. index: 'lib/index' //主入口模块
  214. }).use('index');
  215. </script>
  216. <script>
  217. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  218. var layer = layui.layer;
  219. var $;
  220. layui.use(['jquery', 'layer','form'], function(){
  221. $ = layui.$;
  222. var form = layui.form;
  223. $("[data-toggle='ajaxModal']").click(function () {
  224. var s_url = $(this).attr('data-href');
  225. ajax_url = s_url;
  226. layer.confirm($(this).attr('data-confirm'), function(index){
  227. $.post(ajax_url, {}, function(shtml){
  228. layer.open({
  229. type: 1,
  230. area: '930px',
  231. content: shtml //注意,如果str是object,那么需要字符拼接。
  232. });
  233. });
  234. })
  235. });
  236. $('.deldom').click(function(){
  237. var s_url = $(this).attr('data-href');
  238. layer.confirm($(this).attr('data-confirm'), function(index){
  239. $.ajax({
  240. url:s_url,
  241. type:'post',
  242. dataType:'json',
  243. success:function(info){
  244. if(info.status == 0)
  245. {
  246. layer.msg(info.result.message,{icon: 1,time: 2000});
  247. }else if(info.status == 1){
  248. var go_url = location.href;
  249. if( info.result.hasOwnProperty("url") )
  250. {
  251. go_url = info.result.url;
  252. }
  253. layer.msg('操作成功',{time: 1000,
  254. end:function(){
  255. location.href = info.result.url;
  256. }
  257. });
  258. }
  259. }
  260. })
  261. });
  262. })
  263. $('.btn-operation').click(function(){
  264. var ids_arr = [];
  265. var obj = $(this);
  266. var s_toggle = $(this).attr('data-toggle');
  267. var s_url = $(this).attr('data-href');
  268. $("input[name=item_checkbox]").each(function() {
  269. if( $(this).prop('checked') )
  270. {
  271. ids_arr.push( $(this).val() );
  272. }
  273. })
  274. if(ids_arr.length < 1)
  275. {
  276. layer.msg('请选择要操作的内容');
  277. }else{
  278. var can_sub = true;
  279. if( s_toggle == 'batch-remove' )
  280. {
  281. can_sub = false;
  282. layer.confirm($(obj).attr('data-confirm'), function(index){
  283. $.ajax({
  284. url:s_url,
  285. type:'post',
  286. dataType:'json',
  287. data:{ids:ids_arr},
  288. success:function(info){
  289. if(info.status == 0)
  290. {
  291. layer.msg(info.result.message,{icon: 1,time: 2000});
  292. }else if(info.status == 1){
  293. var go_url = location.href;
  294. if( info.result.hasOwnProperty("url") )
  295. {
  296. go_url = info.result.url;
  297. }
  298. layer.msg('操作成功',{time: 1000,
  299. end:function(){
  300. location.href = info.result.url;
  301. }
  302. });
  303. }
  304. }
  305. })
  306. });
  307. }else{
  308. $.ajax({
  309. url:s_url,
  310. type:'post',
  311. dataType:'json',
  312. data:{ids:ids_arr},
  313. success:function(info){
  314. if(info.status == 0)
  315. {
  316. layer.msg(info.result.message,{icon: 1,time: 2000});
  317. }else if(info.status == 1){
  318. var go_url = location.href;
  319. if( info.result.hasOwnProperty("url") )
  320. {
  321. go_url = info.result.url;
  322. }
  323. layer.msg('操作成功',{time: 1000,
  324. end:function(){
  325. location.href = info.result.url;
  326. }
  327. });
  328. }
  329. }
  330. })
  331. }
  332. }
  333. })
  334. form.on('switch(restwsitch)', function(data){
  335. var s_url = $(this).attr('data-href')
  336. var rest = 1;
  337. if(data.elem.checked)
  338. {
  339. rest = 1;
  340. }else{
  341. rest = 0;
  342. }
  343. $.ajax({
  344. url:s_url,
  345. type:'post',
  346. dataType:'json',
  347. data:{rest:rest},
  348. success:function(info){
  349. if(info.status == 0)
  350. {
  351. layer.msg(info.result.message,{icon: 1,time: 2000});
  352. }else if(info.status == 1){
  353. var go_url = location.href;
  354. if( info.result.hasOwnProperty("url") )
  355. {
  356. go_url = info.result.url;
  357. }
  358. layer.msg('操作成功',{time: 1000,
  359. end:function(){
  360. location.href = info.result.url;
  361. }
  362. });
  363. }
  364. }
  365. })
  366. });
  367. form.on('switch(enablewsitch)', function(data){
  368. var s_url = $(this).attr('data-href')
  369. var enable = 1;
  370. if(data.elem.checked)
  371. {
  372. enable = 1;
  373. }else{
  374. enable = 0;
  375. }
  376. $.ajax({
  377. url:s_url,
  378. type:'post',
  379. dataType:'json',
  380. data:{enable:enable},
  381. success:function(info){
  382. if(info.status == 0)
  383. {
  384. layer.msg(info.result.message,{icon: 1,time: 2000});
  385. }else if(info.status == 1){
  386. var go_url = location.href;
  387. if( info.result.hasOwnProperty("url") )
  388. {
  389. go_url = info.result.url;
  390. }
  391. layer.msg('操作成功',{time: 1000,
  392. end:function(){
  393. location.href = info.result.url;
  394. }
  395. });
  396. }
  397. }
  398. })
  399. });
  400. form.on('switch(statewsitch)', function(data){
  401. var s_url = $(this).attr('data-href')
  402. var state = 1;
  403. if(data.elem.checked)
  404. {
  405. state = 1;
  406. }else{
  407. state = 0;
  408. }
  409. $.ajax({
  410. url:s_url,
  411. type:'post',
  412. dataType:'json',
  413. data:{state:state},
  414. success:function(info){
  415. if(info.status == 0)
  416. {
  417. layer.msg(info.result.message,{icon: 1,time: 2000});
  418. }else if(info.status == 1){
  419. var go_url = location.href;
  420. if( info.result.hasOwnProperty("url") )
  421. {
  422. go_url = info.result.url;
  423. }
  424. layer.msg('操作成功',{time: 1000,
  425. end:function(){
  426. location.href = info.result.url;
  427. }
  428. });
  429. }
  430. }
  431. })
  432. });
  433. form.on('checkbox(checkboxall)', function(data){
  434. if(data.elem.checked)
  435. {
  436. $("input[name=item_checkbox]").each(function() {
  437. $(this).prop("checked", true);
  438. });
  439. $("input[name=checkall]").each(function() {
  440. $(this).prop("checked", true);
  441. });
  442. }else{
  443. $("input[name=item_checkbox]").each(function() {
  444. $(this).prop("checked", false);
  445. });
  446. $("input[name=checkall]").each(function() {
  447. $(this).prop("checked", false);
  448. });
  449. }
  450. form.render('checkbox');
  451. });
  452. //监听提交
  453. form.on('submit(formDemo)', function(data){
  454. $.ajax({
  455. url: data.form.action,
  456. type: data.form.method,
  457. data: data.field,
  458. dataType:'json',
  459. success: function (info) {
  460. if(info.status == 0)
  461. {
  462. layer.msg(info.result.message,{icon: 1,time: 2000});
  463. }else if(info.status == 1){
  464. var go_url = location.href;
  465. if( info.result.hasOwnProperty("url") )
  466. {
  467. go_url = info.result.url;
  468. }
  469. layer.msg('操作成功',{time: 1000,
  470. end:function(){
  471. location.href = info.result.url;
  472. }
  473. });
  474. }
  475. }
  476. });
  477. return false;
  478. });
  479. })
  480. </script>
  481. <script language='javascript'>
  482. $(function(){
  483. $('#importform').submit(function(){
  484. if($("#type").val() == 'mult'){
  485. if(!$(":input[name=express]").val()){
  486. layer.msg("您还未选择快递公司哦~");
  487. return false;
  488. }
  489. }
  490. if(!$(":input[name=excelfile]").val()){
  491. layer.msg("您还未选择Excel文件哦~");
  492. return false;
  493. }
  494. })
  495. $("#express").change(function () {
  496. var obj = $(this);
  497. var sel = obj.find("option:selected").attr("data-name");
  498. $("#expresscom").val(sel);
  499. });
  500. })
  501. </script>
  502. </body>