panel.blade.php 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. @extends('layouts.app')
  2. @section('title')控制台@endsection
  3. @section('head')
  4. <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
  5. @endsection
  6. @section('content')
  7. <div class="d-none" id="list">
  8. <div class="container-fluid">
  9. <div class="card">
  10. <h5 class="card-header">最近常用功能</h5>
  11. <div class="card-body row">
  12. <ul class="list-group" v-for="(menu,index) in menus">
  13. <div class="container-fluid btn-group justify-content-center">
  14. <a class="btn-primary btn-lg" v-if="index<=3" :href="'/'+menu.route">@{{ menu.name }}</a>
  15. </div>
  16. <div v-if="menu.secondLevelMenu && menu.secondLevelMenu.length>0&&index<=3">
  17. <div class="container-fluid btn-group m-1">
  18. <a class="bth btn-sm btn-info m-1" v-for="(secondMenu,index) in menu.secondLevelMenu"
  19. :href="'/'+secondMenu.route" v-if="index < 2"> @{{ secondMenu.name }}</a>
  20. </div>
  21. </div>
  22. </ul>
  23. </div>
  24. </div>
  25. <div class="row my-3">
  26. <div class="col-sm-3 col-lg-3 col-xl-3 col-md-3">
  27. <div class="card">
  28. <div class="card-header text-dark h5">
  29. <p>实时待处理订(总):@{{ totalOrders.total }}</p>
  30. </div>
  31. <div class="card-body">
  32. <p>创建订单:@{{ totalOrders.createOrder }}</p>
  33. <p>分配完成:@{{ totalOrders.assignedComplete }}</p>
  34. <p>部分分配:@{{ totalOrders.partialAllocation }}</p>
  35. <p>部分装箱:@{{ totalOrders.partPacking }}</p>
  36. <p>分拨完成:@{{ totalOrders.sowComplete }}</p>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="col-sm-2 col-lg-2 col-xl-2 col-md-2" v-for="(warehousesOrder,index) in warehousesOrders">
  41. <div class="card">
  42. <div class="card-header text-success h5">
  43. <p>@{{ getWareHouse(warehousesOrder.code) }}:@{{ warehousesOrder.total }}</p>
  44. </div>
  45. <div class="card-body">
  46. <p>创建订单:@{{ warehousesOrder.createOrder }}</p>
  47. <p>分配完成:@{{ warehousesOrder.assignedComplete }}</p>
  48. <p>部分分配:@{{ warehousesOrder.partialAllocation }}</p>
  49. <p>部分装箱:@{{ warehousesOrder.partPacking }}</p>
  50. <p>分拨完成:@{{ warehousesOrder.sowComplete }}</p>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="row my-3">
  56. <div class="col-sm-6 col-lg-6 col-xl-6 col-md-6">
  57. <div class="card">
  58. <div class="card-header">
  59. <div class="block row">
  60. <div>
  61. <span v-show="orderCountingRecordsDayShow" class="demonstration mt-1">起始日期:</span>
  62. <el-date-picker
  63. size="small"
  64. @blur="orderCountingRecordApi('')"
  65. v-show="orderCountingRecordsDayShow"
  66. v-model="orderCountingRecordsStart"
  67. type="date"
  68. value-format="yyyy-MM-dd"
  69. placeholder="选起始日期">
  70. </el-date-picker>
  71. <span v-show="orderCountingRecordsDayShow" class="demonstration mt-1">结束日期:</span>
  72. <el-date-picker
  73. size="small"
  74. @blur="orderCountingRecordApi('')"
  75. v-show="orderCountingRecordsDayShow"
  76. v-model="orderCountingRecordsEnd"
  77. type="date"
  78. value-format="yyyy-MM-dd"
  79. placeholder="选择结束日期">
  80. </el-date-picker>
  81. <span v-show="orderCountingRecordsMonthShow" class="demonstration mt-1">起始月:</span>
  82. <el-date-picker
  83. size="small"
  84. @blur="orderCountingRecordApi('')"
  85. v-show="orderCountingRecordsMonthShow"
  86. v-model="orderCountingRecordsStart"
  87. type="month"
  88. value-format="yyyy-MM-dd"
  89. placeholder="选择起始月">
  90. </el-date-picker>
  91. <span v-show="orderCountingRecordsMonthShow" class="demonstration mt-1">结束月:</span>
  92. <el-date-picker
  93. size="small"
  94. @blur="orderCountingRecordApi('')"
  95. v-show="orderCountingRecordsMonthShow"
  96. v-model="orderCountingRecordsEnd"
  97. type="month"
  98. value-format="yyyy-MM-dd"
  99. placeholder="选择结束月">
  100. </el-date-picker>
  101. <span v-show="orderCountingRecordsYearShow" class="demonstration mt-1">起始年:</span>
  102. <el-date-picker
  103. size="small"
  104. @blur="orderCountingRecordApi('')"
  105. v-show="orderCountingRecordsYearShow"
  106. v-model="orderCountingRecordsStart"
  107. type="year"
  108. value-format="yyyy-MM-dd"
  109. placeholder="选择年">
  110. </el-date-picker>
  111. <span v-show="orderCountingRecordsYearShow" class="demonstration mt-1">结束年:</span>
  112. <el-date-picker
  113. size="small"
  114. @blur="orderCountingRecordApi('')"
  115. v-show="orderCountingRecordsYearShow"
  116. v-model="orderCountingRecordsEnd"
  117. type="year"
  118. value-format="yyyy-MM-dd"
  119. placeholder="选择年">
  120. </el-date-picker>
  121. </div>
  122. <div class="btn-group btn-group-sm ml-2" role="group" >
  123. <el-button type="primary" value="日" @click="orderCountingRecordApi('日')"
  124. class="btn btn-secondary"
  125. v-model="orderCountingRecordsUnit">日
  126. </el-button>
  127. <el-button type="primary" value="月" @click="orderCountingRecordApi('月')"
  128. class="btn btn-secondary "
  129. v-model="orderCountingRecordsUnit">月
  130. </el-button>
  131. <el-button type="primary" value="年" @click="orderCountingRecordApi('年')"
  132. class="btn btn-secondary"
  133. v-model="orderCountingRecordsUnit">年
  134. </el-button>
  135. </div>
  136. <div class="ml-2">
  137. <el-select placeholder="请选择对应货主" multiple v-model="selectOrderOwners" size="small" @change="orderCountingRecordApi('')">
  138. <el-option label="选择所有" value="all"></el-option>
  139. <el-option v-for="item in owners" :label="item.name" :value="item.id" :key="item.id"></el-option>
  140. </el-select>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="card-body">
  145. <div v-show="orderCountingRecordsShow" id="orderCountingRecords"
  146. style="width: 100%;height:500px;"></div>
  147. </div>
  148. <div v-show="!orderCountingRecordsShow" class="text-center">
  149. <h3>正在加载...</h3>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="col-sm-3 col-lg-3 col-xl-3 col-md-3">
  154. <div class="card">
  155. <div class="card-header">
  156. <div class="block row">
  157. <span class="demonstration"></span>
  158. <el-date-picker
  159. size="small"
  160. style="width: 60%;"
  161. @blur="logisticsCountingRecordsApi()"
  162. v-model="logisticsCountingRecordsData"
  163. type="daterange"
  164. align="right"
  165. unlink-panels
  166. range-separator="-"
  167. start-placeholder="开始日期"
  168. end-placeholder="结束日期"
  169. value-format="yyyy-MM-dd"
  170. :picker-options="pickerOptions">
  171. </el-date-picker>
  172. <el-select placeholder="请选择对应货主" multiple v-model="selectLogisticsOwners" size="small" style="width: 50%" @change="logisticsCountingRecordsApi('')">
  173. <el-option label="选择所有" value="all"></el-option>
  174. <el-option v-for="item in owners" :label="item.name" :value="item.id" :key="item.id"></el-option>
  175. </el-select>
  176. </div>
  177. </div>
  178. <div class="card-body row">
  179. <div v-show="logisticsCountingRecordsShow" id="logisticsCountingRecords" class="col"
  180. style="width: 100%;height:500px;"></div>
  181. <div v-show="!logisticsCountingRecordsShow" class="text-center">
  182. <h3>正在加载...</h3>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="col-sm-3 col-lg-3 col-xl-3 col-md-3">
  188. <div class="card">
  189. <div class="card-header">
  190. <div class="block">
  191. <span class="demonstration"></span>
  192. <el-date-picker
  193. size="small"
  194. style="width: 80%;"
  195. @blur="warehouseCountingRecordsApi()"
  196. v-model="warehouseCountingRecordsData"
  197. type="daterange"
  198. align="right"
  199. unlink-panels
  200. range-separator="-"
  201. start-placeholder="开始日期"
  202. end-placeholder="结束日期"
  203. value-format="yyyy-MM-dd"
  204. :picker-options="pickerOptions">
  205. </el-date-picker>
  206. </div>
  207. </div>
  208. <div class="card-body row">
  209. <div v-show="warehouseCountingRecordsShow" id="warehouseCountingRecords" class="col"
  210. style="width: 100%;height:500px;"></div>
  211. <div v-show="!warehouseCountingRecordsShow">
  212. <h3>正在加载...</h3>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="row my-3">
  219. @can('人事管理-临时工报表-可见全部组')
  220. <div class="col-sm-6 col-lg-6 col-xl-6 col-md-6">
  221. <div class="card">
  222. <div class="card-header">
  223. <div class="block row">
  224. <span class="demonstration"></span>
  225. <span v-show="laborReportsCountingRecordsDayShow" class="demonstration mt-1">起始日期:</span>
  226. <el-date-picker
  227. size="small"
  228. @blur="laborReportsCountingRecordApi('')"
  229. v-show="laborReportsCountingRecordsDayShow"
  230. v-model="laborReportsCountingRecordsStart"
  231. type="date"
  232. value-format="yyyy-MM-dd"
  233. placeholder="选起始日期">
  234. </el-date-picker>
  235. <span v-show="laborReportsCountingRecordsDayShow" class="demonstration mt-1">结束日期:</span>
  236. <el-date-picker
  237. size="small"
  238. @blur="laborReportsCountingRecordApi('')"
  239. v-show="laborReportsCountingRecordsDayShow"
  240. v-model="laborReportsCountingRecordsEnd"
  241. type="date"
  242. value-format="yyyy-MM-dd"
  243. placeholder="选择结束日期">
  244. </el-date-picker>
  245. <span v-show="laborReportsCountingRecordsMonthShow" class="demonstration mt-1">起始月:</span>
  246. <el-date-picker
  247. size="small"
  248. @blur="laborReportsCountingRecordApi('')"
  249. v-show="laborReportsCountingRecordsMonthShow"
  250. v-model="laborReportsCountingRecordsStart"
  251. type="month"
  252. value-format="yyyy-MM-dd"
  253. placeholder="选择起始月">
  254. </el-date-picker>
  255. <span v-show="laborReportsCountingRecordsMonthShow" class="demonstration mt-1">结束月:</span>
  256. <el-date-picker
  257. size="small"
  258. @blur="laborReportsCountingRecordApi('')"
  259. v-show="laborReportsCountingRecordsMonthShow"
  260. v-model="laborReportsCountingRecordsEnd"
  261. type="month"
  262. value-format="yyyy-MM-dd"
  263. placeholder="选择结束月">
  264. </el-date-picker>
  265. <span v-show="laborReportsCountingRecordsYearShow" class="demonstration mt-1">起始年:</span>
  266. <el-date-picker
  267. size="small"
  268. @blur="laborReportsCountingRecordApi('')"
  269. v-show="laborReportsCountingRecordsYearShow"
  270. v-model="laborReportsCountingRecordsStart"
  271. type="year"
  272. value-format="yyyy-MM-dd"
  273. placeholder="选择年">
  274. </el-date-picker>
  275. <span v-show="laborReportsCountingRecordsYearShow" class="demonstration mt-1">结束年:</span>
  276. <el-date-picker
  277. size="small"
  278. @blur="laborReportsCountingRecordApi('')"
  279. v-show="laborReportsCountingRecordsYearShow"
  280. v-model="laborReportsCountingRecordsEnd"
  281. type="year"
  282. value-format="yyyy-MM-dd"
  283. placeholder="选择年">
  284. </el-date-picker>
  285. <div class="btn-group btn-group-sm ml-2" role="group">
  286. <el-button type="primary" value="日" @click="laborReportsCountingRecordApi('日')"
  287. class="btn btn-secondary"
  288. v-model="laborReportsCountingRecordUnit">日
  289. </el-button>
  290. <el-button type="primary" value="月" @click="laborReportsCountingRecordApi('月')"
  291. class="btn btn-secondary"
  292. v-model="laborReportsCountingRecordUnit">月
  293. </el-button>
  294. <el-button type="primary" value="年" @click="laborReportsCountingRecordApi('年')"
  295. class="btn btn-secondary"
  296. v-model="laborReportsCountingRecordUnit">年
  297. </el-button>
  298. </div>
  299. </div>
  300. </div>
  301. <div class="card-body row">
  302. <div v-show="laborReportsCountingRecordsShow" id="laborReportsCountingRecords"
  303. class="col"
  304. style="width: 100%;height:500px;"></div>
  305. <div v-show="!laborReportsCountingRecordsShow">
  306. <h3>正在加载...</h3>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. <div class="col-sm-6 col-lg-6 col-xl-6 col-md-6">
  312. <div class="card">
  313. <div class="card-header">
  314. <span class="demonstration"></span>
  315. <el-date-picker
  316. size="small"
  317. @blur="laborReportsUserGroupsCountApi('')"
  318. v-model="laborReportsUserGroupsCountDate"
  319. type="daterange"
  320. align="right"
  321. unlink-panels
  322. range-separator="-"
  323. start-placeholder="开始日期"
  324. end-placeholder="结束日期"
  325. value-format="yyyy-MM-dd"
  326. :picker-options="pickerOptions">
  327. </el-date-picker>
  328. </div>
  329. <div class="card-body row">
  330. <div v-show="laborReportsUserGroupsCountShow" id="laborReportsUserGroupsCount"
  331. class="col"
  332. style="width: 100%;height:500px;"></div>
  333. <div v-show="!laborReportsUserGroupsCountShow">
  334. <h3>正在加载...</h3>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. @endcan
  340. </div>
  341. <div class="row my-3">
  342. @can("控制台-称重统计")
  343. <div class="col-6">
  344. <div class="card">
  345. <div class="card-header">
  346. <div class="row">
  347. <el-date-picker size="small" class="col-6 date" @blur="loadWeightInfo()" type="daterange" align="right"
  348. v-model="searchOption.weightDate" unlink-panels range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd">
  349. </el-date-picker>
  350. <label class="col-3 offset-3">
  351. <select class="form-control rounded" v-model="searchOption.weightSelect" @change="switchWeightDate()">
  352. <option v-for="(date,i) in dateOptions" :value="i">@{{ date.text }}</option>
  353. </select>
  354. </label>
  355. </div>
  356. </div>
  357. <div class="card-body row">
  358. <div id="weight" class="col-12" style="min-height: 500px"></div>
  359. </div>
  360. </div>
  361. </div>
  362. @endcan
  363. </div>
  364. </div>
  365. </div>
  366. @endsection
  367. @section('lastScript')
  368. <script src="{{ mix('js/echarts.js') }}"></script>
  369. <!-- 引入样式 -->
  370. <!-- 引入组件库 -->
  371. <script src="{{ mix('js/element-ui.js') }}"></script>
  372. <script>
  373. let vue = new Vue({
  374. el: "#list",
  375. data: {
  376. myChart: null,
  377. menus:{!! $menus !!},
  378. owners:{!! $owners !!},
  379. selectOrderOwners:[],
  380. selectLogisticsOwners:[],
  381. warehousesOrders:{!! $warehousesOrders !!},
  382. orderCountingRecords:{!! $orderCountingRecords !!},
  383. logisticsCountingRecords:{!! $logisticsCountingRecords !!},
  384. warehouseCountingRecords:{!! $warehouseCountingRecords !!},
  385. laborReportsCountingRecords:{!! $laborReportsCountingRecords !!},
  386. laborReportsUserGroupsCount:{!! $laborReportsUserGroupsCount !!},
  387. warehouses: {},
  388. totalOrders: {
  389. total: null,
  390. createOrder: null,
  391. assignedComplete: null,
  392. partialAllocation: null,
  393. partPacking: null,
  394. sowComplete: null,
  395. },
  396. orderCountingRecordsDateTarget: [],
  397. orderCountingRecordsData: [],
  398. laborReportsCountingRecordsDateTarget: [],
  399. laborReportsCountingRecordsData: [],
  400. pickerOptions: {
  401. shortcuts: [{
  402. text: '最近一周',
  403. onClick(picker) {
  404. const end = new Date();
  405. const start = new Date();
  406. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  407. picker.$emit('pick', [start, end]);
  408. }
  409. }, {
  410. text: '最近一个月',
  411. onClick(picker) {
  412. const end = new Date();
  413. const start = new Date();
  414. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  415. picker.$emit('pick', [start, end]);
  416. }
  417. }, {
  418. text: '最近三个月',
  419. onClick(picker) {
  420. const end = new Date();
  421. const start = new Date();
  422. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  423. picker.$emit('pick', [start, end]);
  424. }
  425. }]
  426. },
  427. dateOptions:[{text:'当天',start:moment().format('yyyy-MM-DD'),end:moment().format('yyyy-MM-DD')},
  428. {text:"昨天",start:moment().subtract("1","day").format('yyyy-MM-DD'),end:moment().subtract("1","day").format('yyyy-MM-DD')},
  429. {text:"本周",start:moment().weekday(1).format('yyyy-MM-DD'),end:moment().weekday(7).format('yyyy-MM-DD')},
  430. {text:"上周",start:moment().weekday(-6).format('yyyy-MM-DD'),end:moment().weekday(0).format('yyyy-MM-DD')},
  431. {text:"本月",start:moment().startOf("month").format('yyyy-MM-DD'),end:moment().endOf("month").format('yyyy-MM-DD')},
  432. {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')},
  433. {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')},
  434. {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')},
  435. {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')},
  436. {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')}],
  437. logisticsCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  438. moment(new Date()).format('yyyy-MM-DD')],
  439. warehouseCountingRecordsData: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  440. moment(new Date()).format('yyyy-MM-DD')],
  441. laborReportsCountingRecordsDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  442. moment(new Date()).format('yyyy-MM-DD')],
  443. laborReportsUserGroupsCountDate: [moment().subtract('1', 'month').format('yyyy-MM-DD'),
  444. moment(new Date()).format('yyyy-MM-DD')],
  445. orderCountingRecordsUnit: '日',
  446. laborReportsCountingRecordUnit: '日',
  447. orderCountingRecordsShow: true,
  448. logisticsCountingRecordsShow: true,
  449. warehouseCountingRecordsShow: true,
  450. laborReportsCountingRecordsShow: true,
  451. laborReportsUserGroupsCountShow: true,
  452. orderCountingRecordsDayShow: true,
  453. orderCountingRecordsMonthShow: false,
  454. orderCountingRecordsYearShow: false,
  455. orderCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  456. orderCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  457. orderCountingUnit: '日',
  458. orderUnitsData: {
  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. laborReportsUnit: '日',
  467. laborReportsData: {
  468. start_day: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  469. end_day: moment(new Date()).format('yyyy-MM-DD'),
  470. start_month: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  471. end_month: moment(new Date()).format('yyyy-MM-DD'),
  472. start_year: moment().subtract('12', 'month').format('yyyy-MM-DD'),
  473. end_year: moment(new Date()).format('yyyy-MM-DD'),
  474. },
  475. laborReportsCountingRecordsDayShow: true,
  476. laborReportsCountingRecordsMonthShow: false,
  477. laborReportsCountingRecordsYearShow: false,
  478. laborReportsCountingRecordsStart: moment().subtract('1', 'month').format('yyyy-MM-DD'),
  479. laborReportsCountingRecordsEnd: moment(new Date()).format('yyyy-MM-DD'),
  480. cardPool:{},
  481. searchOption:{
  482. weightDate:[],
  483. weightSelect:"",
  484. },
  485. },
  486. watch:{
  487. selectOrderOwners:function(val,oldval){
  488. let newindex = val.indexOf('all');
  489. let oldindex = oldval.indexOf('all');
  490. if(newindex!=-1 && oldindex==-1 && val.length>1)
  491. this.selectOrderOwners=['all'];
  492. else if(newindex!=-1 && oldindex!=-1 && val.length>1)
  493. this.selectOrderOwners.splice(val.indexOf('all'),1)
  494. },
  495. selectLogisticsOwners:function(val,oldval){
  496. let newindex = val.indexOf('all');
  497. let oldindex = oldval.indexOf('all');
  498. if(newindex!=-1 && oldindex==-1 && val.length>1)
  499. this.selectLogisticsOwners=['all'];
  500. else if(newindex!=-1 && oldindex!=-1 && val.length>1)
  501. this.selectLogisticsOwners.splice(val.indexOf('all'),1)
  502. }
  503. },
  504. mounted: function () {
  505. let index = 4;
  506. this.searchOption.weightSelect = index;
  507. this.searchOption.weightDate = [this.dateOptions[index].start,this.dateOptions[index].end];
  508. $('#list').removeClass('d-none');
  509. let _this = this;
  510. this.warehouses = {
  511. "WH01": '松江一仓',
  512. "WH02": '松江二仓',
  513. "WH03": '嘉定一仓',
  514. }
  515. this.warehousesOrders.forEach(function (item) {
  516. _this.totalOrders.total += parseInt(item.total);
  517. _this.totalOrders.createOrder += item.createOrder;
  518. _this.totalOrders.assignedComplete += item.assignedComplete;
  519. _this.totalOrders.partialAllocation += item.partialAllocation;
  520. _this.totalOrders.partPacking += item.partPacking;
  521. _this.totalOrders.sowComplete += item.sowComplete;
  522. });
  523. if (this.orderCountingRecords[0]!=null) {
  524. this.initOrderCountingRecords();
  525. this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
  526. this.initOrderCountingRecordsChart();
  527. }
  528. this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
  529. this.initLogisticsCountingRecordsChart();
  530. this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
  531. this.initWarehouseCountingRecordsChart();
  532. @can('人事管理-临时工报表-可见全部组')
  533. this.initLaborReportsCountingRecords();
  534. this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
  535. this.initLaborReportsCountingRecordsChart();
  536. this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
  537. this.initLaborReportsUserGroupsCountChart();
  538. @endcan
  539. @can("控制台-称重统计")
  540. this.cardPool.weight = echarts.init(document.getElementById("weight"));
  541. this.loadWeightInfo();
  542. @endcan
  543. },
  544. methods: {
  545. switchDataPanel_forOrderCountingRecords(fromUnit, toUnit) {
  546. switch (fromUnit) {
  547. case '日':
  548. this.orderUnitsData.start_day = this.orderCountingRecordsStart;
  549. this.orderUnitsData.end_day = this.orderCountingRecordsEnd;
  550. break;
  551. case '月':
  552. this.orderUnitsData.start_month = this.orderCountingRecordsStart;
  553. this.orderUnitsData.end_month = this.orderCountingRecordsEnd;
  554. break;
  555. case '年':
  556. this.orderUnitsData.start_year = this.orderCountingRecordsStart;
  557. this.orderUnitsData.end_year = this.orderCountingRecordsEnd;
  558. break;
  559. }
  560. switch (toUnit) {
  561. case '日':
  562. this.orderCountingRecordsStart = this.orderUnitsData.start_day;
  563. this.orderCountingRecordsEnd = this.orderUnitsData.end_day;
  564. break;
  565. case '月':
  566. this.orderCountingRecordsStart = this.orderUnitsData.start_month;
  567. this.orderCountingRecordsEnd = this.orderUnitsData.end_month;
  568. break;
  569. case '年':
  570. this.orderCountingRecordsStart = this.orderUnitsData.start_year;
  571. this.orderCountingRecordsEnd = this.orderUnitsData.end_year;
  572. break;
  573. }
  574. },
  575. switchDataPanel_forLaborReports(fromUnit, toUnit) {
  576. switch (fromUnit) {
  577. case '日':
  578. this.laborReportsData.start_day = this.laborReportsCountingRecordsStart;
  579. this.laborReportsData.end_day = this.laborReportsCountingRecordsEnd;
  580. break;
  581. case '月':
  582. this.laborReportsData.start_month = this.laborReportsCountingRecordsStart;
  583. this.laborReportsData.end_month = this.laborReportsCountingRecordsEnd;
  584. break;
  585. case '年':
  586. this.laborReportsData.start_year = this.laborReportsCountingRecordsStart;
  587. this.laborReportsData.end_year = this.laborReportsCountingRecordsEnd;
  588. break;
  589. }
  590. switch (toUnit) {
  591. case '日':
  592. this.laborReportsCountingRecordsStart = this.laborReportsData.start_day;
  593. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_day;
  594. break;
  595. case '月':
  596. this.laborReportsCountingRecordsStart = this.laborReportsData.start_month;
  597. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_month;
  598. break;
  599. case '年':
  600. this.laborReportsCountingRecordsStart = this.laborReportsData.start_year;
  601. this.laborReportsCountingRecordsEnd = this.laborReportsData.end_year;
  602. break;
  603. }
  604. },
  605. getWareHouse: function (code) {
  606. return this.warehouses[code];
  607. },
  608. initOrderCountingRecords() {
  609. for (let key in this.orderCountingRecords) {
  610. this.orderCountingRecordsDateTarget.push(this.orderCountingRecords[key].date_target);
  611. this.orderCountingRecordsData.push(this.orderCountingRecords[key].counter);
  612. }
  613. },
  614. initOrderCountingRecordsChart(text) {
  615. if (text==null ||text==''||text==undefined) text='默认显示权限下所有货主订单数量';
  616. this.orderCountingRecordsChart.setOption({
  617. title: {text: '订单量趋势',subtext: text,},
  618. tooltip: {},
  619. legend: {data: ['订单数']},
  620. xAxis: {
  621. type: 'category',
  622. data: this.orderCountingRecordsDateTarget
  623. },
  624. yAxis: {type: 'value'},
  625. series: [{
  626. data: this.orderCountingRecordsData,
  627. type: 'line',
  628. smooth: true
  629. }]
  630. });
  631. },
  632. initLaborReportsCountingRecordsChart() {
  633. this.laborReportsCountingRecordsChart.setOption({
  634. title: {text: '临时用工趋势'},
  635. tooltip: {},
  636. legend: {data: ['临时用工数']},
  637. xAxis: {
  638. type: 'category',
  639. data: this.laborReportsCountingRecordsDateTarget
  640. },
  641. yAxis: {type: 'value'},
  642. series: [{
  643. data: this.laborReportsCountingRecordsData,
  644. type: 'line',
  645. smooth: true
  646. }]
  647. });
  648. },
  649. initLogisticsCountingRecordsChart(text) {
  650. if (text==null ||text==''||text==undefined) text='默认显示权限下所有货主快递分布';
  651. this.logisticsCountingRecordsChart.setOption({
  652. title: {
  653. text: '快递分布',
  654. subtext:text,
  655. left: 'left'
  656. },
  657. tooltip: {
  658. trigger: 'item',
  659. formatter: '{a} <br/>{b} : {c} ({d}%)'
  660. },
  661. series: [
  662. {
  663. name: '快递分布',
  664. type: 'pie',
  665. radius: '55%',
  666. center: ['50%', '60%'],
  667. data: this.logisticsCountingRecords,
  668. emphasis: {
  669. itemStyle: {
  670. shadowBlur: 10,
  671. shadowOffsetX: 0,
  672. shadowColor: 'rgba(0, 0, 0, 0.5)'
  673. }
  674. }
  675. }
  676. ]
  677. });
  678. },
  679. initWarehouseCountingRecordsChart() {
  680. this.warehouseCountingRecordsChart.setOption({
  681. title: {
  682. text: '仓库分布',
  683. left: 'left'
  684. },
  685. tooltip: {
  686. trigger: 'item',
  687. formatter: '{a} <br/>{b} : {c} ({d}%)'
  688. },
  689. series: [
  690. {
  691. name: '仓库分布',
  692. type: 'pie',
  693. radius: '55%',
  694. center: ['50%', '60%'],
  695. data: this.warehouseCountingRecords,
  696. emphasis: {
  697. itemStyle: {
  698. shadowBlur: 10,
  699. shadowOffsetX: 0,
  700. shadowColor: 'rgba(0, 0, 0, 0.5)'
  701. }
  702. }
  703. }
  704. ]
  705. });
  706. },
  707. initLaborReportsUserGroupsCountChart() {
  708. this.laborReportsUserGroupsCountChart.setOption({
  709. title: {
  710. text: '小组临时工分布',
  711. left: 'left'
  712. },
  713. tooltip: {
  714. trigger: 'item',
  715. formatter: '{a} <br/>{b} : {c} ({d}%)'
  716. },
  717. series: [
  718. {
  719. name: '小组临时工分布',
  720. type: 'pie',
  721. radius: '55%',
  722. center: ['50%', '60%'],
  723. data: this.laborReportsUserGroupsCount,
  724. emphasis: {
  725. itemStyle: {
  726. shadowBlur: 10,
  727. shadowOffsetX: 0,
  728. shadowColor: 'rgba(0, 0, 0, 0.5)'
  729. }
  730. }
  731. }
  732. ]
  733. });
  734. },
  735. initLaborReportsCountingRecords() {
  736. let _this = this;
  737. this.laborReportsCountingRecords.forEach(function (item) {
  738. _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
  739. _this.laborReportsCountingRecordsData.push(item.counter);
  740. });
  741. },
  742. orderCountingRecordApi(orderCountingRecordsUnit) {
  743. if (orderCountingRecordsUnit === '') {
  744. orderCountingRecordsUnit = this.orderCountingRecordsUnit;
  745. }
  746. this.switchDataPanel_forOrderCountingRecords(this.orderCountingUnit, orderCountingRecordsUnit);
  747. this.orderCountingUnit = orderCountingRecordsUnit;
  748. switch (orderCountingRecordsUnit) {
  749. case '日':
  750. this.orderCountingRecordsDayShow = true;
  751. this.orderCountingRecordsMonthShow = false;
  752. this.orderCountingRecordsYearShow = false;
  753. break;
  754. case '月':
  755. this.orderCountingRecordsDayShow = false;
  756. this.orderCountingRecordsMonthShow = true;
  757. this.orderCountingRecordsYearShow = false;
  758. break;
  759. case '年':
  760. this.orderCountingRecordsDayShow = false;
  761. this.orderCountingRecordsMonthShow = false;
  762. this.orderCountingRecordsYearShow = true;
  763. break;
  764. }
  765. this.orderCountingRecordsUnit = orderCountingRecordsUnit;
  766. // let formData = new FormData();
  767. // formData.append('start', this.orderCountingRecordsStart);
  768. // formData.append('end', this.orderCountingRecordsEnd);
  769. // formData.append('unit', orderCountingRecordsUnit);
  770. // formData.append('owner_ids',this.selectOwners);
  771. this.orderCountingRecordsShow = false;
  772. let _this = this;
  773. let text = null;
  774. axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}',{
  775. 'start':this.orderCountingRecordsStart,'end':this.orderCountingRecordsEnd,
  776. 'unit':orderCountingRecordsUnit,'owner_ids':this.selectOrderOwners}).then(function (res) {
  777. if (res.status === 200) {
  778. _this.orderCountingRecords = res.data.orderCountingRecords;
  779. _this.orderCountingRecordsDateTarget = [];
  780. _this.orderCountingRecordsData = [];
  781. _this.initOrderCountingRecords();
  782. if (_this.selectOrderOwners.length>0) text='当前选中货主订单数量';
  783. _this.initOrderCountingRecordsChart(text);
  784. _this.orderCountingRecordsShow = true;
  785. }
  786. });
  787. },
  788. logisticsCountingRecordsApi() {
  789. let text = null;
  790. this.logisticsCountingRecordsShow = false;
  791. // let formData = new FormData();
  792. // formData.append('start', this.logisticsCountingRecordsData[0]);
  793. // formData.append('end', this.logisticsCountingRecordsData[1]);
  794. let _this = this;
  795. axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}',{
  796. 'start':this.logisticsCountingRecordsData[0],'end':this.logisticsCountingRecordsData[1],'owner_ids':this.selectLogisticsOwners
  797. }).then(function (res) {
  798. if (res.status === 200) {
  799. _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
  800. if (_this.selectLogisticsOwners.length>0) text='当前选中货主快递分布';
  801. _this.initLogisticsCountingRecordsChart(text);
  802. _this.logisticsCountingRecordsShow = true;
  803. }
  804. });
  805. },
  806. warehouseCountingRecordsApi() {
  807. this.warehouseCountingRecordsShow = false;
  808. let formData = new FormData();
  809. formData.append('start', this.warehouseCountingRecordsData[0]);
  810. formData.append('end', this.warehouseCountingRecordsData[1]);
  811. let _this = this;
  812. axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
  813. if (res.status === 200) {
  814. _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
  815. _this.initWarehouseCountingRecordsChart();
  816. _this.warehouseCountingRecordsShow = true;
  817. }
  818. });
  819. },
  820. laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
  821. this.laborReportsCountingRecordsShow = false;
  822. if (laborReportsCountingRecordUnit === '') {
  823. laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
  824. }
  825. this.switchDataPanel_forLaborReports(this.laborReportsUnit, laborReportsCountingRecordUnit);
  826. this.laborReportsUnit = laborReportsCountingRecordUnit;
  827. this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
  828. switch (laborReportsCountingRecordUnit) {
  829. case '日':
  830. this.laborReportsCountingRecordsDayShow = true;
  831. this.laborReportsCountingRecordsMonthShow = false;
  832. this.laborReportsCountingRecordsYearShow = false;
  833. break;
  834. case '月':
  835. this.laborReportsCountingRecordsDayShow = false;
  836. this.laborReportsCountingRecordsMonthShow = true;
  837. this.laborReportsCountingRecordsYearShow = false;
  838. break;
  839. case '年':
  840. this.laborReportsCountingRecordsDayShow = false;
  841. this.laborReportsCountingRecordsMonthShow = false;
  842. this.laborReportsCountingRecordsYearShow = true;
  843. break;
  844. }
  845. let formData = new FormData();
  846. formData.append('start', this.laborReportsCountingRecordsStart);
  847. formData.append('end', this.laborReportsCountingRecordsEnd);
  848. formData.append('unit', laborReportsCountingRecordUnit);
  849. let _this = this;
  850. axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
  851. if (res.status === 200) {
  852. _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
  853. _this.laborReportsCountingRecordsDateTarget = [];
  854. _this.laborReportsCountingRecordsData = [];
  855. _this.initLaborReportsCountingRecords();
  856. _this.initLaborReportsCountingRecordsChart();
  857. _this.laborReportsCountingRecordsShow = true;
  858. }
  859. });
  860. },
  861. laborReportsUserGroupsCountApi() {
  862. this.laborReportsUserGroupsCountShow = false;
  863. let formData = new FormData();
  864. formData.append('start', this.laborReportsUserGroupsCountDate[0]);
  865. formData.append('end', this.laborReportsUserGroupsCountDate[1]);
  866. let _this = this;
  867. axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
  868. if (res.status === 200) {
  869. _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
  870. _this.initLaborReportsUserGroupsCountChart();
  871. _this.laborReportsUserGroupsCountShow = true;
  872. }
  873. });
  874. },
  875. loadWeightInfo(){
  876. window.tempTip.setDuration(3000);
  877. if (!this.searchOption.weightDate[0]){
  878. window.tempTip.show("开始时间未选择");
  879. return;
  880. }
  881. if (!this.searchOption.weightDate[1]){
  882. window.tempTip.show("结束时间未选择");
  883. return;
  884. }
  885. this.cardPool.weight.showLoading('default',{text:"加 载 中",color:'#C0C0C0'});
  886. let url = "{{url('apiLocal/control/panel/menu/weightApi')}}";
  887. let params = {start:this.searchOption.weightDate[0],end:this.searchOption.weightDate[1]};
  888. window.tempTip.postBasicRequest(url,params,res=>{
  889. this.cardPool.weight.hideLoading();
  890. this.cardPool.weight.setOption(this._setWeightData(res.title,res.data));
  891. });
  892. },
  893. switchWeightDate(){
  894. let obj = this.dateOptions[this.searchOption.weightSelect];
  895. this.searchOption.weightDate = [obj.start,obj.end];
  896. this.loadWeightInfo();
  897. },
  898. _setWeightData(title, data){
  899. return {
  900. title: {
  901. text: '已称重包裹占比',
  902. left: 'left'
  903. },
  904. tooltip: {
  905. trigger: 'item',
  906. formatter: function (params) {
  907. 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>";
  908. }
  909. }, xAxis: {
  910. data: title
  911. }, yAxis: {
  912. axisLabel: {
  913. show: true,
  914. interval: 'auto',
  915. formatter: '{value} %'
  916. },
  917. max:100
  918. }, label:{
  919. show:true,
  920. position: 'top',
  921. formatter: '{c}%',
  922. color:"red"
  923. }, series: [{
  924. type: "bar",
  925. data: data,
  926. itemStyle:{
  927. color:"RGB(62,157,231)",
  928. }
  929. }]
  930. };
  931. },
  932. }
  933. });
  934. </script>
  935. @endsection