statistic.blade.php 9.1 KB

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