panel.blade.php 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. @extends('layouts.app')
  2. @section('title')控制台@endsection
  3. @section('head')
  4. <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
  5. @endsection
  6. @section('content')
  7. <div class="d-none" id="list">
  8. <div class="container-fluid">
  9. <div class="card">
  10. <h5 class="card-header">最近使用功能</h5>
  11. <div class="card-body row">
  12. <ul class="list-group" v-for="(menu,index) in menus">
  13. <div class="container-fluid btn-group justify-content-center">
  14. <a class="btn-primary btn-lg" v-if="index<=3" :href="'/'+menu.route">@{{ menu.name }}</a>
  15. </div>
  16. <div v-if="menu.secondLevelMenu && menu.secondLevelMenu.length>0&&index<=3">
  17. <div class="container-fluid btn-group m-1">
  18. <a class="bth btn-sm btn-info m-1" v-for="(secondMenu,index) in menu.secondLevelMenu"
  19. :href="'/'+secondMenu.route" v-if="index < 2"> @{{ secondMenu.name }}</a>
  20. </div>
  21. </div>
  22. </ul>
  23. </div>
  24. </div>
  25. <div class="row my-3">
  26. <div class="col-sm col-lg-2 col-xl-2 col-md-2">
  27. <div class="card">
  28. <div class="card-header text-dark h5">
  29. {{-- <p><select name="" id="">--}}
  30. {{-- <option value="i+1980" v-for="i in (new Array(30).keys())" :selected="year(widgets.orderAmount.startAt)==i+1980">--}}
  31. {{-- @{{i+1980}}--}}
  32. {{-- </option>--}}
  33. {{-- </select></p>--}}
  34. <p>实时待处理订(总):@{{ totalOrders.total }}</p>
  35. </div>
  36. <div class="card-body">
  37. <p>创建订单:@{{ totalOrders.createOrder }}</p>
  38. <p>分配完成:@{{ totalOrders.assignedComplete }}</p>
  39. <p>部分分配:@{{ totalOrders.partialAllocation }}</p>
  40. <p>部分装箱:@{{ totalOrders.partPacking }}</p>
  41. <p>分拨完成:@{{ totalOrders.sowComplete }}</p>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="col-sm col-lg-2 col-xl-2 col-md-2" v-for="(warehousesOrder,index) in warehousesOrders">
  46. <div class="card">
  47. <div class="card-header text-success h5">
  48. <p>@{{ getWareHouse(warehousesOrder.code) }}:@{{ warehousesOrder.total }}</p>
  49. </div>
  50. <div class="card-body">
  51. <p>创建订单:@{{ warehousesOrder.createOrder }}</p>
  52. <p>分配完成:@{{ warehousesOrder.assignedComplete }}</p>
  53. <p>部分分配:@{{ warehousesOrder.partialAllocation }}</p>
  54. <p>部分装箱:@{{ warehousesOrder.partPacking }}</p>
  55. <p>分拨完成:@{{ warehousesOrder.sowComplete }}</p>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="row my-3">
  61. <div class="col-sm col-lg-5 col-xl-5 col-md-5">
  62. <div class="card">
  63. <div class="card-header">
  64. <div class="block">
  65. <span v-show="orderCountingRecordsDayShow" class="demonstration">起始日期</span>
  66. <el-date-picker
  67. @blur="orderCountingRecordApi('')"
  68. v-show="orderCountingRecordsDayShow"
  69. v-model="orderCountingRecordsStart"
  70. type="date"
  71. value-format="yyyy-MM-dd"
  72. placeholder="选起始日期">
  73. </el-date-picker>
  74. <span v-show="orderCountingRecordsDayShow" class="demonstration">结束日期</span>
  75. <el-date-picker
  76. @blur="orderCountingRecordApi('')"
  77. v-show="orderCountingRecordsDayShow"
  78. v-model="orderCountingRecordsEnd"
  79. type="date"
  80. value-format="yyyy-MM-dd"
  81. placeholder="选择结束日期">
  82. </el-date-picker>
  83. <span v-show="orderCountingRecordsMonthShow" class="demonstration">起始月</span>
  84. <el-date-picker
  85. @blur="orderCountingRecordApi('')"
  86. v-show="orderCountingRecordsMonthShow"
  87. v-model="orderCountingRecordsStart"
  88. type="month"
  89. value-format="yyyy-MM-dd"
  90. placeholder="选择起始月">
  91. </el-date-picker>
  92. <span v-show="orderCountingRecordsMonthShow" class="demonstration">结束月</span>
  93. <el-date-picker
  94. @blur="orderCountingRecordApi('')"
  95. v-show="orderCountingRecordsMonthShow"
  96. v-model="orderCountingRecordsEnd"
  97. type="month"
  98. value-format="yyyy-MM-dd"
  99. placeholder="选择结束月">
  100. </el-date-picker>
  101. <span v-show="orderCountingRecordsYearShow" class="demonstration">起始年</span>
  102. <el-date-picker
  103. @blur="orderCountingRecordApi('')"
  104. v-show="orderCountingRecordsYearShow"
  105. v-model="orderCountingRecordsStart"
  106. type="year"
  107. value-format="yyyy-MM-dd"
  108. placeholder="选择年">
  109. </el-date-picker>
  110. <span v-show="orderCountingRecordsYearShow" class="demonstration">结束年</span>
  111. <el-date-picker
  112. @blur="orderCountingRecordApi('')"
  113. v-show="orderCountingRecordsYearShow"
  114. v-model="orderCountingRecordsEnd"
  115. type="year"
  116. value-format="yyyy-MM-dd"
  117. placeholder="选择年">
  118. </el-date-picker>
  119. </div>
  120. <el-button type="primary" value="日" @click="orderCountingRecordApi('日')"
  121. v-model="orderCountingRecordsUnit">日
  122. </el-button>
  123. <el-button type="primary" value="月" @click="orderCountingRecordApi('月')"
  124. v-model="orderCountingRecordsUnit">月
  125. </el-button>
  126. <el-button type="primary" value="年" @click="orderCountingRecordApi('年')"
  127. v-model="orderCountingRecordsUnit">年
  128. </el-button>
  129. </div>
  130. <div class="card-body row">
  131. <div v-show="orderCountingRecordsShow" id="orderCountingRecords" class="col"
  132. style="width:600px;height:600px;"></div>
  133. </div>
  134. <div v-show="!orderCountingRecordsShow" class="text-center">
  135. <h3>正在加载...</h3>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="col-sm col-lg-7 col-xl-7 col-md-7">
  140. <div class="row">
  141. <div class="col-sm col-lg-5 col-xl-5 col-md-5">
  142. <div class="card">
  143. <div class="card-header">
  144. <div class="col-5 row">
  145. <div class="block">
  146. <span class="demonstration"></span>
  147. <el-date-picker @blur="logisticsCountingRecordsApi()"
  148. v-model="logisticsCountingRecordsData"
  149. type="daterange"
  150. align="right"
  151. unlink-panels
  152. range-separator="-"
  153. start-placeholder="开始日期"
  154. end-placeholder="结束日期"
  155. value-format="yyyy-MM-dd"
  156. :picker-options="pickerOptions">
  157. </el-date-picker>
  158. </div>
  159. </div>
  160. </div>
  161. <div class="card-body row">
  162. <div v-show="logisticsCountingRecordsShow" id="logisticsCountingRecords" class="col"
  163. style="width: 600px;height:600px;"></div>
  164. <div v-show="!logisticsCountingRecordsShow" class="text-center">
  165. <h3>正在加载...</h3>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="col-sm col-lg-5 col-xl-5 col-md-5">
  171. <div class="card">
  172. <div class="card-header">
  173. <div class="col-5 row">
  174. <div class="block">
  175. <span class="demonstration"></span>
  176. <el-date-picker @blur="warehouseCountingRecordsApi()"
  177. v-model="warehouseCountingRecordsData"
  178. type="daterange"
  179. align="right"
  180. unlink-panels
  181. range-separator="-"
  182. start-placeholder="开始日期"
  183. end-placeholder="结束日期"
  184. value-format="yyyy-MM-dd"
  185. :picker-options="pickerOptions">
  186. </el-date-picker>
  187. </div>
  188. </div>
  189. </div>
  190. <div class="card-body row">
  191. <div v-show="warehouseCountingRecordsShow" id="warehouseCountingRecords" class="col"
  192. style="width: 600px;height:600px;"></div>
  193. <div v-show="!warehouseCountingRecordsShow">
  194. 正在加载
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. @can('人事管理-临时工报表-可见全部组')
  202. <div class="col-sm col-lg-5 col-xl-5 col-md-5">
  203. <div class="card">
  204. <div class="card-header">
  205. <span class="demonstration"></span>
  206. {{-- <el-date-picker @blur="laborReportsCountingRecordApi('')"--}}
  207. {{-- v-model="laborReportsCountingRecordsDate"--}}
  208. {{-- type="daterange"--}}
  209. {{-- align="right"--}}
  210. {{-- unlink-panels--}}
  211. {{-- range-separator="-"--}}
  212. {{-- start-placeholder="开始日期"--}}
  213. {{-- end-placeholder="结束日期"--}}
  214. {{-- value-format="yyyy-MM-dd"--}}
  215. {{-- :picker-options="pickerOptions">--}}
  216. {{-- </el-date-picker>--}}
  217. <div class="block">
  218. <span v-show="laborReportsCountingRecordsDayShow" class="demonstration">起始日期</span>
  219. <el-date-picker
  220. @blur="laborReportsCountingRecordApi('')"
  221. v-show="laborReportsCountingRecordsDayShow"
  222. v-model="laborReportsCountingRecordsStart"
  223. type="date"
  224. value-format="yyyy-MM-dd"
  225. placeholder="选起始日期">
  226. </el-date-picker>
  227. <span v-show="laborReportsCountingRecordsDayShow" class="demonstration">结束日期</span>
  228. <el-date-picker
  229. @blur="laborReportsCountingRecordApi('')"
  230. v-show="laborReportsCountingRecordsDayShow"
  231. v-model="laborReportsCountingRecordsEnd"
  232. type="date"
  233. value-format="yyyy-MM-dd"
  234. placeholder="选择结束日期">
  235. </el-date-picker>
  236. <span v-show="laborReportsCountingRecordsMonthShow" class="demonstration">起始月</span>
  237. <el-date-picker
  238. @blur="laborReportsCountingRecordApi('')"
  239. v-show="laborReportsCountingRecordsMonthShow"
  240. v-model="laborReportsCountingRecordsStart"
  241. type="month"
  242. value-format="yyyy-MM-dd"
  243. placeholder="选择起始月">
  244. </el-date-picker>
  245. <span v-show="laborReportsCountingRecordsMonthShow" class="demonstration">结束月</span>
  246. <el-date-picker
  247. @blur="laborReportsCountingRecordApi('')"
  248. v-show="laborReportsCountingRecordsMonthShow"
  249. v-model="laborReportsCountingRecordsEnd"
  250. type="month"
  251. value-format="yyyy-MM-dd"
  252. placeholder="选择结束月">
  253. </el-date-picker>
  254. <span v-show="laborReportsCountingRecordsYearShow" class="demonstration">起始年</span>
  255. <el-date-picker
  256. @blur="laborReportsCountingRecordApi('')"
  257. v-show="laborReportsCountingRecordsYearShow"
  258. v-model="laborReportsCountingRecordsStart"
  259. type="year"
  260. value-format="yyyy-MM-dd"
  261. placeholder="选择年">
  262. </el-date-picker>
  263. <span v-show="laborReportsCountingRecordsYearShow" class="demonstration">结束年</span>
  264. <el-date-picker
  265. @blur="laborReportsCountingRecordApi('')"
  266. v-show="laborReportsCountingRecordsYearShow"
  267. v-model="laborReportsCountingRecordsEnd"
  268. type="year"
  269. value-format="yyyy-MM-dd"
  270. placeholder="选择年">
  271. </el-date-picker>
  272. </div>
  273. <el-button type="primary" value="日" @click="laborReportsCountingRecordApi('日')"
  274. v-model="laborReportsCountingRecordUnit">日
  275. </el-button>
  276. <el-button type="primary" value="月" @click="laborReportsCountingRecordApi('月')"
  277. v-model="laborReportsCountingRecordUnit">月
  278. </el-button>
  279. <el-button type="primary" value="年" @click="laborReportsCountingRecordApi('年')"
  280. v-model="laborReportsCountingRecordUnit">年
  281. </el-button>
  282. </div>
  283. <div class="card-body row">
  284. <div v-show="laborReportsCountingRecordsShow" id="laborReportsCountingRecords"
  285. class="col"
  286. style="width:600px;height:600px;"></div>
  287. <div v-show="!laborReportsCountingRecordsShow">
  288. 正在加载
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. <div class="col-sm col-lg-7 col-xl-5 col-md-5">
  294. <div class="card">
  295. <div class="card-header">
  296. <span class="demonstration"></span>
  297. <el-date-picker @blur="laborReportsUserGroupsCountApi('')"
  298. v-model="laborReportsUserGroupsCountDate"
  299. type="daterange"
  300. align="right"
  301. unlink-panels
  302. range-separator="-"
  303. start-placeholder="开始日期"
  304. end-placeholder="结束日期"
  305. value-format="yyyy-MM-dd"
  306. :picker-options="pickerOptions">
  307. </el-date-picker>
  308. </div>
  309. <div class="card-body row">
  310. <div v-show="laborReportsUserGroupsCountShow" id="laborReportsUserGroupsCount"
  311. class="col"
  312. style="width:600px;height:600px;"></div>
  313. <div v-show="!laborReportsUserGroupsCountShow">
  314. 正在加载
  315. </div>
  316. </div>
  317. </div>
  318. </div>
  319. @endcan
  320. </div>
  321. </div>
  322. </div>
  323. @endsection
  324. @section('lastScript')
  325. <script src="{{ mix('js/echarts.js') }}"></script>
  326. <!-- 引入样式 -->
  327. <!-- 引入组件库 -->
  328. <script src="{{ mix('js/element-ui.js') }}"></script>
  329. <script>
  330. let vue = new Vue({
  331. el: "#list",
  332. data: {
  333. myChart: null,
  334. menus:{!! $menus !!},
  335. warehousesOrders:{!! $warehousesOrders !!},
  336. orderCountingRecords:{!! $orderCountingRecords !!},
  337. logisticsCountingRecords:{!! $logisticsCountingRecords !!},
  338. warehouseCountingRecords:{!! $warehouseCountingRecords !!},
  339. laborReportsCountingRecords:{!! $laborReportsCountingRecords !!},
  340. laborReportsUserGroupsCount:{!! $laborReportsUserGroupsCount !!},
  341. warehouses: {},
  342. totalOrders: {
  343. total: null,
  344. createOrder: null,
  345. assignedComplete: null,
  346. partialAllocation: null,
  347. partPacking: null,
  348. sowComplete: null,
  349. },
  350. orderCountingRecordsDateTarget: [],
  351. orderCountingRecordsData: [],
  352. laborReportsCountingRecordsDateTarget: [],
  353. laborReportsCountingRecordsData: [],
  354. pickerOptions: {
  355. shortcuts: [{
  356. text: '最近一周',
  357. onClick(picker) {
  358. const end = new Date();
  359. const start = new Date();
  360. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  361. picker.$emit('pick', [start, end]);
  362. }
  363. }, {
  364. text: '最近一个月',
  365. onClick(picker) {
  366. const end = new Date();
  367. const start = new Date();
  368. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  369. picker.$emit('pick', [start, end]);
  370. }
  371. }, {
  372. text: '最近三个月',
  373. onClick(picker) {
  374. const end = new Date();
  375. const start = new Date();
  376. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  377. picker.$emit('pick', [start, end]);
  378. }
  379. }]
  380. },
  381. orderCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  382. moment(new Date()).format('yyyy-MM-DD')],
  383. logisticsCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  384. moment(new Date()).format('yyyy-MM-DD')],
  385. warehouseCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  386. moment(new Date()).format('yyyy-MM-DD')],
  387. laborReportsCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  388. moment(new Date()).format('yyyy-MM-DD')],
  389. laborReportsUserGroupsCountDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  390. moment(new Date()).format('yyyy-MM-DD')],
  391. orderCountingRecordsUnit: '日',
  392. laborReportsCountingRecordUnit: '日',
  393. orderCountingRecordsShow: true,
  394. logisticsCountingRecordsShow: true,
  395. warehouseCountingRecordsShow: true,
  396. laborReportsCountingRecordsShow: true,
  397. laborReportsUserGroupsCountShow: true,
  398. orderCountingRecordsDayShow: true,
  399. orderCountingRecordsMonthShow: false,
  400. orderCountingRecordsYearShow: false,
  401. orderCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  402. orderCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  403. laborReportsCountingRecordsDayShow: true,
  404. laborReportsCountingRecordsMonthShow: false,
  405. laborReportsCountingRecordsYearShow:false ,
  406. laborReportsCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  407. laborReportsCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  408. },
  409. mounted: function () {
  410. $('#list').removeClass('d-none');
  411. let _this = this;
  412. this.warehouses = {
  413. "WH01": '松江一仓',
  414. "WH02": '松江二仓',
  415. "WH03": '嘉定一仓',
  416. }
  417. this.warehousesOrders.forEach(function (item) {
  418. _this.totalOrders.total += parseInt(item.total);
  419. _this.totalOrders.createOrder += item.createOrder;
  420. _this.totalOrders.assignedComplete += item.assignedComplete;
  421. _this.totalOrders.partialAllocation += item.partialAllocation;
  422. _this.totalOrders.partPacking += item.partPacking;
  423. _this.totalOrders.sowComplete += item.sowComplete;
  424. });
  425. this.initOrderCountingRecords();
  426. this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
  427. this.initOrderCountingRecordsChart();
  428. this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
  429. this.initLogisticsCountingRecordsChart();
  430. this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
  431. this.initWarehouseCountingRecordsChart();
  432. this.initLaborReportsCountingRecords();
  433. this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
  434. this.initLaborReportsCountingRecordsChart();
  435. this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
  436. this.initLaborReportsUserGroupsCountChart();
  437. },
  438. methods: {
  439. getWareHouse: function (code) {
  440. return this.warehouses[code];
  441. },
  442. initOrderCountingRecords() {
  443. for (let key in this.orderCountingRecords) {
  444. this.orderCountingRecordsDateTarget.push(this.orderCountingRecords[key].date_target);
  445. this.orderCountingRecordsData.push(this.orderCountingRecords[key].counter);
  446. }
  447. },
  448. initOrderCountingRecordsChart() {
  449. this.orderCountingRecordsChart.setOption({
  450. title: {text: '订单量趋势'},
  451. tooltip: {},
  452. legend: {data: ['订单数']},
  453. xAxis: {
  454. type: 'category',
  455. data: this.orderCountingRecordsDateTarget
  456. },
  457. yAxis: {type: 'value'},
  458. series: [{
  459. data: this.orderCountingRecordsData,
  460. type: 'line',
  461. smooth: true
  462. }]
  463. });
  464. },
  465. initLaborReportsCountingRecordsChart() {
  466. this.laborReportsCountingRecordsChart.setOption({
  467. title: {text: '临时用工趋势'},
  468. tooltip: {},
  469. legend: {data: ['临时用工数']},
  470. xAxis: {
  471. type: 'category',
  472. data: this.laborReportsCountingRecordsDateTarget
  473. },
  474. yAxis: {type: 'value'},
  475. series: [{
  476. data: this.laborReportsCountingRecordsData,
  477. type: 'line',
  478. smooth: true
  479. }]
  480. });
  481. },
  482. initLogisticsCountingRecordsChart() {
  483. this.logisticsCountingRecordsChart.setOption({
  484. title: {
  485. text: '快递分布',
  486. left: 'left'
  487. },
  488. tooltip: {
  489. trigger: 'item',
  490. formatter: '{a} <br/>{b} : {c} ({d}%)'
  491. },
  492. series: [
  493. {
  494. name: '快递分布',
  495. type: 'pie',
  496. radius: '55%',
  497. center: ['50%', '60%'],
  498. data: this.logisticsCountingRecords,
  499. emphasis: {
  500. itemStyle: {
  501. shadowBlur: 10,
  502. shadowOffsetX: 0,
  503. shadowColor: 'rgba(0, 0, 0, 0.5)'
  504. }
  505. }
  506. }
  507. ]
  508. });
  509. },
  510. initWarehouseCountingRecordsChart() {
  511. this.warehouseCountingRecordsChart.setOption({
  512. title: {
  513. text: '仓库分布',
  514. left: 'left'
  515. },
  516. tooltip: {
  517. trigger: 'item',
  518. formatter: '{a} <br/>{b} : {c} ({d}%)'
  519. },
  520. series: [
  521. {
  522. name: '仓库分布',
  523. type: 'pie',
  524. radius: '55%',
  525. center: ['50%', '60%'],
  526. data: this.warehouseCountingRecords,
  527. emphasis: {
  528. itemStyle: {
  529. shadowBlur: 10,
  530. shadowOffsetX: 0,
  531. shadowColor: 'rgba(0, 0, 0, 0.5)'
  532. }
  533. }
  534. }
  535. ]
  536. });
  537. },
  538. initLaborReportsUserGroupsCountChart() {
  539. this.laborReportsUserGroupsCountChart.setOption({
  540. title: {
  541. text: '小组临时工分布',
  542. left: 'left'
  543. },
  544. tooltip: {
  545. trigger: 'item',
  546. formatter: '{a} <br/>{b} : {c} ({d}%)'
  547. },
  548. series: [
  549. {
  550. name: '小组临时工分布',
  551. type: 'pie',
  552. radius: '55%',
  553. center: ['50%', '60%'],
  554. data: this.laborReportsUserGroupsCount,
  555. emphasis: {
  556. itemStyle: {
  557. shadowBlur: 10,
  558. shadowOffsetX: 0,
  559. shadowColor: 'rgba(0, 0, 0, 0.5)'
  560. }
  561. }
  562. }
  563. ]
  564. });
  565. },
  566. initLaborReportsCountingRecords() {
  567. let _this = this;
  568. this.laborReportsCountingRecords.forEach(function (item) {
  569. _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
  570. _this.laborReportsCountingRecordsData.push(item.counter);
  571. });
  572. },
  573. orderCountingRecordApi(orderCountingRecordsUnit) {
  574. if (orderCountingRecordsUnit === '') {
  575. orderCountingRecordsUnit = this.orderCountingRecordsUnit;
  576. }
  577. switch (orderCountingRecordsUnit) {
  578. case '日':
  579. this.orderCountingRecordsDayShow = true;
  580. this.orderCountingRecordsMonthShow = false;
  581. this.orderCountingRecordsYearShow = false;
  582. break;
  583. case '月':
  584. this.orderCountingRecordsDayShow = false;
  585. this.orderCountingRecordsMonthShow = true;
  586. this.orderCountingRecordsYearShow = false;
  587. break;
  588. case '年':
  589. this.orderCountingRecordsDayShow = false;
  590. this.orderCountingRecordsMonthShow = false;
  591. this.orderCountingRecordsYearShow = true;
  592. break;
  593. }
  594. this.orderCountingRecordsUnit = orderCountingRecordsUnit;
  595. let formData = new FormData();
  596. formData.append('start', this.orderCountingRecordsStart);
  597. formData.append('end', this.orderCountingRecordsEnd);
  598. formData.append('unit', orderCountingRecordsUnit);
  599. this.orderCountingRecordsShow = false;
  600. let _this = this;
  601. axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}', formData).then(function (res) {
  602. if (res.status === 200) {
  603. _this.orderCountingRecords = res.data.orderCountingRecords;
  604. _this.orderCountingRecordsDateTarget = [];
  605. _this.orderCountingRecordsData = [];
  606. _this.initOrderCountingRecords();
  607. _this.initOrderCountingRecordsChart();
  608. _this.orderCountingRecordsShow = true;
  609. }
  610. });
  611. },
  612. logisticsCountingRecordsApi() {
  613. this.logisticsCountingRecordsShow = false;
  614. let formData = new FormData();
  615. formData.append('start', this.logisticsCountingRecordsData[0]);
  616. formData.append('end', this.logisticsCountingRecordsData[1]);
  617. let _this = this;
  618. axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}', formData).then(function (res) {
  619. if (res.status === 200) {
  620. _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
  621. _this.initLogisticsCountingRecordsChart();
  622. _this.logisticsCountingRecordsShow = true;
  623. }
  624. });
  625. },
  626. warehouseCountingRecordsApi() {
  627. this.warehouseCountingRecordsShow = false;
  628. let formData = new FormData();
  629. formData.append('start', this.warehouseCountingRecordsData[0]);
  630. formData.append('end', this.warehouseCountingRecordsData[1]);
  631. let _this = this;
  632. axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
  633. if (res.status === 200) {
  634. _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
  635. _this.initWarehouseCountingRecordsChart();
  636. _this.warehouseCountingRecordsShow = true;
  637. }
  638. });
  639. },
  640. laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
  641. this.laborReportsCountingRecordsShow = false;
  642. if (laborReportsCountingRecordUnit === '') {
  643. laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
  644. }
  645. this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
  646. switch (laborReportsCountingRecordUnit) {
  647. case '日':
  648. this.laborReportsCountingRecordsDayShow = true;
  649. this.laborReportsCountingRecordsMonthShow = false;
  650. this.laborReportsCountingRecordsYearShow = false;
  651. break;
  652. case '月':
  653. this.laborReportsCountingRecordsDayShow = false;
  654. this.laborReportsCountingRecordsMonthShow = true;
  655. this.laborReportsCountingRecordsYearShow = false;
  656. break;
  657. case '年':
  658. this.laborReportsCountingRecordsDayShow = false;
  659. this.laborReportsCountingRecordsMonthShow = false;
  660. this.laborReportsCountingRecordsYearShow = true;
  661. break;
  662. }
  663. let formData = new FormData();
  664. formData.append('start', this.laborReportsCountingRecordsStart);
  665. formData.append('end', this.laborReportsCountingRecordsEnd);
  666. formData.append('unit', laborReportsCountingRecordUnit);
  667. let _this = this;
  668. axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
  669. if (res.status === 200) {
  670. _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
  671. _this.laborReportsCountingRecordsDateTarget = [];
  672. _this.laborReportsCountingRecordsData = [];
  673. _this.initLaborReportsCountingRecords();
  674. _this.initLaborReportsCountingRecordsChart();
  675. _this.laborReportsCountingRecordsShow = true;
  676. }
  677. });
  678. },
  679. laborReportsUserGroupsCountApi() {
  680. this.laborReportsUserGroupsCountShow = false;
  681. let formData = new FormData();
  682. formData.append('start', this.laborReportsUserGroupsCountDate[0]);
  683. formData.append('end', this.laborReportsUserGroupsCountDate[1]);
  684. let _this = this;
  685. axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
  686. if (res.status === 200) {
  687. _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
  688. _this.initLaborReportsUserGroupsCountChart();
  689. _this.laborReportsUserGroupsCountShow = true;
  690. }
  691. });
  692. },
  693. }
  694. });
  695. </script>
  696. @endsection