| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- @extends('layouts.app')
- @section('title')回收站-问题件-订单管理@endsection
- @section('content')
- <div class="container-fluid d-none" id="recycle_div">
- <div style="min-width: 1990px" class="card">
- <div class="card">
- <div class="card-body">
- <div class="card">
- <table class="col-sm-3 table table-sm table-bordered align-middle m-0">
- <tr>
- <td class="text-muted align-middle">每页显示条数:</td>
- <td>
- <select name="paginate" id="paginate" class="form-control" @change="setPaginate" v-model="paginate">
- <option v-for="paginate in paginates" :value="paginate.name" >@{{ paginate.value }}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="text-muted align-middle">操作选定记录:</td>
- <td>
- <div class="btn btn-outline-danger" @click="recover">恢复</div>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <table class="table table-sm table-striped table-bordered table-hover card-body p-0 m-0">
- <tr>
- <th>
- <input id="all" type="checkbox" @click="checkAll($event)"/>
- </th>
- <th>id</th>
- <th>登记时间</th>
- <th>订单日期</th>
- <th>客户订单号</th>
- <th>原始承运商</th>
- <th>店铺</th>
- <th>原始运单号</th>
- <th>退回单号</th>
- <th>二次订单号</th>
- <th>自定义单号</th>
- </tr>
- <tr v-for="orderIssue in orderIssues">
- <td>
- <input type="checkbox" :value="orderIssue.id" v-model="checkData" >
- </td>
- <td>@{{ orderIssue.id }}</td>
- <td>@{{ orderIssue.created_at }} </td>
- <td>
- <span v-if="orderIssue.order">@{{ orderIssue.order.created_at }}</span>
- </td>
- <td>
- <span v-if="orderIssue.order">@{{ orderIssue.order.client_code }}</span>
- </td>
- <td>
- <span v-if="orderIssue.order">
- <span v-if="orderIssue.order.logistic">
- @{{ orderIssue.order.logistic.name }}
- </span>
- </span>
- </td>
- <td>
- <span v-if="orderIssue.order">
- <span v-if="orderIssue.order.shop">
- @{{ orderIssue.order.shop.name }}
- </span>
- </span>
- </td>
- <td>
- <div v-if="orderIssue.order">
- <div v-if="orderIssue.order.packages">
- <p v-for="package in orderIssue.order.packages">@{{ package.logistic_number }}</p>
- </div>
- </div>
- </td>
- <td>
- <div v-if="orderIssue.order_issue_rejected_bills">
- <div v-for="orderIssueRejectedBill in orderIssue.order_issue_rejected_bills">
- <p>@{{ orderIssueRejectedBill.logistic_number_return }}</p>
- </div>
- </div>
- </td>
- <td>
- <span>@{{ orderIssue.second_client_no }}</span>
- </td>
- <td>
- @{{ orderIssue.custom_code }}
- </td>
- </tr>
- </table>
- {{$orderIssues->withQueryString()->links()}}
- </div>
- </div>
- </div>
- </div>
- @endsection
- @section('lastScript')
- <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
- <script>
- let vue = new Vue({
- el: "#recycle_div",
- data: {
- orderIssues: {!! $orderIssues->toJson() !!}['data'],
- checkBool: false,
- checkData: [],
- paginate:{!! $paginate !!},
- paginates: [
- {name: 50, value: '50条'},
- {name: 100, value: '100条'},
- {name: 200, value: '200条'},
- {name: 500, value: '500条'},
- {name: 1000, value: '1000条'},
- ],
- },
- watch: {
- checkData: function (value) {
- if (value.length === this.orderIssues.length) {
- this.checkBool = true;
- }else{
- this.checkBool = false;
- }
- },
- },
- mounted: function () {
- $("#recycle_div").removeClass('d-none');
- },
- methods: {
- checkAll(e){
- if (e.target.checked) {
- this.orderIssues.forEach((el, i) => {
- if (this.checkData.indexOf(el.id) == '-1') {
- this.checkData.push(el.id);
- }
- });
- } else {
- this.checkData = [];
- }
- },
- recover() {
- if (this.checkData.length === 0) {
- tempTip.setDuration(2000);
- tempTip.show('请勾选需要恢复的问题件');
- return;
- }
- if(!confirm('是否恢复所选问题件'))return;
- let _this = this;
- let data = {ids: this.checkData};
- tempTip.setDuration(99999);
- tempTip.waitingTip('处理中请稍后');
- axios.post('{{url('apiLocal/order/issue/recycle/recover')}}', data)
- .then(function (response) {
- tempTip.cancelWaitingTip();
- tempTip.setDuration(2000);
- if (response.data.success) {
- tempTip.showSuccess('恢复成功');
- for (let i = _this.orderIssues.length -1;i >= 0;i--){
- if(_this.checkData.includes(_this.orderIssues[i].id))
- _this.orderIssues.splice(i,1);
- }
- } else {
- tempTip.show(response.data.error);
- }
- }).catch(function (error) {
- tempTip.cancelWaitingTip();
- tempTip.setDuration(2000);
- tempTip.show(error);
- });
- },
- setPaginate:function(){
- let form=$("<form method='get'></form>");
- let paginate = $('#paginate').val();
- form.append($("<input type='text' name='paginate' value='"+paginate+"'>"));
- $("body").append(form);
- form.submit();
- },
- }
- });
- </script>
- @endsection
|