index.blade.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. @extends('layouts.app')
  2. @section('title')问题件-查询@endsection
  3. @section('content')
  4. @component("order.issue.menu")@endcomponent
  5. <div class="container-fluid" id="issue_div">
  6. <div style="min-width: 2000px;">
  7. <div id="list" class="d-none" style="min-width: 4000px">
  8. <div id="form_div" style="min-width: 2250px;" class="bg-white"></div>
  9. <div class="form-inline mt-1">
  10. <span class="dropdown">
  11. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
  12. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">导出Excel
  13. </button>
  14. <div class="dropdown-menu">
  15. <a class="dropdown-item" @click="orderIssueExport(false)" href="javascript:">导出勾选内容</a>
  16. <a class="dropdown-item" @click="orderIssueExport(true)" href="javascript:">导出所有页</a>
  17. </div>
  18. </span>
  19. <span class="ml-1">
  20. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget" @click="endOrderIssue()" :class="[checkData.length>0?'btn-dark text-light':'']">完结</button>
  21. </span>
  22. <span class="ml-1">
  23. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm tooltipTarget" @click="copyOrderNo()" >复制快递单号</button>
  24. </span>
  25. </div>
  26. <table class="table table-sm table-striped table-bordered table-hover card-body "
  27. style="background: #fff;">
  28. <tr>
  29. <th class="bg-white font-weight-bolder" colspan="3"></th>
  30. <th class=" text-center font-weight-bolder" colspan="15">原始运单号</th>
  31. <th class="bg-white text-center font-weight-bolder" colspan="15">情况说明</th>
  32. <th></th>
  33. </tr>
  34. <tr>
  35. <th>
  36. <label for="all">
  37. <input id="all" type="checkbox" @click="checkAll($event)"/>
  38. </label>
  39. </th>
  40. <th class="">序号</th>
  41. @can("订单管理-问题件-置顶")
  42. <th class="" style="width: 60px">置顶</th>
  43. @endcan
  44. <th class="">ID</th>
  45. <th class="">处理状态</th>
  46. <th class="">登记日期</th>
  47. <th class="">订单日期</th>
  48. <th class="">客户</th>
  49. <th class="">店铺</th>
  50. <th class="">原始订单号</th>
  51. <th class="">原始承运商</th>
  52. <th class="">原始运单号</th>
  53. <th class="" style="min-width: 90px">收货人名称</th>
  54. <th class="">收货人电话</th>
  55. <th class="" style="min-width: 70px">省</th>
  56. <th class="" style="min-width: 70px">市</th>
  57. <th class="" style="min-width: 70px">区</th>
  58. <th class="">收货人地址</th>
  59. <th class="">原始商品明细</th>
  60. <th class="bg-white">返回商品明细</th>
  61. <th class="bg-white">退单状态</th>
  62. <th class="bg-white">情况说明</th>
  63. <th class="bg-white">问题类别</th>
  64. <th class="bg-white">处理结果说明</th>
  65. <th class="bg-white">二次订单号</th>
  66. <th class="bg-white">二次承运商</th>
  67. <th class="bg-white">二次运单号</th>
  68. <th class="bg-white">二次商品明细</th>
  69. <th class="bg-white">最终转态</th>
  70. <th class="bg-white">承运商赔偿金额</th>
  71. <th class="bg-white">承运商快递减免</th>
  72. <th class="bg-white">宝石赔偿金额</th>
  73. <th class="bg-white">宝石快递减免</th>
  74. <th class="bg-white">事故责任方</th>
  75. <th>操作</th>
  76. </tr>
  77. <tr v-for="(orderIssue,index) in orderIssues" @click="selectedColor(orderIssue.id)" v-if="orderIssues">
  78. <td>
  79. <input class="checkItem" type="checkbox" :value="orderIssue.id" v-model="checkData">
  80. </td>
  81. <td class="">@{{index+1}}</td>
  82. @can("订单管理-问题件-置顶")
  83. <td class="td-warm text-muted" v-if="orderIssue.top" >
  84. <button type="button" class="btn btn-sm btn-outline-danger "
  85. @click="cancelOnTop($event)" :data_id="orderIssue.id" style="opacity: 0.75">取消
  86. </button>
  87. </td>
  88. <td v-else>
  89. <button type="button" class="btn btn-sm btn-outline-secondary"
  90. @click="OrderIssueOnTop($event)" :data_id="orderIssue.id" style="opacity: 0.75">置顶
  91. </button>
  92. </td>
  93. @endcan
  94. <td class="">@{{ orderIssue.id }}</td>
  95. <td class="">@{{ orderIssue.handle_status }}</td>
  96. <td class="">@{{ orderIssue.created_at }}</td>
  97. <td class="">@{{ orderIssue.order.created_at }}</td>
  98. <td class="">
  99. <template v-if='orderIssue.order.owner'>
  100. @{{ orderIssue.order.owner.name }}
  101. </template>
  102. </td> <!--客户-->
  103. <td class=""><template v-if="orderIssue.order.shop">@{{ orderIssue.order.shop.name }}</template> </td>
  104. <td class="">@{{ orderIssue.order.code }} </td>
  105. <td class="">
  106. <template v-if='orderIssue.order.logistic'>
  107. @{{ orderIssue.order.logistic.name }}
  108. </template>
  109. </td>
  110. <td class=" hide-content p-0" :id="orderIssue.id+'logisticNumbers'" valign="middle" align="center">
  111. <p v-for="logisticNumber in orderIssue.order.logisticNumbers"
  112. class="m-0 p-0 text-center text-muted " :class="orderIssue.order.logisticNumbers.length >1 ? 'toggle-content':'' ">@{{ logisticNumber }}</p>
  113. <button v-if="orderIssue.order.logisticNumbers.length > 1" type="button"
  114. class="btn btn-sm btn-outline-primary hint-btn text-center align-middle mt-1"
  115. @click="toggleNumber($event)" :data-value="orderIssue.id+'logisticNumbers'">
  116. 分箱@{{ orderIssue.order.logisticNumbers.length }}件,点击展开
  117. </button>
  118. </td>
  119. <td class="">@{{ orderIssue.order.consignee_name }}</td>
  120. <td class="">@{{ orderIssue.order.consignee_phone }}</td>
  121. <td class="">@{{ orderIssue.order.province }}</td>
  122. <td class="">@{{ orderIssue.order.city }}</td>
  123. <td class="">@{{ orderIssue.order.district }}</td>
  124. <td class="" ><p class="text-wrap" style="width: 350px">@{{ orderIssue.order.address }}</p></td>
  125. <td class=" p-0" :id="orderIssue.id+'items'" valign="middle" align="center" >
  126. <table v-if="orderIssue.order.packages.length > 0" class="table table-sm toggle-table m-0">
  127. <tr>
  128. <th>条码</th><th>商品名</th><th>数量</th>
  129. </tr>
  130. <template v-for="package in orderIssue.order.packages">
  131. <tr v-for="packageCommodity in package.commodities" class="toggle-content">
  132. <td>@{{ packageCommodity.commodity.sku }}</td>
  133. <td>@{{ packageCommodity.commodity.name }}</td>
  134. <td>@{{ packageCommodity.amount }}</td>
  135. </tr>
  136. </template>
  137. </table>
  138. <button v-if="orderIssue.order.packages.length > 1" type="button"
  139. class="btn btn-sm btn-outline-primary hint-btn text-center align-middle mt-1"
  140. @click="toggleTable($event)" :data-value="orderIssue.id+'items'">共有@{{ orderIssue.order.logisticNumbers.length }}件商品,点击展开
  141. </button>
  142. </td>
  143. <td class="bg-white" :id="orderIssue.id+'rejectedBill'" valign="middle" align="center">
  144. <div v-if="orderIssue.rejectedBill">
  145. <table v-if="orderIssue.rejectedBill.items" class="table table-sm toggle-table m-0">
  146. <tr>
  147. <th>条码</th>
  148. <th>商品名</th>
  149. <th>数量</th>
  150. <th>是否正品</th>
  151. <th>备注</th>
  152. </tr>
  153. <tr v-for="item in orderIssue.rejectedBill.items">
  154. <td>@{{ item.barcode_goods }}</td>
  155. <td>@{{ item.name_goods }}</td>
  156. <td>@{{ item.amount }}</td>
  157. <td>@{{ item.validity_at }}</td>
  158. <td>@{{ item.remark }}</td>
  159. </tr>
  160. </table>
  161. <button v-if="orderIssue.order.packages.length > 1" type="button"
  162. class="btn btn-sm btn-outline-primary hint-btn text-center align-middle mt-1"
  163. @click="toggleTable($event)" :data-value="orderIssue.id+'rejectedBill'">共有@{{ orderIssue.rejectedBill.items.length }}件商品,点击展开
  164. </button>
  165. </div>
  166. </td>
  167. <td class="bg-white">@{{ orderIssue.rejecting_status }}</td>
  168. <td class="bg-white" :id="orderIssue.id+'packages'" valign="middle" align="center">
  169. <template v-if="orderIssue.logs">
  170. <table v-if="orderIssue.logs" class="table table-sm toggle-table m-0">
  171. <tr>
  172. <th>内容</th><th>类型</th><th>操作人</th>
  173. </tr>
  174. <tr v-if="orderIssue.logs" v-for="log in orderIssue.logs" class="toggle-content">
  175. <td>log.content</td>
  176. <td>log.type</td>
  177. <td>log.user.name</td>
  178. </tr>
  179. </table>
  180. <button v-if="orderIssue.logs.length > 1" type="button"
  181. class="btn btn-sm btn-outline-primary hint-btn text-center align-middle mt-1"
  182. @click="toggleTable($event)" :data-value="orderIssue.id+'packages'">共有@{{ orderIssue.logs.length }}件商品,点击展开
  183. </button>
  184. </template>
  185. </td> {{--情况说明--}}
  186. <td class="bg-white">
  187. <p v-if="orderIssue.order_issue_type">@{{ orderIssue.order_issue_type}}</p>
  188. </td>
  189. <td class="bg-white">@{{ orderIssue.result_explain }}</td>
  190. <td class="bg-white"><p v-if="orderIssue.secondOrder"> @{{ orderIssue.secondOrder.code }}</p></td>
  191. <td class="bg-white"><p v-if="orderIssue.secondOrder"> @{{ orderIssue.secondOrder.logistic_id }}</p></td>
  192. <td class="bg-white"><p v-if="orderIssue.secondOrder"> @{{ orderIssue.secondOrder.logistic_number}}</p></td>
  193. <td class="bg-white"><p v-if="orderIssue.secondOrder"> @{{ orderIssue.secondOrder.code }}</p></td>
  194. <td class="bg-white">@{{ orderIssue.final_status }}</td>
  195. <td class="bg-white">@{{ orderIssue.logistic_indemnity_money }}</td>
  196. <td class="bg-white">@{{ orderIssue.logistic_express_remission }}</td>
  197. <td class="bg-white">@{{ orderIssue.baoshi_indemnity_money }}</td>
  198. <td class="bg-white">@{{ orderIssue.baoshi_express_remission }}</td>
  199. <td class="bg-white"></td>
  200. <td>
  201. <button type="button" class="btn btn-sm btn-outline-primary" @click="editOrderIssue($event)" :data-value="orderIssue.id">改</button>
  202. <button type="button" class="btn btn-sm btn-outline-danger" @click="deleteOrderIssue($event)" :data-value="orderIssue.id">删</button>
  203. </td>
  204. </tr>
  205. </table>
  206. <a :href="page.prevPageUrl" class="btn btn-sm" :class="page.curPage === 1 ?'':'btn-outline-primary'" :disabled="page.curPage === 1">上一页</a>
  207. <a :href="page.nextPageUrl" class="btn btn-sm" :class="page.curPage === page.lastPage ?'':'btn-outline-primary'" :disabled="page.curPage === page.lastPage" >下一页</a>
  208. <input @keyup.enter="pageTurning($event)" class="form-control-sm ml-3 tooltipTarget" :placeholder="'当前页数:'+page.curPage+'/'+page.lastPage" title="去往指定页">
  209. <span class="text-muted m-1">共 @{{page.total}} 条 </span>
  210. </div>
  211. </div>
  212. {{--deleteOrderIssue--}}
  213. <div class="modal fade" id="alertModal" tabindex="-1" role="dialog" aria-labelledby="alertModalLabel" aria-hidden="true">
  214. <div class="modal-dialog modal-dialog-centered">
  215. <div class="modal-content">
  216. <div class="modal-header">
  217. <h5 class="modal-title" id="exampleModalLabel">提示</h5>
  218. <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="changeDeleteId">
  219. <span aria-hidden="true">&times;</span>
  220. </button>
  221. </div>
  222. <div class="modal-body">
  223. <p>是否删除当前订单问题件?</p>
  224. <input type="hidden" id = "deleteId" class="form-control" />
  225. </div>
  226. <div class="modal-footer">
  227. <button type="button" class="btn btn-secondary" data-dismiss="modal" @click="changeDeleteId">取消</button>
  228. <button type="button" class="btn btn-primary" data-dismiss="modal" @click="deleteOrderIssueById">确认</button>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. {{--OrderIssue On Top--}}
  234. <div class="modal fade " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  235. <div class="modal-dialog modal-dialog-centered">
  236. <div class="modal-content">
  237. <div class="modal-header">
  238. <h5 class="modal-title" id="exampleModalLabel">请输入置顶备注</h5>
  239. <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="changeRemark">
  240. <span aria-hidden="true">&times;</span>
  241. </button>
  242. </div>
  243. <div class="modal-body">
  244. <input type="hidden" class="form-control" id="onTopId">
  245. <textarea type="text" class="form-control" required id="remark" @change="changeRemark" ></textarea>
  246. <div class="invalid-feedback">
  247. 备注信息不能为空
  248. </div>
  249. </div>
  250. <div class="modal-footer">
  251. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" @click="changeRemark" >关闭</button>
  252. <button type="button" class="btn btn-sm btn-primary" @click="submitOnTop">提交</button>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. @endsection
  259. @section('lastScript')
  260. <style type="text/css">
  261. .bg-light-yellow {
  262. background: #fffff8;
  263. }
  264. .top {
  265. padding-top: 0px;
  266. padding-left: 10px;
  267. margin-top: -4px;
  268. margin-left: -5px;
  269. line-height: 55px;
  270. position: absolute;
  271. animation: anima;
  272. animation-duration: 3s;
  273. animation-timing-function: cubic-bezier(0, 0, 1, 1);
  274. animation-direction: alternate;
  275. animation-play-state: running;
  276. -webkit-animation-name: anima;
  277. -webkit-animation-duration: 3s;
  278. -webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);
  279. -webkit-animation-iteration-count: infinite;
  280. -webkit-animation-direction: alternate;
  281. -webkit-animation-play-state: running;
  282. }
  283. </style>
  284. <script type="text/javascript" src="{{asset('js/queryForm/queryForm.js')}}"></script>
  285. <script type="text/javascript" src="{{asset('js/queryForm/export.js')}}"></script>
  286. <script>
  287. let listVue = new Vue({
  288. el: '#issue_div ',
  289. data: {
  290. orderIssues: {!! $orderIssues->toJson() !!}['data'],
  291. owners: [
  292. @foreach($owners as $owner)
  293. {name: '{{ $owner->id }}', value: '{{ $owner->name}}'},
  294. @endforeach
  295. ],
  296. checkData: [],
  297. from: '',
  298. finalStatus: [{name: '0', value: '已解决'}, {name: '1', value: '待退回'}, {name: '2', value: '退回中'}],
  299. selectedStyle: '',
  300. deleteId:'',
  301. page:{
  302. lastPage:{!! $orderIssues->toJson() !!}['last_page'],
  303. curPage:{!! $orderIssues->toJson() !!}['current_page'],
  304. total:{!! $orderIssues->toJson() !!}['total'],
  305. nextPageUrl:{!! $orderIssues->toJson() !!}['next_page_url'],
  306. prevPageUrl:{!! $orderIssues->toJson() !!}['prev_page_url'],
  307. lastPageUrl:{!! $orderIssues->toJson() !!}['last_page_url'],
  308. },
  309. onTopId:0,
  310. },
  311. mounted: function () {
  312. $('.tooltipTarget').tooltip({'trigger': 'hover'});
  313. $('#list').removeClass("d-none");
  314. let _this = this;
  315. let final_status = [{name:'0',value:'已解决'},{name:'1',value:'待退回'},{name:'2',value:'退回中'}];
  316. let data = [[
  317. {name: 'created_at_start', type: 'dataTime', tip: '订单开始日期'},
  318. {name: 'owner_id',type: 'select_multiple_select',tip: ['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'], placeholder:['货主','定位或多选货主'],data: _this.owners},
  319. {name: 'final_status', type: 'select', tip: '问题件的最终状态', placeholder: '最终状态', data: final_status},
  320. {name: 'handle_status', type: 'checkbox', tip: '是否已完结', data: [{name: '2', value: '已完结'}]},
  321. ], [
  322. {name: 'created_at_end', type: 'dataTime', tip: '订单结束日期'},
  323. {name: 'logistic_indemnity_money', type: 'input', tip: '承运商赔偿金额', placeholder: '承运商赔偿金额'},
  324. @can('客户不可见')
  325. {name: 'baoshi_express_remission', type: 'input', tip: '宝时赔偿金额', placeholder: '宝时赔偿金额'},
  326. @endcan
  327. ]];
  328. this.form = new query({
  329. el: '#form_div',
  330. condition: data,
  331. })
  332. this.form.init();
  333. $('.table_tr').hide();
  334. $('.hideItems').hide();
  335. $('.toggle-content').hide();
  336. $('.toggle-table').hide();
  337. },
  338. watch:{
  339. checkData:{
  340. handler(){
  341. if (this.checkData.length === this.orderIssues.length){
  342. document.querySelector('#all').checked = true;
  343. }else {
  344. document.querySelector('#all').checked = false;
  345. }
  346. },
  347. deep:true
  348. },
  349. },
  350. methods: {
  351. selectedColor(orderno) {
  352. if (orderno === this.selectedStyle) {
  353. this.selectedStyle = '';
  354. return;
  355. }
  356. this.selectedStyle = orderno;
  357. },
  358. showItems($event) {
  359. let id = $($event.target).attr('data-value');
  360. let table = $('#' + 'id' + 'itemsTable');
  361. table.find('.table_tr').show();
  362. $('#' + 'id' + 'hide').show();
  363. },
  364. hideItems($event) {
  365. let id = $($event.target).attr('data-value');
  366. let table = $('#' + 'id' + 'itemsTable');
  367. table.find('.table_tr').hide();
  368. $('#' + 'id' + 'show').show();
  369. },
  370. toggleNumber($event) {
  371. let tr = $('#' + $($event.target).attr('data-value'));
  372. let toggleContent = tr.find('.toggle-content');
  373. let hintBtn = tr.find('.hint-btn');
  374. if (toggleContent.is(':hidden')) {
  375. toggleContent.show();
  376. hintBtn.text('点击收起');
  377. } else {
  378. toggleContent.hide();
  379. hintBtn.text('分箱 ' + toggleContent.length + ' 件,点击展开');
  380. }
  381. },
  382. toggleTable($event) {
  383. let tr = $('#' + $($event.target).attr('data-value'));
  384. let table = tr.find('.table');
  385. let toggleContent = tr.find('.toggle-content');
  386. let hintBtn = tr.find('.hint-btn');
  387. if (table.is(':hidden')) {
  388. table.show();
  389. toggleContent.show();
  390. hintBtn.text('点击收起');
  391. } else {
  392. table.hide();
  393. toggleContent.hide();
  394. hintBtn.text('共有 ' + toggleContent.length + ' 件商品,点击展开');
  395. }
  396. },
  397. editOrderIssue($event){
  398. let id = $($event.target).attr('data-value');
  399. },
  400. deleteOrderIssue($event){
  401. let id = $($event.target).attr('data-value');
  402. $('#deleteId').val(id);
  403. $('#alertModal').modal('show');
  404. },
  405. deleteOrderIssueById(){
  406. let _this = this;
  407. tempTip.setDuration(99999)
  408. tempTip.waitingTip('删除中,请稍候')
  409. let id = $('#deleteId').val();
  410. let data = {id:id};
  411. axios.post('{{url('order/issue/destroy')}}',data).then(function(res){
  412. tempTip.setDuration(5000)
  413. tempTip.cancelWaitingTip();
  414. if(res.data.success){
  415. for(let i = 0;i< _this.orderIssues.length;i++){
  416. let data = _this.orderIssues[i];
  417. if(data.id == id){
  418. _this.orderIssues.splice(i,1);
  419. _this.deleteId = 0;
  420. break;
  421. }
  422. }
  423. tempTip.setDuration(2000);
  424. tempTip.showSuccess('问题件删除成功');
  425. }else{
  426. tempTip.setDuration(2500);
  427. tempTip.show('标记勾选内容删除失败,错误:' + res.data.fail_info);
  428. }
  429. }).catch(function(err){
  430. tempTip.setDuration(4000);
  431. tempTip.cancelWaitingTip();
  432. tempTip.show('网络错误:' + err);
  433. });
  434. },
  435. changeDeleteId(){
  436. $('#deleteId').val('');
  437. },
  438. cancelOnTop(event){
  439. let id =$(event.target).attr('data-value')
  440. let data = {id:id};
  441. axios.post('{{url('order/issue/onTop')}}',data).then(function(res){
  442. if(res.data.success){
  443. tempTip.setDuration(2000);
  444. tempTip.showSuccess('订单问题件取消置顶成功!');
  445. window.location.reload();
  446. }else{
  447. tempTip.setDuration(2500);
  448. tempTip.show( res.data.fail_info);
  449. }
  450. }).catch(function(err){
  451. tempTip.setDuration(4000);
  452. tempTip.show('网络错误:' + err);
  453. });
  454. },
  455. changeRemark(){
  456. $('#remark').removeClass('is-invalid');
  457. },
  458. OrderIssueOnTop(event){
  459. let id = $(event.target).attr('data-value');
  460. $("#onTopId").val(id);
  461. $("#exampleModal").modal('show');
  462. },
  463. submitOnTop(){
  464. let _this = this;
  465. let remark = $("#remark").val();
  466. let id = $("#onTopId").val();
  467. if(remark === '') {
  468. $("#remark").focus();
  469. $('#remark').addClass('is-invalid');
  470. }else{
  471. let data = {id:id,remark:remark};
  472. axios.post('{{url('order/issue/onTop')}}',data).then(function(res){
  473. if(res.data.success){
  474. _this.orderIssues.forEach(function(orderIssue){
  475. if(orderIssue.id == id){
  476. orderIssue.top.remark = 'remark';
  477. }
  478. })
  479. } else {
  480. tempTip.setDuration(2500);
  481. tempTip.show( res.data.fail_info);
  482. }
  483. }).catch(function(err){
  484. tempTip.setDuration(4000);
  485. tempTip.show('网络错误:' + err);
  486. });
  487. }
  488. },
  489. pageTurning(event){
  490. let page = $(event.target).val();
  491. if (page>this.page.lastPage) {
  492. return;
  493. }
  494. window.location = this.form.goPage(page);
  495. },
  496. // 导出
  497. orderIssueExport(sign){
  498. let url = '{{url('order/issue/export')}}';
  499. let token='{{ csrf_token() }}';
  500. if(sign){
  501. // 所有页
  502. excelExport(true,this.checkData,url,this.page.total,token);
  503. }else{
  504. // 选中
  505. excelExport(false,this.checkData,url,null,token);
  506. }
  507. },
  508. // 复制快递单号
  509. copyOrderNo(){
  510. let _this =this;
  511. if(this.checkData.length === 0){
  512. tempTip.show('没有勾选订单');
  513. }else{
  514. let orderNos = [];
  515. this.orderIssues.forEach(function(item){
  516. if(_this.checkData.includes(item.id)){
  517. let logisticNumbers = item.order.logisticNumbers;
  518. if(logisticNumbers.length>0){
  519. orderNos.push(logisticNumbers);
  520. }
  521. }
  522. })
  523. let p =$('<input id="coty" value="'+orderNos.join(',')+'"/>');
  524. p.attr('opacity',0);
  525. $('body').append(p);
  526. let p_ele = document.getElementById('coty');
  527. p_ele.select();
  528. document.execCommand("Copy");
  529. p.remove();
  530. }
  531. },
  532. checkAll(e){
  533. if (e.target.checked){
  534. this.orderIssues.forEach((el,i)=>{
  535. if (this.checkData.indexOf(el.id) == '-1'){
  536. this.checkData.push(el.id);
  537. }
  538. });
  539. }else {
  540. this.checkData = [];
  541. }
  542. },
  543. // 完结
  544. endOrderIssue(){
  545. if(this.checkData.length === 0){
  546. tempTip.show('没有勾选订单');
  547. return ;
  548. }
  549. let _this = this;
  550. let data = {ids:this.checkData};
  551. axios.post('{{url('order/issue/endOrderIssue')}}',data).then(function(res){
  552. if(res.data.success){
  553. _this.orderIssues.forEach(function(item){
  554. if(_this.checkData.includes(item.id)){
  555. item.handle_status = '已完结';
  556. }
  557. })
  558. tempTip.setDuration(2000);
  559. tempTip.showSuccess('勾选订单已变为已完结');
  560. }else{
  561. tempTip.setDuration(3000);
  562. tempTip.show(res.data.fail_info);
  563. }
  564. }).catch(function(err){
  565. tempTip.setDuration(4000);
  566. tempTip.show('网络异常:'+err);
  567. })
  568. },
  569. // 添加日志
  570. addOrderIssueLog(event){
  571. let _this = this;
  572. let id ;
  573. let data= {id:id,content:''};
  574. axios.post('{{url('order/issue/addOrderIssuesLog')}}').then(function(res){
  575. if(res.data.success){
  576. // unshift
  577. _this.orderIssues.forEach( function(orderIssue){
  578. if(orderIssue.id == id){
  579. orderIssue.logs.unshift(res.data.data);
  580. }
  581. })
  582. tempTip.setDuration(2000);
  583. tempTip.showSuccess('添加成功');
  584. } else {
  585. tempTip.setDuration(3000);
  586. tempTip.showSuccess(res.data.fail_info);
  587. }
  588. }).catch(function(err){
  589. tempTip.setDuration(4000);
  590. tempTip.show('网络异常:'+err);
  591. });
  592. },
  593. }
  594. })
  595. // modal 隐藏时修改 input 为空
  596. $("#exampleModal").on('hide.bs.modal',function(e){
  597. $('#remark').val('');
  598. });
  599. $("#exampleModal").on('hide.bs.modal',function(e){
  600. $('#remark').val('');
  601. });
  602. </script>
  603. @endsection