panel.blade.php 69 KB

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