No Description

orderlist.blade.php 42KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  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' })" autocomplete="off" 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' })" autocomplete="off" 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. <option value="4" @if($status==4) selected @endif>已退款</option>
  35. </select>
  36. <input class="input-text" style="width:5%;text-align:center" type="text" value="发货仓库"/>
  37. <select style="width:6%;text-align:center" id='warehouse' name="warehouse">
  38. <option value="0" @if($warehouse=='0') selected @endif>-- 请选择--</option>
  39. <option value="1" @if($warehouse==1) selected @endif>A仓</option>
  40. <option value="2" @if($warehouse==2) selected @endif>B仓</option>
  41. <option value="3" @if($warehouse==3) selected @endif>C仓</option>
  42. </select>
  43. <div style="float:right">
  44. <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
  45. <a class="btn btn-primary radius" onclick="order_export()" href="javascript:;"> 导出订单</a>
  46. <!--a class="btn btn-primary radius" onclick="order_verify_more()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 批量审核</a-->
  47. </div>
  48. </div>
  49. </div>
  50. <div class="mt-20">
  51. @if($overtime && $self_role !='销售')
  52. <font color='red'>
  53. 超一天未发订单量:【{{$overtime['count']}}单】&nbsp; 订单ID:【
  54. @foreach($overtime['list'] as $k=>$oid)
  55. @if($k == $overtime['count']-1) <a style="text-decoration: underline;color:blue;" href='index?id={{$oid}}'>{{$oid}}</a> @else <a style="text-decoration: underline;color:blue;" href='index?id={{$oid}}'>{{$oid}},</a> @endif
  56. @endforeach
  57. </font>
  58. @endif
  59. <table class="table table-border table-bordered table-bg table-hover table-sort">
  60. <thead>
  61. <tr class="text-c">
  62. <th width="4%"><!--input type="checkbox" id="selected-all"-->订单编号</th>
  63. <th width="4%">买家名称</th>
  64. <th width="4%">收货人</th>
  65. <th width="4%">收货人手机号</th>
  66. <th width="6%">收货地址</th>
  67. <th width="9%">商品信息</th>
  68. <th width="4%">预发货时间</th>
  69. <th width="6%">物流单号</th>
  70. <th width="4%">发货时间</th>
  71. @if($self_role !='销售' )
  72. <th width="3%">货品成本</th>
  73. <th width="3%">运费成本</th>
  74. @endif
  75. <th width="4%">发货仓库</th>
  76. <th width="4%">付款金额</th>
  77. <th width="5%">下单时间</th>
  78. <th width="4%">加粉时间</th>
  79. <th width="2%">是否复购</th>
  80. <th width="2%">是否退补单</th>
  81. <th width="4%">应该退补差价</th>
  82. <th width="4%">退补付款方式</th>
  83. <th width="5%">退补备注</th>
  84. <th width="5%">退补时间</th>
  85. <th width="4%">所属销售</th>
  86. <th width="4%">订单状态</th>
  87. <th width="4%">审核时间</th>
  88. @if($self_role =='销售' )<th width="5%">驳回原因</th>@endif
  89. <th width="5%">买家备注</th>
  90. <th width="5%">卖家备注</th>
  91. <th width="5%">发货备注</th>
  92. <th width="5%">售后费用</th>
  93. <th width="5%">售后原因</th>
  94. <th width="5%">售后时间</th>
  95. <th width="5%">操作</th>
  96. </tr>
  97. </thead>
  98. <tbody>
  99. @if($result)
  100. @foreach($result as $a)
  101. <tr class="text-c" style=" text-align:center;">
  102. <td><!--input type="checkbox" name="id[]" value="{{$a['id']}}"--> {{$a['id']}}</td>
  103. <td>{{$a['customerName']}}</td>
  104. <td>{{$a['receiverName']}}</td>
  105. <td>{{$a['receiverMobile']}}</td>
  106. <td>{{$a['receiverState']}}{{$a['receiverCity']}}{{$a['receiverDistrict']}}{{$a['receiverStreet']}}{{$a['receiverAddress']}}</td>
  107. <td>
  108. @if( is_array($a['goods']) && $a['warehouse'] == 3)
  109. @foreach($a['goods'] as $good)
  110. <p>{{$good}}</p>
  111. @endforeach
  112. @else
  113. {{$a['goods_note']}}
  114. @endif
  115. </td>
  116. <td>{{$a['delivery_date']}}</td>
  117. @if($self_role =='销售' || ($self_role =='管理员' && $a['status']>0) )
  118. <td>{{$a['logistics_id']}}</td>
  119. @else
  120. <td class ="change_logistics_id">
  121. <p id="logi_1{{$a['id']}}">{{$a['logistics_id']}}</p>
  122. <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']}})" />
  123. <span class="sort_icon" hidden onClick='change_logistics_click("{{$a['id']}}","{{$a['logistics_id']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  124. </td>
  125. @endif
  126. <td class ="change_logistics_id">
  127. <p id="send_time_1{{$a['id']}}">{{$a['send_time']}}</p>
  128. <input id="send_time_2{{$a['id']}}" style="display: none" name='send_time' onblur="change_send_time({{$a['id']}})" value="{{$a['send_time']}}" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" class=" Wdate" />
  129. <span class="sort_icon" hidden onClick='change_send_time_click("{{$a['id']}}","{{$a['send_time']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  130. </td>
  131. @if($self_role !='销售' )
  132. @if($self_role =='管理员' && $a['status']>0)
  133. <td>{{$a['cost']}}</td>
  134. <td>{{$a['freight_cost']}}</td>
  135. @else
  136. <td class ="change_logistics_id">
  137. <p id="cost_1{{$a['id']}}">{{$a['cost']}}</p>
  138. <input id="cost_2{{$a['id']}}" style="display: none" type='text' name='cost' value="{{$a['cost']}}" onblur="change_cost({{$a['id']}})" />
  139. <span class="sort_icon" hidden onClick='change_cost_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  140. </td>
  141. <td class ="change_logistics_id">
  142. <p id="freight_cost_1{{$a['id']}}">{{$a['freight_cost']}}</p>
  143. <input id="freight_cost_2{{$a['id']}}" style="display: none" type='text' name='freight_cost' value="{{$a['freight_cost']}}" onblur="change_freight_cost({{$a['id']}})" />
  144. <span class="sort_icon" hidden onClick='change_freight_cost_click("{{$a['id']}}","{{$a['freight_cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  145. </td>
  146. @endif
  147. @endif
  148. <td>@if($a['warehouse']==1) A仓库 @elseif($a['warehouse']==2) B仓库 @elseif($a['warehouse']==3) C仓库 @else @endif</td>
  149. <td>{{$a['receivedAmount']}}</td>
  150. <td>{{$a['createTime']}}</td>
  151. <td>{{$a['fanTime']}}</td>
  152. <td>@if($a['is_fugou']==1) 是 @else 否 @endif</td>
  153. <td>@if($a['is_refund']==1) 是 @else 否 @endif</td>
  154. <td class ="change_logistics_id">
  155. <p id="refund_price_1{{$a['id']}}">{{$a['refund_price']}}</p>
  156. <input id="refund_price_2{{$a['id']}}" style="display: none" type='text' name='refund_price' value="{{$a['refund_price']}}" onblur='change_refund_price({{$a['id']}},"{{$a['refund_type']}}")' />
  157. <span class="sort_icon" hidden onClick='change_refund_price_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  158. </td>
  159. <td class ="change_logistics_id">
  160. <p id="refund_type_1{{$a['id']}}">{{$a['refund_type']}}</p>
  161. <select id="refund_type_2{{$a['id']}}" style="display: none" name='refund_type' value="{{$a['refund_type']}}" onchange="change_refund_type({{$a['id']}})">
  162. <option value='0'>-请选择-</option>
  163. <option value='1'>微信支付</option>
  164. <option value='2'>付款码支付</option>
  165. </select>
  166. <span class="sort_icon" hidden onClick='change_refund_type_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  167. </td>
  168. <td class ="change_logistics_id">
  169. <p id="refund_note_1{{$a['id']}}">{{$a['refund_note']}}</p>
  170. <textarea id="refund_note_2{{$a['id']}}" rows=4 style="display: none" name='refund_note' onblur="change_refund_note({{$a['id']}})" >{{$a['refund_note']}}</textarea>
  171. <span class="sort_icon" hidden onClick='change_refund_note_click("{{$a['id']}}","{{$a['refund_note']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  172. </td>
  173. <td class ="change_logistics_id">
  174. <p id="refund_time_1{{$a['id']}}">{{$a['refund_time']}}</p>
  175. <input id="refund_time_2{{$a['id']}}" style="display: none" name='refund_time' onblur="change_refund_time({{$a['id']}})" value="{{$a['refund_time']}}" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss' })" class=" Wdate" />
  176. <span class="sort_icon" hidden onClick='change_refund_time_click("{{$a['id']}}","{{$a['refund_time']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  177. </td>
  178. <td>{{$a['admin_name']}}</td>
  179. <td id="order_verify{{$a['id']}}">{{$a['status_name']}}</td>
  180. <td>{{$a['verify_time']}}</td>
  181. @if($self_role =='销售' ) <td>@if($a['status'] == 0)<font color='red'> {{$a['refuse_reason']}} </font> @endif</td> @endif
  182. <!--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 -->
  183. @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
  184. <td>{{$a['buyerMemo']}}</td>
  185. <td>{{$a['sellerMemo']}}</td>
  186. <td>{{$a['send_note']}}</td>
  187. @else
  188. <td class ="change_logistics_id">
  189. <p id="buyerMemo_1{{$a['id']}}">{{$a['buyerMemo']}}</p>
  190. <input id="buyerMemo_2{{$a['id']}}" style="display: none" type='text' name='buyerMemo' value="{{$a['buyerMemo']}}" onblur="change_buyerMemo({{$a['id']}})" />
  191. <span class="sort_icon" hidden onClick='change_buyerMemo_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  192. </td>
  193. <td class ="change_logistics_id">
  194. <p id="sellerMemo_1{{$a['id']}}">{{$a['sellerMemo']}}</p>
  195. <input id="sellerMemo_2{{$a['id']}}" style="display: none" type='text' name='sellerMemo' value="{{$a['sellerMemo']}}" onblur="change_sellerMemo({{$a['id']}})" />
  196. <span class="sort_icon" hidden onClick='change_sellerMemo_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  197. </td>
  198. <td class ="change_logistics_id">
  199. <p id="send_note_1{{$a['id']}}">{{$a['send_note']}}</p>
  200. <textarea id="send_note_2{{$a['id']}}" rows=4 style="display: none" name='send_note' onblur="change_send_note({{$a['id']}})" >{{$a['send_note']}}</textarea>
  201. <span class="sort_icon" hidden onClick='change_send_note_click("{{$a['id']}}","{{$a['send_note']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  202. </td>
  203. @endif
  204. @if($self_role =='超级管理员' || $self_role =='售后管理员')
  205. <td class ="change_logistics_id">
  206. <p id="aftersale_fee_1{{$a['id']}}">{{$a['aftersale_fee']}}</p>
  207. <input id="aftersale_fee_2{{$a['id']}}" style="display: none" type='text' name='aftersale_fee' value="{{$a['aftersale_fee']}}" onblur="change_aftersale_fee({{$a['id']}})" />
  208. <span class="sort_icon" hidden onClick='change_aftersale_fee_click("{{$a['id']}}","{{$a['cost']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  209. </td>
  210. <td class ="change_logistics_id">
  211. <p id="aftersale_reason_1{{$a['id']}}">{{$a['aftersale_reason']}}</p>
  212. <textarea id="aftersale_reason_2{{$a['id']}}" rows=4 style="display: none" name='aftersale_reason' onblur="change_aftersale_reason({{$a['id']}})" >{{$a['aftersale_reason']}}</textarea>
  213. <span class="sort_icon" hidden onClick='change_aftersale_reason_click("{{$a['id']}}","{{$a['aftersale_reason']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  214. </td>
  215. <td class ="change_logistics_id">
  216. <p id="aftersale_time_1{{$a['id']}}">{{$a['aftersale_time']}}</p>
  217. <input id="aftersale_time_2{{$a['id']}}" style="display: none" name='aftersale_time' onblur="change_aftersale_time({{$a['id']}})" value="{{$a['aftersale_time']}}" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss' })" class=" Wdate" />
  218. <span class="sort_icon" hidden onClick='change_aftersale_time_click("{{$a['id']}}","{{$a['aftersale_time']}}")' style="cursor:pointer"><i class="Hui-iconfont">&#xe647;</i></span>
  219. </td>
  220. @else
  221. <td>{{$a['aftersale_fee']}}</td>
  222. <td>{{$a['aftersale_reason']}}</td>
  223. <td>{{$a['aftersale_time']}}</td>
  224. @endif
  225. <td>
  226. @if($a['enable_status'])
  227. @foreach($a['enable_status'] as $item)
  228. @if($item['status'] == 0)
  229. <a id="verify_refuse" style="text-decoration:none" onClick='refuse_reason("{{$a['id']}}")' href="javascript:;" title="审核驳回"><span class="btn btn-danger radius">审核驳回</span></a>
  230. @else
  231. <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>
  232. @endif
  233. @endforeach
  234. @endif
  235. @if(($self_role =='销售') && $a['status']>0)
  236. @else
  237. @if($self_role !='超级管理员' && $self_role !='售后管理员' && $a['status']>1 || $a['status']==4)
  238. @else
  239. <a style="text-decoration:none" onClick='order_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
  240. @endif
  241. @if($a['status'] >= 3)
  242. @elseif($a['status'] == 2 && $self_role !='超级管理员' && $self_role !='售后管理员')
  243. @else
  244. <a style="text-decoration:none" onClick='order_del("删除","{{$a['id']}}","{{$a['is_cannot_del']}}")' href="javascript:;" title="删除"><span class="btn btn-danger radius">删除</span></a>
  245. @endif
  246. @endif
  247. @if($a['warehouse']==3 && $a['status']>=2 && $a['status']<4 && ($self_role=='超级管理员' || $self_role=='售后管理员'))
  248. <a style="text-decoration:none" onClick='set_refund("{{$a['id']}}")' href="javascript:;" title="设为已退款"><span class="btn btn-danger radius">设为已退款</span></a>
  249. @endif
  250. @if($a['status'] == 4)
  251. 已退款订单
  252. @endif
  253. </td>
  254. </tr>
  255. @endforeach
  256. @endif
  257. </tbody>
  258. </table>
  259. </div>
  260. <!--弹出层 推入分组-->
  261. <div id="modal-demo1" class="modal fade" tabnonautomatic_index="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  262. <div class="modal-dialog">
  263. <div class="modal-content radius">
  264. <div class="modal-body" style="height:150px">
  265. <div id="fa2">
  266. <p style="font-size:14px">驳回原因:</p>
  267. <input id='order_id' type='hidden' name='status' value=''/>
  268. <textarea style="height:75px;" cols="85" id='refuse_reason'></textarea>
  269. </div>
  270. <div style="float:right">
  271. <button class="btn btn-primary radius" onclick='verify_refuse()' value="&nbsp;&nbsp;确定&nbsp;&nbsp;">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>&nbsp;
  272. <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. <div id="page" class="page_div"></div>
  279. </div>
  280. <!--_footer 作为公共模版分离出去-->
  281. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  282. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  283. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  284. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  285. <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
  286. <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  287. <!--/_footer 作为公共模版分离出去-->
  288. <!--/_footer 作为公共模版分离出去-->
  289. <script type="text/javascript">
  290. /*广告-添加*/
  291. function order_add(title){
  292. sessionStorage.setItem('goods_o_con','');
  293. location.href="/admin/order/create";
  294. }
  295. /*广告-编辑*/
  296. function order_edit(title,id){
  297. var page = {{$page}};
  298. var admin_id = $('#admin_id').val();
  299. var stime = $('#stime').val();
  300. var etime = $('#etime').val();
  301. var receiverName = $('#receiverName').val();
  302. var receiverMobile = $('#receiverMobile').val();
  303. var last_url = '{{$last_url}}';
  304. location.href="/admin/order/edit/"+id+'?page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&last_url='+last_url;
  305. }
  306. /*广告-设为首页显示*/
  307. function up(obj,id){
  308. layer.confirm('确认要设为首页显示吗?',function(index){
  309. location.href='/admin/order/up/'+id;
  310. });
  311. }
  312. /*广告-移除*/
  313. function order_del(obj,id,is_cannot_del){
  314. var msg = '确认要删除吗?';
  315. if(is_cannot_del){
  316. var msg = '该订单已打单待发货,请务必联系仓库管理员确认可以删除该订单,是否继续删除?'
  317. }
  318. layer.confirm(msg,function(index){
  319. location.href='/admin/order/delete/'+id;
  320. });
  321. }
  322. /*广告-移除*/
  323. function set_refund(id){
  324. var msg = '确认要设为退款吗?';
  325. layer.confirm(msg,function(index){
  326. location.href='/admin/order/set_refund/'+id;
  327. });
  328. }
  329. /*广告-设为首页隐藏*/
  330. function down(obj,id){
  331. layer.confirm('确认要设为首页隐藏吗?',function(index){
  332. location.href='/admin/order/down/'+id;
  333. });
  334. }
  335. function user_search(){
  336. var admin_id = $('#admin_id').val();
  337. var stime = $('#stime').val();
  338. var etime = $('#etime').val();
  339. var receiverName = $('#receiverName').val();
  340. var receiverMobile = $('#receiverMobile').val();
  341. var status = $('#status').val();
  342. var id = $('#id').val();
  343. var warehouse = $('#warehouse').val();
  344. //var page = {{$page}};
  345. location.href = 'index?admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&status='+status+'&id='+id + '&warehouse=' + warehouse;
  346. }
  347. //导出
  348. function order_export(){
  349. var admin_id = $('#admin_id').val();
  350. var stime = $('#stime').val();
  351. var etime = $('#etime').val();
  352. var receiverName = $('#receiverName').val();
  353. var receiverMobile = $('#receiverMobile').val();
  354. var status = $('#status').val();
  355. var id = $('#id').val();
  356. var warehouse = $('#warehouse').val();
  357. location.href = '/admin/order/order_export?admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&status='+status+'&id='+id + '&warehouse=' + warehouse;
  358. }
  359. function change_logistics_click(id, logistics_id){
  360. $("#logi_1"+id).hide();
  361. $("#logi_2"+id).show();
  362. $("#logi_2"+id).focus();
  363. }
  364. function change_logistics_id(id){
  365. var logistics_id = $("#logi_2"+id).val();
  366. $.ajax({
  367. url: '/admin/order/editLogisticsId?id='+id+'&logistics_id='+logistics_id,
  368. type: 'get',
  369. dateType: 'json',
  370. success:function(msg){
  371. $("#logi_1"+id).html(logistics_id);
  372. $("#logi_1"+id).show();
  373. $("#logi_2"+id).hide();
  374. }
  375. });
  376. }
  377. function change_cost_click(id, cost){
  378. $("#cost_1"+id).hide();
  379. $("#cost_2"+id).show();
  380. $("#cost_2"+id).focus();
  381. }
  382. function change_cost(id){
  383. var cost = $("#cost_2"+id).val();
  384. $.ajax({
  385. url: '/admin/order/editLogisticsId?id='+id+'&cost='+cost,
  386. type: 'get',
  387. dateType: 'json',
  388. success:function(msg){
  389. $("#cost_1"+id).html(cost);
  390. $("#cost_1"+id).show();
  391. $("#cost_2"+id).hide();
  392. }
  393. });
  394. }
  395. function change_freight_cost_click(id, freight_cost){
  396. $("#freight_cost_1"+id).hide();
  397. $("#freight_cost_2"+id).show();
  398. $("#freight_cost_2"+id).focus();
  399. }
  400. function change_freight_cost(id){
  401. var freight_cost = $("#freight_cost_2"+id).val();
  402. $.ajax({
  403. url: '/admin/order/editLogisticsId?id='+id+'&freight_cost='+freight_cost,
  404. type: 'get',
  405. dateType: 'json',
  406. success:function(msg){
  407. $("#freight_cost_1"+id).html(freight_cost);
  408. $("#freight_cost_1"+id).show();
  409. $("#freight_cost_2"+id).hide();
  410. }
  411. });
  412. }
  413. function change_buyerMemo_click(id, buyerMemo){
  414. $("#buyerMemo_1"+id).hide();
  415. $("#buyerMemo_2"+id).show();
  416. $("#buyerMemo_2"+id).focus();
  417. }
  418. function change_buyerMemo(id){
  419. var buyerMemo = $("#buyerMemo_2"+id).val();
  420. $.ajax({
  421. url: '/admin/order/editLogisticsId?id='+id,
  422. type: 'get',
  423. data: {buyerMemo:buyerMemo},
  424. dateType: 'json',
  425. success:function(msg){
  426. $("#buyerMemo_1"+id).html(buyerMemo);
  427. $("#buyerMemo_1"+id).show();
  428. $("#buyerMemo_2"+id).hide();
  429. }
  430. });
  431. }
  432. function change_sellerMemo_click(id, sellerMemo){
  433. $("#sellerMemo_1"+id).hide();
  434. $("#sellerMemo_2"+id).show();
  435. $("#sellerMemo_2"+id).focus();
  436. }
  437. function change_sellerMemo(id){
  438. var sellerMemo = $("#sellerMemo_2"+id).val();
  439. $.ajax({
  440. url: '/admin/order/editLogisticsId?id='+id,
  441. type: 'get',
  442. dateType: 'json',
  443. data: {sellerMemo:sellerMemo},
  444. success:function(msg){
  445. $("#sellerMemo_1"+id).html(sellerMemo);
  446. $("#sellerMemo_1"+id).show();
  447. $("#sellerMemo_2"+id).hide();
  448. }
  449. });
  450. }
  451. function change_send_note_click(id, send_note){
  452. $("#send_note_1"+id).hide();
  453. $("#send_note_2"+id).show();
  454. $("#send_note_2"+id).focus();
  455. }
  456. function change_send_note(id){
  457. var send_note = $("#send_note_2"+id).val();
  458. $.ajax({
  459. url: '/admin/order/editLogisticsId?id='+id,
  460. type: 'get',
  461. data: {send_note:send_note},
  462. dateType: 'json',
  463. success:function(msg){
  464. $("#send_note_1"+id).html(send_note);
  465. $("#send_note_1"+id).show();
  466. $("#send_note_2"+id).hide();
  467. }
  468. });
  469. }
  470. function change_aftersale_fee_click(id, aftersale_fee){
  471. $("#aftersale_fee_1"+id).hide();
  472. $("#aftersale_fee_2"+id).show();
  473. $("#aftersale_fee_2"+id).focus();
  474. }
  475. function change_aftersale_fee(id){
  476. var aftersale_fee = $("#aftersale_fee_2"+id).val();
  477. $.ajax({
  478. url: '/admin/order/editLogisticsId?id='+id+'&aftersale_fee='+aftersale_fee,
  479. type: 'get',
  480. dateType: 'json',
  481. success:function(msg){
  482. $("#aftersale_fee_1"+id).html(aftersale_fee);
  483. $("#aftersale_fee_1"+id).show();
  484. $("#aftersale_fee_2"+id).hide();
  485. }
  486. });
  487. }
  488. function change_aftersale_time_click(id, aftersale_time){
  489. $("#aftersale_time_1"+id).hide();
  490. $("#aftersale_time_2"+id).show();
  491. $("#aftersale_time_2"+id).focus();
  492. }
  493. function change_aftersale_time(id){
  494. var aftersale_time = $("#aftersale_time_2"+id).val();
  495. if(!aftersale_time){
  496. return false;
  497. }
  498. $.ajax({
  499. url: '/admin/order/editLogisticsId?id='+id+'&aftersale_time='+aftersale_time,
  500. type: 'get',
  501. dateType: 'json',
  502. success:function(msg){
  503. $("#aftersale_time_1"+id).html(aftersale_time);
  504. $("#aftersale_time_1"+id).show();
  505. $("#aftersale_time_2"+id).hide();
  506. }
  507. });
  508. }
  509. function change_refund_time_click(id, refund_time){
  510. $("#refund_time_1"+id).hide();
  511. $("#refund_time_2"+id).show();
  512. $("#refund_time_2"+id).focus();
  513. }
  514. function change_refund_time(id){
  515. var refund_time = $("#refund_time_2"+id).val();
  516. if(!refund_time){
  517. return false;
  518. }
  519. $.ajax({
  520. url: '/admin/order/editLogisticsId?id='+id+'&refund_time='+refund_time,
  521. type: 'get',
  522. dateType: 'json',
  523. success:function(msg){
  524. $("#refund_time_1"+id).html(refund_time);
  525. $("#refund_time_1"+id).show();
  526. $("#refund_time_2"+id).hide();
  527. }
  528. });
  529. }
  530. function change_send_time_click(id, send_time){
  531. $("#send_time_1"+id).hide();
  532. $("#send_time_2"+id).show();
  533. $("#send_time_2"+id).focus();
  534. }
  535. function change_send_time(id){
  536. var send_time = $("#send_time_2"+id).val();
  537. if(!send_time){
  538. return false;
  539. }
  540. $.ajax({
  541. url: '/admin/order/editLogisticsId?id='+id+'&send_time='+send_time,
  542. type: 'get',
  543. dateType: 'json',
  544. success:function(msg){
  545. $("#send_time_1"+id).html(send_time);
  546. $("#send_time_1"+id).show();
  547. $("#send_time_2"+id).hide();
  548. }
  549. });
  550. }
  551. function change_aftersale_reason_click(id, aftersale_reason){
  552. $("#aftersale_reason_1"+id).hide();
  553. $("#aftersale_reason_2"+id).show();
  554. $("#aftersale_reason_2"+id).focus();
  555. }
  556. function change_aftersale_reason(id){
  557. var aftersale_reason = $("#aftersale_reason_2"+id).val();
  558. $.ajax({
  559. url: '/admin/order/editLogisticsId?id='+id,
  560. type: 'get',
  561. data: {aftersale_reason:aftersale_reason},
  562. dateType: 'json',
  563. success:function(msg){
  564. $("#aftersale_reason_1"+id).html(aftersale_reason);
  565. $("#aftersale_reason_1"+id).show();
  566. $("#aftersale_reason_2"+id).hide();
  567. }
  568. });
  569. }
  570. function change_refund_note_click(id, refund_note){
  571. $("#refund_note_1"+id).hide();
  572. $("#refund_note_2"+id).show();
  573. $("#refund_note_2"+id).focus();
  574. }
  575. function change_refund_note(id){
  576. var refund_note = $("#refund_note_2"+id).val();
  577. $.ajax({
  578. url: '/admin/order/editLogisticsId?id='+id,
  579. type: 'get',
  580. data: {refund_note:refund_note},
  581. dateType: 'json',
  582. success:function(msg){
  583. $("#refund_note_1"+id).html(refund_note);
  584. $("#refund_note_1"+id).show();
  585. $("#refund_note_2"+id).hide();
  586. }
  587. });
  588. }
  589. function change_refund_price_click(id, refund_price){
  590. $("#refund_price_1"+id).hide();
  591. $("#refund_price_2"+id).show();
  592. $("#refund_price_2"+id).focus();
  593. }
  594. function change_refund_price(id, refund_type){
  595. var refund_price = $("#refund_price_2"+id).val();
  596. $.ajax({
  597. url: '/admin/order/editLogisticsId?id='+id+'&refund_price='+refund_price,
  598. type: 'get',
  599. dateType: 'json',
  600. success:function(msg){
  601. $("#refund_price_1"+id).html(refund_price);
  602. if(!refund_type){
  603. $("#refund_type_1"+id).html('微信支付');
  604. }
  605. $("#refund_price_1"+id).show();
  606. $("#refund_price_2"+id).hide();
  607. }
  608. });
  609. }
  610. function change_refund_type_click(id, refund_type){
  611. $("#refund_type_1"+id).hide();
  612. $("#refund_type_2"+id).show();
  613. $("#refund_type_2"+id).focus();
  614. }
  615. function change_refund_type(id){
  616. var refund_type = $("#refund_type_2"+id).val();
  617. $.ajax({
  618. url: '/admin/order/editLogisticsId?id='+id+'&refund_type='+refund_type,
  619. type: 'get',
  620. dateType: 'json',
  621. success:function(msg){
  622. if(refund_type==1){
  623. refund_type = '微信支付';
  624. }
  625. if(refund_type==2){
  626. refund_type = '付款码支付';
  627. }
  628. if(refund_type==0){
  629. refund_type = '';
  630. }
  631. $("#refund_type_1"+id).html(refund_type);
  632. $("#refund_type_1"+id).show();
  633. $("#refund_type_2"+id).hide();
  634. }
  635. });
  636. }
  637. function order_refund(id){
  638. $.ajax({
  639. url: '/admin/order/setrefund/'+id,
  640. type: 'get',
  641. dateType: 'json',
  642. success:function(msg){
  643. var str = '<span class="btn btn-danger radius">退款</span>';
  644. $("#refund"+id).html(str);
  645. }
  646. });
  647. }
  648. function order_verify(id, status, name){
  649. if( !confirm('确认'+name) ){
  650. return false;
  651. }
  652. var admin_id = $('#admin_id').val();
  653. var stime = $('#stime').val();
  654. var etime = $('#etime').val();
  655. var receiverName = $('#receiverName').val();
  656. var receiverMobile = $('#receiverMobile').val();
  657. var page = {{$page}};
  658. var str_query = 'page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile;
  659. location.href = '/admin/order/setverify/'+id+'?status='+status+'&'+str_query;
  660. }
  661. function order_verify_more(){
  662. var ids = $(":checkbox[name='id[]']:checked").serialize();
  663. var idLength = $(":checkbox[name='id[]']:checked").length;
  664. if (idLength < 1) {
  665. alert("请至少选中一项");
  666. return false;
  667. }
  668. var ids = $(":checkbox[name='id[]']:checked").serialize();
  669. var admin_id = $('#admin_id').val();
  670. var stime = $('#stime').val();
  671. var etime = $('#etime').val();
  672. var receiverName = $('#receiverName').val();
  673. var receiverMobile = $('#receiverMobile').val();
  674. var page = {{$page}};
  675. location.href = '/admin/order/setverifymore?'+ids+'&page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile;
  676. }
  677. /*弹出层-填写原因*/
  678. function refuse_reason(id) {
  679. $("#order_id").val(id);
  680. $("#modal-demo1").modal("show");
  681. }
  682. function verify_refuse(){
  683. var reason = $("#refuse_reason").val();
  684. var id = $("#order_id").val();
  685. var status = 0;
  686. var admin_id = $('#admin_id').val();
  687. var stime = $('#stime').val();
  688. var etime = $('#etime').val();
  689. var receiverName = $('#receiverName').val();
  690. var receiverMobile = $('#receiverMobile').val();
  691. var page = {{$page}};
  692. var str_query = 'page='+page+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile;
  693. location.href = '/admin/order/setverify/'+id+'?status='+status+'&refuse_reason='+reason+'&'+str_query;
  694. }
  695. $(".change_logistics_id").mouseover(
  696. function(){
  697. $(this).children("span").show();
  698. $(this).children("span").addClass('f-18 c-success');
  699. $(this).mouseout(
  700. function(){
  701. $(this).children("span").hide();
  702. }
  703. );
  704. }
  705. );
  706. /*分页*/
  707. $("#page").paging({
  708. pageNo:{{$page}},
  709. totalPage: {{$pages}},
  710. totalSize: {{$count}},
  711. callback: function(num) {
  712. var admin_id = $('#admin_id').val();
  713. var stime = $('#stime').val();
  714. var etime = $('#etime').val();
  715. var receiverName = $('#receiverName').val();
  716. var receiverMobile = $('#receiverMobile').val();
  717. var status = $('#status').val();
  718. var id = $('#id').val();
  719. var warehouse = $('#warehouse').val();
  720. location.href = 'index?page='+num+'&admin_id='+admin_id+'&stime='+stime+'&etime='+etime+'&receiverName='+receiverName+'&receiverMobile='+receiverMobile+'&status='+status+'&id='+id + '&warehouse=' + warehouse;
  721. }
  722. })
  723. </script>
  724. </body>
  725. @endsection