panel.blade.php 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  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. if (this.orderCountingRecords[0]!=null) {
  483. this.initOrderCountingRecords();
  484. this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
  485. this.initOrderCountingRecordsChart();
  486. }
  487. this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
  488. this.initLogisticsCountingRecordsChart();
  489. this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
  490. this.initWarehouseCountingRecordsChart();
  491. @can('人事管理-临时工报表-可见全部组')
  492. this.initLaborReportsCountingRecords();
  493. this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
  494. this.initLaborReportsCountingRecordsChart();
  495. this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
  496. this.initLaborReportsUserGroupsCountChart();
  497. @endcan
  498. },
  499. methods: {
  500. switchDataPanel_forOrderCountingRecords(fromUnit, toUnit) {
  501. switch (fromUnit) {
  502. case '日':
  503. this.orderUnitsData.start_day = this.orderCountingRecordsStart;
  504. this.orderUnitsData.end_day = this.orderCountingRecordsEnd;
  505. break;
  506. case '月':
  507. this.orderUnitsData.start_month = this.orderCountingRecordsStart;
  508. this.orderUnitsData.end_month = this.orderCountingRecordsEnd;
  509. break;
  510. case '年':
  511. this.orderUnitsData.start_year = this.orderCountingRecordsStart;
  512. this.orderUnitsData.end_year = this.orderCountingRecordsEnd;
  513. break;
  514. }
  515. switch (toUnit) {
  516. case '日':
  517. this.orderCountingRecordsStart = this.orderUnitsData.start_day;
  518. this.orderCountingRecordsEnd = this.orderUnitsData.end_day;
  519. break;
  520. case '月':
  521. this.orderCountingRecordsStart = this.orderUnitsData.start_month;
  522. this.orderCountingRecordsEnd = this.orderUnitsData.end_month;
  523. break;
  524. case '年':
  525. this.orderCountingRecordsStart = this.orderUnitsData.start_year;
  526. this.orderCountingRecordsEnd = this.orderUnitsData.end_year;
  527. break;
  528. }
  529. },
  530. switchDataPanel_forLaborReports(fromUnit, toUnit) {
  531. switch (fromUnit) {
  532. case '日':
  533. this.laborReportsData.start_day = this.laborReportsCountingRecordsStart;
  534. this.laborReportsData.end_day = this.laborReportsCountingRecordsEnd;
  535. break;
  536. case '月':
  537. this.laborReportsData.start_month = this.laborReportsCountingRecordsStart;
  538. this.laborReportsData.end_month = this.laborReportsCountingRecordsEnd;
  539. break;
  540. case '年':
  541. this.laborReportsData.start_year = this.laborReportsCountingRecordsStart;
  542. this.laborReportsData.end_year = this.laborReportsCountingRecordsEnd;
  543. break;
  544. }
  545. switch (toUnit) {
  546. case '日':
  547. this.laborReportsCountingRecordsStart = this.laborReportsData.start_day;
  548. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_day;
  549. break;
  550. case '月':
  551. this.laborReportsCountingRecordsStart = this.laborReportsData.start_month;
  552. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_month;
  553. break;
  554. case '年':
  555. this.laborReportsCountingRecordsStart = this.laborReportsData.start_year;
  556. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_year;
  557. break;
  558. }
  559. },
  560. getWareHouse: function (code) {
  561. return this.warehouses[code];
  562. },
  563. initOrderCountingRecords() {
  564. for (let key in this.orderCountingRecords) {
  565. this.orderCountingRecordsDateTarget.push(this.orderCountingRecords[key].date_target);
  566. this.orderCountingRecordsData.push(this.orderCountingRecords[key].counter);
  567. }
  568. },
  569. initOrderCountingRecordsChart(text) {
  570. if (text==null ||text==''||text==undefined) text='默认显示权限下所有货主订单数量';
  571. this.orderCountingRecordsChart.setOption({
  572. title: {text: '订单量趋势',subtext: text,},
  573. tooltip: {},
  574. legend: {data: ['订单数']},
  575. xAxis: {
  576. type: 'category',
  577. data: this.orderCountingRecordsDateTarget
  578. },
  579. yAxis: {type: 'value'},
  580. series: [{
  581. data: this.orderCountingRecordsData,
  582. type: 'line',
  583. smooth: true
  584. }]
  585. });
  586. },
  587. initLaborReportsCountingRecordsChart() {
  588. this.laborReportsCountingRecordsChart.setOption({
  589. title: {text: '临时用工趋势'},
  590. tooltip: {},
  591. legend: {data: ['临时用工数']},
  592. xAxis: {
  593. type: 'category',
  594. data: this.laborReportsCountingRecordsDateTarget
  595. },
  596. yAxis: {type: 'value'},
  597. series: [{
  598. data: this.laborReportsCountingRecordsData,
  599. type: 'line',
  600. smooth: true
  601. }]
  602. });
  603. },
  604. initLogisticsCountingRecordsChart(text) {
  605. if (text==null ||text==''||text==undefined) text='默认显示权限下所有货主快递分布';
  606. this.logisticsCountingRecordsChart.setOption({
  607. title: {
  608. text: '快递分布',
  609. subtext:text,
  610. left: 'left'
  611. },
  612. tooltip: {
  613. trigger: 'item',
  614. formatter: '{a} <br/>{b} : {c} ({d}%)'
  615. },
  616. series: [
  617. {
  618. name: '快递分布',
  619. type: 'pie',
  620. radius: '55%',
  621. center: ['50%', '60%'],
  622. data: this.logisticsCountingRecords,
  623. emphasis: {
  624. itemStyle: {
  625. shadowBlur: 10,
  626. shadowOffsetX: 0,
  627. shadowColor: 'rgba(0, 0, 0, 0.5)'
  628. }
  629. }
  630. }
  631. ]
  632. });
  633. },
  634. initWarehouseCountingRecordsChart() {
  635. this.warehouseCountingRecordsChart.setOption({
  636. title: {
  637. text: '仓库分布',
  638. left: 'left'
  639. },
  640. tooltip: {
  641. trigger: 'item',
  642. formatter: '{a} <br/>{b} : {c} ({d}%)'
  643. },
  644. series: [
  645. {
  646. name: '仓库分布',
  647. type: 'pie',
  648. radius: '55%',
  649. center: ['50%', '60%'],
  650. data: this.warehouseCountingRecords,
  651. emphasis: {
  652. itemStyle: {
  653. shadowBlur: 10,
  654. shadowOffsetX: 0,
  655. shadowColor: 'rgba(0, 0, 0, 0.5)'
  656. }
  657. }
  658. }
  659. ]
  660. });
  661. },
  662. initLaborReportsUserGroupsCountChart() {
  663. this.laborReportsUserGroupsCountChart.setOption({
  664. title: {
  665. text: '小组临时工分布',
  666. left: 'left'
  667. },
  668. tooltip: {
  669. trigger: 'item',
  670. formatter: '{a} <br/>{b} : {c} ({d}%)'
  671. },
  672. series: [
  673. {
  674. name: '小组临时工分布',
  675. type: 'pie',
  676. radius: '55%',
  677. center: ['50%', '60%'],
  678. data: this.laborReportsUserGroupsCount,
  679. emphasis: {
  680. itemStyle: {
  681. shadowBlur: 10,
  682. shadowOffsetX: 0,
  683. shadowColor: 'rgba(0, 0, 0, 0.5)'
  684. }
  685. }
  686. }
  687. ]
  688. });
  689. },
  690. initLaborReportsCountingRecords() {
  691. let _this = this;
  692. this.laborReportsCountingRecords.forEach(function (item) {
  693. _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
  694. _this.laborReportsCountingRecordsData.push(item.counter);
  695. });
  696. },
  697. orderCountingRecordApi(orderCountingRecordsUnit) {
  698. if (orderCountingRecordsUnit === '') {
  699. orderCountingRecordsUnit = this.orderCountingRecordsUnit;
  700. }
  701. this.switchDataPanel_forOrderCountingRecords(this.orderCountingUnit, orderCountingRecordsUnit);
  702. this.orderCountingUnit = orderCountingRecordsUnit;
  703. switch (orderCountingRecordsUnit) {
  704. case '日':
  705. this.orderCountingRecordsDayShow = true;
  706. this.orderCountingRecordsMonthShow = false;
  707. this.orderCountingRecordsYearShow = false;
  708. break;
  709. case '月':
  710. this.orderCountingRecordsDayShow = false;
  711. this.orderCountingRecordsMonthShow = true;
  712. this.orderCountingRecordsYearShow = false;
  713. break;
  714. case '年':
  715. this.orderCountingRecordsDayShow = false;
  716. this.orderCountingRecordsMonthShow = false;
  717. this.orderCountingRecordsYearShow = true;
  718. break;
  719. }
  720. this.orderCountingRecordsUnit = orderCountingRecordsUnit;
  721. // let formData = new FormData();
  722. // formData.append('start', this.orderCountingRecordsStart);
  723. // formData.append('end', this.orderCountingRecordsEnd);
  724. // formData.append('unit', orderCountingRecordsUnit);
  725. // formData.append('owner_ids',this.selectOwners);
  726. this.orderCountingRecordsShow = false;
  727. let _this = this;
  728. let text = null;
  729. axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}',{
  730. 'start':this.orderCountingRecordsStart,'end':this.orderCountingRecordsEnd,
  731. 'unit':orderCountingRecordsUnit,'owner_ids':this.selectOrderOwners}).then(function (res) {
  732. if (res.status === 200) {
  733. _this.orderCountingRecords = res.data.orderCountingRecords;
  734. _this.orderCountingRecordsDateTarget = [];
  735. _this.orderCountingRecordsData = [];
  736. _this.initOrderCountingRecords();
  737. if (_this.selectOrderOwners.length>0) text='当前选中货主订单数量';
  738. _this.initOrderCountingRecordsChart(text);
  739. _this.orderCountingRecordsShow = true;
  740. }
  741. });
  742. },
  743. logisticsCountingRecordsApi() {
  744. let text = null;
  745. this.logisticsCountingRecordsShow = false;
  746. // let formData = new FormData();
  747. // formData.append('start', this.logisticsCountingRecordsData[0]);
  748. // formData.append('end', this.logisticsCountingRecordsData[1]);
  749. let _this = this;
  750. axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}',{
  751. 'start':this.logisticsCountingRecordsData[0],'end':this.logisticsCountingRecordsData[1],'owner_ids':this.selectLogisticsOwners
  752. }).then(function (res) {
  753. if (res.status === 200) {
  754. _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
  755. if (_this.selectLogisticsOwners.length>0) text='当前选中货主快递分布';
  756. _this.initLogisticsCountingRecordsChart(text);
  757. _this.logisticsCountingRecordsShow = true;
  758. }
  759. });
  760. },
  761. warehouseCountingRecordsApi() {
  762. this.warehouseCountingRecordsShow = false;
  763. let formData = new FormData();
  764. formData.append('start', this.warehouseCountingRecordsData[0]);
  765. formData.append('end', this.warehouseCountingRecordsData[1]);
  766. let _this = this;
  767. axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
  768. if (res.status === 200) {
  769. _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
  770. _this.initWarehouseCountingRecordsChart();
  771. _this.warehouseCountingRecordsShow = true;
  772. }
  773. });
  774. },
  775. laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
  776. this.laborReportsCountingRecordsShow = false;
  777. if (laborReportsCountingRecordUnit === '') {
  778. laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
  779. }
  780. this.switchDataPanel_forLaborReports(this.laborReportsUnit, laborReportsCountingRecordUnit);
  781. this.laborReportsUnit = laborReportsCountingRecordUnit;
  782. this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
  783. switch (laborReportsCountingRecordUnit) {
  784. case '日':
  785. this.laborReportsCountingRecordsDayShow = true;
  786. this.laborReportsCountingRecordsMonthShow = false;
  787. this.laborReportsCountingRecordsYearShow = false;
  788. break;
  789. case '月':
  790. this.laborReportsCountingRecordsDayShow = false;
  791. this.laborReportsCountingRecordsMonthShow = true;
  792. this.laborReportsCountingRecordsYearShow = false;
  793. break;
  794. case '年':
  795. this.laborReportsCountingRecordsDayShow = false;
  796. this.laborReportsCountingRecordsMonthShow = false;
  797. this.laborReportsCountingRecordsYearShow = true;
  798. break;
  799. }
  800. let formData = new FormData();
  801. formData.append('start', this.laborReportsCountingRecordsStart);
  802. formData.append('end', this.laborReportsCountingRecordsEnd);
  803. formData.append('unit', laborReportsCountingRecordUnit);
  804. let _this = this;
  805. axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
  806. if (res.status === 200) {
  807. _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
  808. _this.laborReportsCountingRecordsDateTarget = [];
  809. _this.laborReportsCountingRecordsData = [];
  810. _this.initLaborReportsCountingRecords();
  811. _this.initLaborReportsCountingRecordsChart();
  812. _this.laborReportsCountingRecordsShow = true;
  813. }
  814. });
  815. },
  816. laborReportsUserGroupsCountApi() {
  817. this.laborReportsUserGroupsCountShow = false;
  818. let formData = new FormData();
  819. formData.append('start', this.laborReportsUserGroupsCountDate[0]);
  820. formData.append('end', this.laborReportsUserGroupsCountDate[1]);
  821. let _this = this;
  822. axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
  823. if (res.status === 200) {
  824. _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
  825. _this.initLaborReportsUserGroupsCountChart();
  826. _this.laborReportsUserGroupsCountShow = true;
  827. }
  828. });
  829. },
  830. }
  831. });
  832. </script>
  833. @endsection