panel.blade.php 43 KB

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