panel.blade.php 54 KB

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