index.blade.php 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. @extends('layouts.app')
  2. @section('title')运输管理@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('waybill.menu')
  6. @endcomponent
  7. <div class="container-fluid nav3">
  8. <div class="card menu-third" >
  9. <ul class="nav nav-pills">
  10. @can('运输管理-查询')
  11. <li class="nav-item">
  12. <a class="nav-link" href="{{url('waybill/index')}}" :class="{active:isActive('',3)}">全部</a>
  13. </li> @endcan
  14. @can('运输管理-查询')
  15. <li class="nav-item">
  16. <a class="nav-link" href="{{url('waybill/index/ZX')}}" :class="{active:isActive('ZX',3)}">专线</a>
  17. </li> @endcan
  18. @can('运输管理-查询')
  19. <li class="nav-item">
  20. <a class="nav-link" href="{{url('waybill/index/ZF')}}" :class="{active:isActive('ZF',3)}">直发车</a>
  21. </li> @endcan
  22. </ul>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="container-fluid" style="min-width: 2000px;">
  27. <div class="d-none" id="list">
  28. <form method="GET" action="@if($uriType=='ZF'){{url('waybill/index/ZF')}}@elseif($uriType=='ZX'){{url('waybill/index/ZX')}}@else{{url('waybill/index')}}@endif" id="optionSubmit">
  29. <table class="table table-sm table-bordered table-hover text-nowrap mb-0" style="background: #fff;">
  30. <tr v-if="isBeingFilterConditions">
  31. <td colspan="4"><div class="col" style="padding:0">
  32. <a href="@if($uriType=='ZF'){{url('waybill/index/ZF')}}@elseif($uriType=='ZX'){{url('waybill/index/ZX')}}@else{{url('waybill/index')}}@endif"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
  33. </div>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td colspan="6">
  38. <select name="paginate" v-model="filterData.paginate" @change="setPaginate" class="form-control-sm" style="vertical-align: middle">
  39. <option value="50">每页显示50行</option>
  40. <option value="100">每页显示100行</option>
  41. <option value="200">每页显示200行</option>
  42. <option value="500">每页显示500行</option>
  43. <option value="1000">每页显示1000行</option>
  44. </select>
  45. </td>
  46. </tr>
  47. <tr >
  48. <td >
  49. <select name="owner_id" v-model="filterData.owner_id" class="form-control-sm " @change="setOwner" style="vertical-align: middle">
  50. <option value="" selected>货主</option>
  51. @foreach($owners as $owner)
  52. <option value="{{$owner->id}}">{{$owner->name}}</option>
  53. @endforeach
  54. </select></td>
  55. <td >
  56. <select name="carrier_id" v-model="filterData.carrier_id" class="form-control-sm " @change="setCarrier" style="vertical-align: middle">
  57. <option value="" selected>承运商</option>
  58. @foreach($carriers as $carrier)
  59. <option value="{{$carrier->id}}">{{$carrier->name}}</option>
  60. @endforeach
  61. </select></td>
  62. <td >
  63. <input type="text" title="运单号:支持15内模糊搜索与15天外精确搜索" name="waybill_number" placeholder="运单号"
  64. class="form-control-sm tooltipTarget" v-model="filterData.waybill_number" style="vertical-align: middle"></td>
  65. <td >
  66. <input type="text" title="承运商单号:支持15内模糊搜索与15天外精确搜索" name="carrier_bill" placeholder="承运商单号"
  67. class="form-control-sm tooltipTarget" v-model="filterData.carrier_bill" style="vertical-align: middle"></td>
  68. <td width="60%"></td>
  69. </tr>
  70. <tr>
  71. <td >
  72. <input type="text" title="WMS单号:支持15内模糊搜索与15天外精确搜索" name="wms_bill_number" placeholder="WMS单号"
  73. class="form-control-sm tooltipTarget" v-model="filterData.wms_bill_number" style="vertical-align: middle"></td>
  74. <td style="width: 500px"><div>
  75. <input type="text" title="始发地:支持15内模糊搜索与15天外精确搜索" name="origination" placeholder="始发地"
  76. class="form-control-sm tooltipTarget" v-model="filterData.origination" style="vertical-align: middle">
  77. <input type="text" title="目的地:支持15内模糊搜索与15天外精确搜索" style="vertical-align: middle" placeholder="目的地"
  78. name="destination" class="form-control-sm tooltipTarget" v-model="filterData.destination"></div></td>
  79. <td style="width: 500px"><div>
  80. <input type="date" name="created_at_start" class="form-control-sm tooltipTarget" title="开始日期"
  81. v-model="filterData.created_at_start">
  82. <input type="date" class="form-control-sm tooltipTarget" name="created_at_end" title="截至日期"
  83. v-model="filterData.created_at_end"></div></td>
  84. <td>
  85. <select name="status" v-model="filterData.status" @change="setState" class="form-control-sm" style="vertical-align: middle">
  86. <option value="" selected>运单状态</option>
  87. <option value="待审核">待审核</option>
  88. <option value="已审核">待调度</option>
  89. <option value="待终审">待终审</option>
  90. <option value="已完结">已完结</option>
  91. </select>
  92. <input hidden type="submit">
  93. </td>
  94. <td></td>
  95. </tr>
  96. <tr>
  97. <td colspan="6">
  98. <span class="dropdown">
  99. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData>0?'btn-dark text-light':'']"
  100. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  101. 导出Excel
  102. </button>
  103. <div class="dropdown-menu">
  104. <a class="dropdown-item" @click="waybillExport(1)" href="javascript:">导出勾选内容</a>
  105. <a class="dropdown-item" @click="waybillExport(2)" href="javascript:">导出所有页</a>
  106. </div>
  107. </span>
  108. </td>
  109. </tr>
  110. </table>
  111. </form>
  112. <div>
  113. @if(Session::has('successTip'))
  114. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  115. @endif
  116. </div>
  117. <table class="table table-striped table-sm table-bordered table-hover text-nowrap waybill-table" style="background: #fff;">
  118. <tr>
  119. <th>
  120. <label for="all">
  121. <input id="all" type="checkbox" @click="checkAll($event)">全选
  122. </label>
  123. </th>
  124. @can('运输管理-编辑','运输管理-运单审核','运输管理-调度','运输管理-编辑','运输管理-删除')
  125. <th>操作</th>
  126. @endcan
  127. <th>状态</th>
  128. <th class="waybill_1">ID</th>
  129. <th class="waybill_1">创建时间</th>
  130. <th class="waybill_1">运单类型</th>
  131. <th class="waybill_1">货主</th>
  132. <th class="waybill_1">运单号</th>
  133. <th class="waybill_1">始发地</th>
  134. <th class="waybill_1">目的地</th>
  135. <th class="waybill_2">承运商</th>
  136. <th class="waybill_2">单号/车型</th>
  137. <th class="waybill_2">仓库计抛</th>
  138. <th class="waybill_2">承运商计抛</th>
  139. <th class="waybill_2">仓库计重</th>
  140. <th class="waybill_2">承运商计重</th>
  141. <th class="waybill_3">运费</th>
  142. <th class="waybill_3">提货费</th>
  143. <th class="waybill_3">其他费用</th>
  144. <th class="waybill_3">调度备注</th>
  145. {{-- <th>WMS单号</th>--}}
  146. {{-- <th>收件人</th>--}}
  147. {{-- <th>收件人电话</th>--}}
  148. {{-- <th>收费(元)</th>--}}
  149. {{-- <th>到付金额(元)</th>--}}
  150. {{-- <th>下单备注</th>--}}
  151. {{-- <th>运单审核人</th>--}}
  152. {{-- <th>商品列表</th>--}}
  153. {{-- <th>始发市</th>--}}
  154. {{-- <th>目的市</th>--}}
  155. {{-- <th>车辆信息</th>--}}
  156. {{-- <th>调度审核人</th>--}}
  157. </tr>
  158. <tr v-for="waybill in waybills" :style="{color:waybill.status=='待重审'?'red':''||waybill.status=='已完结'?'green':''}" :id="'waybill'+waybill.id">
  159. <td>
  160. <input class="checkItem" type="checkbox" :value="waybill.id" v-model="checkData">
  161. </td>
  162. <td>
  163. <span v-if=waybill.status==="未审核"||waybill.status==="待重审">
  164. @can('运输管理-运单审核')
  165. <button class="btn btn-outline-success btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>
  166. @endcan
  167. @can('运输管理-运单编辑')
  168. <button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>
  169. @endcan
  170. </span>
  171. <span v-if=waybill.status==="已审核">
  172. @can('运输管理-调度')
  173. <button class="btn btn-outline-secondary btn-sm" @click="waybillRetreatAudit(waybill.id,waybill.waybill_number)">取消审核</button>
  174. <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">调度</button>
  175. @endcan
  176. </span>
  177. <span v-if=waybill.status==="待终审">
  178. @can('运输管理-调度审核')
  179. <button class="btn btn-outline-success btn-sm" @click="waybillEndAudit(waybill.id,waybill.waybill_number)">完结</button>
  180. @endcan
  181. @can('运输管理-调度')
  182. <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">改调度</button>
  183. @endcan
  184. </span>
  185. </td>
  186. <td :style="{color:waybill.status=='已审核'?'blue':''}">@{{waybill.status}}</td>
  187. <td>@{{waybill.id}}</td>
  188. <td>@{{waybill.created_at}}</td>
  189. <td>@{{waybill.type}}</td>
  190. <td>@{{waybill.owner}}</td>
  191. <td>@{{waybill.waybill_number}}</td>
  192. <td>@{{waybill.origination}}</td>
  193. <td>@{{waybill.destination}}</td>
  194. <td>@{{waybill.carrier}}</td>
  195. <td><span v-if="waybill.type=='专线'">@{{waybill.carrier_bill}}</span>
  196. <span v-if="waybill.type=='直发车'">
  197. <span v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span></span></td>
  198. <td>@{{waybill.warehouse_weight}} @{{waybill.warehouse_weight_unit}}</td>
  199. <td>@{{waybill.carrier_weight}} @{{waybill.carrier_weight_unit}}</td>
  200. <td>@{{waybill.warehouse_weight_other}} @{{waybill.warehouse_weight_unit_other}}</td>
  201. <td>@{{waybill.carrier_weight_other}} @{{waybill.carrier_weight_unit_other}}</td>
  202. @can('运输管理-可见费用项')
  203. <td><span v-if="waybill.type=='专线'"></span><span v-else>@{{waybill.fee}}</span></td>
  204. <td>@{{waybill.pick_up_fee}}</td>
  205. <td>@{{waybill.other_fee}}</td>
  206. @endcan
  207. <td>@{{waybill.dispatch_remark}}</td>
  208. {{-- <td>@{{waybill.wms_bill_number}}</td>--}}
  209. {{-- <td>@{{waybill.recipient}}</td>--}}
  210. {{-- <td>@{{waybill.recipient_mobile}}</td>--}}
  211. {{-- <td>@{{waybill.charge}}</td>--}}
  212. {{-- <td>@{{waybill.collect_fee}}</td>--}}
  213. {{-- <td>@{{waybill.ordering_remark}}</td>--}}
  214. {{-- <td><span v-for="waybillAuditLog in waybill.waybillAuditLogs" v-if=waybillAuditLog.audit_stage==="运单阶段">@{{waybillAuditLog.user.name}}</span></td>--}}
  215. {{-- <td ><u style="user-select: none;cursor:pointer" class="text-primary" v-if="!waybill.isBtn && waybill.wmsCommodities && waybill.wmsCommodities.length>0" @click="showWMSCommodities(waybill.id,waybill.wmsCommodities,waybill.isBtn)">--}}
  216. {{-- 该单有 @{{waybill.wmsCommodities.length}} 件商品,点击展开</u>--}}
  217. {{-- <u style="user-select: none;cursor:pointer" class="text-secondary" v-if="waybill.isBtn" @click="showWMSCommodities(waybill.id,waybill.wmsCommodities,waybill.isBtn)">--}}
  218. {{-- 该单有 @{{waybill.wmsCommodities.length}} 件商品,点击收起</u>--}}
  219. {{-- </td>--}}
  220. {{-- <td>--}}
  221. {{-- <div v-if=waybill.status==="未审核"||waybill.status==="待重审">--}}
  222. {{-- @can('运输管理-运单审核')--}}
  223. {{-- <button class="btn btn-outline-success btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>--}}
  224. {{-- @endcan--}}
  225. {{-- @can('运输管理-运单编辑')--}}
  226. {{-- <button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>--}}
  227. {{-- @endcan--}}
  228. {{-- </div>--}}
  229. {{-- <div v-if=waybill.status==="已审核">--}}
  230. {{-- @can('运输管理-调度')--}}
  231. {{-- <button class="btn btn-outline-secondary btn-sm" @click="waybillRetreatAudit(waybill.id,waybill.waybill_number)">取消审核</button>--}}
  232. {{-- <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">调度</button>--}}
  233. {{-- @endcan--}}
  234. {{-- </div>--}}
  235. {{-- <div v-if=waybill.status==="待终审">--}}
  236. {{-- @can('运输管理-调度审核')--}}
  237. {{-- <button class="btn btn-outline-success btn-sm" @click="waybillEndAudit(waybill.id,waybill.waybill_number)">完结</button>--}}
  238. {{-- @endcan--}}
  239. {{-- @can('运输管理-调度')--}}
  240. {{-- <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">改调度</button>--}}
  241. {{-- @endcan--}}
  242. {{-- </div>--}}
  243. {{-- </td>--}}
  244. {{-- <td>@{{waybill.origination_city}}</td>--}}
  245. {{-- <td>@{{waybill.destination_city}}</td>--}}
  246. {{-- <td>@{{waybill.car_owner_info}}</td>--}}
  247. {{-- <td><span v-for="waybillAuditLog in waybill.waybillAuditLogs" v-if=waybillAuditLog.audit_stage==="调度阶段">@{{waybillAuditLog.user.name}}</span></td>--}}
  248. </tr>
  249. {{-- <tr v-show="wmsCommodities&&wmsCommodities.length>0" id="wmsCommodities">--}}
  250. {{-- <td colspan="15"></td>--}}
  251. {{-- <td colspan="15">--}}
  252. {{-- <table>--}}
  253. {{-- <tr style="background: #9fcdff">--}}
  254. {{-- <th>商品名称</th>--}}
  255. {{-- <th>商品编码</th>--}}
  256. {{-- <th>条码</th>--}}
  257. {{-- <th>数量</th>--}}
  258. {{-- <th>体称</th>--}}
  259. {{-- <th>毛重</th>--}}
  260. {{-- <th>净重</th>--}}
  261. {{-- </tr>--}}
  262. {{-- <tr v-for="wmsCommodity in wmsCommodities">--}}
  263. {{-- <td>@{{ wmsCommodity.SKU_Descr_c }}</td>--}}
  264. {{-- <td>@{{ wmsCommodity.SKU }}</td>--}}
  265. {{-- <td>@{{ wmsCommodity.Alternate_sku1 }}</td>--}}
  266. {{-- <td>@{{ wmsCommodity.Qtyordered_each }}</td>--}}
  267. {{-- <td>@{{ wmsCommodity.Cubic }}</td>--}}
  268. {{-- <td>@{{ wmsCommodity.GrossWeight }}</td>--}}
  269. {{-- <td>@{{ wmsCommodity.NetWeight }}</td>--}}
  270. {{-- </tr>--}}
  271. {{-- </table>--}}
  272. {{-- </td>--}}
  273. {{-- </tr>--}}
  274. </table>
  275. <div class="text-info h5 btn btn">{{$waybills->count()}}/{{$waybills->total()}}</div>
  276. {{$waybills->appends($filterData)->links()}}
  277. </div>
  278. </div>
  279. @endsection
  280. @section('lastScript')
  281. <style>
  282. .waybill_1{background-color: #FFA07A}
  283. .waybill_2{background-color: cornflowerblue}
  284. .waybill_3{background-color: #00FFFF}
  285. </style>
  286. <script>
  287. let vueList=new Vue({
  288. el:'#list',
  289. data:{
  290. waybills:[
  291. @foreach($waybills as $waybill)
  292. {
  293. id:'{{$waybill->id}}',created_at:'{{$waybill->created_at}}',updated_at:'{{$waybill->updated_at}}',
  294. status:'{{$waybill->status}}',type:'{{$waybill->type}}',waybill_number:'{{$waybill->waybill_number}}',
  295. owner:'{{$waybill->owner_name}}',wms_bill_number:'{{$waybill->wms_bill_number}}',origination:'{{$waybill->origination}}',
  296. destination:'{{$waybill->destination}}',recipient:'{{$waybill->recipient}}',recipient_mobile:'{{$waybill->recipient_mobile}}',
  297. charge:'{{$waybill->charge}}',ordering_remark:'{{$waybill->ordering_remark}}',carrier:'{{$waybill->carrier_name}}',
  298. carrier_bill:'{{$waybill->carrier_bill}}',origination_city:'{{$waybill->origination_city_name}}',
  299. destination_city:'{{$waybill->destination_city_name}}',warehouse_weight:'{{$waybill->warehouse_weight}}',
  300. warehouse_weight_unit:'{{$waybill->warehouse_weight_unit_name}}',carrier_weight:'{{$waybill->carrier_weight}}',
  301. carrier_weight_unit:'{{$waybill->carrier_weight_unit_name}}',
  302. warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
  303. warehouse_weight_unit_other:'{{$waybill->warehouse_weight_unit_other_name}}',carrier_weight_other:'{{$waybill->carrier_weight_other}}',
  304. carrier_weight_unit_other:'{{$waybill->carrier_weight_unit_other_name}}',
  305. @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif @can('运输管理-可见费用项') fee:'{{$waybill->fee}}',
  306. pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
  307. collect_fee:'{{$waybill->collect_fee}}', @endcan dispatch_remark:'{{$waybill->dispatch_remark}}',isBtn:false,wmsCommodities:{!! $waybill->wmsCommodities !!},
  308. waybillAuditLogs:{!! $waybill->waybillAuditLogs !!}
  309. },
  310. @endforeach
  311. ],
  312. checkData:[],
  313. filterData:
  314. {paginate:'50',waybill_number:''
  315. ,carrier_bill:'',carrier_id:''
  316. ,owner_id:'',wms_bill_number:''
  317. ,created_at_start:'',created_at_end:''
  318. ,type:'',status:'',origination:'',destination:'',},
  319. wmsCommodities:[],
  320. },
  321. computed:{
  322. isBeingFilterConditions:function(){
  323. for(let key in this.filterData){
  324. if(this.filterData[key]){
  325. if(key==='paginate')continue;
  326. return true
  327. }
  328. }
  329. return false;
  330. },
  331. },
  332. watch:{
  333. checkData:{
  334. handler(){
  335. if (this.checkData.length === this.waybills.length){
  336. document.querySelector('#all').checked = true;
  337. }else {
  338. document.querySelector('#all').checked = false;
  339. }
  340. },
  341. deep:true
  342. }
  343. },
  344. mounted:function(){
  345. this.initInputs();
  346. $(".tooltipTarget").tooltip({'trigger':'hover'});
  347. $('#list').removeClass('d-none');
  348. },
  349. methods:{
  350. initInputs:function(){
  351. let data=this;
  352. let uriParts =decodeURI(location.href).split("?");
  353. if(uriParts.length>1){
  354. let params = uriParts[1].split('&');
  355. params.forEach(function(paramPair){
  356. let pair=paramPair.split('=');
  357. let key = pair[0], val = pair[1];
  358. $('input[name="'+key+'"]').val(val);
  359. $('select[name="'+key+'"]').val(val);
  360. decodeURI(data.filterData[key]=val);
  361. });
  362. }
  363. },
  364. waybillAudit(id,waybill_number){
  365. if(!confirm('确定要通过“'+waybill_number+'”的审核吗?')){return};
  366. let _this=this;
  367. let w;
  368. let url = '{{url('waybill/waybillAudit')}}';
  369. axios.post(url, {id:id})
  370. .then(
  371. function (response) {
  372. if (response.data.success){
  373. _this.waybills.forEach(function (waybill) {
  374. if (waybill.id===id){
  375. waybill.status=response.data.status;
  376. waybill.waybillAuditLogs.push(response.data.waybillAuditLog);
  377. w=waybill.waybill_number;
  378. }
  379. });
  380. tempTip.setDuration(3000);
  381. tempTip.showSuccess('审核'+w+'成功!');
  382. }else if (response.data.exception!=null){
  383. tempTip.setDuration(3000);
  384. tempTip.show(response.data.exception);
  385. }else {
  386. tempTip.setDuration(3000);
  387. tempTip.show('审核失败!');
  388. }
  389. }
  390. ).catch(function (err) {
  391. tempTip.setDuration(3000);
  392. tempTip.show('审核失败,网络连接错误!'+err);
  393. });
  394. },
  395. waybillUpdate(id){
  396. location.href="{{url('waybill/waybillEdit')}}/"+id;
  397. },
  398. waybillRetreatAudit(id,waybill_number){
  399. if(!confirm('确定要驳回“'+waybill_number+'”的审核吗?')){return};
  400. let _this=this;
  401. let w;
  402. let url='{{url('waybill/waybillRetreatAudit')}}';
  403. axios.post(url,{id:id})
  404. .then(
  405. function (response) {
  406. if (response.data.success){
  407. _this.waybills.forEach(function (waybill){
  408. if (waybill.id===id){
  409. waybill.status=response.data.status;
  410. waybill.waybillAuditLogs=[];
  411. w=waybill.waybill_number;
  412. }
  413. });
  414. tempTip.setDuration(3000);
  415. tempTip.showSuccess(w+'审核驳回成功!');
  416. }else {
  417. tempTip.setDuration(3000);
  418. tempTip.show('审核驳回失败!');
  419. }
  420. }
  421. ).catch(function (err) {
  422. tempTip.setDuration(3000);
  423. tempTip.show('审核驳回失败,网络连接错误!'+err);
  424. });
  425. },
  426. job(id){
  427. location.href="{{url('waybill')}}/"+id+"/edit";
  428. },
  429. waybillEndAudit(id,waybill_number){
  430. if(!confirm('确定要通过“'+waybill_number+'”的终审吗?')){return};
  431. let _this=this;
  432. let w;
  433. let url='{{url('waybill/waybillEndAudit')}}';
  434. axios.post(url, {id:id})
  435. .then(
  436. function (response) {
  437. if (response.data.success){
  438. _this.waybills.forEach(function (s) {
  439. if (s.id===id){
  440. s.status=response.data.status;
  441. s.waybillAuditLogs.push(response.data.waybillAuditLog);
  442. w=s.waybill_number;
  443. }
  444. });
  445. tempTip.setDuration(3000);
  446. tempTip.showSuccess(w+'终审完毕!');
  447. }else if (response.data.exception!=null){
  448. tempTip.setDuration(3000);
  449. tempTip.show(response.data.exception);
  450. }else {
  451. tempTip.setDuration(3000);
  452. tempTip.show('终审失败!');
  453. }
  454. }
  455. ).catch(function (err) {
  456. tempTip.setDuration(3000);
  457. tempTip.show('终审失败,网络连接错误!'+err);
  458. });
  459. },
  460. setPaginate:function(e){
  461. this.filterData.paginate=e.target.value;
  462. var form = document.getElementById("optionSubmit");
  463. form.submit();
  464. },
  465. setCarrier:function (e){
  466. this.filterData.carrier_id=e.target.value;
  467. var form = document.getElementById("optionSubmit");
  468. form.submit();
  469. },
  470. setOwner:function (e) {
  471. this.filterData.owner_id=e.target.value;
  472. var form = document.getElementById("optionSubmit");
  473. form.submit();
  474. },
  475. setType:function (e) {
  476. this.filterData.type=e.target.value;
  477. var form = document.getElementById("optionSubmit");
  478. form.submit();
  479. },
  480. setState:function (e) {
  481. this.filterData.status=e.target.value;
  482. var form = document.getElementById("optionSubmit");
  483. form.submit();
  484. },
  485. checkAll(e){
  486. if (e.target.checked){
  487. this.waybills.forEach((el,i)=>{
  488. if (this.checkData.indexOf(el.id) == '-1'){
  489. this.checkData.push(el.id);
  490. }
  491. });
  492. }else {
  493. this.checkData = [];
  494. }
  495. },
  496. waybillExport(e){
  497. let val=e;
  498. let data=this.filterData;
  499. if (val==1) {
  500. if (this.checkData.length <= 0) {
  501. tempTip.setDuration(4000);
  502. tempTip.showSuccess('没有勾选任何记录');
  503. } else {
  504. location.href = "{{url('waybillExport')}}/" + this.checkData;
  505. }
  506. }else {
  507. location.href = "{{url('waybillExport/-1?waybill_number=')}}"+
  508. data.waybill_number+"&carrier_bill="+data.carrier_bill+
  509. "&carrier_id="+data.carrier_id+"&owner_id="+data.owner_id+
  510. "&wms_bill_number="+data.wms_bill_number+"&created_at_start="+
  511. data.created_at_start+"&created_at_end="+data.created_at_end+
  512. "&type="+data.type+"&status="+data.status+"&origination="+data.origination+
  513. "&destination="+data.destination;
  514. }
  515. },
  516. //展开收起商品列表
  517. showWMSCommodities(id,wmsCommodities,isBtn){
  518. if (!isBtn){
  519. this.wmsCommodities=wmsCommodities;
  520. $("#waybill"+id).after($("#wmsCommodities"));
  521. this.waybills.forEach(function (waybill) {
  522. if (waybill.id!==id&&waybill.isBtn){
  523. waybill.isBtn=false;
  524. }
  525. if (waybill.id===id){
  526. waybill.isBtn=true;
  527. }
  528. });
  529. return;
  530. }
  531. if (isBtn){
  532. this.wmsCommodities=[];
  533. this.waybills.every(function (waybill) {
  534. if (waybill.id===id){
  535. waybill.isBtn=false;
  536. return false;
  537. }
  538. return true;
  539. });
  540. }
  541. }
  542. },
  543. });
  544. </script>
  545. @endsection