ordersendall.html 13 KB

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