panel.blade.php 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944
  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. </div>
  359. </div>
  360. </div>
  361. @endsection
  362. @section('lastScript')
  363. <script src="{{ mix('js/echarts.js') }}"></script>
  364. <script src="{{ mix('js/element-ui.js') }}"></script>
  365. <script>
  366. let vue = new Vue({
  367. el: "#list",
  368. data: {
  369. myChart: null,
  370. menus:{!! $menus !!},
  371. owners:{!! $owners !!},
  372. selectOrderOwners: [],
  373. selectLogisticsOwners: [],
  374. warehousesOrders:{!! $warehousesOrders !!},
  375. orderCountingRecords:{},
  376. logisticsCountingRecords:{},
  377. warehouseCountingRecords:{},
  378. laborReportsCountingRecords:{},
  379. laborReportsUserGroupsCount:{},
  380. warehouses: {
  381. "WH01": '松江一仓',
  382. "WH02": '松江二仓',
  383. "WH03": '嘉定一仓',},
  384. totalOrders: {
  385. total: null,
  386. createOrder: null,
  387. assignedComplete: null,
  388. partialAllocation: null,
  389. partPacking: null,
  390. sowComplete: null,
  391. },
  392. orderCountingRecordsDateTarget: [],
  393. orderCountingRecordsData: [],
  394. laborReportsCountingRecordsDateTarget: [],
  395. laborReportsCountingRecordsData: [],
  396. pickerOptions: {
  397. shortcuts: [{
  398. text: '最近一周',
  399. onClick(picker) {
  400. const end = new Date();
  401. const start = new Date();
  402. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  403. picker.$emit('pick', [start, end]);
  404. }
  405. }, {
  406. text: '最近一个月',
  407. onClick(picker) {
  408. const end = new Date();
  409. const start = new Date();
  410. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  411. picker.$emit('pick', [start, end]);
  412. }
  413. }, {
  414. text: '最近三个月',
  415. onClick(picker) {
  416. const end = new Date();
  417. const start = new Date();
  418. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  419. picker.$emit('pick', [start, end]);
  420. }
  421. }]
  422. },
  423. dateOptions:[{text:'当天',start:moment().format('yyyy-MM-DD'),end:moment().format('yyyy-MM-DD')},
  424. {text:"昨天",start:moment().subtract("1","day").format('yyyy-MM-DD'),end:moment().subtract("1","day").format('yyyy-MM-DD')},
  425. {text:"本周",start:moment().weekday(1).format('yyyy-MM-DD'),end:moment().weekday(7).format('yyyy-MM-DD')},
  426. {text:"上周",start:moment().weekday(-6).format('yyyy-MM-DD'),end:moment().weekday(0).format('yyyy-MM-DD')},
  427. {text:"本月",start:moment().startOf("month").format('yyyy-MM-DD'),end:moment().endOf("month").format('yyyy-MM-DD')},
  428. {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')},
  429. {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')},
  430. {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')},
  431. {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')},
  432. {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')}],
  433. logisticsCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  434. moment(new Date()).format('yyyy-MM-DD')],
  435. warehouseCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  436. moment(new Date()).format('yyyy-MM-DD')],
  437. laborReportsCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  438. moment(new Date()).format('yyyy-MM-DD')],
  439. laborReportsUserGroupsCountDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  440. moment(new Date()).format('yyyy-MM-DD')],
  441. orderCountingRecordsUnit: '日',
  442. laborReportsCountingRecordUnit: '日',
  443. orderCountingRecordsDayShow: true,
  444. orderCountingRecordsMonthShow: false,
  445. orderCountingRecordsYearShow: false,
  446. orderCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  447. orderCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  448. orderCountingUnit: '日',
  449. orderUnitsData: {
  450. start_day: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  451. end_day: moment(new Date()).format('yyyy-MM-DD'),
  452. start_month: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  453. end_month: moment(new Date()).format('yyyy-MM-DD'),
  454. start_year: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  455. end_year: moment(new Date()).format('yyyy-MM-DD'),
  456. },
  457. laborReportsUnit: '日',
  458. laborReportsData: {
  459. start_day: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  460. end_day: moment(new Date()).format('yyyy-MM-DD'),
  461. start_month: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  462. end_month: moment(new Date()).format('yyyy-MM-DD'),
  463. start_year: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  464. end_year: moment(new Date()).format('yyyy-MM-DD'),
  465. },
  466. laborReportsCountingRecordsDayShow: true,
  467. laborReportsCountingRecordsMonthShow: false,
  468. laborReportsCountingRecordsYearShow: false,
  469. laborReportsCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  470. laborReportsCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  471. cardPool:{},
  472. searchOption:{
  473. weightDate:[],
  474. weightSelect:"",
  475. },
  476. },
  477. watch:{
  478. selectOrderOwners:function(val,oldval){
  479. let newindex = val.indexOf('all');
  480. let oldindex = oldval.indexOf('all');
  481. if(newindex!=-1 && oldindex==-1 && val.length>1)
  482. this.selectOrderOwners=['all'];
  483. else if(newindex!=-1 && oldindex!=-1 && val.length>1)
  484. this.selectOrderOwners.splice(val.indexOf('all'),1)
  485. },
  486. selectLogisticsOwners:function(val,oldval){
  487. let newindex = val.indexOf('all');
  488. let oldindex = oldval.indexOf('all');
  489. if(newindex!=-1 && oldindex==-1 && val.length>1)
  490. this.selectLogisticsOwners=['all'];
  491. else if(newindex!=-1 && oldindex!=-1 && val.length>1)
  492. this.selectLogisticsOwners.splice(val.indexOf('all'),1)
  493. }
  494. },
  495. mounted() {
  496. $('#list').removeClass('d-none');
  497. let index = 4;
  498. this.searchOption.weightSelect = index;
  499. this.searchOption.weightDate = [this.dateOptions[index].start, this.dateOptions[index].end];
  500. let _this = this;
  501. this.warehousesOrders.forEach(function (item) {
  502. _this.totalOrders.total += parseInt(item.total);
  503. _this.totalOrders.createOrder += item.createOrder;
  504. _this.totalOrders.assignedComplete += item.assignedComplete;
  505. _this.totalOrders.partialAllocation += item.partialAllocation;
  506. _this.totalOrders.partPacking += item.partPacking;
  507. _this.totalOrders.sowComplete += item.sowComplete;
  508. });
  509. //订单量趋势
  510. this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
  511. this.initOrderCountingRecordsChart();
  512. this.orderCountingRecordApi('日');
  513. //订单快递分布
  514. this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
  515. this.initLogisticsCountingRecordsChart();
  516. this.logisticsCountingRecordsApi();
  517. //订单仓库分布
  518. this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
  519. this.initWarehouseCountingRecordsChart();
  520. this.warehouseCountingRecordsApi();
  521. @can('人事管理-临时工报表-可见全部组')
  522. this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
  523. this.initLaborReportsCountingRecordsChart();
  524. this.laborReportsCountingRecordApi('日');
  525. this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
  526. this.initLaborReportsUserGroupsCountChart();
  527. this.laborReportsUserGroupsCountApi();
  528. @endcan
  529. @can("控制台-称重统计")
  530. this.cardPool.weight = echarts.init(document.getElementById("weight"));
  531. this.loadWeightInfo();
  532. @endcan
  533. },
  534. methods: {
  535. switchDataPanel_forOrderCountingRecords(fromUnit, toUnit) {
  536. switch (fromUnit) {
  537. case '日':
  538. this.orderUnitsData.start_day = this.orderCountingRecordsStart;
  539. this.orderUnitsData.end_day = this.orderCountingRecordsEnd;
  540. break;
  541. case '月':
  542. this.orderUnitsData.start_month = this.orderCountingRecordsStart;
  543. this.orderUnitsData.end_month = this.orderCountingRecordsEnd;
  544. break;
  545. case '年':
  546. this.orderUnitsData.start_year = this.orderCountingRecordsStart;
  547. this.orderUnitsData.end_year = this.orderCountingRecordsEnd;
  548. break;
  549. }
  550. switch (toUnit) {
  551. case '日':
  552. this.orderCountingRecordsStart = this.orderUnitsData.start_day;
  553. this.orderCountingRecordsEnd = this.orderUnitsData.end_day;
  554. break;
  555. case '月':
  556. this.orderCountingRecordsStart = this.orderUnitsData.start_month;
  557. this.orderCountingRecordsEnd = this.orderUnitsData.end_month;
  558. break;
  559. case '年':
  560. this.orderCountingRecordsStart = this.orderUnitsData.start_year;
  561. this.orderCountingRecordsEnd = this.orderUnitsData.end_year;
  562. break;
  563. }
  564. },
  565. switchDataPanel_forLaborReports(fromUnit, toUnit) {
  566. switch (fromUnit) {
  567. case '日':
  568. this.laborReportsData.start_day = this.laborReportsCountingRecordsStart;
  569. this.laborReportsData.end_day = this.laborReportsCountingRecordsEnd;
  570. break;
  571. case '月':
  572. this.laborReportsData.start_month = this.laborReportsCountingRecordsStart;
  573. this.laborReportsData.end_month = this.laborReportsCountingRecordsEnd;
  574. break;
  575. case '年':
  576. this.laborReportsData.start_year = this.laborReportsCountingRecordsStart;
  577. this.laborReportsData.end_year = this.laborReportsCountingRecordsEnd;
  578. break;
  579. }
  580. switch (toUnit) {
  581. case '日':
  582. this.laborReportsCountingRecordsStart = this.laborReportsData.start_day;
  583. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_day;
  584. break;
  585. case '月':
  586. this.laborReportsCountingRecordsStart = this.laborReportsData.start_month;
  587. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_month;
  588. break;
  589. case '年':
  590. this.laborReportsCountingRecordsStart = this.laborReportsData.start_year;
  591. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_year;
  592. break;
  593. }
  594. },
  595. getWareHouse: function (code) {
  596. return this.warehouses[code];
  597. },
  598. initOrderCountingRecords() {
  599. for (let key in this.orderCountingRecords) {
  600. this.orderCountingRecordsDateTarget.push(this.orderCountingRecords[key].date_target);
  601. this.orderCountingRecordsData.push(this.orderCountingRecords[key].counter);
  602. }
  603. },
  604. initOrderCountingRecordsChart(text) {
  605. this.orderCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  606. if (text == null || text == '' || text == undefined) text = '默认显示权限下所有货主订单数量';
  607. this.orderCountingRecordsChart.setOption({
  608. title: {text: '订单量趋势', subtext: text,},
  609. tooltip: {},
  610. legend: {data: ['订单数']},
  611. xAxis: {
  612. type: 'category',
  613. data: this.orderCountingRecordsDateTarget
  614. },
  615. yAxis: {type: 'value'},
  616. series: [{
  617. data: this.orderCountingRecordsData,
  618. type: 'line',
  619. smooth: true
  620. }]
  621. });
  622. },
  623. initLaborReportsCountingRecordsChart() {
  624. this.laborReportsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  625. this.laborReportsCountingRecordsChart.setOption({
  626. title: {text: '临时用工趋势'},
  627. tooltip: {},
  628. legend: {data: ['临时用工数']},
  629. xAxis: {
  630. type: 'category',
  631. data: this.laborReportsCountingRecordsDateTarget
  632. },
  633. yAxis: {type: 'value'},
  634. series: [{
  635. data: this.laborReportsCountingRecordsData,
  636. type: 'line',
  637. smooth: true
  638. }]
  639. });
  640. },
  641. initLogisticsCountingRecordsChart(text) {
  642. this.logisticsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  643. if (text == null || text == '' || text == undefined) text = '默认显示权限下所有货主快递分布';
  644. this.logisticsCountingRecordsChart.setOption({
  645. title: {
  646. text: '快递分布',
  647. subtext: text,
  648. left: 'left'
  649. },
  650. tooltip: {
  651. trigger: 'item',
  652. formatter: '{a} <br/>{b} : {c} ({d}%)'
  653. },
  654. series: [
  655. {
  656. name: '快递分布',
  657. type: 'pie',
  658. radius: '55%',
  659. center: ['50%', '60%'],
  660. data: this.logisticsCountingRecords,
  661. emphasis: {
  662. itemStyle: {
  663. shadowBlur: 10,
  664. shadowOffsetX: 0,
  665. shadowColor: 'rgba(0, 0, 0, 0.5)'
  666. }
  667. }
  668. }
  669. ]
  670. });
  671. },
  672. initWarehouseCountingRecordsChart() {
  673. this.warehouseCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  674. this.warehouseCountingRecordsChart.setOption({
  675. title: {
  676. text: '仓库分布',
  677. left: 'left'
  678. },
  679. tooltip: {
  680. trigger: 'item',
  681. formatter: '{a} <br/>{b} : {c} ({d}%)'
  682. },
  683. series: [
  684. {
  685. name: '仓库分布',
  686. type: 'pie',
  687. radius: '55%',
  688. center: ['50%', '60%'],
  689. data: this.warehouseCountingRecords,
  690. emphasis: {
  691. itemStyle: {
  692. shadowBlur: 10,
  693. shadowOffsetX: 0,
  694. shadowColor: 'rgba(0, 0, 0, 0.5)'
  695. }
  696. }
  697. }
  698. ]
  699. });
  700. },
  701. initLaborReportsUserGroupsCountChart() {
  702. this.laborReportsUserGroupsCountChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  703. this.laborReportsUserGroupsCountChart.setOption({
  704. title: {
  705. text: '小组临时工分布',
  706. left: 'left'
  707. },
  708. tooltip: {
  709. trigger: 'item',
  710. formatter: '{a} <br/>{b} : {c} ({d}%)'
  711. },
  712. series: [
  713. {
  714. name: '小组临时工分布',
  715. type: 'pie',
  716. radius: '55%',
  717. center: ['50%', '60%'],
  718. data: this.laborReportsUserGroupsCount,
  719. emphasis: {
  720. itemStyle: {
  721. shadowBlur: 10,
  722. shadowOffsetX: 0,
  723. shadowColor: 'rgba(0, 0, 0, 0.5)'
  724. }
  725. }
  726. }
  727. ]
  728. });
  729. },
  730. initLaborReportsCountingRecords() {
  731. let _this = this;
  732. this.laborReportsCountingRecords.forEach(function (item) {
  733. _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
  734. _this.laborReportsCountingRecordsData.push(item.counter);
  735. });
  736. },
  737. orderCountingRecordApi(orderCountingRecordsUnit) {
  738. this.orderCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  739. if (orderCountingRecordsUnit === '') {
  740. orderCountingRecordsUnit = this.orderCountingRecordsUnit;
  741. }
  742. this.switchDataPanel_forOrderCountingRecords(this.orderCountingUnit, orderCountingRecordsUnit);
  743. this.orderCountingUnit = orderCountingRecordsUnit;
  744. switch (orderCountingRecordsUnit) {
  745. case '日':
  746. this.orderCountingRecordsDayShow = true;
  747. this.orderCountingRecordsMonthShow = false;
  748. this.orderCountingRecordsYearShow = false;
  749. break;
  750. case '月':
  751. this.orderCountingRecordsDayShow = false;
  752. this.orderCountingRecordsMonthShow = true;
  753. this.orderCountingRecordsYearShow = false;
  754. break;
  755. case '年':
  756. this.orderCountingRecordsDayShow = false;
  757. this.orderCountingRecordsMonthShow = false;
  758. this.orderCountingRecordsYearShow = true;
  759. break;
  760. }
  761. this.orderCountingRecordsUnit = orderCountingRecordsUnit;
  762. let _this = this;
  763. let text = null;
  764. axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}', {
  765. 'start': this.orderCountingRecordsStart, 'end': this.orderCountingRecordsEnd,
  766. 'unit': orderCountingRecordsUnit, 'owner_ids': this.selectOrderOwners
  767. }).then(function (res) {
  768. if (res.status === 200) {
  769. _this.orderCountingRecords = res.data.orderCountingRecords;
  770. _this.orderCountingRecordsDateTarget = [];
  771. _this.orderCountingRecordsData = [];
  772. _this.initOrderCountingRecords();
  773. if (_this.selectOrderOwners.length > 0) text = '当前选中货主订单数量';
  774. _this.initOrderCountingRecordsChart(text);
  775. _this.orderCountingRecordsChart.hideLoading();
  776. }
  777. });
  778. },
  779. logisticsCountingRecordsApi() {
  780. this.logisticsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  781. let text = null;
  782. let _this = this;
  783. axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}', {
  784. 'start': this.logisticsCountingRecordsData[0],
  785. 'end': this.logisticsCountingRecordsData[1],
  786. 'owner_ids': this.selectLogisticsOwners
  787. }).then(function (res) {
  788. if (res.status === 200) {
  789. _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
  790. if (_this.selectLogisticsOwners.length > 0) text = '当前选中货主快递分布';
  791. _this.initLogisticsCountingRecordsChart(text);
  792. _this.logisticsCountingRecordsChart.hideLoading();
  793. }
  794. });
  795. },
  796. warehouseCountingRecordsApi() {
  797. this.warehouseCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  798. let formData = new FormData();
  799. formData.append('start', this.warehouseCountingRecordsData[0]);
  800. formData.append('end', this.warehouseCountingRecordsData[1]);
  801. let _this = this;
  802. axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
  803. if (res.status === 200) {
  804. _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
  805. _this.initWarehouseCountingRecordsChart();
  806. _this.warehouseCountingRecordsChart.hideLoading();
  807. }
  808. });
  809. },
  810. laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
  811. this.laborReportsCountingRecordsChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  812. if (laborReportsCountingRecordUnit === '') {
  813. laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
  814. }
  815. this.switchDataPanel_forLaborReports(this.laborReportsUnit, laborReportsCountingRecordUnit);
  816. this.laborReportsUnit = laborReportsCountingRecordUnit;
  817. this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
  818. switch (laborReportsCountingRecordUnit) {
  819. case '日':
  820. this.laborReportsCountingRecordsDayShow = true;
  821. this.laborReportsCountingRecordsMonthShow = false;
  822. this.laborReportsCountingRecordsYearShow = false;
  823. break;
  824. case '月':
  825. this.laborReportsCountingRecordsDayShow = false;
  826. this.laborReportsCountingRecordsMonthShow = true;
  827. this.laborReportsCountingRecordsYearShow = false;
  828. break;
  829. case '年':
  830. this.laborReportsCountingRecordsDayShow = false;
  831. this.laborReportsCountingRecordsMonthShow = false;
  832. this.laborReportsCountingRecordsYearShow = true;
  833. break;
  834. }
  835. let formData = new FormData();
  836. formData.append('start', this.laborReportsCountingRecordsStart);
  837. formData.append('end', this.laborReportsCountingRecordsEnd);
  838. formData.append('unit', laborReportsCountingRecordUnit);
  839. let _this = this;
  840. axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
  841. if (res.status === 200) {
  842. _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
  843. _this.laborReportsCountingRecordsDateTarget = [];
  844. _this.laborReportsCountingRecordsData = [];
  845. _this.initLaborReportsCountingRecords();
  846. _this.initLaborReportsCountingRecordsChart();
  847. _this.laborReportsCountingRecordsChart.hideLoading();
  848. }
  849. });
  850. },
  851. laborReportsUserGroupsCountApi() {
  852. this.laborReportsUserGroupsCountChart.showLoading('default', {text: "加 载 中", color: '#C0C0C0'});
  853. let formData = new FormData();
  854. formData.append('start', this.laborReportsUserGroupsCountDate[0]);
  855. formData.append('end', this.laborReportsUserGroupsCountDate[1]);
  856. let _this = this;
  857. axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
  858. if (res.status === 200) {
  859. _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
  860. _this.initLaborReportsUserGroupsCountChart();
  861. _this.laborReportsUserGroupsCountChart.hideLoading();
  862. }
  863. });
  864. },
  865. loadWeightInfo(){
  866. window.tempTip.setDuration(3000);
  867. if (!this.searchOption.weightDate[0]){
  868. window.tempTip.show("开始时间未选择");
  869. return;
  870. }
  871. if (!this.searchOption.weightDate[1]){
  872. window.tempTip.show("结束时间未选择");
  873. return;
  874. }
  875. this.cardPool.weight.showLoading('default',{text:"加 载 中",color:'#C0C0C0'});
  876. let url = "{{url('apiLocal/control/panel/menu/weightApi')}}";
  877. let params = {start:this.searchOption.weightDate[0],end:this.searchOption.weightDate[1]};
  878. window.tempTip.postBasicRequest(url,params,res=>{
  879. this.cardPool.weight.hideLoading();
  880. this.cardPool.weight.setOption(this._setWeightData(res.title,res.data));
  881. });
  882. },
  883. switchWeightDate(){
  884. let obj = this.dateOptions[this.searchOption.weightSelect];
  885. this.searchOption.weightDate = [obj.start,obj.end];
  886. this.loadWeightInfo();
  887. },
  888. _setWeightData(title, data){
  889. return {
  890. title: {
  891. text: '已称重包裹占比',
  892. left: 'left'
  893. },
  894. tooltip: {
  895. trigger: 'item',
  896. formatter: function (params) {
  897. 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>";
  898. }
  899. }, xAxis: {
  900. data: title
  901. }, yAxis: {
  902. axisLabel: {
  903. show: true,
  904. interval: 'auto',
  905. formatter: '{value} %'
  906. },
  907. max: 100
  908. }, label: {
  909. show: true,
  910. position: 'top',
  911. formatter: '{c}%',
  912. color: "red"
  913. }, series: [{
  914. type: "bar",
  915. data: data,
  916. itemStyle: {
  917. color: "RGB(62,157,231)",
  918. }
  919. }]
  920. };
  921. },
  922. }
  923. });
  924. </script>
  925. @endsection