index.blade.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="page-header">
  7. <h3 class="page-title">
  8. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  9. <i class="mdi mdi-settings"></i>
  10. </span>
  11. {{ __('auto.库存变化曲线') }}
  12. </h3>
  13. <nav aria-label="breadcrumb">
  14. <ol class="breadcrumb">
  15. <li class="breadcrumb-item"><a href="#">{{ __('auto.库存变化曲线') }}</a></li>
  16. <li class="breadcrumb-item active" aria-current="page">{{ __('auto.用户控制') }}</li>
  17. </ol>
  18. </nav>
  19. </div>
  20. <div class="row">
  21. <div class="col-lg-12 grid-margin stretch-card">
  22. <div class="card">
  23. <div class="card-body">
  24. <h4 class="card-title">{{ __('auto.库存变化曲线') }}</h4>
  25. <form class="well form-inline margin-top-20" method="get" action='/admin/stock/change'>
  26. <spen style="padding-left: 10px" >{{ __('auto.库存选择:') }}</spen>
  27. <select class="form-control" name="type" value="{{$type}}" style="color: black" onchange="gradeChange(this.options[this.options.selectedIndex].value)">
  28. <option value="">{{ __('auto.全部') }}</option>
  29. @foreach($stocks as $key=>$val)
  30. <option value="{{$key}}" @if ($type == $key)
  31. selected
  32. @endif>{{$val}}</option>
  33. @endforeach
  34. </select> &nbsp;&nbsp;
  35. <spen style="padding-left: 10px" >{{ __('auto.房间选择:') }}</spen>
  36. <select class="form-control" name="roomID" value="" style="color: black" id="room_list">
  37. <option value="">{{ __('auto.全部') }}</option>
  38. @foreach($roomList as $key=>$val)
  39. <option value="{{$val->ServerID}}" @if ($room == $val->ServerID)
  40. selected
  41. @endif>{{$val->ServerName}}</option>
  42. @endforeach
  43. </select> &nbsp;&nbsp;
  44. <spen style="padding-left: 10px" >{{ __('auto.选择时间:') }}</spen>
  45. <input type="datetime-local" step="01" name="start_time" class="form-control" value="{{$start_time}}" />&nbsp;&nbsp;
  46. <input type="datetime-local" step="01" name="end_time" class="form-control" value="{{$end_time}}" />&nbsp;&nbsp;
  47. <spen style="padding-left: 10px" >{{ __('auto.选择时间:') }}</spen>
  48. <select class="form-control" name="date" value="" style="color: black">
  49. <option value="">{{ __('auto.全部') }}</option>
  50. @foreach($dates as $key=>$val)
  51. <option value="{{$key}}" @if ($choice_date == $key)
  52. selected
  53. @endif>{{$val}}</option>
  54. @endforeach
  55. </select> &nbsp;&nbsp;
  56. <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
  57. <a href="/admin/stock/change" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
  58. <a href="/admin/stock/change?excel=1&start_time={{$start_time}}&end_time={{$end_time}}&roomID={{$room}}" class="btn btn-sm btn-gradient-light btn-icon-text">{{ __('auto.导出') }}</a>
  59. </form>
  60. <div style="margin-left:20px;float: left ;width: 100%;height:400px;" id="zhexian" >
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- 引入 ECharts 文件 -->
  69. <script src="/assets/js/echarts.min.js"></script>
  70. <script>
  71. // 基于准备好的dom,初始化echarts实例
  72. var myChart = echarts.init(document.getElementById('zhexian'));
  73. option = {
  74. title: {
  75. text: '{!! $title !!}'
  76. },
  77. tooltip: {
  78. trigger: 'axis'
  79. },
  80. legend: {
  81. data: []
  82. },
  83. grid: {
  84. left: '3%',
  85. right: '4%',
  86. bottom: '3%',
  87. containLabel: true
  88. },
  89. toolbox: {
  90. feature: {
  91. saveAsImage: {}
  92. }
  93. },
  94. xAxis: {
  95. type: 'category',
  96. boundaryGap: false,
  97. data: {!! $date !!}
  98. },
  99. yAxis: {
  100. type: 'value'
  101. },
  102. series: [
  103. {
  104. name: '{!! $title !!}',
  105. type: 'line',
  106. stack: '{{ __('auto.库存') }}',
  107. data: {!! $list !!},
  108. },
  109. ]
  110. };
  111. // 使用刚指定的配置项和数据显示图表。
  112. myChart.setOption(option);
  113. </script>
  114. <script>
  115. $(function(){
  116. cutStr(50);
  117. });
  118. function gradeChange(value) {
  119. myRequest("/admin/stock/room_list", "get", {'type': value}, function (res) {
  120. var data = res.data
  121. var html = ''
  122. for (var i of data) {
  123. html += '<option value=' + i['ServerID'] + '>' + i['ServerName'] + '</option>'
  124. }
  125. $("#room_list").html(html)
  126. });
  127. }
  128. </script>
  129. @endsection