recycle.blade.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. @extends('layouts.app')
  2. @section('title')订单管理-问题件-回收站@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('order.issue.menu')@endcomponent
  6. </div>
  7. <div class="container-fluid d-none" id="recycle_div">
  8. <div style="min-width: 1990px" class="card">
  9. <div class="card">
  10. <div class="card-body">
  11. <div class="card">
  12. <table class="col-sm-3 table table-sm table-bordered align-middle m-0">
  13. <tr>
  14. <td class="text-muted align-middle">每页显示条数:</td>
  15. <td>
  16. <select name="paginate" id="paginate" class="form-control" @change="setPaginate" v-model="paginate">
  17. <option v-for="paginate in paginates" :value="paginate.name" >@{{ paginate.value }}</option>
  18. </select>
  19. </td>
  20. </tr>
  21. <tr>
  22. <td class="text-muted align-middle">操作选定记录:</td>
  23. <td>
  24. <div class="btn btn-outline-danger" @click="recover">恢复</div>
  25. </td>
  26. </tr>
  27. </table>
  28. </div>
  29. </div>
  30. <table class="table table-sm table-striped table-bordered table-hover card-body p-0 m-0">
  31. <tr>
  32. <th>
  33. <input id="all" type="checkbox" @click="checkAll($event)"/>
  34. </th>
  35. <th>id</th>
  36. <th>登记时间</th>
  37. <th>订单日期</th>
  38. <th>客户订单号</th>
  39. <th>原始承运商</th>
  40. <th>店铺</th>
  41. <th>原始运单号</th>
  42. <th>退回单号</th>
  43. <th>二次订单号</th>
  44. <th>自定义单号</th>
  45. </tr>
  46. <tr v-for="orderIssue in orderIssues">
  47. <td>
  48. <input type="checkbox" :value="orderIssue.id" v-model="checkData" >
  49. </td>
  50. <td>@{{ orderIssue.id }}</td>
  51. <td>@{{ orderIssue.created_at }} </td>
  52. <td>
  53. <span v-if="orderIssue.order">@{{ orderIssue.order.created_at }}</span>
  54. </td>
  55. <td>
  56. <span v-if="orderIssue.order">@{{ orderIssue.order.client_code }}</span>
  57. </td>
  58. <td>
  59. <span v-if="orderIssue.order">
  60. <span v-if="orderIssue.order.logistic">
  61. @{{ orderIssue.order.logistic.name }}
  62. </span>
  63. </span>
  64. </td>
  65. <td>
  66. <span v-if="orderIssue.order">
  67. <span v-if="orderIssue.order.shop">
  68. @{{ orderIssue.order.shop.name }}
  69. </span>
  70. </span>
  71. </td>
  72. <td>
  73. <div v-if="orderIssue.order">
  74. <div v-if="orderIssue.order.packages">
  75. <p v-for="package in orderIssue.order.packages">@{{ package.logistic_number }}</p>
  76. </div>
  77. </div>
  78. </td>
  79. <td>
  80. <div v-if="orderIssue.order_issue_rejected_bills">
  81. <div v-for="orderIssueRejectedBill in orderIssue.order_issue_rejected_bills">
  82. <p>@{{ orderIssueRejectedBill.logistic_number_return }}</p>
  83. </div>
  84. </div>
  85. </td>
  86. <td>
  87. <span>@{{ orderIssue.second_client_no }}</span>
  88. </td>
  89. <td>
  90. @{{ orderIssue.custom_code }}
  91. </td>
  92. </tr>
  93. </table>
  94. {{$orderIssues->withQueryString()->links()}}
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. @endsection
  100. @section('lastScript')
  101. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  102. <script>
  103. let vue = new Vue({
  104. el: "#recycle_div",
  105. data: {
  106. orderIssues: {!! $orderIssues->toJson() !!}['data'],
  107. checkBool: false,
  108. checkData: [],
  109. paginate:{!! $paginate !!},
  110. paginates: [
  111. {name: 50, value: '50条'},
  112. {name: 100, value: '100条'},
  113. {name: 200, value: '200条'},
  114. {name: 500, value: '500条'},
  115. {name: 1000, value: '1000条'},
  116. ],
  117. },
  118. watch: {
  119. checkData: function (value) {
  120. if (value.length === this.orderIssues.length) {
  121. this.checkBool = true;
  122. }else{
  123. this.checkBool = false;
  124. }
  125. },
  126. },
  127. mounted: function () {
  128. $("#recycle_div").removeClass('d-none');
  129. },
  130. methods: {
  131. checkAll(e){
  132. if (e.target.checked) {
  133. this.orderIssues.forEach((el, i) => {
  134. if (this.checkData.indexOf(el.id) == '-1') {
  135. this.checkData.push(el.id);
  136. }
  137. });
  138. } else {
  139. this.checkData = [];
  140. }
  141. },
  142. recover() {
  143. if (this.checkData.length === 0) {
  144. tempTip.setDuration(2000);
  145. tempTip.show('请勾选需要恢复的问题件');
  146. return;
  147. }
  148. if(!confirm('是否恢复所选问题件'))return;
  149. let _this = this;
  150. let data = {ids: this.checkData};
  151. tempTip.setDuration(99999);
  152. tempTip.waitingTip('处理中请稍后');
  153. axios.post('{{url('apiLocal/order/issue/recycle/recover')}}', data)
  154. .then(function (response) {
  155. tempTip.cancelWaitingTip();
  156. tempTip.setDuration(2000);
  157. if (response.data.success) {
  158. tempTip.showSuccess('恢复成功');
  159. for (let i = _this.orderIssues.length -1;i >= 0;i--){
  160. if(_this.checkData.includes(_this.orderIssues[i].id))
  161. _this.orderIssues.splice(i,1);
  162. }
  163. } else {
  164. tempTip.show(response.data.error);
  165. }
  166. }).catch(function (error) {
  167. tempTip.cancelWaitingTip();
  168. tempTip.setDuration(2000);
  169. tempTip.show(error);
  170. });
  171. },
  172. setPaginate:function(){
  173. let form=$("<form method='get'></form>");
  174. let paginate = $('#paginate').val();
  175. form.append($("<input type='text' name='paginate' value='"+paginate+"'>"));
  176. $("body").append(form);
  177. form.submit();
  178. },
  179. }
  180. });
  181. </script>
  182. @endsection