|
|
@@ -0,0 +1,122 @@
|
|
|
+@extends("layouts.app")
|
|
|
+@section('title')订单管理-自动冻结@endsection
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ @component('order.index.menu')@endcomponent
|
|
|
+ <div class="card" id="container">
|
|
|
+ <div class="card-body">
|
|
|
+ <div class="container-fluid">
|
|
|
+
|
|
|
+ @include("order.index._freezeModal")
|
|
|
+
|
|
|
+ <div class="pull-left">
|
|
|
+ <button class="btn btn-outline-info mb-1 mr-3" @click="openModal()"><span class="fa fa-plus"></span> 新 增</button>
|
|
|
+ </div>
|
|
|
+ <table class="table table-striped table-borderless rounded">
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>承运商</th>
|
|
|
+ <th>省</th>
|
|
|
+ <th>市</th>
|
|
|
+ <th>区</th>
|
|
|
+ <th></th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(freeze,i) in freezes">
|
|
|
+ <td>@{{ i+1 }}</td>
|
|
|
+ <td>@{{ freeze.logistic ? freeze.logistic.name : '' }}</td>
|
|
|
+ <td>@{{ freeze.province ? freeze.province.name : '' }}</td>
|
|
|
+ <td>@{{ freeze.city ? freeze.city.name : '' }}</td>
|
|
|
+ <td>@{{ freeze.location ? freeze.location.name : '' }}</td>
|
|
|
+ <td>
|
|
|
+ <button class="btn btn-sm btn-outline-danger" @click="deleteFreeze(freeze,i)">删除</button>
|
|
|
+ <button class="btn btn-sm btn-outline-info" @click="openModal(freeze,i)">编辑</button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ {{$freezes->links()}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+@stop
|
|
|
+
|
|
|
+@section("lastScript")
|
|
|
+ <script>
|
|
|
+ new Vue({
|
|
|
+ el:"#container",
|
|
|
+ data:{
|
|
|
+ freezes:[
|
|
|
+ @foreach($freezes as $freeze)
|
|
|
+ {!! $freeze !!},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ data:{},
|
|
|
+ freeze:{},
|
|
|
+ errors : {},
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ openModal(model = null,index = null){
|
|
|
+ if (!model)this.freeze = {};
|
|
|
+ else {
|
|
|
+ model.index = index;
|
|
|
+ this.freeze = model;
|
|
|
+ }
|
|
|
+ this._load();
|
|
|
+ $("#modal").modal("show");
|
|
|
+ },
|
|
|
+ _load(){
|
|
|
+ if (!this.data.logistics){
|
|
|
+ let url = "{{url('maintenance/logistic/get')}}";
|
|
|
+ window.tempTip.postBasicRequest(url,{},res=>{
|
|
|
+ this.$set(this.data,'logistics',res);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!this.data.provinces){
|
|
|
+ let url = "{{url('maintenance/province/get')}}";
|
|
|
+ window.tempTip.postBasicRequest(url,{},res=>{
|
|
|
+ this.$set(this.data,'provinces',res);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!this.data.cities){
|
|
|
+ let url = "{{url('maintenance/city/get')}}";
|
|
|
+ window.tempTip.postBasicRequest(url,{},res=>{
|
|
|
+ this.$set(this.data,'cities',res);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (!this.data.districts){
|
|
|
+ let url = "{{url('maintenance/region/get')}}";
|
|
|
+ window.tempTip.postBasicRequest(url,{type:3},res=>{
|
|
|
+ this.$set(this.data,'districts',res);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit(){
|
|
|
+ if (!this.freeze.logistic_id){
|
|
|
+ window.tempTip.setIndex(1099);
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show("必须选择承运商");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let url = "{{url('order/index/freeze')}}";
|
|
|
+ window.tempTip.postBasicRequest(url,this.freeze,res=>{
|
|
|
+ let msg = "新增冻结选项成功!";
|
|
|
+ if (this.freeze.id){
|
|
|
+ msg = "修改冻结选项成功!";
|
|
|
+ this.freezes[this.freeze.index] = res;
|
|
|
+ } else this.freezes.unshift(res);
|
|
|
+ $("#modal").modal("hide");
|
|
|
+ return msg;
|
|
|
+ },true)
|
|
|
+ },
|
|
|
+ deleteFreeze(freeze,index){
|
|
|
+ let url = "{{url('order/index/freeze/delFreeze')}}";
|
|
|
+ window.tempTip.confirm("确定要解除该冻结条件吗?",()=>{
|
|
|
+ window.tempTip.postBasicRequest(url,freeze,res=>{
|
|
|
+ this.$delete(this.freezes,index);
|
|
|
+ return "删除成功!";
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+@stop
|