|
|
@@ -64,9 +64,9 @@
|
|
|
value-format="yyyy-MM-dd"
|
|
|
:picker-options="pickerOptions">
|
|
|
</el-date-picker>
|
|
|
- <el-button type="primary" value="日" @click="orderCountingRecordApi('日')" v-model="unit">日</el-button>
|
|
|
- <el-button type="primary" value="周" @click="orderCountingRecordApi('周')" v-model="unit">周</el-button>
|
|
|
- <el-button type="primary" value="月" @click="orderCountingRecordApi('月')" v-model="unit">月</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>
|
|
|
+ <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>
|
|
|
@@ -129,6 +129,30 @@
|
|
|
</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>
|
|
|
</div>
|
|
|
@endsection
|
|
|
@@ -148,6 +172,7 @@
|
|
|
orderCountingRecords:{!! $orderCountingRecords !!},
|
|
|
logisticsCountingRecords:{!! $logisticsCountingRecords !!},
|
|
|
warehouseCountingRecords:{!! $warehouseCountingRecords !!},
|
|
|
+ laborReportsCountingRecords:{!! $laborReportsCountingRecords !!},
|
|
|
warehouses: {},
|
|
|
totalOrders: {
|
|
|
total: null,
|
|
|
@@ -159,6 +184,8 @@
|
|
|
},
|
|
|
orderCountingRecordsDateTarget: [],
|
|
|
orderCountingRecordsData: [],
|
|
|
+ laborReportsCountingRecordsDateTarget: [],
|
|
|
+ laborReportsCountingRecordsData: [],
|
|
|
pickerOptions: {
|
|
|
shortcuts: [{
|
|
|
text: '最近一周',
|
|
|
@@ -192,7 +219,10 @@
|
|
|
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')],
|
|
|
- unit: '日'
|
|
|
+ laborReportsCountingRecordsDate: [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;
|
|
|
@@ -219,6 +249,10 @@
|
|
|
this.warehouseCountingRecordsChart = echarts.init(document.getElementById('warehouseCountingRecords'));
|
|
|
this.initWarehouseCountingRecordsChart();
|
|
|
|
|
|
+ this.initLaborReportsCountingRecords();
|
|
|
+ this.laborReportsCountingRecordsChart = echarts.init(document.getElementById('laborReportsCountingRecords'));
|
|
|
+ this.initLaborReportsCountingRecordsChart();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
getWareHouse: function (code) {
|
|
|
@@ -248,6 +282,23 @@
|
|
|
}]
|
|
|
});
|
|
|
},
|
|
|
+ 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: {
|
|
|
@@ -304,13 +355,23 @@
|
|
|
]
|
|
|
});
|
|
|
},
|
|
|
- orderCountingRecordApi(unit) {
|
|
|
- this.unit = unit;
|
|
|
+ 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', unit);
|
|
|
- console.log(formData.get('unit'));
|
|
|
+ formData.append('unit', orderCountingRecordsUnit);
|
|
|
let _this = this;
|
|
|
axios.post('{{url('apiLocal/control/panel/menu/orderCountingRecordApi')}}', formData).then(function (res) {
|
|
|
if (res.status === 200) {
|
|
|
@@ -348,6 +409,26 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
});
|
|
|
</script>
|