No Description

orderlist.blade.php 43KB

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