recycle.blade.php 8.4 KB

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