forwarding.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. @extends('layouts.app')
  2. @section('content')
  3. @component('exit.index.menu')@endcomponent
  4. <div id="list" class="d-none">
  5. <form method="GET" action="{{url('exit/index/forwarding')}}" id="form">
  6. <table class="table table-sm table-bordered text-nowrap mb-0 ml-3">
  7. <tr v-if="isBeingFilterConditions">
  8. <td colspan="10">
  9. <div class="col" style="padding:0">
  10. <a href="{{url('exit/index/forwarding')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
  11. </div></td>
  12. </tr>
  13. <tr>
  14. <td style="width: 400px">
  15. <select name="paginate" v-model="filterData.paginate" class="tooltipTarget form-control-sm" style="vertical-align: middle" @change="submit">
  16. <option value="50">每页显示50行</option>
  17. <option value="100">每页显示100行</option>
  18. <option value="200">每页显示200行</option>
  19. <option value="500">每页显示500行</option>
  20. <option value="1000">每页显示1000行</option>
  21. </select></td>
  22. <td style="width: 400px">
  23. <input type="date" name="ordertime_start" class=" form-control-sm tooltipTarget" title="选择显示指定日期的起始时间"
  24. v-model="filterData.ordertime_start" :class="filterData.ordertime_start?'bg-warning':''">
  25. </td>
  26. <td style="width: 400px">
  27. <input type="date" class=" form-control-sm tooltipTarget" name="ordertime_end" title="选择显示指定日期的结束时间"
  28. v-model="filterData.ordertime_end" :class="filterData.ordertime_end?'bg-warning':''" >
  29. </td>
  30. <td colspan="7"></td>
  31. </tr>
  32. <tr>
  33. <td >
  34. <input type="text" class="form-control-sm tooltipTarget" placeholder="客户"
  35. style="width:70px" @input="owner_seek"
  36. title="输入关键词快速定位下拉列表,回车确定">
  37. <select name="customerid" v-model="filterData.customerid" @change="submit" style="max-width: 120px" class="form-control-sm tooltipTarget" title="选择要显示的客户" :class="filterData.customerid?'bg-warning':''">
  38. <option > </option>
  39. <option v-for="owner in owners" :value="owner.customerid" >@{{owner.descr_c}}</option>
  40. </select>
  41. </td>
  42. <td>
  43. <input name="soreference1" v-model="filterData.soreference1" class="form-control-sm tooltipTarget" placeholder="发运单号" :class="filterData.soreference1?'bg-warning':''">
  44. </td>
  45. <td >
  46. <input name="soreference5" title="可输出多快递单号" v-model="filterData.soreference5" class="form-control-sm tooltipTarget" placeholder="快递单号" :class="filterData.soreference5?'bg-warning':''">
  47. </td>
  48. <td colspan="7"><input hidden type="submit"></td>
  49. </tr>
  50. <tr>
  51. <td colspan="10">
  52. <span class="dropdown">
  53. <button type="button" class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
  54. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  55. 导出Excel
  56. </button>
  57. <div class="dropdown-menu">
  58. <a class="dropdown-item" @click="exitExport(1)" href="javascript:">导出勾选内容</a>
  59. <a class="dropdown-item" @click="exitExport(2)" href="javascript:">导出所有页</a>
  60. </div>
  61. </span>
  62. @can('出库管理-批量注释')<button @click="modal()" type="button" class="btn btn-sm ml-2 btn-outline-primary">批量注释</button>@endcan
  63. </td>
  64. </tr>
  65. </table>
  66. </form>
  67. <div class="modal fade " style="top: 20%" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  68. <div class="modal-dialog">
  69. <div class="modal-content">
  70. <div class="modal-header">
  71. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  72. </div>
  73. <div class="modal-body">
  74. <input class="form-control" v-model="content" placeholder="注释内容">
  75. </div>
  76. <div class="modal-footer">
  77. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  78. <button type="button" @click="batchComments()" class="btn btn-primary">提交批量注释</button>
  79. </div>
  80. </div><!-- /.modal-content -->
  81. </div><!-- /.modal -->
  82. </div>
  83. <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2 ml-3">
  84. <tr>
  85. <th>
  86. <label for="all">
  87. <input id="all" type="checkbox" @click="checkAll($event)">全选
  88. </label>
  89. </th>
  90. <th>序号</th>
  91. <th>编号</th>
  92. <th>订单状态</th>
  93. <th>仓库</th>
  94. <th>客户</th>
  95. <th>收货人</th>
  96. <th>收货人名称</th>
  97. <th>收货人电话</th>
  98. <th>承运人</th>
  99. <th>下单方名称</th>
  100. <th>波次编号</th>
  101. <th>客户订单号</th>
  102. <th>快递单号</th>
  103. <th>快递获取标记</th>
  104. <th>快递获取时间</th>
  105. <th style="width: 200px">产品代码</th>
  106. <th style="width: 200px">产品条码</th>
  107. <th style="width: 200px">产品名称</th>
  108. <th>订单数量</th>
  109. <th>备注</th>
  110. <th>接口取消标记</th>
  111. <th>拣货单打印标记</th>
  112. <th>接口回传标记</th>
  113. <th>订单冻结标记</th>
  114. <th>收货人地址</th>
  115. </tr>
  116. <tr v-for="(order,i) in orders">
  117. <td>
  118. <input class="checkItem" type="checkbox" :value="order.orderno" v-model="checkData">
  119. </td>
  120. <td>@{{ i+1 }}</td>
  121. <td class="text-primary">@{{ order.orderno }}</td>
  122. <td class="text-muted">@{{ order.oracleBASCode_codename_c }}</td>
  123. <td> @{{ order.warehouseid }}</td>
  124. <td >@{{ order.oracleBASCustomer_descr_c }}</td>
  125. <td class="text-muted">@{{ order.consigneeid }}</td>
  126. <td class="text-muted">@{{ order.consigneename }}</td>
  127. <td class="text-muted">@{{ order.c_tel1 }}</td>
  128. <td class="text-muted">@{{ order.carriername }}</td>
  129. <td>@{{ order.issuepartyname }}</td>
  130. <td>@{{ order.waveno }}</td>
  131. <td>@{{ order.soreference1 }}</td>
  132. <td>@{{ order.soreference5 }}</td>
  133. <td>@{{ order.edisendflag2 }}</td>
  134. <td>@{{ order.edisendtime2 }}</td>
  135. <td colspan="4" class="text-center">
  136. <table v-if="order.oracle_d_o_c_order_details.length==1 || isBtn[order.orderno]" class="table table-sm">
  137. <tr v-for="oracleDOCOrderDetail in order.oracle_d_o_c_order_details">
  138. <td><div style="width: 180px;overflow: hidden">@{{ oracleDOCOrderDetail.sku }}</div></td>
  139. <td><div style="width: 180px;overflow: hidden">@{{ oracleDOCOrderDetail.alternate_sku1 }}</div></td>
  140. <td><div :title="oracleDOCOrderDetail.descr_c" class="tooltipTarget" style="width: 180px;overflow: hidden">@{{ oracleDOCOrderDetail.descr_c }}</div></td>
  141. <td>@{{ oracleDOCOrderDetail.qtyordered }}</td>
  142. </tr>
  143. <tr v-if="isBtn[order.orderno]">
  144. <td colspan="4">
  145. <b style="cursor:pointer;color: #4aa0e6;" @click="isBtn[order.orderno]=false;">点击收起明细</b>
  146. </td>
  147. </tr>
  148. </table>
  149. <b @click="unfold(order.orderno)" style="cursor:pointer;text-decoration: underline;color: #4aa0e6;" v-if="order.oracle_d_o_c_order_details.length>1 && !isBtn[order.orderno]">共有 @{{ order.oracle_d_o_c_order_details.length }} 件商品,点击展开</b>
  150. </td>
  151. <td>@{{ order.notes }}</td>
  152. <td>@{{ order.erpcancelflag }}</td>
  153. <td>@{{ order.picking_print_flag }}</td>
  154. <td>@{{ order.edisendflag }}</td>
  155. <td>@{{ order.releasestatus }}</td>
  156. <td>@{{ order.c_address1 }}</td>
  157. </tr>
  158. </table>
  159. {{$orders->appends($request)->links()}}
  160. </div>
  161. @endsection
  162. @section('lastScript')
  163. <script>
  164. new Vue({
  165. el:"#list",
  166. data:{
  167. filterData:{
  168. paginate:50,ordertime_start:'',ordertime_end:'',customerid:'',soreference1:'',soreference5:'',
  169. },
  170. checkData:[],
  171. owners:[
  172. @foreach($customers as $customer)
  173. {!! $customer !!},
  174. @endforeach
  175. ],
  176. orders:[
  177. @foreach($orders as $order)
  178. {!! $order !!},
  179. @endforeach
  180. ],
  181. isBtn:{},
  182. content:'',
  183. },
  184. mounted:function () {
  185. $(".tooltipTarget").tooltip({'trigger':'hover'});
  186. this.initInputs();
  187. $("#list").removeClass('d-none');
  188. },
  189. computed:{
  190. isBeingFilterConditions:function(){
  191. for(let key in this.filterData){
  192. if(this.filterData[key] && key!='paginate'){
  193. return true
  194. }
  195. }
  196. return false;
  197. },
  198. },
  199. watch:{
  200. checkData:{
  201. handler(){
  202. if (this.checkData.length === this.orders.length){
  203. document.querySelector('#all').checked = true;
  204. }else {
  205. document.querySelector('#all').checked = false;
  206. }
  207. },
  208. deep:true
  209. }
  210. },
  211. methods:{
  212. initInputs:function(){
  213. let data=this;
  214. let uriParts =decodeURI(location.href).split("?");
  215. if(uriParts.length>1){
  216. let params = uriParts[1].split('&');
  217. params.forEach(function(paramPair){
  218. let pair=paramPair.split('=');
  219. let key = pair[0], val = pair[1];
  220. $('input[name="'+key+'"]').val(val);
  221. $('select[name="'+key+'"]').val(val);
  222. decodeURI(data.filterData[key]=val);
  223. });
  224. }
  225. },
  226. //提交表单
  227. submit:function(){
  228. let form = $("#form");
  229. form.submit();
  230. },
  231. //全选事件
  232. checkAll(e){
  233. if (e.target.checked){
  234. this.orders.forEach((el,i)=>{
  235. if (this.checkData.indexOf(el.orderno) == '-1'){
  236. this.checkData.push(el.orderno);
  237. }
  238. });
  239. }else {
  240. this.checkData = [];
  241. }
  242. },
  243. //寻找客户
  244. owner_seek:function (e) {
  245. let _this=this;
  246. let $val=e.target.value;
  247. if($val==='')_this.filterData.customerid='';
  248. else
  249. _this.owners.forEach(function (owner) {
  250. if (owner.descr_c.includes($val)){
  251. _this.filterData.customerid=owner.customerid;
  252. }
  253. });
  254. },
  255. unfold(orderno){
  256. this.$set(this.isBtn,orderno,true);
  257. setTimeout(function () {
  258. $(".tooltipTarget").tooltip({'trigger':'hover'});
  259. },1);
  260. },
  261. exitExport(val){
  262. if (val==1){
  263. if (this.checkData.length<1) {
  264. tempTip.setDuration(3000);
  265. tempTip.showSuccess('没有勾选任何记录')
  266. return;
  267. }
  268. window.location.href="{{url('exit/index/forwarding?checkData=')}}"+this.checkData;
  269. return;
  270. }
  271. window.location.href="{{url('exit/index/forwarding?ordertime_start=')}}"+this.filterData.ordertime_start
  272. +"&&ordertime_end="+this.filterData.ordertime_end+"&&soreference1="+this.filterData.soreference1
  273. +"&&soreference5="+this.filterData.soreference5+"&&export="+true;
  274. },
  275. modal(){
  276. $("#myModal").modal('show');
  277. },
  278. batchComments(){
  279. let _this=this;
  280. if (this.checkData.length<1 || !this.content) {
  281. $("#myModal").modal('hide');
  282. tempTip.setDuration(3000);
  283. if (this.checkData.length<1) tempTip.showSuccess('没有勾选任何记录');
  284. else tempTip.showSuccess('没有输入任何内容');
  285. return;
  286. }
  287. axios.post('{{url('exit/create/batchComments')}}',{checkData:this.checkData,content:this.content})
  288. .then(function (response) {
  289. let sign=[];
  290. _this.orders.every(function (order) {
  291. if (sign.length===response.data.length)return false;
  292. response.data.every(function (data) {
  293. if (order.orderno===data.orderno){
  294. order.notes=data.notes;
  295. sign.push(order.orderno);
  296. return false;
  297. }
  298. return true;
  299. });
  300. return true;
  301. });
  302. tempTip.setDuration(3000);
  303. tempTip.showSuccess('注释完毕!')
  304. _this.content='';
  305. }).catch(function (err) {
  306. tempTip.setDuration(4000);
  307. tempTip.show('网络错误:'+err)
  308. });
  309. $("#myModal").modal('hide');
  310. }
  311. },
  312. });
  313. </script>
  314. @endsection