panel.blade.php 46 KB

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