Нет описания

orderlist.blade.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. <div class="page-container">
  5. <div>
  6. <div>
  7. <a class="btn btn-primary radius" onclick="order_add('新增', 0)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增订单</a>
  8. <input class="input-text" style="width:5%;text-align:center" type="text" value="订单编号"/>
  9. <input id="id" type="text" class="input-text" style="width:6%;text-align:center" name="id" value="{{$id?$id:''}}">
  10. @if($search_admin == 1)
  11. <input class="input-text" style="width:5%;text-align:center" type="text" value="所属销售"/>
  12. <select style="width:6%;text-align:center" id='admin_id' name="admin_id">
  13. <option value="0" @if($admin_id=='') selected @endif>-- 选择销售 --</option>
  14. @foreach($adminlist as $v)
  15. <option value="{{$v['id']}}" @if($admin_id==$v['id']) selected @endif>{{$v['realname']}}</option>
  16. @endforeach
  17. </select>
  18. @endif
  19. <input class="input-text" style="width:5%;text-align:center" type="text" value="开始时间"/>
  20. <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:7%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
  21. <input class="input-text" style="width:5%;text-align:center" type="text" value="结束时间"/>
  22. <input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class="input-text Wdate" style="width:7%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">
  23. <input class="input-text" style="width:5%;text-align:center" type="text" value="收货人"/>
  24. <input id="receiverName" type="text" class="input-text" style="width:6%;text-align:center" name="receiverName" value="{{$receiverName?$receiverName:''}}">
  25. <input class="input-text" style="width:5%;text-align:center" type="text" value="手机号"/>
  26. <input id="receiverMobile" type="text" class="input-text" style="width:6%;text-align:center" name="receiverMobile" value="{{$receiverMobile?$receiverMobile:''}}">
  27. <input class="input-text" style="width:5%;text-align:center" type="text" value="订单状态"/>
  28. <select style="width:6%;text-align:center" id='status' name="status">
  29. <option value="-1" @if($status=='-1') selected @endif>-- 请选择--</option>
  30. @if($self_role !='管理员' )<option value="0" @if($status==0) selected @endif>已录入</option> @endif
  31. <option value="1" @if($status==1) selected @endif>待审核</option>
  32. <option value="2" @if($status==2) selected @endif>已审核</option>
  33. <option value="3" @if($status==3) selected @endif>已发货</option>
  34. </select>
  35. <div style="float:right">
  36. <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
  37. <a class="btn btn-primary radius" onclick="order_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出订单</a>
  38. <!--a class="btn btn-primary radius" onclick="order_verify_more()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 批量审核</a-->
  39. </div>
  40. </div>
  41. </div>
  42. <div class="mt-20">
  43. <table class="table table-border table-bordered table-bg table-hover table-sort">
  44. <thead>
  45. <tr class="text-c">
  46. <th width="4%"><!--input type="checkbox" id="selected-all"-->订单编号</th>
  47. <th width="4%">买家名称</th>
  48. <th width="4%">收货人</th>
  49. <th width="4%">收货人手机号</th>
  50. <th width="6%">收货地址</th>
  51. <th width="9%">商品信息</th>
  52. <th width="4%">预发货时间</th>
  53. <th width="6%">物流单号</th>
  54. @if($self_role !='销售' ) <th width="3%">成本</th> @endif
  55. <th width="4%">发货仓库</th>
  56. <th width="4%">付款金额</th>
  57. <th width="5%">下单时间</th>
  58. <th width="4%">加粉时间</th>
  59. <th width="2%">是否复购</th>
  60. <th width="2%">是否退补单</th>
  61. <th width="4%">应该退补差价</th>
  62. <th width="5%">退补备注</th>
  63. <th width="4%">所属销售</th>
  64. <th width="4%">订单状态</th>
  65. @if($self_role =='销售' )<th width="5%">驳回原因</th>@endif
  66. <th width="3%">是否退款</th>
  67. <th width="5%">买家备注</th>
  68. <th width="5%">卖家备注</th>
  69. <th width="5%">发货备注</th>
  70. <th width="5%">操作</th>
  71. </tr>
  72. </thead>
  73. <tbody>
  74. @if($result)
  75. @foreach($result as $a)
  76. <tr class="text-c" style=" text-align:center;">
  77. <td><!--input type="checkbox" name="id[]" value="{{$a['id']}}"--> {{$a['id']}}</td>
  78. <td>{{$a['customerName']}}</td>
  79. <td>{{$a['receiverName']}}</td>
  80. <td>{{$a['receiverMobile']}}</td>
  81. <td>{{$a['receiverState']}}{{$a['receiverCity']}}{{$a['receiverDistrict']}}{{$a['receiverStreet']}}{{$a['receiverAddress']}}</td>
  82. <td>{{$a['goods_note']}}</td>
  83. <td>{{$a['delivery_date']}}</td>
  84. @if($self_role =='销售' )
  85. <td>{{$a['logistics_id']}}</td>
  86. @else
  87. <td class ="change_logistics_id">
  88. <p id="logi_1{{$a['id']}}">{{$a['logistics_id']}}</p>
  89. <input id="logi_2{{$a['id']}}" style="display: none" type='text' autofocus="autofocus" name='logistics_id' value="{{$a['logistics_id']}}" onblur="change_logistics_id({{$a['id']}})" />
  90. <span class="sort_icon" hidden onClick='change_logistics_click("{{$a['id']}}","{{$a['logistics_id']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  91. </td>
  92. @endif
  93. @if($self_role !='销售' )
  94. <td class ="change_logistics_id">
  95. <p id="cost_1{{$a['id']}}">{{$a['cost']}}</p>
  96. <input id="cost_2{{$a['id']}}" style="display: none" type='text' name='cost' value="{{$a['cost']}}" onblur="change_cost({{$a['id']}})" />
  97. <span class="sort_icon" hidden onClick='change_cost_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  98. </td>
  99. @endif
  100. <td>@if($a['warehouse']==1) A仓库 @elseif($a['warehouse']==2) B仓库 @else @endif</td>
  101. <td>{{$a['receivedAmount']}}</td>
  102. <td>{{$a['createTime']}}</td>
  103. <td>{{$a['fanTime']}}</td>
  104. <td>@if($a['is_fugou']==1) 是 @else 否 @endif</td>
  105. <td>@if($a['is_refund']==1) 是 @else 否 @endif</td>
  106. <td>{{$a['refund_price']}}</td>
  107. <td>{{$a['refund_note']}}</td>
  108. <td>{{$a['admin_name']}}</td>
  109. <td id="order_verify{{$a['id']}}">{{$a['status_name']}}</td>
  110. @if($self_role =='销售' ) <td>@if($a['status'] == 0)<font color='red'> {{$a['refuse_reason']}} </font> @endif</td> @endif
  111. <td id="refund{{$a['id']}}">@if($a['order_status']==2) <span class="btn btn-danger radius">退款</span> @else 正常<br><span class="btn btn-primary radius" onclick="order_refund({{$a['id']}})">设为退款</span> @endif</td>
  112. <td class ="change_logistics_id">
  113. <p id="buyerMemo_1{{$a['id']}}">{{$a['buyerMemo']}}</p>
  114. <input id="buyerMemo_2{{$a['id']}}" style="display: none" type='text' name='buyerMemo' value="{{$a['buyerMemo']}}" onblur="change_buyerMemo({{$a['id']}})" />
  115. <span class="sort_icon" hidden onClick='change_buyerMemo_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  116. </td>
  117. <td class ="change_logistics_id">
  118. <p id="sellerMemo_1{{$a['id']}}">{{$a['sellerMemo']}}</p>
  119. <input id="sellerMemo_2{{$a['id']}}" style="display: none" type='text' name='sellerMemo' value="{{$a['sellerMemo']}}" onblur="change_sellerMemo({{$a['id']}})" />
  120. <span class="sort_icon" hidden onClick='change_sellerMemo_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  121. </td>
  122. <td>{{$a['send_note']}}</td>
  123. <td>
  124. @if($a['enable_status'])
  125. @foreach($a['enable_status'] as $item)
  126. @if($item['status'] == 0)
  127. <a id="verify_refuse" style="text-decoration:none" onClick='refuse_reason("{{$a['id']}}")' href="javascript:;" title="审核驳回"><span class="btn btn-danger radius">审核驳回</span></a>
  128. @else
  129. <a id="verify" style="text-decoration:none" onClick='order_verify("{{$a['id']}}", "{{$item['status']}}", "{{$item['name']}}")' href="javascript:;" title="{{$item['name']}}"><span class="btn btn-primary radius">{{$item['name']}}</span></a>
  130. @endif
  131. @endforeach
  132. @endif
  133. @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
  134. @else
  135. <a style="text-decoration:none" onClick='order_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
  136. <a style="text-decoration:none" onClick='order_del("删除","{{$a['id']}}")' href="javascript:;" title="删除"><span class="btn btn-danger radius">删除</span></a>
  137. @endif
  138. </td>
  139. </tr>
  140. @endforeach
  141. @endif
  142. </tbody>
  143. </table>
  144. </div>
  145. <!--弹出层 推入分组-->
  146. <div id="modal-demo1" class="modal fade" tabnonautomatic_index="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  147. <div class="modal-dialog">
  148. <div class="modal-content radius">
  149. <div class="modal-body" style="height:150px">
  150. <div id="fa2">
  151. <p style="font-size:14px">驳回原因:</p>
  152. <input id='order_id' type='hidden' name='status' value=''/>
  153. <textarea style="height:75px;" cols="85" id='refuse_reason'></textarea>
  154. </div>
  155. <div style="float:right">
  156. <button class="btn btn-primary radius" onclick='verify_refuse()' value="&nbsp;&nbsp;确定&nbsp;&nbsp;">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>&nbsp;
  157. <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <div id="page" class="page_div"></div>
  164. </div>
  165. <!--_footer 作为公共模版分离出去-->
  166. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  167. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  168. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  169. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  170. <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
  171. <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  172. <!--/_footer 作为公共模版分离出去-->
  173. <!--/_footer 作为公共模版分离出去-->
  174. <script type="text/javascript">
  175. /*广告-添加*/
  176. function order_add(title){
  177. location.href="/admin/order/create";
  178. }
  179. /*广告-编辑*/
  180. function order_edit(title,id){
  181. var page = {{$page}};
  182. var admin_id = $('#admin_id').val();
  183. var stime = $('#stime').val();
  184. var etime = $('#etime').val();
  185. var receiverName = $('#receiverName').val();
  186. var receiverMobile = $('#receiverMobile').val();
  187. var last_url = '{{$last_url}}';
  188. location.href="/admin/order/edit/"+id+'?page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&last_url='+last_url;
  189. }
  190. /*广告-设为首页显示*/
  191. function up(obj,id){
  192. layer.confirm('确认要设为首页显示吗?',function(index){
  193. location.href='/admin/order/up/'+id;
  194. });
  195. }
  196. /*广告-移除*/
  197. function order_del(obj,id){
  198. layer.confirm('确认要删除吗?',function(index){
  199. location.href='/admin/order/delete/'+id;
  200. });
  201. }
  202. /*广告-设为首页隐藏*/
  203. function down(obj,id){
  204. layer.confirm('确认要设为首页隐藏吗?',function(index){
  205. location.href='/admin/order/down/'+id;
  206. });
  207. }
  208. function user_search(){
  209. var admin_id = $('#admin_id').val();
  210. var stime = $('#stime').val();
  211. var etime = $('#etime').val();
  212. var receiverName = $('#receiverName').val();
  213. var receiverMobile = $('#receiverMobile').val();
  214. var status = $('#status').val();
  215. var id = $('#id').val();
  216. //var page = {{$page}};
  217. location.href = 'index?admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&status='+status+'&id='+id;
  218. }
  219. //导出
  220. function order_export(){
  221. var admin_id = $('#admin_id').val();
  222. var stime = $('#stime').val();
  223. var etime = $('#etime').val();
  224. var receiverName = $('#receiverName').val();
  225. var receiverMobile = $('#receiverMobile').val();
  226. var status = $('#status').val();
  227. var id = $('#id').val();
  228. location.href = '/admin/order/order_export?admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&status='+status+'&id='+id;
  229. }
  230. function change_logistics_click(id, logistics_id){
  231. $("#logi_1"+id).hide();
  232. $("#logi_2"+id).show();
  233. $("#logi_2"+id).focus();
  234. }
  235. function change_logistics_id(id){
  236. var logistics_id = $("#logi_2"+id).val();
  237. $.ajax({
  238. url: '/admin/order/editLogisticsId?id='+id+'&logistics_id='+logistics_id,
  239. type: 'get',
  240. dateType: 'json',
  241. success:function(msg){
  242. $("#logi_1"+id).html(logistics_id);
  243. $("#logi_1"+id).show();
  244. $("#logi_2"+id).hide();
  245. }
  246. });
  247. }
  248. function change_cost_click(id, cost){
  249. $("#cost_1"+id).hide();
  250. $("#cost_2"+id).show();
  251. $("#cost_2"+id).focus();
  252. }
  253. function change_cost(id){
  254. var cost = $("#cost_2"+id).val();
  255. $.ajax({
  256. url: '/admin/order/editLogisticsId?id='+id+'&cost='+cost,
  257. type: 'get',
  258. dateType: 'json',
  259. success:function(msg){
  260. $("#cost_1"+id).html(cost);
  261. $("#cost_1"+id).show();
  262. $("#cost_2"+id).hide();
  263. }
  264. });
  265. }
  266. function change_buyerMemo_click(id, buyerMemo){
  267. $("#buyerMemo_1"+id).hide();
  268. $("#buyerMemo_2"+id).show();
  269. $("#buyerMemo_2"+id).focus();
  270. }
  271. function change_buyerMemo(id){
  272. var buyerMemo = $("#buyerMemo_2"+id).val();
  273. $.ajax({
  274. url: '/admin/order/editLogisticsId?id='+id+'&buyerMemo='+buyerMemo,
  275. type: 'get',
  276. dateType: 'json',
  277. success:function(msg){
  278. $("#buyerMemo_1"+id).html(buyerMemo);
  279. $("#buyerMemo_1"+id).show();
  280. $("#buyerMemo_2"+id).hide();
  281. }
  282. });
  283. }
  284. function change_sellerMemo_click(id, sellerMemo){
  285. $("#sellerMemo_1"+id).hide();
  286. $("#sellerMemo_2"+id).show();
  287. $("#sellerMemo_2"+id).focus();
  288. }
  289. function change_sellerMemo(id){
  290. var sellerMemo = $("#sellerMemo_2"+id).val();
  291. $.ajax({
  292. url: '/admin/order/editLogisticsId?id='+id+'&sellerMemo='+sellerMemo,
  293. type: 'get',
  294. dateType: 'json',
  295. success:function(msg){
  296. $("#sellerMemo_1"+id).html(sellerMemo);
  297. $("#sellerMemo_1"+id).show();
  298. $("#sellerMemo_2"+id).hide();
  299. }
  300. });
  301. }
  302. function order_refund(id){
  303. $.ajax({
  304. url: '/admin/order/setrefund/'+id,
  305. type: 'get',
  306. dateType: 'json',
  307. success:function(msg){
  308. var str = '<span class="btn btn-danger radius">退款</span>';
  309. $("#refund"+id).html(str);
  310. }
  311. });
  312. }
  313. function order_verify(id, status, name){
  314. if( !confirm('确认'+name) ){
  315. return false;
  316. }
  317. var admin_id = $('#admin_id').val();
  318. var stime = $('#stime').val();
  319. var etime = $('#etime').val();
  320. var receiverName = $('#receiverName').val();
  321. var receiverMobile = $('#receiverMobile').val();
  322. var page = {{$page}};
  323. var str_query = 'page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile;
  324. location.href = '/admin/order/setverify/'+id+'?status='+status+'&'+str_query;
  325. }
  326. function order_verify_more(){
  327. var ids = $(":checkbox[name='id[]']:checked").serialize();
  328. var idLength = $(":checkbox[name='id[]']:checked").length;
  329. if (idLength < 1) {
  330. alert("请至少选中一项");
  331. return false;
  332. }
  333. var ids = $(":checkbox[name='id[]']:checked").serialize();
  334. var admin_id = $('#admin_id').val();
  335. var stime = $('#stime').val();
  336. var etime = $('#etime').val();
  337. var receiverName = $('#receiverName').val();
  338. var receiverMobile = $('#receiverMobile').val();
  339. var page = {{$page}};
  340. location.href = '/admin/order/setverifymore?'+ids+'&page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile;
  341. }
  342. /*弹出层-填写原因*/
  343. function refuse_reason(id) {
  344. $("#order_id").val(id);
  345. $("#modal-demo1").modal("show");
  346. }
  347. function verify_refuse(){
  348. var reason = $("#refuse_reason").val();
  349. var id = $("#order_id").val();
  350. var status = 0;
  351. var admin_id = $('#admin_id').val();
  352. var stime = $('#stime').val();
  353. var etime = $('#etime').val();
  354. var receiverName = $('#receiverName').val();
  355. var receiverMobile = $('#receiverMobile').val();
  356. var page = {{$page}};
  357. var str_query = 'page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile;
  358. location.href = '/admin/order/setverify/'+id+'?status='+status+'&refuse_reason='+reason+'&'+str_query;
  359. }
  360. $(".change_logistics_id").mouseover(
  361. function(){
  362. $(this).children("span").show();
  363. $(this).children("span").addClass('f-18 c-success');
  364. $(this).mouseout(
  365. function(){
  366. $(this).children("span").hide();
  367. }
  368. );
  369. }
  370. );
  371. /*分页*/
  372. $("#page").paging({
  373. pageNo:{{$page}},
  374. totalPage: {{$pages}},
  375. totalSize: {{$count}},
  376. callback: function(num) {
  377. var admin_id = $('#admin_id').val();
  378. var stime = $('#stime').val();
  379. var etime = $('#etime').val();
  380. var receiverName = $('#receiverName').val();
  381. var receiverMobile = $('#receiverMobile').val();
  382. var status = $('#status').val();
  383. var id = $('#id').val();
  384. location.href = 'index?page='+num+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&status='+status+'&id='+id;
  385. }
  386. })
  387. </script>
  388. </body>
  389. @endsection