index.blade.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. @extends('layouts.app')
  2. @section('title')财务报表@endsection
  3. @section('content')
  4. <div class="d-none" id="editingPanel">
  5. <div class="card" id="nav2">
  6. @component('waybill.menu')@endcomponent
  7. <div class="container-fluid nav3">
  8. <div class="card menu-third" >
  9. <ul class="nav nav-pills">
  10. @can('财务报表-查询')
  11. <li class="nav-item">
  12. <a class="nav-link @if($type=='') active @endif" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot')}} @else {{url('waybill/waybillFinancialExcepted')}} @endif">全部</a>
  13. </li>
  14. <li class="nav-item">
  15. <a class="nav-link @if($type=='ZX') active @endif" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot?type=ZX')}} @else {{url('waybill/waybillFinancialExcepted?type=ZX')}} @endif">专线</a>
  16. </li>
  17. <li class="nav-item">
  18. <a class="nav-link @if($type=='ZF') active @endif" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot?type=ZF')}} @else {{url('waybill/waybillFinancialExcepted?type=ZF')}} @endif">直发车</a>
  19. </li> @endcan
  20. </ul>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="card " style="width: 3500px">
  25. <form method="get" action="@if(!isset($excepted))
  26. @if($type=='ZF'){{url('waybill/waybillFinancialSnapshot?type=ZF')}}@elseif($type=='ZX'){{url('waybill/waybillFinancialSnapshot?type=ZX')}}@else{{url('waybill/waybillFinancialSnapshot')}}@endif
  27. @else
  28. @if($type=='ZF'){{url('waybill/waybillFinancialExcepted?type=ZF')}}@elseif($type=='ZX'){{url('waybill/waybillFinancialExcepted?type=ZX')}}@else{{url('waybill/waybillFinancialExcepted')}}@endif
  29. @endif ">
  30. <div class="card-header form-inline">
  31. <label style="margin-left: 1%"> 开始日期:</label><input style="max-width: 200px" type="date" name="created_at_start" class="form-control form-control-sm" v-model="filterData.created_at_start">
  32. <label style="margin-left: 1%"> 截至日期:</label><input style="max-width: 200px" type="date" class="form-control form-control-sm" name="created_at_end" v-model="filterData.created_at_end">
  33. <input type="text" hidden name="type" v-model="filterData.type" >
  34. <input type="submit" class="btn btn-sm btn-outline-dark ml-3" value="按条件搜索" >
  35. </div>
  36. </form>
  37. <!-- 自定义内容区域 -->
  38. <div>
  39. @if(!isset($excepted))
  40. <div class="card-header">
  41. <label>操作选定记录:</label>
  42. <span class="dropdown">
  43. <button class="btn btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark':'btn-outline-dark']"
  44. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  45. 导出Excel
  46. </button>
  47. <div class="dropdown-menu">
  48. <a class="dropdown-item" @click="waybillExport(1)" href="javascript:">导出勾选内容</a>
  49. <a class="dropdown-item" @click="waybillExport(2)" href="javascript:">导出所有页</a>
  50. </div>
  51. </span>
  52. </div>
  53. @endif
  54. @if(!isset($excepted))
  55. <label for="all" class="d-none" id="cloneCheckAll">
  56. <input id="all" type="checkbox" @click="checkAll($event)">全选
  57. </label>
  58. @endif
  59. <table class="d-none table table-bordered text-nowrap" id="headerRoll"></table>
  60. <table class="table table-hover table-bordered text-nowrap " style="width: 1500px;height: auto" id="headerParent">
  61. <thead>
  62. <tr style="background: #E8E8E8;@if(isset($excepted)) color: red; @endif" id="header"></tr>
  63. </thead>
  64. <tbody>
  65. <tr v-for="(json_content,i) in json_contents" :style="{background:json_content.waybill.type=='直发车'?'#F8F8F8':''}">
  66. @if(!isset($excepted))
  67. <td>
  68. <input class="checkItem" type="checkbox" :value="json_content.waybill_id" v-model="checkData">
  69. </td>
  70. @endif
  71. <td>@{{ i+1 }}</td>
  72. <td>@{{json_content.waybill.type}}</td>
  73. <td>@{{json_content.waybill.waybill_number}}</td>
  74. <td><p v-if="json_content.waybill.owner">@{{json_content.waybill.owner.name}}</p></td>
  75. <td>@{{json_content.waybill.wms_bill_number}}</td>
  76. <td>@{{json_content.waybill.origination}}</td>
  77. <td>@{{json_content.waybill.destination}}</td>
  78. <td>@{{json_content.waybill.recipient}}</td>
  79. <td>@{{json_content.waybill.recipient_mobile}}</td>
  80. <td>@{{json_content.waybill.charge}}</td>
  81. <td>@{{json_content.waybill.ordering_remark}}</td>
  82. <td><p v-if="json_content.waybill.carrier">@{{json_content.waybill.carrier.name}}</p></td>
  83. <td>@{{json_content.waybill.carrier_bill}}</td>
  84. <td><p v-if="json_content.waybill.origination_city&&json_content.waybill.origination_city.name">@{{json_content.waybill.origination_city.name}}</p> </td>
  85. <td><p v-if="json_content.waybill.destination_city&&json_content.waybill.destination_city.name">@{{json_content.waybill.destination_city.name}}</p> </td>
  86. <td>@{{json_content.waybill.warehouse_weight}}&nbsp;<b>@{{json_content.waybill.warehouse_weight_unit_name}}</b></td>
  87. <td>@{{json_content.waybill.warehouse_weight_other}}&nbsp;<b>@{{json_content.waybill.warehouse_weight_unit_other_name}}</b></td>
  88. <td>@{{json_content.waybill.carrier_weight}}&nbsp;<b>@{{json_content.waybill.carrier_weight_unit_name}}</b></td>
  89. <td>@{{json_content.waybill.carrier_weight_other}}&nbsp;<b>@{{json_content.waybill.carrier_weight_unit_other_name}}</b></td>
  90. <td><p v-if="json_content.waybill.car_type">@{{json_content.waybill.car_type.name}}</p></td>
  91. <td>@{{json_content.waybill.car_owner_info}}</td>
  92. <td>@{{json_content.waybill.fee}}</td>
  93. <td>@{{json_content.waybill.pick_up_fee}}</td>
  94. <td>@{{json_content.waybill.other_fee}}</td>
  95. <td>@{{json_content.waybill.collect_fee}}</td>
  96. <td>@{{json_content.waybill.dispatch_remark}}</td>
  97. <td>@{{json_content.waybill.created_at}}</td>
  98. <td>
  99. <ul style="list-style: none">
  100. <li v-for="waybillAuditLog in json_content.waybill.waybill_audit_logs" v-if=waybillAuditLog.audit_stage==="运单阶段">@{{waybillAuditLog.user.name}}</li>
  101. </ul>
  102. </td>
  103. <td>
  104. <ul style="list-style: none">
  105. <li v-for="waybillAuditLog in json_content.waybill.waybill_audit_logs" v-if=waybillAuditLog.audit_stage==="调度阶段">@{{waybillAuditLog.user.name}}</li>
  106. </ul>
  107. </td>
  108. <td>@{{json_content.total_receivable}}</td>
  109. <td>@{{json_content.total_expense}}</td>
  110. <td>@{{json_content.gross_margin}}</td>
  111. <td>@{{Math.round(json_content.gross_profit_rate*100)}}%</td>
  112. </tr>
  113. </tbody>
  114. </table>
  115. <div class="text-info h5 btn btn">{{$waybillFinancialSnapshots->count()}}/{{$waybillFinancialSnapshots->total()}}</div>
  116. </div>
  117. </div>
  118. <!-- 分页 -->
  119. <div>
  120. <div class="pull-right">
  121. {{$waybillFinancialSnapshots->render()}}
  122. </div>
  123. </div>
  124. </div>
  125. @stop
  126. @section('lastScript')
  127. <script type="text/javascript" src="{{asset('js/queryForm/header200818a.js')}}"></script>
  128. <script>
  129. let vue = new Vue({
  130. el:'#editingPanel',
  131. data:{
  132. json_contents:[
  133. @if(isset($waybillFinancialSnapshots))
  134. @foreach($waybillFinancialSnapshots as $waybillFinancialSnapshot)
  135. {!!$waybillFinancialSnapshot->json_content!!},
  136. @endforeach
  137. @endif
  138. ],
  139. checkData:[],
  140. filterData:{
  141. created_at_start:'',created_at_end:'',type:'{{$type}}',
  142. },
  143. },
  144. watch:{
  145. checkData:{
  146. handler(){
  147. if (this.checkData.length === this.json_contents.length){
  148. document.querySelector('#all').checked = true;
  149. document.querySelector('#all_temp').checked = true;
  150. }else {
  151. document.querySelector('#all').checked = false;
  152. document.querySelector('#all_temp').checked = false;
  153. }
  154. },
  155. deep:true
  156. },
  157. },
  158. mounted:function(){
  159. this.initInputs();
  160. $(".tooltipTarget").tooltip({'trigger':'hover'});
  161. $('#editingPanel').removeClass('d-none');
  162. let column = [
  163. @if(!isset($excepted)){name:'cloneCheckAll',customization:true,type:'checkAll',column:'waybill_id',
  164. dom:$('#cloneCheckAll').removeClass('d-none'), neglect: true},@endif
  165. {name:'index',value: '序号', neglect: true},
  166. {name:'type',value: '运单类型', neglect: true},
  167. {name:'waybill_number',value: '运单号', neglect: true},
  168. {name:'owner',value: '货主', neglect: true},
  169. {name:'wms_bill_number',value: 'WMS单号', neglect: true},
  170. {name:'origination',value: '始发地', neglect: true},
  171. {name:'destination',value: '目的地', neglect: true},
  172. {name:'recipient',value: '收件人', neglect: true},
  173. {name:'recipient_mobile',value: '收件人电话', neglect: true},
  174. {name:'charge',value: '收费(元)', neglect: true},
  175. {name:'ordering_remark',value: '下单备注', neglect: true},
  176. {name:'carrier',value: '承运商', neglect: true},
  177. {name:'carrier_bill',value: '承运商单号', neglect: true},
  178. {name:'origination_city',value: '始发市', neglect: true},
  179. {name:'destination_city',value: '目的市', neglect: true},
  180. {name:'warehouse_weight',value: '仓库计数(抛)', neglect: true},
  181. {name:'warehouse_weight_other',value: '仓库计数二', neglect: true},
  182. {name:'carrier_weight',value: '承运商计数(抛)', neglect: true},
  183. {name:'carrier_weight_other',value: '承运商计数二', neglect: true},
  184. {name:'car_type',value: '车型', neglect: true},
  185. {name:'car_owner_info',value: '车辆信息', neglect: true},
  186. {name:'fee',value: '运费(元)', neglect: true},
  187. {name:'pick_up_fee',value: '提货费(元)', neglect: true},
  188. {name:'other_fee',value: '其他费用(元)', neglect: true},
  189. {name:'collect_fee',value: '到付金额(元)', neglect: true},
  190. {name:'dispatch_remark',value: '调度备注', neglect: true},
  191. {name:'created_at',value: '创建时间', neglect: true},
  192. {name:'user_name',value: '运单审核人', neglect: true},
  193. {name:'user_name_update',value: '调度审核人', neglect: true},
  194. {name:'total_receivable',value: '应收款', neglect: true},
  195. {name:'total_expense',value: '应付款', neglect: true},
  196. {name:'gross_margin',value: '毛利', neglect: true},
  197. {name:'gross_profit_rate',value: '毛利率', neglect: true},
  198. ];
  199. let _this = this;
  200. setTimeout(function () {
  201. let header = new Header({
  202. el: "#header",
  203. column: column,
  204. data: _this.json_contents,
  205. restorationColumn: 'id',
  206. offset:0.5,
  207. vue : vue,
  208. });
  209. header.init();
  210. },0);
  211. },
  212. methods:{
  213. initInputs:function(){
  214. let data=this;
  215. let uriParts =decodeURI(location.href).split("?");
  216. if(uriParts.length>1){
  217. let params = uriParts[1].split('&');
  218. params.forEach(function(paramPair){
  219. let pair=paramPair.split('=');
  220. let key = pair[0], val = pair[1];
  221. $('input[name="'+key+'"]').val(val);
  222. decodeURI(data.filterData[key]=val);
  223. });
  224. }
  225. },
  226. checkAll(e){
  227. if (e.target.checked){
  228. this.json_contents.forEach((el,i)=>{
  229. if (this.checkData.indexOf(el.waybill_id) == '-1'){
  230. this.checkData.push(el.waybill_id);
  231. }
  232. });
  233. }else {
  234. this.checkData = [];
  235. }
  236. },
  237. waybillExport(e){
  238. let val=e;
  239. let data=this.filterData;
  240. if (val==1) {
  241. if (this.checkData.length <= 0) {
  242. tempTip.setDuration(4000);
  243. tempTip.showSuccess('没有勾选任何记录');
  244. } else {
  245. location.href = "{{url('waybillFinancialSnapshot/export')}}/" + this.checkData;
  246. }
  247. }else {
  248. location.href = "{{url('waybillFinancialSnapshot/export/-1?created_at_start=')}}"+
  249. data.created_at_start+"&created_at_end="+data.created_at_end;
  250. }
  251. },
  252. }
  253. })
  254. </script>
  255. @stop