index.blade.php 54 KB

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