index.blade.php 61 KB

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