panel.blade.php 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  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. orderCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  366. moment(new Date()).format('yyyy-MM-DD')],
  367. logisticsCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  368. moment(new Date()).format('yyyy-MM-DD')],
  369. warehouseCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  370. moment(new Date()).format('yyyy-MM-DD')],
  371. laborReportsCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  372. moment(new Date()).format('yyyy-MM-DD')],
  373. laborReportsUserGroupsCountDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  374. moment(new Date()).format('yyyy-MM-DD')],
  375. orderCountingRecordsUnit: '日',
  376. laborReportsCountingRecordUnit: '日',
  377. orderCountingRecordsShow: true,
  378. logisticsCountingRecordsShow: true,
  379. warehouseCountingRecordsShow: true,
  380. laborReportsCountingRecordsShow: true,
  381. laborReportsUserGroupsCountShow: true,
  382. orderCountingRecordsDayShow: true,
  383. orderCountingRecordsMonthShow: false,
  384. orderCountingRecordsYearShow: false,
  385. orderCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  386. orderCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  387. laborReportsCountingRecordsDayShow: true,
  388. laborReportsCountingRecordsMonthShow: false,
  389. laborReportsCountingRecordsYearShow: false,
  390. laborReportsCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  391. laborReportsCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  392. },
  393. mounted: function () {
  394. $('#list').removeClass('d-none');
  395. let _this = this;
  396. this.warehouses = {
  397. "WH01": '松江一仓',
  398. "WH02": '松江二仓',
  399. "WH03": '嘉定一仓',
  400. }
  401. this.warehousesOrders.forEach(function (item) {
  402. _this.totalOrders.total += parseInt(item.total);
  403. _this.totalOrders.createOrder += item.createOrder;
  404. _this.totalOrders.assignedComplete += item.assignedComplete;
  405. _this.totalOrders.partialAllocation += item.partialAllocation;
  406. _this.totalOrders.partPacking += item.partPacking;
  407. _this.totalOrders.sowComplete += item.sowComplete;
  408. });
  409. this.initOrderCountingRecords();
  410. this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
  411. this.initOrderCountingRecordsChart();
  412. this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
  413. this.initLogisticsCountingRecordsChart();
  414. this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
  415. this.initWarehouseCountingRecordsChart();
  416. this.initLaborReportsCountingRecords();
  417. this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
  418. this.initLaborReportsCountingRecordsChart();
  419. this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
  420. this.initLaborReportsUserGroupsCountChart();
  421. },
  422. methods: {
  423. getWareHouse: function (code) {
  424. return this.warehouses[code];
  425. },
  426. initOrderCountingRecords() {
  427. for (let key in this.orderCountingRecords) {
  428. this.orderCountingRecordsDateTarget.push(this.orderCountingRecords[key].date_target);
  429. this.orderCountingRecordsData.push(this.orderCountingRecords[key].counter);
  430. }
  431. },
  432. initOrderCountingRecordsChart() {
  433. this.orderCountingRecordsChart.setOption({
  434. title: {text: '订单量趋势'},
  435. tooltip: {},
  436. legend: {data: ['订单数']},
  437. xAxis: {
  438. type: 'category',
  439. data: this.orderCountingRecordsDateTarget
  440. },
  441. yAxis: {type: 'value'},
  442. series: [{
  443. data: this.orderCountingRecordsData,
  444. type: 'line',
  445. smooth: true
  446. }]
  447. });
  448. },
  449. initLaborReportsCountingRecordsChart() {
  450. this.laborReportsCountingRecordsChart.setOption({
  451. title: {text: '临时用工趋势'},
  452. tooltip: {},
  453. legend: {data: ['临时用工数']},
  454. xAxis: {
  455. type: 'category',
  456. data: this.laborReportsCountingRecordsDateTarget
  457. },
  458. yAxis: {type: 'value'},
  459. series: [{
  460. data: this.laborReportsCountingRecordsData,
  461. type: 'line',
  462. smooth: true
  463. }]
  464. });
  465. },
  466. initLogisticsCountingRecordsChart() {
  467. this.logisticsCountingRecordsChart.setOption({
  468. title: {
  469. text: '快递分布',
  470. left: 'left'
  471. },
  472. tooltip: {
  473. trigger: 'item',
  474. formatter: '{a} <br/>{b} : {c} ({d}%)'
  475. },
  476. series: [
  477. {
  478. name: '快递分布',
  479. type: 'pie',
  480. radius: '55%',
  481. center: ['50%', '60%'],
  482. data: this.logisticsCountingRecords,
  483. emphasis: {
  484. itemStyle: {
  485. shadowBlur: 10,
  486. shadowOffsetX: 0,
  487. shadowColor: 'rgba(0, 0, 0, 0.5)'
  488. }
  489. }
  490. }
  491. ]
  492. });
  493. },
  494. initWarehouseCountingRecordsChart() {
  495. this.warehouseCountingRecordsChart.setOption({
  496. title: {
  497. text: '仓库分布',
  498. left: 'left'
  499. },
  500. tooltip: {
  501. trigger: 'item',
  502. formatter: '{a} <br/>{b} : {c} ({d}%)'
  503. },
  504. series: [
  505. {
  506. name: '仓库分布',
  507. type: 'pie',
  508. radius: '55%',
  509. center: ['50%', '60%'],
  510. data: this.warehouseCountingRecords,
  511. emphasis: {
  512. itemStyle: {
  513. shadowBlur: 10,
  514. shadowOffsetX: 0,
  515. shadowColor: 'rgba(0, 0, 0, 0.5)'
  516. }
  517. }
  518. }
  519. ]
  520. });
  521. },
  522. initLaborReportsUserGroupsCountChart() {
  523. this.laborReportsUserGroupsCountChart.setOption({
  524. title: {
  525. text: '小组临时工分布',
  526. left: 'left'
  527. },
  528. tooltip: {
  529. trigger: 'item',
  530. formatter: '{a} <br/>{b} : {c} ({d}%)'
  531. },
  532. series: [
  533. {
  534. name: '小组临时工分布',
  535. type: 'pie',
  536. radius: '55%',
  537. center: ['50%', '60%'],
  538. data: this.laborReportsUserGroupsCount,
  539. emphasis: {
  540. itemStyle: {
  541. shadowBlur: 10,
  542. shadowOffsetX: 0,
  543. shadowColor: 'rgba(0, 0, 0, 0.5)'
  544. }
  545. }
  546. }
  547. ]
  548. });
  549. },
  550. initLaborReportsCountingRecords() {
  551. let _this = this;
  552. this.laborReportsCountingRecords.forEach(function (item) {
  553. _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
  554. _this.laborReportsCountingRecordsData.push(item.counter);
  555. });
  556. },
  557. orderCountingRecordApi(orderCountingRecordsUnit) {
  558. if (orderCountingRecordsUnit === '') {
  559. orderCountingRecordsUnit = this.orderCountingRecordsUnit;
  560. }
  561. switch (orderCountingRecordsUnit) {
  562. case '日':
  563. this.orderCountingRecordsDayShow = true;
  564. this.orderCountingRecordsMonthShow = false;
  565. this.orderCountingRecordsYearShow = false;
  566. this.orderCountingRecordsStart = moment().subtract('1', 'month').format('yyyy-MM-DD');
  567. break;
  568. case '月':
  569. this.orderCountingRecordsDayShow = false;
  570. this.orderCountingRecordsMonthShow = true;
  571. this.orderCountingRecordsYearShow = false;
  572. this.orderCountingRecordsStart = moment().subtract('12', 'month').format('yyyy-MM-DD');
  573. break;
  574. case '年':
  575. this.orderCountingRecordsDayShow = false;
  576. this.orderCountingRecordsMonthShow = false;
  577. this.orderCountingRecordsYearShow = true;
  578. this.orderCountingRecordsStart = moment().subtract('12', 'month').format('yyyy-MM-DD');
  579. break;
  580. }
  581. this.orderCountingRecordsUnit = orderCountingRecordsUnit;
  582. let formData = new FormData();
  583. formData.append('start', this.orderCountingRecordsStart);
  584. formData.append('end', this.orderCountingRecordsEnd);
  585. formData.append('unit', orderCountingRecordsUnit);
  586. this.orderCountingRecordsShow = false;
  587. let _this = this;
  588. axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}', formData).then(function (res) {
  589. if (res.status === 200) {
  590. _this.orderCountingRecords = res.data.orderCountingRecords;
  591. _this.orderCountingRecordsDateTarget = [];
  592. _this.orderCountingRecordsData = [];
  593. _this.initOrderCountingRecords();
  594. _this.initOrderCountingRecordsChart();
  595. _this.orderCountingRecordsShow = true;
  596. }
  597. });
  598. },
  599. logisticsCountingRecordsApi() {
  600. this.logisticsCountingRecordsShow = false;
  601. let formData = new FormData();
  602. formData.append('start', this.logisticsCountingRecordsData[0]);
  603. formData.append('end', this.logisticsCountingRecordsData[1]);
  604. let _this = this;
  605. axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}', formData).then(function (res) {
  606. if (res.status === 200) {
  607. _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
  608. _this.initLogisticsCountingRecordsChart();
  609. _this.logisticsCountingRecordsShow = true;
  610. }
  611. });
  612. },
  613. warehouseCountingRecordsApi() {
  614. this.warehouseCountingRecordsShow = false;
  615. let formData = new FormData();
  616. formData.append('start', this.warehouseCountingRecordsData[0]);
  617. formData.append('end', this.warehouseCountingRecordsData[1]);
  618. let _this = this;
  619. axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
  620. if (res.status === 200) {
  621. _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
  622. _this.initWarehouseCountingRecordsChart();
  623. _this.warehouseCountingRecordsShow = true;
  624. }
  625. });
  626. },
  627. laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
  628. this.laborReportsCountingRecordsShow = false;
  629. if (laborReportsCountingRecordUnit === '') {
  630. laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
  631. }
  632. this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
  633. switch (laborReportsCountingRecordUnit) {
  634. case '日':
  635. this.laborReportsCountingRecordsDayShow = true;
  636. this.laborReportsCountingRecordsMonthShow = false;
  637. this.laborReportsCountingRecordsYearShow = false;
  638. this.laborReportsCountingRecordsStart = moment().subtract('1', 'month').format('yyyy-MM-DD');
  639. break;
  640. case '月':
  641. this.laborReportsCountingRecordsDayShow = false;
  642. this.laborReportsCountingRecordsMonthShow = true;
  643. this.laborReportsCountingRecordsYearShow = false;
  644. this.laborReportsCountingRecordsStart = moment().subtract('12', 'month').format('yyyy-MM-DD');
  645. break;
  646. case '年':
  647. this.laborReportsCountingRecordsDayShow = false;
  648. this.laborReportsCountingRecordsMonthShow = false;
  649. this.laborReportsCountingRecordsYearShow = true;
  650. this.laborReportsCountingRecordsStart = moment().subtract('12', 'month').format('yyyy-MM-DD');
  651. break;
  652. }
  653. let formData = new FormData();
  654. formData.append('start', this.laborReportsCountingRecordsStart);
  655. formData.append('end', this.laborReportsCountingRecordsEnd);
  656. formData.append('unit', laborReportsCountingRecordUnit);
  657. let _this = this;
  658. axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
  659. if (res.status === 200) {
  660. _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
  661. _this.laborReportsCountingRecordsDateTarget = [];
  662. _this.laborReportsCountingRecordsData = [];
  663. _this.initLaborReportsCountingRecords();
  664. _this.initLaborReportsCountingRecordsChart();
  665. _this.laborReportsCountingRecordsShow = true;
  666. }
  667. });
  668. },
  669. laborReportsUserGroupsCountApi() {
  670. this.laborReportsUserGroupsCountShow = false;
  671. let formData = new FormData();
  672. formData.append('start', this.laborReportsUserGroupsCountDate[0]);
  673. formData.append('end', this.laborReportsUserGroupsCountDate[1]);
  674. let _this = this;
  675. axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
  676. if (res.status === 200) {
  677. _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
  678. _this.initLaborReportsUserGroupsCountChart();
  679. _this.laborReportsUserGroupsCountShow = true;
  680. }
  681. });
  682. },
  683. }
  684. });
  685. </script>
  686. @endsection