|
@@ -245,9 +245,7 @@ export default {
|
245
|
245
|
//一月
|
246
|
246
|
if(month == 0){
|
247
|
247
|
const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
|
248
|
|
- console.log("开始时间",startDate)
|
249
|
248
|
const endDate = moment(new Date()).format('YYYY-MM-DD')
|
250
|
|
- console.log("结束时间",endDate)
|
251
|
249
|
var now = new Date()
|
252
|
250
|
var nowMonth = now.getMonth(); //当前月
|
253
|
251
|
var nowYear = now.getFullYear(); //当前年
|
|
@@ -256,7 +254,7 @@ export default {
|
256
|
254
|
this.startime=Date.parse(monthStartDate)/1000;//s
|
257
|
255
|
|
258
|
256
|
//本月的结束时间
|
259
|
|
- var monthEndDate = new Date(nowYear, nowMonth+1, 0);
|
|
257
|
+ var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
|
260
|
258
|
this.endtime =Date.parse(monthEndDate)/1000-1;//s
|
261
|
259
|
this.getlist()
|
262
|
260
|
}
|
|
@@ -264,21 +262,21 @@ export default {
|
264
|
262
|
//近三月
|
265
|
263
|
if(month == 1){
|
266
|
264
|
const startDate = moment().subtract('month', 3).format('YYYY-MM-DD')
|
267
|
|
- console.log("三月前",startDate)
|
|
265
|
+
|
268
|
266
|
this.startime = Date.parse(startDate)/1000
|
269
|
|
- console.log("开始时间搓",this.startime)
|
|
267
|
+
|
270
|
268
|
const endDate = moment(new Date()).format('YYYY-MM-DD')
|
271
|
|
- console.log("结束时间",endDate)
|
|
269
|
+
|
272
|
270
|
this.endtime = Date.parse(endDate)/1000
|
273
|
|
- console.log("日期时间搓",this.endtime)
|
|
271
|
+
|
274
|
272
|
this.getlist()
|
275
|
273
|
}
|
276
|
|
- console.log("month",month)
|
|
274
|
+
|
277
|
275
|
|
278
|
276
|
//近半年
|
279
|
277
|
if(month == 2){
|
280
|
278
|
const startDate = moment().subtract('month', 6).format('YYYY-MM-DD')
|
281
|
|
- console.log("6月前",startDate)
|
|
279
|
+
|
282
|
280
|
this.startime = Date.parse(startDate)/1000
|
283
|
281
|
const endDate = moment(new Date()).format('YYYY-MM-DD')
|
284
|
282
|
this.endtime = Date.parse(endDate)/1000
|
|
@@ -381,11 +379,11 @@ export default {
|
381
|
379
|
//本月的开始时间
|
382
|
380
|
var monthStartDate = new Date(nowYear, nowMonth, 1);
|
383
|
381
|
this.startime=Date.parse(monthStartDate)/1000;//s
|
384
|
|
-
|
|
382
|
+ console.log("本月开始时间",this.startime)
|
385
|
383
|
//本月的结束时间
|
386
|
|
- var monthEndDate = new Date(nowYear, nowMonth+1, 0);
|
387
|
|
- this.endtime =Date.parse(monthEndDate)/1000-1;//s
|
388
|
|
-
|
|
384
|
+ var monthEndDate = moment().endOf('month').format('YYYY-MM-DD HH:mm:ss');
|
|
385
|
+ this.endtime =Date.parse(monthEndDate)/1000-1;//s
|
|
386
|
+ console.log("本月结束时间",)
|
389
|
387
|
|
390
|
388
|
|
391
|
389
|
const params = {
|
|
@@ -394,18 +392,17 @@ export default {
|
394
|
392
|
endtime:this.endtime,
|
395
|
393
|
itemid:this.item_id,
|
396
|
394
|
}
|
397
|
|
- console.log("params",params)
|
398
|
395
|
GetQualityControl(params).then(response=>{
|
399
|
396
|
if(response.data.state == 1){
|
400
|
397
|
var list = response.data.data.list
|
401
|
|
- console.log("list",list)
|
|
398
|
+
|
402
|
399
|
for(let i=0;i<list.length;i++){
|
403
|
400
|
this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
|
404
|
401
|
this.modesData.series.push(list[i].inspect_value)
|
405
|
402
|
}
|
406
|
403
|
this.chart.series[0].data = this.modesData.series
|
407
|
404
|
this.chart.xAxis.data = this.modesData.xAxis
|
408
|
|
- console.log(2222,this.modesData)
|
|
405
|
+
|
409
|
406
|
}
|
410
|
407
|
|
411
|
408
|
})
|