index.blade.php 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111
  1. @extends('layouts.app')
  2. @section('title')运输管理@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('waybill.menu')
  6. @endcomponent
  7. </div>
  8. <div class="container-fluid" style="min-width: 1500px;">
  9. <div class="d-none" id="list">
  10. <div class="container-fluid nav3">
  11. <div class="card menu-third" >
  12. <ul class="nav nav-pills">
  13. @can('运输管理-查询')
  14. <li class="nav-item">
  15. <a class="nav-link" href="{{url('waybill/index')}}" :class="!filterData.uriType || filterData.uriType=='' ? 'active' :''">全部</a>
  16. </li> @endcan
  17. @can('运输管理-查询')
  18. <li class="nav-item">
  19. <a class="nav-link" href="{{url('waybill/index?uriType=ZX')}}" :class="filterData.uriType=='ZX' ? 'active' :''">专线</a>
  20. </li> @endcan
  21. @can('运输管理-查询')
  22. <li class="nav-item">
  23. <a class="nav-link" href="{{url('waybill/index?uriType=ZF')}}" :class="filterData.uriType=='ZF' ? 'active' :''">直发车</a>
  24. </li> @endcan
  25. </ul>
  26. </div>
  27. </div>
  28. <form method="GET" action="@if($uriType=='ZF'){{url('waybill/index?uriType=ZF')}}@elseif($uriType=='ZX'){{url('waybill/index?uriType=ZX')}}@else{{url('waybill/index')}}@endif" id="optionSubmit">
  29. <table class="table table-sm table-bordered 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. <div class="form-inline">
  50. <select v-if="is_ownerSelectShow" name="owner_id" v-model="filterData.owner_id" class="form-control form-control-sm tooltipTarget " @change="setOwner" style="vertical-align: middle;max-width: 100px" :class="filterData.owner_id?'bg-warning':''">
  51. <option value="" class="text-secondary">货主 </option>
  52. <option v-for="owner in owners" :value="owner.id" class="font-weight-bold">@{{owner.name}}</option>
  53. </select>
  54. <label v-if="!is_ownerSelectShow" class="text-muted" style="vertical-align: middle;min-width: 100px">(多选)</label>
  55. <div style="position: relative;" @mouseover="isOut=true;mouseleaveOwner();" @mouseleave="isOut=false;mouseleaveOwner();">
  56. <input type="text" title="多选货主时双击选中" class="form-control form-control-sm tooltipTarget" @input="owner_seek($event)" placeholder="定位或多选货主" @blur="isBlur=false;blurOwner();" @focus="isOwnersBtn=true;isBlur=true;">
  57. <span v-show="isOwnersBtn" class="border" style="position: absolute;left:0;top:30px;width:150px;max-height:100px;overflow:auto;background-color: white">
  58. <ul style="list-style-type:none" class="pl-0" >
  59. <li v-for="owner in owners" style="cursor: pointer;user-select:none;" :style="{'background-color':filterData.owners['_'+owner.id]?'#4aa0e6':''}"
  60. @dblclick="selectedOwner(owner.id)" class="text-left">@{{owner.name}}<hr class="m-0" style="width: 100%"></li>
  61. </ul>
  62. </span>
  63. <input hidden name="owners" :value="JSON.stringify(filterData.owners)">
  64. </div>
  65. </div>
  66. </td>
  67. <td ><div class="form-inline">
  68. <input type="date" name="created_at_start" style="width: 150px" class="form-control form-control-sm tooltipTarget" title="选择显示指定日期的起始时间"
  69. v-model="filterData.created_at_start" :class="filterData.created_at_start?'bg-warning':''">
  70. <input type="date" style="width: 150px" class="form-control form-control-sm tooltipTarget" name="created_at_end" title="选择显示指定日期的结束时间"
  71. v-model="filterData.created_at_end" :class="filterData.created_at_end?'bg-warning':''"></div>
  72. </td>
  73. <td >
  74. <input type="text" title="承运商单号:支持15内模糊搜索与15天外精确搜索" name="carrier_bill" placeholder="承运商单号"
  75. class="form-control form-control-sm tooltipTarget" v-model="filterData.carrier_bill" style="vertical-align: middle;max-width: 200px" :class="filterData.carrier_bill?'bg-warning':''">
  76. </td>
  77. <td >
  78. <select name="status" v-model="filterData.status" @change="setState" class="form-control form-control-sm tooltipTarget" style="vertical-align: middle;max-width: 100px" :class="filterData.status?'bg-warning':''">
  79. <option value="" class="text-secondary">运单状态</option>
  80. <option value="未审核" class="font-weight-bold">未审核</option>
  81. <option value="已审核" class="font-weight-bold">待调度</option>
  82. <option value="待终审" class="font-weight-bold">待终审</option>
  83. <option value="已完结" class="font-weight-bold">已完结</option>
  84. </select>
  85. </td>
  86. <td></td>
  87. </tr>
  88. <tr>
  89. <td style="width: 300px">
  90. <input type="text" title="WMS单号:支持15内模糊搜索与15天外精确搜索" name="wms_bill_number" placeholder="WMS单号"
  91. class="form-control form-control-sm tooltipTarget" v-model="filterData.wms_bill_number" style="vertical-align: middle;max-width: 200px" :class="filterData.wms_bill_number?'bg-warning':''"></td>
  92. <td style="width: 350px"><div class="form-inline">
  93. <input type="text" title="始发地:支持15内模糊搜索与15天外精确搜索" name="origination" placeholder="始发地"
  94. class="form-control form-control-sm tooltipTarget" v-model="filterData.origination" style="vertical-align: middle;width: 150px" :class="filterData.origination?'bg-warning':''">
  95. <input type="text" title="目的地:支持15内模糊搜索与15天外精确搜索" style="vertical-align: middle;width: 150px" placeholder="目的地"
  96. name="destination" class="form-control form-control-sm tooltipTarget" v-model="filterData.destination" :class="filterData.destination?'bg-warning':''"></div></td>
  97. <td style="width: 280px">
  98. <input type="text" title="运单号:支持15内模糊搜索与15天外精确搜索" name="waybill_number" placeholder="运单号"
  99. class="form-control form-control-sm tooltipTarget" v-model="filterData.waybill_number" style="vertical-align: middle;max-width: 200px" :class="filterData.waybill_number?'bg-warning':''">
  100. </td>
  101. <td>
  102. <div class="form-inline">
  103. <select name="carrier_id" v-model="filterData.carrier_id" class="form-control form-control-sm tooltipTarget" @change="setCarrier" style="vertical-align: middle;width: 100px" :class="filterData.carrier_id?'bg-warning':''">
  104. <option value="" class="text-secondary">承运商 </option>
  105. @foreach($carriers as $carrier)
  106. <option value="{{$carrier->id}}" class="font-weight-bold">{{$carrier->name}}</option>
  107. @endforeach
  108. </select>
  109. <button type="submit" class="btn btn-sm btn-outline-dark w-25 ml-5">按条件搜索</button>
  110. </div>
  111. </td>
  112. <td></td>
  113. </tr>
  114. <tr>
  115. <td colspan="6">
  116. <span class="dropdown">
  117. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
  118. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  119. 导出Excel
  120. </button>
  121. <div class="dropdown-menu">
  122. <a class="dropdown-item" @click="waybillExport(1)" href="javascript:">导出勾选内容</a>
  123. <a class="dropdown-item" @click="waybillExport(2)" href="javascript:">导出所有页</a>
  124. </div>
  125. </span>
  126. </td>
  127. </tr>
  128. </table>
  129. </form>
  130. <div>
  131. @if(Session::has('successTip'))
  132. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  133. @endif
  134. </div>
  135. <table class="table table-striped table-sm table-bordered table-hover text-nowrap waybill-table" style="background: #fff;">
  136. <tr>
  137. <th class="table-header-layer-1" :colspan="elementCount('th.td-operation')"></th>
  138. <th class="table-header-layer-1" :colspan="elementCount('th.td-warm')"><span class="fa fa-file-text-o"></span> 运单信息</th>
  139. <th class="table-header-layer-1" :colspan="elementCount('th.td-cool')"><span class="fa fa-truck"></span> 运输信息</th>
  140. <th class="table-header-layer-1" :colspan="elementCount('th.td-helpful')"><span class="fa fa-rmb"></span> 费用信息
  141. @can('运输管理-删除')
  142. <th class="table-header-layer-1" :colspan="elementCount('th.td-delete')"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
  143. @endcan
  144. </tr>
  145. <tr>
  146. <th class="td-operation">
  147. <label for="all">
  148. <input id="all" type="checkbox" @click="checkAll($event)">
  149. </label>
  150. </th>
  151. @can('运输管理-编辑','运输管理-运单审核','运输管理-调度','运输管理-编辑')
  152. <th class="td-operation">操作</th>
  153. @endcan
  154. <th class="td-operation">置顶</th>
  155. <th class="td-operation">状态</th>
  156. <th class="td-warm">ID</th>
  157. <th class="td-warm">创建时间</th>
  158. <th class="td-warm">运单类型</th>
  159. <th class="td-warm">货主</th>
  160. <th class="td-warm">上游单号</th>
  161. <th class="td-warm">WMS订单号</th>
  162. <th class="td-warm">运单号</th>
  163. <th class="td-warm">运输收费</th>
  164. <th class="td-warm">其他收费</th>
  165. <th class="td-warm">其他收费备注</th>
  166. @can('运输管理-图片上传')<th class="td-warm">照片</th>@endcan
  167. <th class="td-cool">收件人</th>
  168. <th class="td-cool">收件人电话</th>
  169. <th class="td-cool">始发地</th>
  170. <th class="td-cool">目的地</th>
  171. <th class="td-cool">承运商</th>
  172. <th class="td-cool">单号/车型</th>
  173. <th class="td-cool">仓库计抛</th>
  174. <th class="td-cool">承运商计抛</th>
  175. <th class="td-cool">仓库计重</th>
  176. <th class="td-cool">承运商计重</th>
  177. <th class="td-cool">计件</th>
  178. <th class="td-cool">里程</th>
  179. @can('运输管理-运费')
  180. <th class="td-helpful">运费</th>
  181. @endcan
  182. <th class="td-helpful">提货费</th>
  183. <th class="td-helpful">其他支出</th>
  184. <th class="td-helpful">发货时间</th>
  185. <th class="td-helpful">调度备注</th>
  186. @can('运输管理-删除')
  187. <th class="td-delete">操作</th>
  188. @endcan
  189. {{-- <th>WMS单号</th>--}}
  190. {{-- <th>收件人</th>--}}
  191. {{-- <th>收件人电话</th>--}}
  192. {{-- <th>收费(元)</th>--}}
  193. {{-- <th>到付金额(元)</th>--}}
  194. {{-- <th>下单备注</th>--}}
  195. {{-- <th>运单审核人</th>--}}
  196. {{-- <th>商品列表</th>--}}
  197. {{-- <th>始发市</th>--}}
  198. {{-- <th>目的市</th>--}}
  199. {{-- <th>车辆信息</th>--}}
  200. {{-- <th>调度审核人</th>--}}
  201. </tr>
  202. <tr v-for="waybill in waybills" :style="[{color:waybill.status=='待重审'?'red':''||waybill.status=='已完结'?'green':''},{'font-weight': waybill.id==selectedStyle?'bold':''}]"
  203. :id="'waybill'+waybill.id" @click="selectedColor(waybill.id)" position="static" v-on:mouseover="hidetop($event)" v-on:mouseleave="showtop($event)">
  204. <td>
  205. <input class="checkItem" type="checkbox" :value="waybill.id" v-model="checkData">
  206. </td>
  207. <td>
  208. <span v-if=waybill.status==="未审核"||waybill.status==="待重审">
  209. @can('运输管理-运单审核')
  210. <button class="btn btn-outline-primary btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>
  211. @endcan
  212. @can('运输管理-编辑')
  213. <button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>
  214. @endcan
  215. </span>
  216. <span v-if=waybill.status==="已审核">
  217. @can('运输管理-调度')
  218. <button class="btn btn-outline-secondary btn-sm" @click="waybillRetreatAudit(waybill.id,waybill.waybill_number)">取消审核</button>
  219. <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">调度</button>
  220. @endcan
  221. </span>
  222. <span v-if=waybill.status==="待终审">
  223. @can('运输管理-调度审核')
  224. <button class="btn btn-outline-success btn-sm" @click="waybillEndAudit(waybill.id,waybill.waybill_number)">完结</button>
  225. @endcan
  226. @can('运输管理-调度')
  227. <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">改调度</button>
  228. @endcan
  229. </span>
  230. </td>
  231. @can('运输管理-置顶')
  232. <td class="td-warm text-muted" v-if="waybill.remark" style="height: 55px">
  233. <button type="button" class="btn btn-sm btn-outline-danger " @click="cancelOnTop($event)" :data_id="waybill.id" style="opacity: 0.75">取消</button>
  234. </td>
  235. <td v-else>
  236. <button type="button" class="btn btn-sm btn-outline-secondary" @click="waybillOnTop($event)" :data_id="waybill.id" style="opacity: 0.75">置顶</button>
  237. </td>
  238. @endcan
  239. <td :class="[waybill.status=='已审核'?'text-success':'']">@{{waybill.status}}</td>
  240. <td class="td-warm text-muted toptd" >
  241. <div v-if="waybill.remark" class="bg-light-yellow text-danger top" data-toggle="tooltip" style="opacity: 0.1;position: absolute;z-index: 1"
  242. >置顶备注:@{{ waybill.remark }}</div>
  243. @{{waybill.id}}</td>
  244. <td class="td-warm text-muted">@{{waybill.created_at}}</td>
  245. <td class="td-warm">@{{waybill.type}} <span class="badge badge-sm bg-warning" v-if="waybill.collect_fee">到付</span></td>
  246. <td class="td-warm">@{{waybill.owner}}</td>
  247. <td class="td-warm toptd" :title="waybill.remark? '置顶备注:'+waybill.remark :''">@{{waybill.source_bill}}</td>
  248. <td class="td-warm" >@{{waybill.wms_bill_number}}</td>
  249. <td class="td-warm">@{{waybill.waybill_number}}</td>
  250. <td class="td-warm">@{{waybill.charge}}</td>
  251. <td class="td-warm">@{{waybill.other_charge}}</td>
  252. <td class="td-warm">@{{waybill.other_charge_remark}}</td>
  253. <td class="td-warm">
  254. <div align="center" @mouseleave="removeCommonImg('common_img_'+waybill.id)" @mouseenter="commonImg('img_'+waybill.id,waybill.url,waybill.suffix)">
  255. <img v-if="waybill.url" :id="'img_'+waybill.id" :data-src="waybill.url+'-thumbnail.'+waybill.suffix" src="{{url('icon/img404-thumbnail.jpg')}}">
  256. @can('运输管理-图片上传')<div v-if="!waybill.url">
  257. <input class="btn btn-sm btn-outline-secondary" type="button" @click="certiimg(waybill.waybill_number)" value="上传照片 "/>
  258. <input type="file" @change="submitFile($event,waybill.waybill_number)" :id="waybill.waybill_number"
  259. style="display: none" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"/>
  260. </div>@endcan
  261. </div>
  262. </td>
  263. <td class="td-cool">@{{waybill.recipient}}</td>
  264. <td class="td-cool">@{{waybill.recipient_mobile}}</td>
  265. <td class="td-cool text-muted">@{{waybill.origination}}</td>
  266. <td class="td-cool text-muted">@{{waybill.destination}}</td>
  267. <td class="td-cool">@{{waybill.carrier}}</td>
  268. <td class="td-cool"><span v-if="waybill.type==='专线'">@{{waybill.carrier_bill}}</span>
  269. <span v-if="waybill.type==='直发车'">
  270. <span v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span></span></td>
  271. <td class="td-cool"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight|filterZero}} @{{waybill.warehouse_weight_unit}}</span></td>
  272. <td class="td-cool"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight|filterZero}} @{{waybill.carrier_weight_unit}}</span></td>
  273. <td class="td-cool"><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other|filterZero}} @{{waybill.warehouse_weight_unit_other}}</span></td>
  274. <td class="td-cool"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other|filterZero}} @{{waybill.carrier_weight_unit_other}}</span></td>
  275. <td class="td-cool"><span v-if="waybill.amount">@{{waybill.amount}} @{{waybill.amount_unit_name }}</span></td>
  276. <td class="td-cool">@{{waybill.mileage|km}} </td>
  277. @can('运输管理-可见费用项')
  278. {{--zengjun start--}}
  279. @can('运输管理-运费')
  280. {{-- <td class="td-helpful" v-if="waybill.type==='专线'">--}}
  281. {{-- </td>--}}
  282. {{-- <td class="td-helpful" v-else-if="waybill.type==='直发车'">--}}
  283. {{-- <span v-if="waybill.fee" class="btn-sm btn-outline-secondary btn" @click="waybillFeeCheck($event)" :data_id="waybill.id">@{{waybill.fee}}</span>--}}
  284. {{-- <input type="number" class="form-control form-control-sm" @blur="updateWaybillFee($event)" v-model="waybill.fee" :data_id="waybill.id" style="min-width:85px;display: none">--}}
  285. {{-- <input v-else type="number" class="form-control form-control-sm">--}}
  286. {{-- </td>--}}
  287. <td class="td-helpful" v-if="waybill.fee">
  288. <span v-if="waybill.type==='专线'"></span>
  289. <span v-else-if="waybill.fee" class="btn-sm btn-outline-secondary btn" @click="waybillFeeCheck($event)" :data_id="waybill.id">@{{waybill.fee|money}}</span>
  290. <input type="number" class="form-control form-control-sm" @blur="updateWaybillFee($event)" :value="waybill.fee" :data_id="waybill.id" style="min-width:85px;display: none">
  291. </td>
  292. <td class="td-helpful" v-else>
  293. <span v-if="waybill.type==='专线'"></span>
  294. <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillFee($event)" onfocus="$(this).css('width','85px')" :value="waybill.fee" :data_id="waybill.id" >
  295. </td>
  296. @endcan
  297. {{--zengjun end--}}
  298. <td class="td-helpful">@{{waybill.pick_up_fee}}</td>
  299. <td class="td-helpful">@{{waybill.other_fee}}</td>
  300. @endcan
  301. <td class="td-helpful">@{{waybill.deliver_at}}</td>
  302. <td class="td-helpful">@{{waybill.dispatch_remark}}</td>
  303. @can('运输管理-删除')
  304. <td class="td-operation">
  305. <button type="button" class="btn btn-outline-danger btn-sm" @click="waybillDestroy(waybill.id,waybill.waybill_number)">删</button>
  306. </td>
  307. @endcan
  308. {{-- <td>@{{waybill.wms_bill_number}}</td>--}}
  309. {{-- <td>@{{waybill.recipient}}</td>--}}
  310. {{-- <td>@{{waybill.recipient_mobile}}</td>--}}
  311. {{-- <td>@{{waybill.charge}}</td>--}}
  312. {{-- <td>@{{waybill.collect_fee}}</td>--}}
  313. {{-- <td>@{{waybill.ordering_remark}}</td>--}}
  314. {{-- <td><span v-for="waybillAuditLog in waybill.waybillAuditLogs" v-if=waybillAuditLog.audit_stage==="运单阶段">@{{waybillAuditLog.user.name}}</span></td>--}}
  315. {{-- <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)">--}}
  316. {{-- 该单有 @{{waybill.wmsCommodities.length}} 件商品,点击展开</u>--}}
  317. {{-- <u style="user-select: none;cursor:pointer" class="text-secondary" v-if="waybill.isBtn" @click="showWMSCommodities(waybill.id,waybill.wmsCommodities,waybill.isBtn)">--}}
  318. {{-- 该单有 @{{waybill.wmsCommodities.length}} 件商品,点击收起</u>--}}
  319. {{-- </td>--}}
  320. {{-- <td>--}}
  321. {{-- <div v-if=waybill.status==="未审核"||waybill.status==="待重审">--}}
  322. {{-- @can('运输管理-运单审核')--}}
  323. {{-- <button class="btn btn-outline-success btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>--}}
  324. {{-- @endcan--}}
  325. {{-- @can('运输管理-编辑')--}}
  326. {{-- <button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>--}}
  327. {{-- @endcan--}}
  328. {{-- </div>--}}
  329. {{-- <div v-if=waybill.status==="已审核">--}}
  330. {{-- @can('运输管理-调度')--}}
  331. {{-- <button class="btn btn-outline-secondary btn-sm" @click="waybillRetreatAudit(waybill.id,waybill.waybill_number)">取消审核</button>--}}
  332. {{-- <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">调度</button>--}}
  333. {{-- @endcan--}}
  334. {{-- </div>--}}
  335. {{-- <div v-if=waybill.status==="待终审">--}}
  336. {{-- @can('运输管理-调度审核')--}}
  337. {{-- <button class="btn btn-outline-success btn-sm" @click="waybillEndAudit(waybill.id,waybill.waybill_number)">完结</button>--}}
  338. {{-- @endcan--}}
  339. {{-- @can('运输管理-调度')--}}
  340. {{-- <button class="btn btn-outline-secondary btn-sm" @click="job(waybill.id)">改调度</button>--}}
  341. {{-- @endcan--}}
  342. {{-- </div>--}}
  343. {{-- </td>--}}
  344. {{-- <td>@{{waybill.origination_city}}</td>--}}
  345. {{-- <td>@{{waybill.destination_city}}</td>--}}
  346. {{-- <td>@{{waybill.car_owner_info}}</td>--}}
  347. {{-- <td><span v-for="waybillAuditLog in waybill.waybillAuditLogs" v-if=waybillAuditLog.audit_stage==="调度阶段">@{{waybillAuditLog.user.name}}</span></td>--}}
  348. </tr>
  349. {{-- <tr v-show="wmsCommodities&&wmsCommodities.length>0" id="wmsCommodities">--}}
  350. {{-- <td colspan="15"></td>--}}
  351. {{-- <td colspan="15">--}}
  352. {{-- <table>--}}
  353. {{-- <tr style="background: #9fcdff">--}}
  354. {{-- <th>商品名称</th>--}}
  355. {{-- <th>商品编码</th>--}}
  356. {{-- <th>条码</th>--}}
  357. {{-- <th>数量</th>--}}
  358. {{-- <th>体称</th>--}}
  359. {{-- <th>毛重</th>--}}
  360. {{-- <th>净重</th>--}}
  361. {{-- </tr>--}}
  362. {{-- <tr v-for="wmsCommodity in wmsCommodities">--}}
  363. {{-- <td>@{{ wmsCommodity.SKU_Descr_c }}</td>--}}
  364. {{-- <td>@{{ wmsCommodity.SKU }}</td>--}}
  365. {{-- <td>@{{ wmsCommodity.Alternate_sku1 }}</td>--}}
  366. {{-- <td>@{{ wmsCommodity.Qtyordered_each }}</td>--}}
  367. {{-- <td>@{{ wmsCommodity.Cubic }}</td>--}}
  368. {{-- <td>@{{ wmsCommodity.GrossWeight }}</td>--}}
  369. {{-- <td>@{{ wmsCommodity.NetWeight }}</td>--}}
  370. {{-- </tr>--}}
  371. {{-- </table>--}}
  372. {{-- </td>--}}
  373. {{-- </tr>--}}
  374. </table>
  375. <div class="modal fade " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  376. <div class="modal-dialog modal-dialog-centered">
  377. <div class="modal-content">
  378. <div class="modal-header">
  379. <h5 class="modal-title" id="exampleModalLabel">请输入置顶备注</h5>
  380. <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="changeRemark">
  381. <span aria-hidden="true">&times;</span>
  382. </button>
  383. </div>
  384. <div class="modal-body">
  385. <input type="hidden" class="form-control" id="onTopId">
  386. <textarea type="text" class="form-control" required id="remark" @change="changeRemark" ></textarea>
  387. <div class="invalid-feedback">
  388. 备注信息不能为空
  389. </div>
  390. </div>
  391. <div class="modal-footer">
  392. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" @click="changeRemark" >关闭</button>
  393. <button type="button" class="btn btn-sm btn-primary" @click="submitOnTop">提交</button>
  394. </div>
  395. </div>
  396. </div>
  397. </div>
  398. <div class="text-info h5 btn btn">{{$waybills->count()}}/{{$waybills->total()}}</div>
  399. {{$waybills->appends($filterData)->links()}}
  400. </div>
  401. </div>
  402. @endsection
  403. @section('lastScript')
  404. <style type="text/css">
  405. @keyframes anima
  406. {
  407. from {
  408. opacity:0.1;
  409. }
  410. to{
  411. opacity:1;
  412. }
  413. }
  414. @-webkit-keyframes anima
  415. {
  416. from {
  417. opacity:0.75;
  418. }
  419. to{
  420. opacity:0.1;
  421. }
  422. }
  423. .bg-light-yellow{
  424. background: #fffff8;
  425. }
  426. .top{
  427. padding-top: 0px;
  428. padding-left: 10px;
  429. margin-top: -4px;
  430. margin-left: -5px;
  431. line-height: 55px;
  432. position: absolute;
  433. animation: anima;
  434. animation-duration: 3s;
  435. animation-timing-function: cubic-bezier(0,0,1,1);
  436. animation-direction: alternate;
  437. animation-play-state: running;
  438. -webkit-animation-name: anima;
  439. -webkit-animation-duration: 3s;
  440. -webkit-animation-timing-function: cubic-bezier(0,0,1,1);
  441. -webkit-animation-iteration-count: infinite;
  442. -webkit-animation-direction: alternate;
  443. -webkit-animation-play-state: running;
  444. }
  445. .imgBtn{
  446. }
  447. </style>
  448. <script>
  449. let vueList=new Vue({
  450. el:'#list',
  451. data:{
  452. waybills:[
  453. @foreach($waybills as $waybill)
  454. {
  455. id:'{{$waybill->id}}',created_at:'{{$waybill->created_at}}',updated_at:'{{$waybill->updated_at}}',url:'{{$waybill->upload_file_url}}',suffix:'{{$waybill->upload_file_type}}',
  456. status:'{{$waybill->status}}',type:'{{$waybill->type}}',waybill_number:'{{$waybill->waybill_number}}',
  457. owner:'{{$waybill->owner_name}}',source_bill:'{{$waybill->source_bill}}',wms_bill_number:'{{$waybill->wms_bill_number}}',origination:'{{$waybill->origination}}',
  458. destination:'{{$waybill->destination}}',recipient:'{{$waybill->recipient}}',recipient_mobile:'{{$waybill->recipient_mobile}}',
  459. charge:'{{$waybill->charge}}',ordering_remark:'{{$waybill->ordering_remark}}',carrier:'{{$waybill->carrier_name}}',
  460. carrier_bill:'{{$waybill->carrier_bill}}',origination_city:'{{$waybill->origination_city_name}}',
  461. destination_city:'{{$waybill->destination_city_name}}',warehouse_weight:'{{$waybill->warehouse_weight}}',
  462. destination_province_name:'{{$waybill->destination_province_name}}',
  463. warehouse_weight_unit:'{{$waybill->warehouse_weight_unit_name}}',carrier_weight:'{{$waybill->carrier_weight}}',
  464. carrier_weight_unit:'{{$waybill->carrier_weight_unit_name}}',
  465. warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
  466. warehouse_weight_unit_other:'{{$waybill->warehouse_weight_unit_other_name}}',carrier_weight_other:'{{$waybill->carrier_weight_other}}',
  467. carrier_weight_unit_other:'{{$waybill->carrier_weight_unit_other_name}}',
  468. amount_unit_name:'{{$waybill->amount_unit_name}}',other_charge:'{{$waybill->other_charge}}',other_charge_remark:'{{$waybill->other_charge_remark}}',
  469. mileage:'{{$waybill->mileage}}',amount:'{{$waybill->amount}}',
  470. @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif @can('运输管理-可见费用项') fee:'{{$waybill->fee}}',
  471. pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
  472. collect_fee:'{{$waybill->collect_fee}}', @endcan deliver_at:'{{$waybill->deliver_at}}',dispatch_remark:'{{$waybill->dispatch_remark}}',isBtn:false,
  473. waybillAuditLogs:{!! $waybill->waybillAuditLogs !!},
  474. @if($waybill->remark)remark:'{{$waybill->remark}}', @else remark:'', @endif
  475. },
  476. @endforeach
  477. ],
  478. checkData:[],
  479. filterData:
  480. {paginate:'50',waybill_number:''
  481. ,carrier_bill:'',carrier_id:''
  482. ,owner_id:'',wms_bill_number:''
  483. ,created_at_start:'',created_at_end:'',uriType:''
  484. ,type:'',status:'',origination:'',destination:'',owners:{}},
  485. wmsCommodities:[],
  486. selectedStyle:[],
  487. owners:[
  488. @foreach($owners as $owner)
  489. {!! $owner !!},
  490. @endforeach
  491. ],
  492. isOut:false,
  493. isBlur:false,
  494. isOwnersBtn:false,
  495. imgs:'',
  496. is_ownerSelectShow:true,
  497. },
  498. computed:{
  499. isBeingFilterConditions:function(){
  500. for(let key in this.filterData){
  501. if(this.filterData[key]){
  502. if(key==='paginate')continue;
  503. if (key==='owners' && Object.keys(this.filterData.owners).length<1)continue;
  504. return true
  505. }
  506. }
  507. return false;
  508. },
  509. },
  510. watch:{
  511. checkData:{
  512. handler(){
  513. if (this.checkData.length === this.waybills.length){
  514. document.querySelector('#all').checked = true;
  515. }else {
  516. document.querySelector('#all').checked = false;
  517. }
  518. },
  519. deep:true
  520. },
  521. },
  522. mounted:function(){
  523. this.initInputs();
  524. $(".tooltipTarget").tooltip({'trigger':'hover'});
  525. $('#list').removeClass('d-none');
  526. let waybill = $('.table-header-layer-1')[1];
  527. $('.top').css('min-width', waybill.scrollWidth);
  528. this.imgs=Array.from(document.getElementById('list').querySelectorAll('img'));
  529. this.lazy();
  530. if (this.imgs&&this.imgs.length>0){
  531. window.addEventListener('scroll',this.lazy)
  532. }
  533. },
  534. methods:{
  535. lazy(){
  536. //可视区域高度
  537. let height=window.innerHeight;
  538. //滚动区域高度
  539. let scrollHeight = document.documentElement.scrollTop || document.body.scrollTop;
  540. let _this=this;
  541. this.imgs.forEach(function (img,i) {
  542. if ((height+scrollHeight)>$('#'+img.getAttribute('id')).offset().top && img.getAttribute('data-src')){
  543. let temp=new Image();
  544. temp.src=img.getAttribute('data-src');
  545. temp.onload=function () {
  546. img.src=img.getAttribute('data-src');
  547. _this.$delete(_this.imgs,i);
  548. }
  549. }
  550. });
  551. },
  552. initInputs:function(){
  553. let data=this;
  554. let uriParts =decodeURI(location.href).split("?");
  555. if(uriParts.length>1){
  556. let params = uriParts[1].split('&');
  557. params.forEach(function(paramPair){
  558. let pair=paramPair.split('=');
  559. let key = pair[0], val = pair[1];
  560. $('input[name="'+key+'"]').val(val);
  561. $('select[name="'+key+'"]').val(val);
  562. decodeURI(data.filterData[key]=val);
  563. if (key==='owners')
  564. data.filterData['owners']=JSON.parse( unescape(val) );
  565. });
  566. }
  567. },
  568. waybillAudit(id,waybill_number){
  569. if(!confirm('确定要通过“'+waybill_number+'”的审核吗?')){return};
  570. let _this=this;
  571. let w;
  572. let url = '{{url('waybill/waybillAudit')}}';
  573. axios.post(url, {id:id})
  574. .then(
  575. function (response) {
  576. if (response.data.success){
  577. _this.waybills.forEach(function (waybill) {
  578. if (waybill.id===id){
  579. waybill.status=response.data.status;
  580. waybill.waybillAuditLogs.push(response.data.waybillAuditLog);
  581. w=waybill.waybill_number;
  582. }
  583. });
  584. tempTip.setDuration(3000);
  585. tempTip.showSuccess('审核'+w+'成功!');
  586. }else if (response.data.exception!=null){
  587. tempTip.setDuration(3000);
  588. tempTip.show(response.data.exception);
  589. }else {
  590. tempTip.setDuration(3000);
  591. tempTip.show('审核失败!');
  592. }
  593. }
  594. ).catch(function (err) {
  595. tempTip.setDuration(3000);
  596. tempTip.show('审核失败,网络连接错误!'+err);
  597. });
  598. },
  599. waybillUpdate(id){
  600. location.href="{{url('waybill/waybillEdit')}}/"+id;
  601. },
  602. // 软删除
  603. waybillDestroy(id,waybill_number){
  604. if(!confirm('确定要删除运单号为:“'+waybill_number+'”的运单吗?')){return};
  605. let _this = this;
  606. let url = '{{url('waybill')}}/'+id;
  607. axios.delete(url).then(
  608. function (response) {
  609. if(!response.data.success){
  610. tempTip.setDuration(3000);
  611. tempTip.show('运单:'+waybill_number+'删除失败!');
  612. }else {
  613. tempTip.setDuration(3000);
  614. tempTip.showSuccess('运单:'+waybill_number+'删除成功!');
  615. setInterval(function () {
  616. window.location.reload();
  617. form.submit();
  618. },1000)
  619. }
  620. }
  621. ).catch(function (err) {
  622. tempTip.setDuration(3000);
  623. tempTip.show('删除失败,网络链接错误!'+err);
  624. });
  625. },
  626. waybillRetreatAudit(id,waybill_number){
  627. if(!confirm('确定要驳回“'+waybill_number+'”的审核吗?')){return};
  628. let _this=this;
  629. let w;
  630. let url='{{url('files')}}';
  631. axios.post(url,{id:id})
  632. .then(
  633. function (response) {
  634. if (response.data.success){
  635. _this.waybills.forEach(function (waybill){
  636. if (waybill.id===id){
  637. waybill.status=response.data.status;
  638. waybill.waybillAuditLogs=[];
  639. w=waybill.waybill_number;
  640. }
  641. });
  642. tempTip.setDuration(3000);
  643. tempTip.showSuccess(w+'审核驳回成功!');
  644. }else {
  645. tempTip.setDuration(3000);
  646. tempTip.show('审核驳回失败!');
  647. }
  648. }
  649. ).catch(function (err) {
  650. tempTip.setDuration(3000);
  651. tempTip.show('审核驳回失败,网络连接错误!'+err);
  652. });
  653. },
  654. job(id){
  655. location.href="{{url('waybill')}}/"+id+"/edit";
  656. },
  657. waybillEndAudit(id,waybill_number){
  658. if(!confirm('确定要通过“'+waybill_number+'”的终审吗?')){return};
  659. let _this=this;
  660. let w;
  661. let url='{{url('waybill/waybillEndAudit')}}';
  662. axios.post(url, {id:id})
  663. .then(
  664. function (response) {
  665. if (response.data.success){
  666. _this.waybills.forEach(function (s) {
  667. if (s.id===id){
  668. s.status=response.data.status;
  669. s.waybillAuditLogs.push(response.data.waybillAuditLog);
  670. w=s.waybill_number;
  671. }
  672. });
  673. tempTip.setDuration(3000);
  674. tempTip.showSuccess(w+'终审完毕!');
  675. }else if (response.data.exception!=null){
  676. tempTip.setDuration(3000);
  677. tempTip.show(response.data.exception);
  678. }else {
  679. tempTip.setDuration(3000);
  680. tempTip.show('终审失败!');
  681. }
  682. }
  683. ).catch(function (err) {
  684. tempTip.setDuration(3000);
  685. tempTip.show('终审失败,网络连接错误!'+err);
  686. });
  687. },
  688. setPaginate:function(e){
  689. this.filterData.paginate=e.target.value;
  690. var form = document.getElementById("optionSubmit");
  691. form.submit();
  692. },
  693. setCarrier:function (e){
  694. this.filterData.carrier_id=e.target.value;
  695. var form = document.getElementById("optionSubmit");
  696. form.submit();
  697. },
  698. setOwner:function (e) {
  699. this.filterData.owner_id=e.target.value;
  700. var form = document.getElementById("optionSubmit");
  701. form.submit();
  702. },
  703. setType:function (e) {
  704. this.filterData.type=e.target.value;
  705. var form = document.getElementById("optionSubmit");
  706. form.submit();
  707. },
  708. setState:function (e) {
  709. this.filterData.status=e.target.value;
  710. var form = document.getElementById("optionSubmit");
  711. form.submit();
  712. },
  713. checkAll(e){
  714. if (e.target.checked){
  715. this.waybills.forEach((el,i)=>{
  716. if (this.checkData.indexOf(el.id) == '-1'){
  717. this.checkData.push(el.id);
  718. }
  719. });
  720. }else {
  721. this.checkData = [];
  722. }
  723. },
  724. waybillExport(e){
  725. let val=e;
  726. let data=this.filterData;
  727. if (val==1) {
  728. if (this.checkData.length <= 0) {
  729. tempTip.setDuration(2000);
  730. tempTip.showSuccess('没有勾选任何记录');
  731. } else {
  732. location.href = "{{url('waybillExport')}}/" + this.checkData;
  733. }
  734. }else {
  735. location.href = "{{url('waybillExport/-1?waybill_number=')}}"+
  736. data.waybill_number+"&carrier_bill="+data.carrier_bill+
  737. "&carrier_id="+data.carrier_id+"&owner_id="+data.owner_id+
  738. "&wms_bill_number="+data.wms_bill_number+"&created_at_start="+
  739. data.created_at_start+"&created_at_end="+data.created_at_end+
  740. "&type="+data.type+"&status="+data.status+"&origination="+data.origination+
  741. "&destination="+data.destination;
  742. }
  743. },
  744. //展开收起商品列表
  745. showWMSCommodities(id,wmsCommodities,isBtn){
  746. if (!isBtn){
  747. this.wmsCommodities=wmsCommodities;
  748. $("#waybill"+id).after($("#wmsCommodities"));
  749. this.waybills.forEach(function (waybill) {
  750. if (waybill.id!==id&&waybill.isBtn){
  751. waybill.isBtn=false;
  752. }
  753. if (waybill.id===id){
  754. waybill.isBtn=true;
  755. }
  756. });
  757. return;
  758. }
  759. if (isBtn){
  760. this.wmsCommodities=[];
  761. this.waybills.every(function (waybill) {
  762. if (waybill.id===id){
  763. waybill.isBtn=false;
  764. return false;
  765. }
  766. return true;
  767. });
  768. }
  769. },
  770. selectedColor(id){
  771. if (id==this.selectedStyle){
  772. this.selectedStyle='';
  773. return;
  774. }
  775. this.selectedStyle=id;
  776. },
  777. elementCount:function(elementName){
  778. return $(elementName).length;
  779. },
  780. //多货主查询
  781. selectedOwner:function (id) {
  782. if (this.filterData.owners['_'+id]) this.$delete(this.filterData.owners,'_'+id);
  783. else this.$set(this.filterData.owners,'_'+id,id);
  784. if (Object.keys(this.filterData.owners).length===1){
  785. this.filterData.owner_id=id;
  786. if (!this.is_ownerSelectShow)this.is_ownerSelectShow=true;
  787. }
  788. if (Object.keys(this.filterData.owners).length<1) {
  789. this.filterData.owner_id='';
  790. if (!this.is_ownerSelectShow)this.is_ownerSelectShow=true;
  791. }
  792. if (Object.keys(this.filterData.owners).length>1) {
  793. this.filterData.owner_id='';
  794. if (this.is_ownerSelectShow)this.is_ownerSelectShow=false;
  795. }
  796. },
  797. owner_seek:function (e) {
  798. let val=e.target.value;
  799. if (this.owners.length<1)return;
  800. let _this=this;
  801. let ownerTemp=_this.owners[0];
  802. this.owners.every(function (owner,i) {
  803. if (owner.name.includes(val)){
  804. if (i===0)return ;
  805. _this.$set(_this.owners,0,owner);
  806. _this.$set(_this.owners,i,ownerTemp);
  807. return false;
  808. }
  809. return true;
  810. });
  811. },
  812. mouseleaveOwner:function () {
  813. if(!this.isOut&&!this.isBlur){
  814. this.isOwnersBtn=false;
  815. }
  816. },
  817. blurOwner:function () {
  818. if (!this.isOut&&!this.isBlur){
  819. this.isOwnersBtn=false;
  820. }
  821. },
  822. certiimg(waybill_number){
  823. $('#'+waybill_number).click();
  824. },
  825. submitFile(e,waybill_number){
  826. let file=e.target.files[0];
  827. if (file.size >=5242880){
  828. tempTip.setDuration(3000);
  829. tempTip.show("图片大小不能超过5MB!");
  830. return;
  831. }
  832. let _this=this;
  833. let formData=new FormData();
  834. formData.append("file",file);
  835. formData.append("waybill_number",waybill_number);
  836. axios.post('{{url('waybill/upload')}}',formData)
  837. .then(function (response) {
  838. if (!response.data.success){
  839. tempTip.setDuration(4000);
  840. tempTip.show(response.data.error);
  841. return;
  842. }
  843. _this.waybills.some(function (waybill) {
  844. if (waybill.waybill_number===waybill_number){
  845. waybill.url=response.data.data.url;
  846. waybill.suffix=response.data.data.type;
  847. setTimeout(function () {
  848. _this.imgs.push(document.getElementById('img_'+waybill.id));
  849. _this.lazy();
  850. },1);
  851. tempTip.setDuration(3000);
  852. tempTip.showSuccess("上传成功!");
  853. return true;
  854. }
  855. });
  856. }).catch(function (err) {
  857. tempTip.setDuration(4000);
  858. tempTip.show("网络错误:"+err);
  859. })
  860. },
  861. commonImg(id,url,suffix){
  862. $('#'+id).after(
  863. "<div id=\"common_"+id+"\" style='position: absolute;padding-top: 2px;z-index: 99'>" +
  864. "<div style='position:absolute'>"+
  865. "<div >"+
  866. "<a target='_blank' href='"+url+'-bulky.'+suffix+"'>" +
  867. "<img src=\""+url+'-common.'+suffix+"\" style='position: relative;left:-50px;' >" +
  868. "</a>" +
  869. "</div>"+
  870. @can('运输管理-图片删除')"<button type='button' class='btn btn-sm btn-danger' onclick='vueList.btnDeleteImg(this)' value='"+id+"' style='position: relative;float: right;margin-right: 51px;margin-top: -30px;' >删除</button>" +@endcan
  871. "</div>"+
  872. "</div>");
  873. },
  874. removeCommonImg(id){
  875. $('#'+id).remove();
  876. },
  877. btnDeleteImg(e){
  878. let idstr = $(e).val();
  879. let id = idstr.substr( idstr.indexOf('_')+1);
  880. if (!confirm('确定要删除所选图片吗?'))return;
  881. this.destroyImg([id]);
  882. },
  883. deleteImg(){
  884. if (this.checkData.length <= 0) {
  885. tempTip.setDuration(2000);
  886. tempTip.showSuccess('没有勾选任何记录');
  887. return;
  888. }
  889. if (!confirm('确定要删除所选图片吗?'))return;
  890. this.destroyImg(this.checkData);
  891. },
  892. destroyImg(id){
  893. let _this = this;
  894. axios.post('{{url('waybill/deleteImg')}}',{'ids':id})
  895. .then(function (response) {
  896. if (!response.data.success){
  897. tempTip.setDuration(4000);
  898. tempTip.show("删除失败");
  899. return;
  900. }
  901. // _this.checkData.forEach(function (id) {
  902. // _this.waybills.some(function (waybill) {
  903. // if (waybill.id===id){
  904. // waybill.url='';
  905. // return true;
  906. // }
  907. // });
  908. // });
  909. id.forEach(function (id) {
  910. _this.waybills.some(function (waybill) {
  911. if (waybill.id===id){
  912. waybill.url='';
  913. return true;
  914. }
  915. });
  916. });
  917. tempTip.setDuration(3000);
  918. tempTip.showSuccess("删除成功!");
  919. }).catch(function (err) {
  920. tempTip.setDuration(4000);
  921. tempTip.show("网络错误:"+err);
  922. });
  923. },
  924. // 运费修改
  925. waybillFeeCheck:function (e) {
  926. let target = $(e.target);
  927. target.hide();
  928. let input = target.next();
  929. input.show();
  930. input.focus();
  931. },
  932. // 失焦事件
  933. updateWaybillFee:function (e) {
  934. let target = $(e.target);
  935. let _this = this;
  936. let span = target.prev();
  937. let id = target.attr('data_id');
  938. let oldFee = span.text();
  939. let fee = target.val();
  940. if(fee !== span.text()){
  941. let ajaxUrl= '{{url("apiLocal/waybill/changeFee")}}';
  942. axios.post(ajaxUrl,{'id':id,'fee':fee}).then(function (response) {
  943. if(response.data.success){
  944. _this.updateWaybills(id,fee);
  945. tempTip.setDuration(2000);
  946. tempTip.showSuccess('运单运费修改成功');
  947. }else{
  948. tempTip.setDuration(3000);
  949. tempTip.show('运单运费修改失败!'+response.data.fail_info);
  950. _this.updateWaybills(id,oldFee);
  951. }
  952. }).catch(function (err) {
  953. tempTip.setDuration(3000);
  954. tempTip.show('运单运费修改失败!网络异常:'+err);
  955. _this.updateWaybills(id,oldFee);
  956. });
  957. }
  958. span.show();
  959. target.hide();
  960. },
  961. // 为直发车运单添加运费
  962. addWaybillFee(e){
  963. let target = $(e.target);
  964. target.css('width','85px');
  965. let _this = this;
  966. let id = target.attr('data_id');
  967. let fee = target.val();
  968. let ajaxUrl= '{{url("apiLocal/waybill/changeFee")}}';
  969. if(fee === ''|| fee === null){
  970. target.css('width','75px');
  971. return;
  972. }else{
  973. axios.post(ajaxUrl,{'id':id,'fee':fee}).then(function (response) {
  974. if(response.data.success){
  975. tempTip.setDuration(2000);
  976. tempTip.showSuccess('运单运费添加成功');
  977. _this.updateWaybills(id,fee);
  978. }else{
  979. tempTip.setDuration(3000);
  980. tempTip.show('运单运费添加失败!'+response.data.fail_info);
  981. }
  982. }).catch(function (err) {
  983. tempTip.setDuration(3000);
  984. tempTip.show('运单运费添加失败!网络异常:'+response.data.fail_info);
  985. });
  986. target.css('width','75px');
  987. }
  988. },
  989. // 更新表格数据
  990. updateWaybills(id,newFee){
  991. this.waybills.some(function(waybill){
  992. if(waybill.id === id){
  993. waybill.fee = newFee;
  994. return true;
  995. }
  996. })
  997. },
  998. // 置顶操作
  999. waybillOnTop:function(e){
  1000. let target = $(e.target);
  1001. let id = target.attr('data_id');
  1002. $("#onTopId").val(id);
  1003. $('#exampleModal').modal('show');
  1004. },
  1005. submitOnTop:function(){
  1006. let ajaxUrl = '{{url('waybill/ontop/top')}}';
  1007. let remark = $("#remark").val();
  1008. let id = $("#onTopId").val();
  1009. if(remark === ''){
  1010. $("#remark").focus();
  1011. $('#remark').addClass('is-invalid');
  1012. }else{
  1013. axios.post(ajaxUrl,{'id':id,'detail':remark}).then(function (response) {
  1014. if(response.data.success){
  1015. tempTip.setDuration(3000);
  1016. tempTip.showSuccess('置顶成功');
  1017. $('#exampleModal').modal('hide');
  1018. setTimeout(function(){
  1019. window.location.reload();
  1020. }
  1021. ,1000);
  1022. }else{
  1023. tempTip.setDuration(3000);
  1024. tempTip.show('置顶失败!'+response.fail_info);
  1025. }
  1026. }).catch(function (err) {
  1027. tempTip.setDuration(3000);
  1028. tempTip.show('置顶失败,网络连接错误!'+err);
  1029. });
  1030. }
  1031. },
  1032. changeRemark:function(){
  1033. $('#remark').removeClass('is-invalid');
  1034. },
  1035. cancelOnTop:function (e) {
  1036. let target = $(e.target);
  1037. let id = target.attr('data_id');
  1038. let ajaxUrl='{{url('waybill/ontop/cancel')}}';
  1039. if(id !== null){
  1040. axios.post(ajaxUrl,{'id':id}).then(function (response) {
  1041. if(response.data.success){
  1042. tempTip.setDuration(30000);
  1043. tempTip.showSuccess('取消置顶成功');
  1044. setTimeout(function(){
  1045. window.location.reload();
  1046. }
  1047. ,1000);
  1048. }else{
  1049. tempTip.setDuration(3000);
  1050. tempTip.show('取消置顶失败!'+response.fail_info);
  1051. }
  1052. }).catch(function (err) {
  1053. tempTip.setDuration(3000);
  1054. tempTip.show('取消置顶失败,网络连接错误!'+err);
  1055. });
  1056. }
  1057. },
  1058. hidetop:function(e) {
  1059. let target = $(e.target);
  1060. let top = target.parent().find('.top');
  1061. let tip = target.parent().find('.toptd');
  1062. top.hide();
  1063. tip.tooltip('show');
  1064. },
  1065. showtop:function(e){
  1066. let target = $(e.target);
  1067. let top = target.parent().find('.top');
  1068. let tip = target.parent().find('.toptd');
  1069. top.show();
  1070. tip.tooltip('hide');
  1071. }
  1072. },
  1073. filters:{
  1074. km:function(value){
  1075. if(!value)return '';
  1076. return value + ' km';
  1077. },
  1078. money:function(value){
  1079. if(value.indexOf('.')>0){
  1080. return value
  1081. }
  1082. return value += '.00';
  1083. },
  1084. filterZero:function(value){
  1085. value=value.replace(/\.00$/,'');
  1086. value=value.replace(/(\.[1-9])0$/,'$1');
  1087. return value;
  1088. },
  1089. }
  1090. });
  1091. // modal 隐藏时修改 input 为空
  1092. $("#exampleModal").on('hide.bs.modal',function(e){
  1093. $('#remark').val('');
  1094. });
  1095. </script>
  1096. @endsection