statistic.blade.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. @extends('layouts.app')
  2. @section('title')统计-二次加工单@endsection
  3. @section('content')
  4. <div class="d-none container-fluid" id="statistics" style="width: 2070px">
  5. <div id="form_div"></div>
  6. <span class="dropdown">
  7. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  8. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
  9. 导出Excel
  10. </button>
  11. <div class="dropdown-menu">
  12. <a class="dropdown-item" @click="processStatisticExport(false)" href="javascript:">导出勾选内容</a>
  13. <a class="dropdown-item" @click="processStatisticExport(true)" href="javascript:">导出所有页</a>
  14. </div>
  15. </span>
  16. <table class="table table-striped text-nowrap table-hover td-min-width-80" style="background: #fff;" id="table">
  17. <tr v-for="(processStatistic,i) in processStatistics" :class="processStatistic.gross_profit_rate?'text-success':''">
  18. <td><label><input class="checkItem" type="checkbox" :value="processStatistic.process_id"></label></td>
  19. <td><span>@{{ i+1 }}</span></td>
  20. <td><span v-if="processStatistic.process">@{{ processStatistic.process.code }}</span></td>
  21. <td><span v-if="processStatistic.operatorLog && processStatistic.operatorLog.user">@{{ processStatistic.operatorLog.user.name }}</span></td>
  22. <td><span v-if="processStatistic.process">@{{ processStatistic.process.owner_name }}</span></td>
  23. <td><span>@{{ processStatistic.started_at }}</span></td>
  24. <td><span>@{{ processStatistic.ended_at }}</span></td>
  25. <td><span v-if="processStatistic.process">@{{ processStatistic.process.created_at }}</span></td>
  26. <td><span v-if="processStatistic.process">@{{ processStatistic.process.unit_price }}</span></td>
  27. <td><span v-if="processStatistic.process">@{{ processStatistic.process.amount }}</span></td>
  28. <td><span v-if="processStatistic.process">@{{ processStatistic.process.completed_amount }}</span></td>
  29. <td><span>@{{ processStatistic.revenue }}</span></td>
  30. <td><span>@{{ processStatistic.duration_days }}</span></td>
  31. <td><span v-if="processStatistic.process">@{{ processStatistic.duration_man_hours }}</span></td>
  32. <td><span v-if="processStatistic.process">@{{ processStatistic.process.process_method_name }}</span></td>
  33. <td><span>@{{ processStatistic.top_capacity }}</span></td>
  34. <td><span>@{{ processStatistic.bottom_capacity }}</span></td>
  35. <td><span>@{{ processStatistic.average_capacity }}</span></td>
  36. <td><span>@{{ processStatistic.total_cost }}</span></td>
  37. <td><span>@{{ processStatistic.gross_profit }}</span></td>
  38. <td><b v-if="processStatistic.gross_profit_rate">@{{ (processStatistic.gross_profit_rate)*100 | money}}%</b></td>
  39. <td><span v-if="processStatistic.process">@{{ processStatistic.process.status }}</span></td>
  40. <td><span v-if="processStatistic.process">@{{ processStatistic.process.remark }}</span></td>
  41. <td><span v-if="processStatistic.process">@{{ processStatistic.process.balance_remark }}</span></td>
  42. </tr>
  43. </table>
  44. {{$processStatistics->appends($params)->links()}}
  45. </div>
  46. @endsection
  47. @section('lastScript')
  48. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  49. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  50. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  51. <script>
  52. new Vue({
  53. el:"#statistics",
  54. data:{
  55. processStatistics:[
  56. @foreach($processStatistics as $processStatistic)
  57. {!! $processStatistic !!},
  58. @endforeach
  59. ],
  60. owners:[
  61. @foreach($owners as $owner)
  62. {name:'{{ $owner->id }}',value:'{{ $owner->name }}'},
  63. @endforeach
  64. ],
  65. processMethods:[
  66. @foreach($processMethods as $processMethod)
  67. {name:'{{ $processMethod->id }}',value:'{{ $processMethod->name }}'},
  68. @endforeach
  69. ],
  70. sum:{!! $processStatistics->total() !!},
  71. filterData:{paginate:'50',started_at:'',ended_at:'',owner_id:'',code:'',status:''},
  72. status:[
  73. {name:'待审核',value:'待审核'},{name:'待接单',value:'待接单'},{name:'待加工',value:'待加工'},
  74. {name:'已驳回',value:'已驳回'},{name:'加工中',value:'加工中'},{name:'待验收',value:'待验收'},
  75. {name:'交接完成',value:'交接完成'},
  76. ],
  77. },
  78. mounted:function(){
  79. $(".tooltipTarget").tooltip({'trigger':'hover'});
  80. $('#statistics').removeClass('d-none');
  81. let data=[
  82. [
  83. {name: 'started_at_start', type: 'dateTime', tip: '选择显示指定日期的起始时间'},
  84. {
  85. name: 'owners', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的客户'],
  86. placeholder: ['货主', '定位或多选货主'], data: this.owners
  87. },
  88. {name: 'process_method_id', type: 'select', placeholder: '加工类型', data: this.processMethods},
  89. ],
  90. [
  91. {name: 'started_at_end', type: 'dateTime', tip: '选择显示指定日期的结束时间'},
  92. {name: 'code', type: 'input', tip: '可支持多任务号,模糊搜索可在两侧增加百分号(%)进行', placeholder: '任务号'},
  93. {name: 'status', type: 'select', placeholder: '状态', data: this.status},
  94. ],
  95. ];
  96. this.form = new query({
  97. el: "#form_div",
  98. condition: data,
  99. });
  100. this.form.init();
  101. let column = [
  102. {name:'index',value: '序号', neglect: true},
  103. {name:'code',value: '任务号', neglect: true},
  104. {name:'user',value: '接单人', neglect: true},
  105. {name:'owner_name',value: '货主', neglect: true},
  106. {name:'started_at',value: '开始日期', neglect: true},
  107. {name:'ended_at',value: '完成日期', neglect: true},
  108. {name:'created_at',value: '创建日期', neglect: true},
  109. {name:'unit_price',value: '单价', neglect: true},
  110. {name:'amount',value: '预期数量', neglect: true},
  111. {name:'completed_amount',value: '完成数量', neglect: true},
  112. {name:'revenue',value: '收入合计', neglect: true},
  113. {name:'duration_days',value: '完成时间(天)', neglect: true},
  114. {name:'duration_man_hours',value: '总工时', neglect: true},
  115. {name:'process_method_name',value: '加工类型', neglect: true},
  116. {name:'top_capacity',value: '最高日产能', neglect: true},
  117. {name:'bottom_capacity',value: '最低日产能', neglect: true},
  118. {name:'average_capacity',value: '日均产能', neglect: true},
  119. {name:'total_cost',value: '合计成本', neglect: true},
  120. {name:'gross_profit',value: '毛利润', neglect: true},
  121. {name:'gross_profit_rate',value: '毛利率', neglect: true},
  122. {name:'status',value: '状态', neglect: true},
  123. {name:'remark',value: '加工备注', neglect: true},
  124. {name:'balance_remark',value: '结算备注', neglect: true},
  125. ];
  126. new Header({
  127. el: "table",
  128. name: "processStatistic",
  129. column: column,
  130. data: this.processStatistics,
  131. restorationColumn: 'id',
  132. fixedTop:($('#form_div').height())+2,
  133. }).init();
  134. },
  135. methods: {
  136. //导出excel
  137. processStatisticExport(checkAllSign){
  138. let url = '{{url('process/statistic/export')}}';
  139. let token='{{ csrf_token() }}';
  140. excelExport(checkAllSign,checkData,url,this.sum,token);
  141. },
  142. },
  143. filters:{
  144. money:function(value){
  145. return _.round(value,2);
  146. }
  147. }
  148. });
  149. </script>
  150. @endsection