panel.blade.php 48 KB

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