panel.blade.php 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  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-6">
  57. <div class="card">
  58. <div class="card-header">
  59. <div class="row">
  60. <span v-show="orderCountingRecordsDayShow" class="demonstration mt-1">起始日期:</span>
  61. <el-date-picker
  62. size="small"
  63. @blur="orderCountingRecordApi('')"
  64. v-show="orderCountingRecordsDayShow"
  65. v-model="orderCountingRecordsStart"
  66. type="date"
  67. value-format="yyyy-MM-dd"
  68. placeholder="选起始日期">
  69. </el-date-picker>
  70. <span v-show="orderCountingRecordsDayShow" class="demonstration mt-1">结束日期:</span>
  71. <el-date-picker
  72. size="small"
  73. @blur="orderCountingRecordApi('')"
  74. v-show="orderCountingRecordsDayShow"
  75. v-model="orderCountingRecordsEnd"
  76. type="date"
  77. value-format="yyyy-MM-dd"
  78. placeholder="选择结束日期">
  79. </el-date-picker>
  80. <span v-show="orderCountingRecordsMonthShow" class="demonstration mt-1">起始月:</span>
  81. <el-date-picker
  82. size="small"
  83. @blur="orderCountingRecordApi('')"
  84. v-show="orderCountingRecordsMonthShow"
  85. v-model="orderCountingRecordsStart"
  86. type="month"
  87. value-format="yyyy-MM-dd"
  88. placeholder="选择起始月">
  89. </el-date-picker>
  90. <span v-show="orderCountingRecordsMonthShow" class="demonstration mt-1">结束月:</span>
  91. <el-date-picker
  92. size="small"
  93. @blur="orderCountingRecordApi('')"
  94. v-show="orderCountingRecordsMonthShow"
  95. v-model="orderCountingRecordsEnd"
  96. type="month"
  97. value-format="yyyy-MM-dd"
  98. placeholder="选择结束月">
  99. </el-date-picker>
  100. <span v-show="orderCountingRecordsYearShow" class="demonstration mt-1">起始年:</span>
  101. <el-date-picker
  102. size="small"
  103. @blur="orderCountingRecordApi('')"
  104. v-show="orderCountingRecordsYearShow"
  105. v-model="orderCountingRecordsStart"
  106. type="year"
  107. value-format="yyyy-MM-dd"
  108. placeholder="选择年">
  109. </el-date-picker>
  110. <span v-show="orderCountingRecordsYearShow" class="demonstration mt-1">结束年:</span>
  111. <el-date-picker
  112. size="small"
  113. @blur="orderCountingRecordApi('')"
  114. v-show="orderCountingRecordsYearShow"
  115. v-model="orderCountingRecordsEnd"
  116. type="year"
  117. value-format="yyyy-MM-dd"
  118. placeholder="选择年">
  119. </el-date-picker>
  120. <div class="btn-group btn-group-sm ml-2" role="group">
  121. <el-button type="primary" value="日" @click="orderCountingRecordApi('日')"
  122. class="btn btn-secondary"
  123. v-model="orderCountingRecordsUnit">日
  124. </el-button>
  125. <el-button type="primary" value="月" @click="orderCountingRecordApi('月')"
  126. class="btn btn-secondary "
  127. v-model="orderCountingRecordsUnit">月
  128. </el-button>
  129. <el-button type="primary" value="年" @click="orderCountingRecordApi('年')"
  130. class="btn btn-secondary"
  131. v-model="orderCountingRecordsUnit">年
  132. </el-button>
  133. </div>
  134. <div class="ml-2">
  135. <el-select placeholder="请选择对应货主" multiple v-model="selectOrderOwners" size="small"
  136. @change="orderCountingRecordApi('')">
  137. <el-option label="选择所有" value="all"></el-option>
  138. <el-option v-for="item in owners" :label="item.name" :value="item.id"
  139. :key="item.id"></el-option>
  140. </el-select>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="card-body row">
  145. <div id="orderCountingRecords" class="col-12"
  146. style="min-height: 500px"></div>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="col-sm-3 col-lg-3 col-xl-3 col-md-3">
  151. <div class="card">
  152. <div class="card-header">
  153. <div class="block row">
  154. <span class="demonstration"></span>
  155. <el-date-picker
  156. size="small"
  157. style="width: 60%;"
  158. @blur="logisticsCountingRecordsApi()"
  159. v-model="logisticsCountingRecordsData"
  160. type="daterange"
  161. align="right"
  162. unlink-panels
  163. range-separator="-"
  164. start-placeholder="开始日期"
  165. end-placeholder="结束日期"
  166. value-format="yyyy-MM-dd"
  167. :picker-options="pickerOptions">
  168. </el-date-picker>
  169. <el-select placeholder="请选择对应货主" multiple v-model="selectLogisticsOwners" size="small" style="width: 50%" @change="logisticsCountingRecordsApi('')">
  170. <el-option label="选择所有" value="all"></el-option>
  171. <el-option v-for="item in owners" :label="item.name" :value="item.id" :key="item.id"></el-option>
  172. </el-select>
  173. </div>
  174. </div>
  175. <div class="card-body row">
  176. <div id="logisticsCountingRecords" class="col-12"
  177. style="min-height:500px;"></div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="col-sm-3 col-lg-3 col-xl-3 col-md-3">
  182. <div class="card">
  183. <div class="card-header">
  184. <div class="block">
  185. <span class="demonstration"></span>
  186. <el-date-picker
  187. size="small"
  188. style="width: 80%;"
  189. @blur="warehouseCountingRecordsApi()"
  190. v-model="warehouseCountingRecordsData"
  191. type="daterange"
  192. align="right"
  193. unlink-panels
  194. range-separator="-"
  195. start-placeholder="开始日期"
  196. end-placeholder="结束日期"
  197. value-format="yyyy-MM-dd"
  198. :picker-options="pickerOptions">
  199. </el-date-picker>
  200. </div>
  201. </div>
  202. <div class="card-body row">
  203. <div id="warehouseCountingRecords" class="col-12"
  204. style=min-height:500px;"></div>
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="row my-3">
  210. @can('人事管理-临时工报表-可见全部组')
  211. <div class="col-sm-6 col-lg-6 col-xl-6 col-md-6">
  212. <div class="card">
  213. <div class="card-header">
  214. <div class="block row">
  215. <span class="demonstration"></span>
  216. <span v-show="laborReportsCountingRecordsDayShow"
  217. class="demonstration mt-1">起始日期:</span>
  218. <el-date-picker
  219. size="small"
  220. @blur="laborReportsCountingRecordApi('')"
  221. v-show="laborReportsCountingRecordsDayShow"
  222. v-model="laborReportsCountingRecordsStart"
  223. type="date"
  224. value-format="yyyy-MM-dd"
  225. placeholder="选起始日期">
  226. </el-date-picker>
  227. <span v-show="laborReportsCountingRecordsDayShow"
  228. class="demonstration mt-1">结束日期:</span>
  229. <el-date-picker
  230. size="small"
  231. @blur="laborReportsCountingRecordApi('')"
  232. v-show="laborReportsCountingRecordsDayShow"
  233. v-model="laborReportsCountingRecordsEnd"
  234. type="date"
  235. value-format="yyyy-MM-dd"
  236. placeholder="选择结束日期">
  237. </el-date-picker>
  238. <span v-show="laborReportsCountingRecordsMonthShow"
  239. class="demonstration mt-1">起始月:</span>
  240. <el-date-picker
  241. size="small"
  242. @blur="laborReportsCountingRecordApi('')"
  243. v-show="laborReportsCountingRecordsMonthShow"
  244. v-model="laborReportsCountingRecordsStart"
  245. type="month"
  246. value-format="yyyy-MM-dd"
  247. placeholder="选择起始月">
  248. </el-date-picker>
  249. <span v-show="laborReportsCountingRecordsMonthShow"
  250. class="demonstration mt-1">结束月:</span>
  251. <el-date-picker
  252. size="small"
  253. @blur="laborReportsCountingRecordApi('')"
  254. v-show="laborReportsCountingRecordsMonthShow"
  255. v-model="laborReportsCountingRecordsEnd"
  256. type="month"
  257. value-format="yyyy-MM-dd"
  258. placeholder="选择结束月">
  259. </el-date-picker>
  260. <span v-show="laborReportsCountingRecordsYearShow"
  261. 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"
  272. class="demonstration mt-1">结束年:</span>
  273. <el-date-picker
  274. size="small"
  275. @blur="laborReportsCountingRecordApi('')"
  276. v-show="laborReportsCountingRecordsYearShow"
  277. v-model="laborReportsCountingRecordsEnd"
  278. type="year"
  279. value-format="yyyy-MM-dd"
  280. placeholder="选择年">
  281. </el-date-picker>
  282. <div class="btn-group btn-group-sm ml-2" role="group">
  283. <el-button type="primary" value="日" @click="laborReportsCountingRecordApi('日')"
  284. class="btn btn-secondary"
  285. v-model="laborReportsCountingRecordUnit">日
  286. </el-button>
  287. <el-button type="primary" value="月" @click="laborReportsCountingRecordApi('月')"
  288. class="btn btn-secondary"
  289. v-model="laborReportsCountingRecordUnit">月
  290. </el-button>
  291. <el-button type="primary" value="年" @click="laborReportsCountingRecordApi('年')"
  292. class="btn btn-secondary"
  293. v-model="laborReportsCountingRecordUnit">年
  294. </el-button>
  295. </div>
  296. </div>
  297. </div>
  298. <div class="card-body row">
  299. <div id="laborReportsCountingRecords"
  300. class="col-12"
  301. style="min-height:500px;"></div>
  302. </div>
  303. </div>
  304. </div>
  305. <div class="col-sm-6 col-lg-6 col-xl-6 col-md-6">
  306. <div class="card">
  307. <div class="card-header">
  308. <span class="demonstration"></span>
  309. <el-date-picker
  310. size="small"
  311. @blur="laborReportsUserGroupsCountApi('')"
  312. v-model="laborReportsUserGroupsCountDate"
  313. type="daterange"
  314. align="right"
  315. unlink-panels
  316. range-separator="-"
  317. start-placeholder="开始日期"
  318. end-placeholder="结束日期"
  319. value-format="yyyy-MM-dd"
  320. :picker-options="pickerOptions">
  321. </el-date-picker>
  322. </div>
  323. <div class="card-body row">
  324. <div id="laborReportsUserGroupsCount"
  325. class="col-12"
  326. style="min-height:500px;"></div>
  327. </div>
  328. </div>
  329. </div>
  330. @endcan
  331. </div>
  332. <div class="row my-3">
  333. @can("控制台-称重统计")
  334. <div class="col-6">
  335. <div class="card">
  336. <div class="card-header">
  337. <div class="row">
  338. <el-date-picker size="small" class="col-6 date" @blur="loadWeightInfo()"
  339. type="daterange" align="right"
  340. v-model="searchOption.weightDate" unlink-panels range-separator="-"
  341. start-placeholder="开始日期" end-placeholder="结束日期"
  342. value-format="yyyy-MM-dd">
  343. </el-date-picker>
  344. <label class="col-3 offset-3">
  345. <select class="form-control rounded" v-model="searchOption.weightSelect"
  346. @change="switchWeightDate()">
  347. <option v-for="(date,i) in dateOptions" :value="i">@{{ date.text }}</option>
  348. </select>
  349. </label>
  350. </div>
  351. </div>
  352. <div class="card-body row">
  353. <div id="weight" class="col-12" style="min-height: 500px"></div>
  354. </div>
  355. </div>
  356. </div>
  357. @endcan
  358. {{--异常分布图--}}
  359. <div class="col-6">
  360. <div class="card">
  361. <div class="card-header">
  362. <div class="flex-column">
  363. <el-date-picker size="small" class="col-6 date" @blur="loadExceptionTypeInfo()"
  364. type="daterange" align="right"
  365. v-model="searchOption.exceptionTypeDate" unlink-panels range-separator="-"
  366. start-placeholder="开始日期" end-placeholder="结束日期"
  367. value-format="yyyy-MM-dd">
  368. </el-date-picker>
  369. <el-select class="col-3" placeholder="请选择对应货主" multiple v-model="selectExceptionTypeOwners" size="small" style="width: 20%" @change="loadExceptionTypeInfo()">
  370. <el-option label="选择所有" value="all"></el-option>
  371. <el-option v-for="item in owners" :label="item.name" :value="item.id" :key="item.id"></el-option>
  372. </el-select>
  373. <label class="col-3 ">
  374. <select class="form-control rounded" v-model="searchOption.exceptionTypeSelect"
  375. @change="switchExceptionTypeDate()">
  376. <option v-for="(date,i) in dateOptions" :value="i">@{{ date.text }}</option>
  377. </select>
  378. </label>
  379. </div>
  380. </div>
  381. <div class="card-body row">
  382. <div id="exceptionType" class="col-12" style="min-height: 500px"></div>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. <div class="row my-3">
  388. {{--快递接口请求成功失败统计图--}}
  389. <div class="col-6">
  390. <div class="card">
  391. <div class="card-header">
  392. <div class="row">
  393. <el-date-picker size="small" class="col-6 date" @blur="loadOrderPackageReceivedSyncRecordInfo()"
  394. type="daterange" align="right"
  395. v-model="searchOption.OrderPackageReceivedSyncRecordDate" unlink-panels range-separator="-"
  396. start-placeholder="开始日期" end-placeholder="结束日期"
  397. value-format="yyyy-MM-dd">
  398. </el-date-picker>
  399. <label class="col-3 offset-3">
  400. <select class="form-control rounded" v-model="searchOption.OrderPackageReceivedSyncRecordSelect"
  401. @change="switchOrderPackageReceivedSyncRecordDate()">
  402. <option v-for="(date,i) in dateOptions" :value="i">@{{ date.text }}</option>
  403. </select>
  404. </label>
  405. </div>
  406. </div>
  407. <div class="card-body row">
  408. <div id="orderPackageReceivedSyncRecord" class="col-12" style="min-height: 500px"></div>
  409. </div>
  410. </div>
  411. </div>
  412. </div>
  413. </div>
  414. </div>
  415. @endsection
  416. @section('lastScript')
  417. <script src="{{ mix('js/echarts.js') }}"></script>
  418. <script src="{{ mix('js/element-ui.js') }}"></script>
  419. <script>
  420. let vue = new Vue({
  421. el: "#list",
  422. data: {
  423. myChart: null,
  424. menus:{!! $menus !!},
  425. owners:{!! $owners !!},
  426. selectOrderOwners: [],
  427. selectLogisticsOwners: [],
  428. selectExceptionTypeOwners: [],
  429. warehousesOrders:{!! $warehousesOrders !!},
  430. orderCountingRecords:{},
  431. logisticsCountingRecords:{},
  432. warehouseCountingRecords:{},
  433. laborReportsCountingRecords:{},
  434. laborReportsUserGroupsCount:{},
  435. warehouses: {
  436. "WH01": '松江一仓',
  437. "WH02": '松江二仓',
  438. "WH03": '嘉定一仓',},
  439. totalOrders: {
  440. total: null,
  441. createOrder: null,
  442. assignedComplete: null,
  443. partialAllocation: null,
  444. partPacking: null,
  445. sowComplete: null,
  446. },
  447. orderCountingRecordsDateTarget: [],
  448. orderCountingRecordsData: [],
  449. laborReportsCountingRecordsDateTarget: [],
  450. laborReportsCountingRecordsData: [],
  451. pickerOptions: {
  452. shortcuts: [{
  453. text: '最近一周',
  454. onClick(picker) {
  455. const end = new Date();
  456. const start = new Date();
  457. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  458. picker.$emit('pick', [start, end]);
  459. }
  460. }, {
  461. text: '最近一个月',
  462. onClick(picker) {
  463. const end = new Date();
  464. const start = new Date();
  465. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  466. picker.$emit('pick', [start, end]);
  467. }
  468. }, {
  469. text: '最近三个月',
  470. onClick(picker) {
  471. const end = new Date();
  472. const start = new Date();
  473. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  474. picker.$emit('pick', [start, end]);
  475. }
  476. }]
  477. },
  478. dateOptions:[{text:'当天',start:moment().format('yyyy-MM-DD'),end:moment().format('yyyy-MM-DD')},
  479. {text:"昨天",start:moment().subtract("1","day").format('yyyy-MM-DD'),end:moment().subtract("1","day").format('yyyy-MM-DD')},
  480. {text:"本周",start:moment().weekday(1).format('yyyy-MM-DD'),end:moment().weekday(7).format('yyyy-MM-DD')},
  481. {text:"上周",start:moment().weekday(-6).format('yyyy-MM-DD'),end:moment().weekday(0).format('yyyy-MM-DD')},
  482. {text:"本月",start:moment().startOf("month").format('yyyy-MM-DD'),end:moment().endOf("month").format('yyyy-MM-DD')},
  483. {text:"上月",start:moment().month(moment().month() - 1).startOf('month').format('yyyy-MM-DD'),end:moment().month(moment().month() - 1).endOf('month').format('yyyy-MM-DD')},
  484. {text:"本季度",start:moment(moment().quarter(moment().quarter()).startOf('quarter').valueOf()).format('yyyy-MM-DD'),end:moment(moment().quarter(moment().quarter()).endOf('quarter').valueOf()).format('yyyy-MM-DD')},
  485. {text:"上季度",start:moment(moment().quarter(moment().quarter() - 1).startOf('quarter').valueOf()).format('yyyy-MM-DD'),end:moment(moment().quarter(moment().quarter() - 1).endOf('quarter').valueOf()).format('yyyy-MM-DD')},
  486. {text:"本年",start:moment(moment().year(moment().year()).startOf('year').valueOf()).format('yyyy-MM-DD'),end:moment(moment().year(moment().year()).endOf('year').valueOf()).format('yyyy-MM-DD')},
  487. {text:"去年",start:moment(moment().year(moment().year() - 1).startOf('year').valueOf()).format('yyyy-MM-DD'),end:moment(moment().year(moment().year() - 1).endOf('year').valueOf()).format('yyyy-MM-DD')}],
  488. logisticsCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  489. moment(new Date()).format('yyyy-MM-DD')],
  490. warehouseCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  491. moment(new Date()).format('yyyy-MM-DD')],
  492. laborReportsCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  493. moment(new Date()).format('yyyy-MM-DD')],
  494. laborReportsUserGroupsCountDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  495. moment(new Date()).format('yyyy-MM-DD')],
  496. orderCountingRecordsUnit: '日',
  497. laborReportsCountingRecordUnit: '日',
  498. orderCountingRecordsDayShow: true,
  499. orderCountingRecordsMonthShow: false,
  500. orderCountingRecordsYearShow: false,
  501. orderCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  502. orderCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  503. orderCountingUnit: '日',
  504. orderUnitsData: {
  505. start_day: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  506. end_day: moment(new Date()).format('yyyy-MM-DD'),
  507. start_month: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  508. end_month: moment(new Date()).format('yyyy-MM-DD'),
  509. start_year: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  510. end_year: moment(new Date()).format('yyyy-MM-DD'),
  511. },
  512. laborReportsUnit: '日',
  513. laborReportsData: {
  514. start_day: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  515. end_day: moment(new Date()).format('yyyy-MM-DD'),
  516. start_month: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  517. end_month: moment(new Date()).format('yyyy-MM-DD'),
  518. start_year: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  519. end_year: moment(new Date()).format('yyyy-MM-DD'),
  520. },
  521. laborReportsCountingRecordsDayShow: true,
  522. laborReportsCountingRecordsMonthShow: false,
  523. laborReportsCountingRecordsYearShow: false,
  524. laborReportsCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  525. laborReportsCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  526. cardPool:{},
  527. searchOption:{
  528. weightDate:[],
  529. exceptionTypeDate: [],
  530. weightSelect:"",
  531. exceptionTypeSelect:"",
  532. OrderPackageReceivedSyncRecordDate: [],
  533. OrderPackageReceivedSyncRecordSelect:"",
  534. },
  535. },
  536. watch:{
  537. selectOrderOwners:function(val,oldval){
  538. let newindex = val.indexOf('all');
  539. let oldindex = oldval.indexOf('all');
  540. if(newindex!=-1 && oldindex==-1 && val.length>1)
  541. this.selectOrderOwners=['all'];
  542. else if(newindex!=-1 && oldindex!=-1 && val.length>1)
  543. this.selectOrderOwners.splice(val.indexOf('all'),1)
  544. },
  545. selectLogisticsOwners:function(val,oldval){
  546. let newindex = val.indexOf('all');
  547. let oldindex = oldval.indexOf('all');
  548. if(newindex!=-1 && oldindex==-1 && val.length>1)
  549. this.selectLogisticsOwners=['all'];
  550. else if(newindex!=-1 && oldindex!=-1 && val.length>1)
  551. this.selectLogisticsOwners.splice(val.indexOf('all'),1)
  552. }
  553. },
  554. mounted() {
  555. $('#list').removeClass('d-none');
  556. let index = 4;
  557. this.searchOption.weightSelect = index;
  558. this.searchOption.OrderPackageReceivedSyncRecordSelect = 2;
  559. this.searchOption.exceptionTypeSelect = index;
  560. this.searchOption.weightDate = [this.dateOptions[index].start, this.dateOptions[index].end];
  561. this.searchOption.OrderPackageReceivedSyncRecordDate = [this.dateOptions[2].start, this.dateOptions[2].end];
  562. this.searchOption.exceptionTypeDate = [this.dateOptions[index].start, this.dateOptions[index].end];
  563. let _this = this;
  564. this.warehousesOrders.forEach(function (item) {
  565. _this.totalOrders.total += parseInt(item.total);
  566. _this.totalOrders.createOrder += item.createOrder;
  567. _this.totalOrders.assignedComplete += item.assignedComplete;
  568. _this.totalOrders.partialAllocation += item.partialAllocation;
  569. _this.totalOrders.partPacking += item.partPacking;
  570. _this.totalOrders.sowComplete += item.sowComplete;
  571. });
  572. //订单量趋势
  573. this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
  574. this.initOrderCountingRecordsChart();
  575. this.orderCountingRecordApi('日');
  576. //订单快递分布
  577. this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
  578. this.initLogisticsCountingRecordsChart();
  579. this.logisticsCountingRecordsApi();
  580. //订单仓库分布
  581. this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
  582. this.initWarehouseCountingRecordsChart();
  583. this.warehouseCountingRecordsApi();
  584. @can('人事管理-临时工报表-可见全部组')
  585. this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
  586. this.initLaborReportsCountingRecordsChart();
  587. this.laborReportsCountingRecordApi('日');
  588. this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
  589. this.initLaborReportsUserGroupsCountChart();
  590. this.laborReportsUserGroupsCountApi();
  591. @endcan
  592. @can("控制台-称重统计")
  593. this.cardPool.weight = echarts.init(document.getElementById("weight"));
  594. this.loadWeightInfo();
  595. @endcan
  596. this.cardPool.orderPackageReceivedSyncRecord = echarts.init(document.getElementById("orderPackageReceivedSyncRecord"));
  597. this.loadOrderPackageReceivedSyncRecordInfo();
  598. this.cardPool.exceptionType = echarts.init(document.getElementById("exceptionType"));
  599. this.loadExceptionTypeInfo();
  600. },
  601. methods: {
  602. switchDataPanel_forOrderCountingRecords(fromUnit, toUnit) {
  603. switch (fromUnit) {
  604. case '日':
  605. this.orderUnitsData.start_day = this.orderCountingRecordsStart;
  606. this.orderUnitsData.end_day = this.orderCountingRecordsEnd;
  607. break;
  608. case '月':
  609. this.orderUnitsData.start_month = this.orderCountingRecordsStart;
  610. this.orderUnitsData.end_month = this.orderCountingRecordsEnd;
  611. break;
  612. case '年':
  613. this.orderUnitsData.start_year = this.orderCountingRecordsStart;
  614. this.orderUnitsData.end_year = this.orderCountingRecordsEnd;
  615. break;
  616. }
  617. switch (toUnit) {
  618. case '日':
  619. this.orderCountingRecordsStart = this.orderUnitsData.start_day;
  620. this.orderCountingRecordsEnd = this.orderUnitsData.end_day;
  621. break;
  622. case '月':
  623. this.orderCountingRecordsStart = this.orderUnitsData.start_month;
  624. this.orderCountingRecordsEnd = this.orderUnitsData.end_month;
  625. break;
  626. case '年':
  627. this.orderCountingRecordsStart = this.orderUnitsData.start_year;
  628. this.orderCountingRecordsEnd = this.orderUnitsData.end_year;
  629. break;
  630. }
  631. },
  632. switchDataPanel_forLaborReports(fromUnit, toUnit) {
  633. switch (fromUnit) {
  634. case '日':
  635. this.laborReportsData.start_day = this.laborReportsCountingRecordsStart;
  636. this.laborReportsData.end_day = this.laborReportsCountingRecordsEnd;
  637. break;
  638. case '月':
  639. this.laborReportsData.start_month = this.laborReportsCountingRecordsStart;
  640. this.laborReportsData.end_month = this.laborReportsCountingRecordsEnd;
  641. break;
  642. case '年':
  643. this.laborReportsData.start_year = this.laborReportsCountingRecordsStart;
  644. this.laborReportsData.end_year = this.laborReportsCountingRecordsEnd;
  645. break;
  646. }
  647. switch (toUnit) {
  648. case '日':
  649. this.laborReportsCountingRecordsStart = this.laborReportsData.start_day;
  650. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_day;
  651. break;
  652. case '月':
  653. this.laborReportsCountingRecordsStart = this.laborReportsData.start_month;
  654. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_month;
  655. break;
  656. case '年':
  657. this.laborReportsCountingRecordsStart = this.laborReportsData.start_year;
  658. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_year;
  659. break;
  660. }
  661. },
  662. getWareHouse: function (code) {
  663. return this.warehouses[code];
  664. },
  665. initOrderCountingRecords() {
  666. for (let key in this.orderCountingRecords) {
  667. this.orderCountingRecordsDateTarget.push(this.orderCountingRecords[key].date_target);
  668. this.orderCountingRecordsData.push(this.orderCountingRecords[key].counter);
  669. }
  670. },
  671. initOrderCountingRecordsChart(text) {
  672. this.orderCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  673. if (text == null || text == '' || text == undefined) text = '默认显示权限下所有货主订单数量';
  674. this.orderCountingRecordsChart.setOption({
  675. title: {text: '订单量趋势', subtext: text,},
  676. tooltip: {},
  677. legend: {data: ['订单数']},
  678. xAxis: {
  679. type: 'category',
  680. data: this.orderCountingRecordsDateTarget
  681. },
  682. yAxis: {type: 'value'},
  683. series: [{
  684. data: this.orderCountingRecordsData,
  685. type: 'line',
  686. smooth: true
  687. }]
  688. });
  689. },
  690. initLaborReportsCountingRecordsChart() {
  691. this.laborReportsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  692. this.laborReportsCountingRecordsChart.setOption({
  693. title: {text: '临时用工趋势'},
  694. tooltip: {},
  695. legend: {data: ['临时用工数']},
  696. xAxis: {
  697. type: 'category',
  698. data: this.laborReportsCountingRecordsDateTarget
  699. },
  700. yAxis: {type: 'value'},
  701. series: [{
  702. data: this.laborReportsCountingRecordsData,
  703. type: 'line',
  704. smooth: true
  705. }]
  706. });
  707. },
  708. initLogisticsCountingRecordsChart(text) {
  709. this.logisticsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  710. if (text == null || text == '' || text == undefined) text = '默认显示权限下所有货主快递分布';
  711. this.logisticsCountingRecordsChart.setOption({
  712. title: {
  713. text: '快递分布',
  714. subtext: text,
  715. left: 'left'
  716. },
  717. tooltip: {
  718. trigger: 'item',
  719. formatter: '{a} <br/>{b} : {c} ({d}%)'
  720. },
  721. series: [
  722. {
  723. name: '快递分布',
  724. type: 'pie',
  725. radius: '55%',
  726. center: ['50%', '60%'],
  727. data: this.logisticsCountingRecords,
  728. emphasis: {
  729. itemStyle: {
  730. shadowBlur: 10,
  731. shadowOffsetX: 0,
  732. shadowColor: 'rgba(0, 0, 0, 0.5)'
  733. }
  734. }
  735. }
  736. ]
  737. });
  738. },
  739. initWarehouseCountingRecordsChart() {
  740. this.warehouseCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  741. this.warehouseCountingRecordsChart.setOption({
  742. title: {
  743. text: '仓库分布',
  744. left: 'left'
  745. },
  746. tooltip: {
  747. trigger: 'item',
  748. formatter: '{a} <br/>{b} : {c} ({d}%)'
  749. },
  750. series: [
  751. {
  752. name: '仓库分布',
  753. type: 'pie',
  754. radius: '55%',
  755. center: ['50%', '60%'],
  756. data: this.warehouseCountingRecords,
  757. emphasis: {
  758. itemStyle: {
  759. shadowBlur: 10,
  760. shadowOffsetX: 0,
  761. shadowColor: 'rgba(0, 0, 0, 0.5)'
  762. }
  763. }
  764. }
  765. ]
  766. });
  767. },
  768. initLaborReportsUserGroupsCountChart() {
  769. this.laborReportsUserGroupsCountChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  770. this.laborReportsUserGroupsCountChart.setOption({
  771. title: {
  772. text: '小组临时工分布',
  773. left: 'left'
  774. },
  775. tooltip: {
  776. trigger: 'item',
  777. formatter: '{a} <br/>{b} : {c} ({d}%)'
  778. },
  779. series: [
  780. {
  781. name: '小组临时工分布',
  782. type: 'pie',
  783. radius: '55%',
  784. center: ['50%', '60%'],
  785. data: this.laborReportsUserGroupsCount,
  786. emphasis: {
  787. itemStyle: {
  788. shadowBlur: 10,
  789. shadowOffsetX: 0,
  790. shadowColor: 'rgba(0, 0, 0, 0.5)'
  791. }
  792. }
  793. }
  794. ]
  795. });
  796. },
  797. initLaborReportsCountingRecords() {
  798. let _this = this;
  799. this.laborReportsCountingRecords.forEach(function (item) {
  800. _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
  801. _this.laborReportsCountingRecordsData.push(item.counter);
  802. });
  803. },
  804. orderCountingRecordApi(orderCountingRecordsUnit) {
  805. this.orderCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  806. if (orderCountingRecordsUnit === '') {
  807. orderCountingRecordsUnit = this.orderCountingRecordsUnit;
  808. }
  809. this.switchDataPanel_forOrderCountingRecords(this.orderCountingUnit, orderCountingRecordsUnit);
  810. this.orderCountingUnit = orderCountingRecordsUnit;
  811. switch (orderCountingRecordsUnit) {
  812. case '日':
  813. this.orderCountingRecordsDayShow = true;
  814. this.orderCountingRecordsMonthShow = false;
  815. this.orderCountingRecordsYearShow = false;
  816. break;
  817. case '月':
  818. this.orderCountingRecordsDayShow = false;
  819. this.orderCountingRecordsMonthShow = true;
  820. this.orderCountingRecordsYearShow = false;
  821. break;
  822. case '年':
  823. this.orderCountingRecordsDayShow = false;
  824. this.orderCountingRecordsMonthShow = false;
  825. this.orderCountingRecordsYearShow = true;
  826. break;
  827. }
  828. this.orderCountingRecordsUnit = orderCountingRecordsUnit;
  829. let _this = this;
  830. let text = null;
  831. axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}', {
  832. 'start': this.orderCountingRecordsStart, 'end': this.orderCountingRecordsEnd,
  833. 'unit': orderCountingRecordsUnit, 'owner_ids': this.selectOrderOwners
  834. }).then(function (res) {
  835. if (res.status === 200) {
  836. _this.orderCountingRecords = res.data.orderCountingRecords;
  837. _this.orderCountingRecordsDateTarget = [];
  838. _this.orderCountingRecordsData = [];
  839. _this.initOrderCountingRecords();
  840. if (_this.selectOrderOwners.length > 0) text = '当前选中货主订单数量';
  841. _this.initOrderCountingRecordsChart(text);
  842. _this.orderCountingRecordsChart.hideLoading();
  843. }
  844. });
  845. },
  846. logisticsCountingRecordsApi() {
  847. this.logisticsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  848. let text = null;
  849. let _this = this;
  850. axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}', {
  851. 'start': this.logisticsCountingRecordsData[0],
  852. 'end': this.logisticsCountingRecordsData[1],
  853. 'owner_ids': this.selectLogisticsOwners
  854. }).then(function (res) {
  855. if (res.status === 200) {
  856. _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
  857. if (_this.selectLogisticsOwners.length > 0) text = '当前选中货主快递分布';
  858. _this.initLogisticsCountingRecordsChart(text);
  859. _this.logisticsCountingRecordsChart.hideLoading();
  860. }
  861. });
  862. },
  863. warehouseCountingRecordsApi() {
  864. this.warehouseCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  865. let formData = new FormData();
  866. formData.append('start', this.warehouseCountingRecordsData[0]);
  867. formData.append('end', this.warehouseCountingRecordsData[1]);
  868. let _this = this;
  869. axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
  870. if (res.status === 200) {
  871. _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
  872. _this.initWarehouseCountingRecordsChart();
  873. _this.warehouseCountingRecordsChart.hideLoading();
  874. }
  875. });
  876. },
  877. laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
  878. this.laborReportsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  879. if (laborReportsCountingRecordUnit === '') {
  880. laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
  881. }
  882. this.switchDataPanel_forLaborReports(this.laborReportsUnit, laborReportsCountingRecordUnit);
  883. this.laborReportsUnit = laborReportsCountingRecordUnit;
  884. this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
  885. switch (laborReportsCountingRecordUnit) {
  886. case '日':
  887. this.laborReportsCountingRecordsDayShow = true;
  888. this.laborReportsCountingRecordsMonthShow = false;
  889. this.laborReportsCountingRecordsYearShow = false;
  890. break;
  891. case '月':
  892. this.laborReportsCountingRecordsDayShow = false;
  893. this.laborReportsCountingRecordsMonthShow = true;
  894. this.laborReportsCountingRecordsYearShow = false;
  895. break;
  896. case '年':
  897. this.laborReportsCountingRecordsDayShow = false;
  898. this.laborReportsCountingRecordsMonthShow = false;
  899. this.laborReportsCountingRecordsYearShow = true;
  900. break;
  901. }
  902. let formData = new FormData();
  903. formData.append('start', this.laborReportsCountingRecordsStart);
  904. formData.append('end', this.laborReportsCountingRecordsEnd);
  905. formData.append('unit', laborReportsCountingRecordUnit);
  906. let _this = this;
  907. axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
  908. if (res.status === 200) {
  909. _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
  910. _this.laborReportsCountingRecordsDateTarget = [];
  911. _this.laborReportsCountingRecordsData = [];
  912. _this.initLaborReportsCountingRecords();
  913. _this.initLaborReportsCountingRecordsChart();
  914. _this.laborReportsCountingRecordsChart.hideLoading();
  915. }
  916. });
  917. },
  918. laborReportsUserGroupsCountApi() {
  919. this.laborReportsUserGroupsCountChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  920. let formData = new FormData();
  921. formData.append('start', this.laborReportsUserGroupsCountDate[0]);
  922. formData.append('end', this.laborReportsUserGroupsCountDate[1]);
  923. let _this = this;
  924. axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
  925. if (res.status === 200) {
  926. _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
  927. _this.initLaborReportsUserGroupsCountChart();
  928. _this.laborReportsUserGroupsCountChart.hideLoading();
  929. }
  930. });
  931. },
  932. loadWeightInfo(){
  933. window.tempTip.setDuration(3000);
  934. if (!this.searchOption.weightDate[0]){
  935. window.tempTip.show("开始时间未选择");
  936. return;
  937. }
  938. if (!this.searchOption.weightDate[1]){
  939. window.tempTip.show("结束时间未选择");
  940. return;
  941. }
  942. this.cardPool.weight.showLoading('default',{text:"加 载 中",color:'#C0C0C0'});
  943. let url = "{{url('apiLocal/control/panel/menu/weightApi')}}";
  944. let params = {start:this.searchOption.weightDate[0],end:this.searchOption.weightDate[1]};
  945. window.tempTip.postBasicRequest(url,params,res=>{
  946. this.cardPool.weight.hideLoading();
  947. this.cardPool.weight.setOption(this._setWeightData(res.title,res.data));
  948. });
  949. },
  950. loadOrderPackageReceivedSyncRecordInfo(){
  951. window.tempTip.setDuration(3000);
  952. if (!this.searchOption.OrderPackageReceivedSyncRecordDate[0]){
  953. window.tempTip.show("开始时间未选择");
  954. return;
  955. }
  956. if (!this.searchOption.OrderPackageReceivedSyncRecordDate[1]){
  957. window.tempTip.show("结束时间未选择");
  958. return;
  959. }
  960. this.cardPool.orderPackageReceivedSyncRecord.showLoading('default',{text:"加 载 中",color:'#C0C0C0'});
  961. let url = "{{url('apiLocal/control/panel/menu/orderPackageReceivedSyncRecordApi')}}";
  962. let params = {start:this.searchOption.OrderPackageReceivedSyncRecordDate[0],end:this.searchOption.OrderPackageReceivedSyncRecordDate[1]};
  963. window.tempTip.postBasicRequest(url,params,res=>{
  964. this.cardPool.orderPackageReceivedSyncRecord.hideLoading();
  965. this.cardPool.orderPackageReceivedSyncRecord.setOption(this._setOrderPackageReceivedSyncRecordData(res.title, res.data));
  966. });
  967. },
  968. loadExceptionTypeInfo() {
  969. window.tempTip.setDuration(3000);
  970. if (!this.searchOption.exceptionTypeDate[0]){
  971. window.tempTip.show("开始时间未选择");
  972. return;
  973. }
  974. if (!this.searchOption.exceptionTypeDate[1]){
  975. window.tempTip.show("结束时间未选择");
  976. return;
  977. }
  978. this.cardPool.exceptionType.showLoading('default',{text:"加 载 中",color:'#C0C0C0'});
  979. let url = "{{url('apiLocal/control/panel/menu/exceptionTypeApi')}}";
  980. let params = {start:this.searchOption.exceptionTypeDate[0],end:this.searchOption.exceptionTypeDate[1],owner_ids:this.selectExceptionTypeOwners};
  981. window.tempTip.postBasicRequest(url,params,res=>{
  982. this.cardPool.exceptionType.hideLoading();
  983. this.cardPool.exceptionType.setOption(this._setExceptionTypeData(res.data));
  984. });
  985. },
  986. switchWeightDate(){
  987. let obj = this.dateOptions[this.searchOption.weightSelect];
  988. this.searchOption.weightDate = [obj.start,obj.end];
  989. this.loadWeightInfo();
  990. },
  991. switchOrderPackageReceivedSyncRecordDate(){
  992. let obj = this.dateOptions[this.searchOption.OrderPackageReceivedSyncRecordSelect];
  993. this.searchOption.OrderPackageReceivedSyncRecordDate = [obj.start,obj.end];
  994. this.loadOrderPackageReceivedSyncRecordInfo();
  995. },
  996. switchExceptionTypeDate(){
  997. let obj = this.dateOptions[this.searchOption.exceptionTypeSelect];
  998. this.searchOption.exceptionTypeDate = [obj.start,obj.end];
  999. this.loadExceptionTypeInfo();
  1000. },
  1001. _setWeightData(title, data){
  1002. return {
  1003. title: {
  1004. text: '已称重包裹占比',
  1005. left: 'left'
  1006. },
  1007. tooltip: {
  1008. trigger: 'item',
  1009. formatter: function (params) {
  1010. return params.data.date + "<br>" + "总量:<span class='text-success font-weight-bold'>" + params.data.total + "</span><br>" + "已称:<span class='text-info font-weight-bold'>" + params.data.count + "</span>";
  1011. }
  1012. }, xAxis: {
  1013. data: title
  1014. }, yAxis: {
  1015. axisLabel: {
  1016. show: true,
  1017. interval: 'auto',
  1018. formatter: '{value} %'
  1019. },
  1020. max: 100
  1021. }, label: {
  1022. show: true,
  1023. position: 'top',
  1024. formatter: '{c}%',
  1025. color: "red"
  1026. }, series: [{
  1027. type: "bar",
  1028. data: data,
  1029. itemStyle: {
  1030. color: "RGB(62,157,231)",
  1031. }
  1032. }]
  1033. };
  1034. },
  1035. _setOrderPackageReceivedSyncRecordData(title,data){
  1036. return {
  1037. title: {
  1038. text: '快递信息同步成功失败占比',
  1039. left: 'left'
  1040. },
  1041. tooltip: {
  1042. trigger: 'item',
  1043. formatter: function (params) {
  1044. return params.data.date + "<br>" + "总量:<span class='text-success font-weight-bold'>" + params.data.total + "</span><br>" + "成功:<span class='text-info font-weight-bold'>" + params.data.count + "</span><br>"+ "承运商:<span class='text-info font-weight-bold'>" + params.data.logistic_name + "</span>";
  1045. }
  1046. }, xAxis: {
  1047. data: title
  1048. }, yAxis: {
  1049. axisLabel: {
  1050. show: true,
  1051. interval: 'auto',
  1052. formatter: '{value} %'
  1053. },
  1054. max: 100
  1055. }, label: {
  1056. show: true,
  1057. position: 'top',
  1058. formatter: '{c}%',
  1059. color: "red"
  1060. }, series: [{
  1061. type: "bar",
  1062. data: data,
  1063. itemStyle: {
  1064. color: "RGB(62,157,231)",
  1065. }
  1066. }]
  1067. };
  1068. },
  1069. _setExceptionTypeData(data) {
  1070. let resData = [];
  1071. data.forEach(item => {
  1072. resData.push({
  1073. value:item.count,
  1074. name:item.exception_type
  1075. })
  1076. })
  1077. return {
  1078. title: {
  1079. text: '异常分布',
  1080. left: 'left'
  1081. },
  1082. tooltip: {
  1083. trigger: 'item',
  1084. formatter: '{a} <br/>{b} : {c} ({d}%)'
  1085. },
  1086. series: [
  1087. {
  1088. name: '异常分布',
  1089. type: 'pie',
  1090. radius: '55%',
  1091. center: ['50%', '60%'],
  1092. data: resData,
  1093. emphasis: {
  1094. itemStyle: {
  1095. shadowBlur: 10,
  1096. shadowOffsetX: 0,
  1097. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1098. }
  1099. }
  1100. }
  1101. ]
  1102. }
  1103. }
  1104. }
  1105. });
  1106. </script>
  1107. @endsection