| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503 |
- @extends('layouts.app')
- @section('title')控制台@endsection
- @section('content')
- <div class="container-fluid" id="list">
- <div class="card">
- <h5 class="card-header">最近使用功能</h5>
- <div class="card-body row">
- <ul class="list-group" v-for="(menu,index) in menus">
- <div class="container-fluid btn-group justify-content-center">
- <a class="btn-primary btn-lg" v-if="index<=3" :href="'/'+menu.route">@{{ menu.name }}</a>
- </div>
- <div v-if="menu.secondLevelMenu && menu.secondLevelMenu.length>0&&index<=3">
- <div class="container-fluid btn-group m-1">
- <a class="bth btn-sm btn-info m-1" v-for="(secondMenu,index) in menu.secondLevelMenu"
- :href="'/'+secondMenu.route" v-if="index < 2"> @{{ secondMenu.name }}</a>
- </div>
- </div>
- </ul>
- </div>
- </div>
- <div class="row my-3">
- <div class="col-2">
- <div class="card">
- <div class="card-header text-dark h5">
- <p>实时待处理订(总):@{{ totalOrders.total }}</p>
- </div>
- <div class="card-body">
- <p>创建订单:@{{ totalOrders.createOrder }}</p>
- <p>分配完成:@{{ totalOrders.assignedComplete }}</p>
- <p>部分分配:@{{ totalOrders.partialAllocation }}</p>
- <p>部分装箱:@{{ totalOrders.partPacking }}</p>
- <p>播种完成:@{{ totalOrders.sowComplete }}</p>
- </div>
- </div>
- </div>
- <div class="col-2" v-for="(warehousesOrder,index) in warehousesOrders">
- <div class="card">
- <div class="card-header text-success h5">
- <p>@{{ getWareHouse(warehousesOrder.name) }}:@{{ warehousesOrder.total }}</p>
- </div>
- <div class="card-body">
- <p>创建订单:@{{ warehousesOrder.createOrder }}</p>
- <p>分配完成:@{{ warehousesOrder.assignedComplete }}</p>
- <p>部分分配:@{{ warehousesOrder.partialAllocation }}</p>
- <p>部分装箱:@{{ warehousesOrder.partPacking }}</p>
- <p>播种完成:@{{ warehousesOrder.sowComplete }}</p>
- </div>
- </div>
- </div>
- </div>
- <div class="row my-3">
- <div class="col-5">
- <div class="card">
- <div class="card-header">
- <span class="demonstration" ></span>
- <el-date-picker @blur="orderCountingRecordApi('')"
- v-model="orderCountingRecordsDate"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions">
- </el-date-picker>
- <el-button type="primary" value="日" @click="orderCountingRecordApi('日')" v-model="orderCountingRecordsUnit">日</el-button>
- <el-button type="primary" value="周" @click="orderCountingRecordApi('周')" v-model="orderCountingRecordsUnit">周</el-button>
- <el-button type="primary" value="月" @click="orderCountingRecordApi('月')" v-model="orderCountingRecordsUnit">月</el-button>
- </div>
- <div class="card-body row">
- <div id="orderCountingRecords" class="col" style="width:600px;height:600px;"></div>
- </div>
- </div>
- </div>
- <div class="col-7">
- <div class="row">
- <div class="col-6">
- <div class="card">
- <div class="card-header">
- <div class="col-5 row">
- <div class="block">
- <span class="demonstration"></span>
- <el-date-picker @blur="logisticsCountingRecordsApi()"
- v-model="logisticsCountingRecordsData"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions">
- </el-date-picker>
- </div>
- </div>
- </div>
- <div class="card-body row">
- <div id="logisticsCountingRecords" class="col"
- style="width: 600px;height:600px;"></div>
- </div>
- </div>
- </div>
- <div class="col-6">
- <div class="card">
- <div class="card-header">
- <div class="col-5 row">
- <div class="block">
- <span class="demonstration"></span>
- <el-date-picker @blur="warehouseCountingRecordsApi()"
- v-model="warehouseCountingRecordsData"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions">
- </el-date-picker>
- </div>
- </div>
- </div>
- <div class="card-body row">
- <div id="warehouseCountingRecords" class="col"
- style="width: 600px;height:600px;"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-5">
- <div class="card">
- <div class="card-header">
- <span class="demonstration" ></span>
- <el-date-picker @blur="laborReportsCountingRecordApi('')"
- v-model="laborReportsCountingRecordsDate"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions">
- </el-date-picker>
- <el-button type="primary" value="日" @click="laborReportsCountingRecordApi('日')" v-model="laborReportsCountingRecordUnit">日</el-button>
- <el-button type="primary" value="周" @click="laborReportsCountingRecordApi('周')" v-model="laborReportsCountingRecordUnit">周</el-button>
- <el-button type="primary" value="月" @click="laborReportsCountingRecordApi('月')" v-model="laborReportsCountingRecordUnit">月</el-button>
- </div>
- <div class="card-body row">
- <div id="laborReportsCountingRecords" class="col" style="width:600px;height:600px;"></div>
- </div>
- </div>
- </div>
- <div class="col-7">
- <div class="card">
- <div class="card-header">
- <span class="demonstration" ></span>
- <el-date-picker @blur="laborReportsUserGroupsCountApi('')"
- v-model="laborReportsUserGroupsCountDate"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions">
- </el-date-picker>
- </div>
- <div class="card-body row">
- <div id="laborReportsUserGroupsCount" class="col" style="width:600px;height:600px;"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- @endsection
- @section('lastScript')
- <script src="{{ mix('js/echarts.js') }}"></script>
- <!-- 引入样式 -->
- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
- <!-- 引入组件库 -->
- <script src="https://unpkg.com/element-ui/lib/index.js"></script>
- <script>
- let vue = new Vue({
- el: "#list",
- data: {
- myChart: null,
- menus:{!! $menus !!},
- warehousesOrders:{!! $warehousesOrders !!},
- orderCountingRecords:{!! $orderCountingRecords !!},
- logisticsCountingRecords:{!! $logisticsCountingRecords !!},
- warehouseCountingRecords:{!! $warehouseCountingRecords !!},
- laborReportsCountingRecords:{!! $laborReportsCountingRecords !!},
- laborReportsUserGroupsCount:{!! $laborReportsUserGroupsCount !!},
- warehouses: {},
- totalOrders: {
- total: null,
- createOrder: null,
- assignedComplete: null,
- partialAllocation: null,
- partPacking: null,
- sowComplete: null,
- },
- orderCountingRecordsDateTarget: [],
- orderCountingRecordsData: [],
- laborReportsCountingRecordsDateTarget: [],
- laborReportsCountingRecordsData: [],
- pickerOptions: {
- shortcuts: [{
- text: '最近一周',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近一个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近三个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- orderCountingRecordsDate: [moment(new Date(new Date().getTime() - 3600 * 1000 * 24 * 30)).format('yyyy-MM-DD'),
- moment(new Date()).format('yyyy-MM-DD')],
- logisticsCountingRecordsData: [moment(new Date(new Date().getTime() - 3600 * 1000 * 24 * 30)).format('yyyy-MM-DD'),
- moment(new Date()).format('yyyy-MM-DD')],
- warehouseCountingRecordsData: [moment(new Date(new Date().getTime() - 3600 * 1000 * 24 * 30)).format('yyyy-MM-DD'),
- moment(new Date()).format('yyyy-MM-DD')],
- laborReportsCountingRecordsDate: [moment(new Date(new Date().getTime() - 3600 * 1000 * 24 * 30)).format('yyyy-MM-DD'),
- moment(new Date()).format('yyyy-MM-DD')],
- laborReportsUserGroupsCountDate: [moment(new Date(new Date().getTime() - 3600 * 1000 * 24 * 30)).format('yyyy-MM-DD'),
- moment(new Date()).format('yyyy-MM-DD')],
- orderCountingRecordsUnit: '日',
- laborReportsCountingRecordUnit: '日'
- },
- mounted: function () {
- let _this = this;
- this.warehouses = {
- "WH01": '松江一仓',
- "WH02": '松江二仓',
- "WH03": '嘉定一仓',
- }
- this.warehousesOrders.forEach(function (item) {
- _this.totalOrders.total += parseInt(item.total);
- _this.totalOrders.createOrder += item.createOrder;
- _this.totalOrders.assignedComplete += item.assignedComplete;
- _this.totalOrders.partialAllocation += item.partialAllocation;
- _this.totalOrders.partPacking += item.partPacking;
- _this.totalOrders.sowComplete += item.sowComplete;
- });
- this.initOrderCountingRecords();
- this.orderCountingRecordsChart = echarts.init(document.getElementById('orderCountingRecords'));
- this.initOrderCountingRecordsChart();
- this.logisticsCountingRecordsChart = echarts.init(document.getElementById('logisticsCountingRecords'));
- this.initLogisticsCountingRecordsChart();
- this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
- this.initWarehouseCountingRecordsChart();
- this.initLaborReportsCountingRecords();
- this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
- this.initLaborReportsCountingRecordsChart();
- this.laborReportsUserGroupsCountChart = echarts.init(document.getElementById('laborReportsUserGroupsCount'));
- this.initLaborReportsUserGroupsCountChart();
- },
- methods: {
- getWareHouse: function (code) {
- return this.warehouses[code];
- },
- initOrderCountingRecords() {
- let _this = this;
- this.orderCountingRecords.forEach(function (item) {
- _this.orderCountingRecordsDateTarget.push(item.date_target);
- _this.orderCountingRecordsData.push(item.counter);
- });
- },
- initOrderCountingRecordsChart() {
- this.orderCountingRecordsChart.setOption({
- title: {text: '订单量趋势'},
- tooltip: {},
- legend: {data: ['订单数']},
- xAxis: {
- type: 'category',
- data: this.orderCountingRecordsDateTarget
- },
- yAxis: {type: 'value'},
- series: [{
- data: this.orderCountingRecordsData,
- type: 'line',
- smooth: true
- }]
- });
- },
- initLaborReportsCountingRecordsChart() {
- this.laborReportsCountingRecordsChart.setOption({
- title: {text: '临时用工趋势'},
- tooltip: {},
- legend: {data: ['临时用工数']},
- xAxis: {
- type: 'category',
- data: this.laborReportsCountingRecordsDateTarget
- },
- yAxis: {type: 'value'},
- series: [{
- data: this.laborReportsCountingRecordsData,
- type: 'line',
- smooth: true
- }]
- });
- },
- initLogisticsCountingRecordsChart() {
- this.logisticsCountingRecordsChart.setOption({
- title: {
- text: '快递分布',
- left: 'left'
- },
- tooltip: {
- trigger: 'item',
- formatter: '{a} <br/>{b} : {c} ({d}%)'
- },
- series: [
- {
- name: '访问来源',
- type: 'pie',
- radius: '55%',
- center: ['50%', '60%'],
- data: this.logisticsCountingRecords,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- });
- },
- initWarehouseCountingRecordsChart() {
- this.warehouseCountingRecordsChart.setOption({
- title: {
- text: '仓库分布',
- left: 'left'
- },
- tooltip: {
- trigger: 'item',
- formatter: '{a} <br/>{b} : {c} ({d}%)'
- },
- series: [
- {
- name: '访问来源',
- type: 'pie',
- radius: '55%',
- center: ['50%', '60%'],
- data: this.warehouseCountingRecords,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- });
- },
- initLaborReportsUserGroupsCountChart() {
- this.laborReportsUserGroupsCountChart.setOption({
- title: {
- text: '小组临时工分布',
- left: 'left'
- },
- tooltip: {
- trigger: 'item',
- formatter: '{a} <br/>{b} : {c} ({d}%)'
- },
- series: [
- {
- name: '访问来源',
- type: 'pie',
- radius: '55%',
- center: ['50%', '60%'],
- data: this.laborReportsUserGroupsCount,
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ]
- });
- },
- initLaborReportsCountingRecords() {
- let _this = this;
- this.laborReportsCountingRecords.forEach(function (item) {
- _this.laborReportsCountingRecordsDateTarget.push(item.date_target);
- _this.laborReportsCountingRecordsData.push(item.counter);
- });
- },
- orderCountingRecordApi(orderCountingRecordsUnit) {
- if (orderCountingRecordsUnit === '') {
- orderCountingRecordsUnit = this.orderCountingRecordsUnit;
- }
- this.orderCountingRecordsUnit = orderCountingRecordsUnit;
- let formData = new FormData();
- formData.append('start', this.orderCountingRecordsDate[0]);
- formData.append('end', this.orderCountingRecordsDate[1]);
- formData.append('unit', orderCountingRecordsUnit);
- let _this = this;
- axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}', formData).then(function (res) {
- if (res.status === 200) {
- _this.orderCountingRecords = res.data.orderCountingRecords;
- _this.orderCountingRecordsDateTarget = [];
- _this.orderCountingRecordsData = [];
- _this.initOrderCountingRecords();
- _this.initOrderCountingRecordsChart();
- }
- });
- },
- logisticsCountingRecordsApi() {
- let formData = new FormData();
- formData.append('start', this.logisticsCountingRecordsData[0]);
- formData.append('end', this.logisticsCountingRecordsData[1]);
- let _this = this;
- axios.post('{{url('apiLocal/control/panel/menu/logisticsCountingRecordsApi')}}', formData).then(function (res) {
- if (res.status === 200) {
- _this.logisticsCountingRecords = res.data.logisticsCountingRecords;
- _this.initLogisticsCountingRecordsChart();
- }
- });
- },
- warehouseCountingRecordsApi() {
- let formData = new FormData();
- formData.append('start', this.warehouseCountingRecordsData[0]);
- formData.append('end', this.warehouseCountingRecordsData[1]);
- let _this = this;
- axios.post('{{url('apiLocal/control/panel/menu/warehouseCountingRecordsApi')}}', formData).then(function (res) {
- if (res.status === 200) {
- _this.warehouseCountingRecords = res.data.warehouseCountingRecords;
- _this.initWarehouseCountingRecordsChart();
- }
- });
- },
- laborReportsCountingRecordApi(laborReportsCountingRecordUnit) {
- if (laborReportsCountingRecordUnit === '') {
- laborReportsCountingRecordUnit = this.laborReportsCountingRecordUnit;
- }
- this.laborReportsCountingRecordUnit = laborReportsCountingRecordUnit;
- let formData = new FormData();
- formData.append('start', this.laborReportsCountingRecordsDate[0]);
- formData.append('end', this.laborReportsCountingRecordsDate[1]);
- formData.append('unit', laborReportsCountingRecordUnit);
- let _this = this;
- axios.post('{{url('apiLocal/control/panel/menu/laborReportsCountingRecordApi')}}', formData).then(function (res) {
- if (res.status === 200) {
- _this.laborReportsCountingRecords = res.data.laborReportsCountingRecords;
- _this.laborReportsCountingRecordsDateTarget = [];
- _this.laborReportsCountingRecordsData = [];
- _this.initLaborReportsCountingRecords();
- _this.initLaborReportsCountingRecordsChart();
- }
- });
- },
- laborReportsUserGroupsCountApi() {
- let formData = new FormData();
- formData.append('start', this.laborReportsUserGroupsCountDate[0]);
- formData.append('end', this.laborReportsUserGroupsCountDate[1]);
- let _this = this;
- axios.post('{{url('apiLocal/control/panel/menu/laborReportsUserGroupsCountApi')}}', formData).then(function (res) {
- if (res.status === 200) {
- _this.laborReportsUserGroupsCount = res.data.laborReportsUserGroupsCount;
- _this.initLaborReportsUserGroupsCountChart();
- }
- });
- },
- }
- });
- </script>
- @endsection
|