首页库存、生产进度更改
This commit is contained in:
parent
5401d07003
commit
688b3b82fe
|
@ -19,33 +19,33 @@
|
|||
<div style="padding-top: 20px;display: flex;">
|
||||
<div class="countItem">
|
||||
<div class="countname">预制棒合格数</div>
|
||||
<p class="countnum">{{dayPassNum7}}</p>
|
||||
<p class="countnum">{{ dayPassNum7 }}</p>
|
||||
<p class="countrate">同比前天
|
||||
<span :class="bindClass(tongbi7)">
|
||||
{{tongbi7}}%
|
||||
<span v-if="tongbi7<0"> ▼</span>
|
||||
{{ tongbi7 }}%
|
||||
<span v-if="tongbi7 < 0"> ▼</span>
|
||||
<span v-else> ▲</span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="countItem">
|
||||
<div class="countname">预制管合格数</div>
|
||||
<p class="countnum">{{dayPassNum10}}</p>
|
||||
<p class="countnum">{{ dayPassNum10 }}</p>
|
||||
<p class="countrate">同比前天
|
||||
<span :class="bindClass(tongbi10)">
|
||||
{{tongbi10}}%
|
||||
<span v-if="tongbi10<0"> ▼</span>
|
||||
<span :class="bindClass(tongbi10)">
|
||||
{{ tongbi10 }}%
|
||||
<span v-if="tongbi10 < 0"> ▼</span>
|
||||
<span v-else> ▲</span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="countItem">
|
||||
<div class="countname">AVG合格数</div>
|
||||
<p class="countnum">{{dayAVGcountOk}}</p>
|
||||
<p class="countnum">{{ dayAVGcountOk }}</p>
|
||||
<p class="countrate">同比前天
|
||||
<span :class="bindClass(AVGOktongbi)">
|
||||
{{AVGOktongbi}}%
|
||||
<span v-if="AVGOktongbi<0"> ▼</span>
|
||||
{{ AVGOktongbi }}%
|
||||
<span v-if="AVGOktongbi < 0"> ▼</span>
|
||||
<span v-else> ▲</span>
|
||||
</span>
|
||||
</p>
|
||||
|
@ -54,20 +54,20 @@
|
|||
<div class="countname">预制棒管交付数</div>
|
||||
<p class="countnum">{{ dayPayNum6 }}</p>
|
||||
<p class="countrate">同比前天
|
||||
<span :class="bindClass(tongbi06)">
|
||||
{{tongbi06}}%
|
||||
<span v-if="tongbi06<0"> ▼</span>
|
||||
<span :class="bindClass(tongbi06)">
|
||||
{{ tongbi06 }}%
|
||||
<span v-if="tongbi06 < 0"> ▼</span>
|
||||
<span v-else> ▲</span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="countItem">
|
||||
<div class="countname">AVG交付数</div>
|
||||
<p class="countnum">{{dayAVGcountDelivered}}</p>
|
||||
<p class="countnum">{{ dayAVGcountDelivered }}</p>
|
||||
<p class="countrate">同比前天
|
||||
<span :class="bindClass(AVGDelivertongbi)">
|
||||
{{AVGDelivertongbi}}%
|
||||
<span v-if="AVGDelivertongbi<0"> ▼</span>
|
||||
{{ AVGDelivertongbi }}%
|
||||
<span v-if="AVGDelivertongbi < 0"> ▼</span>
|
||||
<span v-else> ▲</span>
|
||||
</span>
|
||||
</p>
|
||||
|
@ -95,14 +95,15 @@
|
|||
<el-progress type="circle" :stroke-width="15" :show-text="false" :percentage="monthPassRate7" />
|
||||
<div style="margin-left: 20px;">
|
||||
<div class="countname">预制棒合格率</div>
|
||||
<p class="countnum" style="line-height: 82px">{{monthPassRate7}}%</p>
|
||||
<p class="countnum" style="line-height: 82px">{{ monthPassRate7 }}%</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middleItem" style="display: flex;">
|
||||
<el-progress type="circle" :stroke-width="15" :show-text="false" :percentage="monthPassRate10" />
|
||||
<el-progress type="circle" :stroke-width="15" :show-text="false"
|
||||
:percentage="monthPassRate10" />
|
||||
<div style="margin-left: 20px;">
|
||||
<div class="countname">预制管合格率</div>
|
||||
<p class="countnum" style="line-height: 82px">{{monthPassRate10}}%</p>
|
||||
<p class="countnum" style="line-height: 82px">{{ monthPassRate10 }}%</p>
|
||||
<!-- <p class="countrate">同比上周 8.63%</p> -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -110,7 +111,7 @@
|
|||
<el-progress type="circle" :stroke-width="15" :show-text="false" :percentage="monthRateAVG" />
|
||||
<div style="margin-left: 20px;">
|
||||
<div class="countname">AVG合格率</div>
|
||||
<p class="countnum" style="line-height: 82px">{{monthRateAVG}}%</p>
|
||||
<p class="countnum" style="line-height: 82px">{{ monthRateAVG }}%</p>
|
||||
<!-- <p class="countrate">同比上周 8.63%</p> -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -135,7 +136,7 @@
|
|||
<div style="padding: 20px 24px 0 24px;background: #ffffff;">
|
||||
<div class="bottomItem">
|
||||
<div class="countname">本月计划完成度</div>
|
||||
<p class="countnum">99%</p>
|
||||
<p class="countnum">{{ hgNumber }}%</p>
|
||||
<!-- <p class="countrate">同比上周<span class="redColor"> 8.63%▲</span> 月同比6.47%</p> -->
|
||||
<div id="barCharts" style="width: 100%;height: 218px;"></div>
|
||||
</div>
|
||||
|
@ -149,6 +150,13 @@
|
|||
<div style="display: flex;justify-content: space-between;padding: 0 24px;">
|
||||
<div style="color: rgb(30, 30, 30);font-size: 16px;font-weight: 400;line-height: 24px;">库存情况
|
||||
</div>
|
||||
<div
|
||||
style="color: rgb(122, 121, 121);size: 12px;font-weight: 290;line-height: 22px;height:23px">
|
||||
<el-radio-group v-model="materialType" @change="materialTypeChange">
|
||||
<el-radio label="20">半成品</el-radio>
|
||||
<el-radio label="10">成品</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 20px 24px 24px 24px;">
|
||||
<el-table :data="tableData" style="width: 100%;height: 293px;">
|
||||
|
@ -215,11 +223,15 @@
|
|||
<el-table-column prop="belong_dept_name" label="所在车间" />
|
||||
<el-table-column prop="state" label="设备状态">
|
||||
<template #default="scope">
|
||||
<el-tag class="ml-2" type="success" v-if="scope.row.state==10">{{ eqState_[scope.row.state] }}</el-tag>
|
||||
<el-tag class="ml-2" type="warning" v-if="scope.row.state==20">{{ eqState_[scope.row.state] }}</el-tag>
|
||||
<el-tag class="ml-2" type="info" v-if="scope.row.state==30">{{ eqState_[scope.row.state] }}</el-tag>
|
||||
<el-tag class="ml-2" type="danger" v-if="scope.row.state==40">{{ eqState_[scope.row.state] }}</el-tag>
|
||||
|
||||
<el-tag class="ml-2" type="success" v-if="scope.row.state == 10">{{
|
||||
eqState_[scope.row.state] }}</el-tag>
|
||||
<el-tag class="ml-2" type="warning" v-if="scope.row.state == 20">{{
|
||||
eqState_[scope.row.state] }}</el-tag>
|
||||
<el-tag class="ml-2" type="info" v-if="scope.row.state == 30">{{
|
||||
eqState_[scope.row.state] }}</el-tag>
|
||||
<el-tag class="ml-2" type="danger" v-if="scope.row.state == 40">{{
|
||||
eqState_[scope.row.state] }}</el-tag>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -254,14 +266,15 @@ export default {
|
|||
year_s: '',
|
||||
day_s: '',
|
||||
month_s: '',
|
||||
deptName:'10车间',
|
||||
yesterday:'',
|
||||
yesterdayBefore:'',
|
||||
deptName: '10车间',
|
||||
materialType: '20',
|
||||
yesterday: '',
|
||||
yesterdayBefore: '',
|
||||
yearData: [],
|
||||
monthData: [],
|
||||
warningNum: 0,
|
||||
warningNum2: 0,
|
||||
chartData:[],
|
||||
chartData: [],
|
||||
tableData: [],
|
||||
equipList: [],
|
||||
calendarValue: '',
|
||||
|
@ -271,35 +284,35 @@ export default {
|
|||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
dayPassNum7:0,
|
||||
tongbi7:0,
|
||||
dayPassNum10:0,
|
||||
tongbi10:0,
|
||||
dayPayNum6:0,//交付数
|
||||
tongbi06:0,
|
||||
dayPassNum7: 0,
|
||||
tongbi7: 0,
|
||||
dayPassNum10: 0,
|
||||
tongbi10: 0,
|
||||
dayPayNum6: 0,//交付数
|
||||
tongbi06: 0,
|
||||
|
||||
monthPayNum6:0,
|
||||
monthPassRate7:0,
|
||||
monthPassRate10:0,
|
||||
monthPayNum6: 0,
|
||||
monthPassRate7: 0,
|
||||
monthPassRate10: 0,
|
||||
|
||||
|
||||
dayAVGcountOk:0,
|
||||
AVGOktongbi:0,
|
||||
dayAVGcountDelivered:0,
|
||||
AVGDelivertongbi:0,
|
||||
monthRateAVG:0,
|
||||
monthPayNumAVG:0,
|
||||
|
||||
option:{
|
||||
|
||||
dayAVGcountOk: 0,
|
||||
AVGOktongbi: 0,
|
||||
dayAVGcountDelivered: 0,
|
||||
AVGDelivertongbi: 0,
|
||||
monthRateAVG: 0,
|
||||
monthPayNumAVG: 0,
|
||||
hgNumber: 0,
|
||||
option: {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: { // 图表距离边框的距离,可用百分比和数字(px)配置
|
||||
top: '5%',
|
||||
left: '1%',
|
||||
|
@ -320,7 +333,7 @@ export default {
|
|||
show: false, // X 轴标签文字旋转角度
|
||||
},
|
||||
},
|
||||
series:{
|
||||
series: {
|
||||
data: [],
|
||||
type: 'bar',
|
||||
barMaxWidth: 50,
|
||||
|
@ -330,7 +343,7 @@ export default {
|
|||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
color:'#000'
|
||||
color: '#000'
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
|
@ -351,10 +364,10 @@ export default {
|
|||
that.month_s = month;
|
||||
that.day_s = day;
|
||||
|
||||
let yesterday = new Date(myDate.getTime()-24*60*60*1000);
|
||||
this.yesterday = yesterday.getFullYear()+"-" + (yesterday.getMonth()+1) + "-" + yesterday.getDate();
|
||||
let yesterdayBefore = new Date(yesterday.getTime()-24*60*60*1000);
|
||||
this.yesterdayBefore = yesterdayBefore.getFullYear()+"-" + (yesterdayBefore.getMonth()+1) + "-" + yesterdayBefore.getDate();
|
||||
let yesterday = new Date(myDate.getTime() - 24 * 60 * 60 * 1000);
|
||||
this.yesterday = yesterday.getFullYear() + "-" + (yesterday.getMonth() + 1) + "-" + yesterday.getDate();
|
||||
let yesterdayBefore = new Date(yesterday.getTime() - 24 * 60 * 60 * 1000);
|
||||
this.yesterdayBefore = yesterdayBefore.getFullYear() + "-" + (yesterdayBefore.getMonth() + 1) + "-" + yesterdayBefore.getDate();
|
||||
that.getdayData();
|
||||
that.getMonthData();
|
||||
this.getAVGDayData();
|
||||
|
@ -367,11 +380,11 @@ export default {
|
|||
// 动态绑定Class
|
||||
bindClass(rate) {
|
||||
let classInfo = {
|
||||
socketDom: true, redColor: false,greenColor: true
|
||||
socketDom: true, redColor: false, greenColor: true
|
||||
}
|
||||
if (rate>0) {
|
||||
if (rate > 0) {
|
||||
classInfo.greenColor = true
|
||||
}else if(rate<0){
|
||||
} else if (rate < 0) {
|
||||
classInfo.redColor = true
|
||||
}
|
||||
return classInfo
|
||||
|
@ -381,15 +394,20 @@ export default {
|
|||
this.equipList = res
|
||||
})
|
||||
},
|
||||
materialTypeChange() {
|
||||
this.getMaterialList();
|
||||
},
|
||||
//获取库存
|
||||
getMaterialList() {
|
||||
this.$API.mtm.material.list.req({ page: 0, type: 10 }).then(res => {
|
||||
this.tableData = res.filter(item=>{
|
||||
return item.count>0;
|
||||
let that = this;
|
||||
that.$API.mtm.material.list.req({ page: 0, type: that.materialType }).then(res => {
|
||||
that.tableData = res.filter(item => {
|
||||
return item.count > 0;
|
||||
});
|
||||
console.log('getMaterialList',res)
|
||||
console.log('getMaterialList', res)
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
showTime() {
|
||||
this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
|
||||
this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
|
||||
|
@ -398,206 +416,210 @@ export default {
|
|||
this.$router.replace({ path: '/em/equipment' })
|
||||
},
|
||||
//昨日数据
|
||||
getdayData(){
|
||||
let that = this;
|
||||
getdayData() {
|
||||
let that = this;
|
||||
let date = that.yesterday;
|
||||
let obj6 ={
|
||||
query: {start_date:date,end_date:date,mio_type: 'sale_out',material_id:''},
|
||||
};
|
||||
let obj7 ={
|
||||
query: {start_date:date,end_date:date,dept_name: "7车间"},
|
||||
};
|
||||
let obj10 ={
|
||||
query: {start_date:date,end_date:date,dept_name: "10车间"},
|
||||
};
|
||||
let obj6 = {
|
||||
query: { start_date: date, end_date: date, mio_type: 'sale_out', material_id: '' },
|
||||
};
|
||||
let obj7 = {
|
||||
query: { start_date: date, end_date: date, dept_name: "7车间" },
|
||||
};
|
||||
let obj10 = {
|
||||
query: { start_date: date, end_date: date, dept_name: "10车间" },
|
||||
};
|
||||
|
||||
let date0 = that.yesterdayBefore;
|
||||
let obj06 ={
|
||||
query: {start_date:date0,end_date:date0,mio_type: 'sale_out',material_id:''},
|
||||
};
|
||||
let obj07 ={
|
||||
query: {start_date:date0,end_date:date0,dept_name: "7车间"},
|
||||
};
|
||||
let obj010 ={
|
||||
query: {start_date:date0,end_date:date0,dept_name: "10车间"},
|
||||
};
|
||||
//7车间昨日合格数
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj7).then((res7) => {
|
||||
let obj06 = {
|
||||
query: { start_date: date0, end_date: date0, mio_type: 'sale_out', material_id: '' },
|
||||
};
|
||||
let obj07 = {
|
||||
query: { start_date: date0, end_date: date0, dept_name: "7车间" },
|
||||
};
|
||||
let obj010 = {
|
||||
query: { start_date: date0, end_date: date0, dept_name: "10车间" },
|
||||
};
|
||||
//7车间昨日合格数
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj7).then((res7) => {
|
||||
let list7 = res7.data2.ds0;
|
||||
if(list7.length>0){
|
||||
if (list7.length > 0) {
|
||||
this.dayPassNum7 = list7[0].合格数;
|
||||
}
|
||||
//7车间前天合格数
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj07).then((res07) => {
|
||||
let list07 = res07.data2.ds0;
|
||||
if(list07.length>0){
|
||||
this.tongbi7 =Math.round((this.dayPassNum7- list07[0].合格数)/list07[0].合格数*100);
|
||||
if (list07.length > 0) {
|
||||
this.tongbi7 = Math.round((this.dayPassNum7 - list07[0].合格数) / list07[0].合格数 * 100);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
//10车间昨日合格数
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj10).then((res10) => {
|
||||
console.log('res10',res10);
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj10).then((res10) => {
|
||||
console.log('res10', res10);
|
||||
let list10 = res10.data2.ds0;
|
||||
if(list10.length>0){
|
||||
this.dayPassNum10 = list10[0].合格数;
|
||||
if (list10.length > 0) {
|
||||
this.dayPassNum10 = list10[0].合格数;
|
||||
}
|
||||
//10车间前天合格数
|
||||
that.$API.bi.dataset.exec.req('lineDay', obj010).then((res010) => {
|
||||
console.log('res10',res010);
|
||||
console.log('res10', res010);
|
||||
let list010 = res010.data2.ds0;
|
||||
if(list010.length>0){
|
||||
this.tongbi10 =Math.round((this.dayPassNum10- list010[0].合格数)/list010[0].合格数*100);
|
||||
if (list010.length > 0) {
|
||||
this.tongbi10 = Math.round((this.dayPassNum10 - list010[0].合格数) / list010[0].合格数 * 100);
|
||||
}
|
||||
});
|
||||
});
|
||||
//6车昨日交付数
|
||||
that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => {
|
||||
});
|
||||
//6车昨日交付数
|
||||
that.$API.bi.dataset.exec.req('saleOutDay', obj6).then((res6) => {
|
||||
let list6 = res6.data2.ds0;
|
||||
if(list6.length>0){
|
||||
if (list6.length > 0) {
|
||||
this.dayPayNum6 = list6[0].交付数;
|
||||
}
|
||||
//6车前日交付数
|
||||
that.$API.bi.dataset.exec.req('saleOutDay', obj06).then((res06) => {
|
||||
let list06 = res06.data2.ds0;
|
||||
if(list06.length>0){
|
||||
this.tongbi06 = Math.round((this.dayPayNum6- list06[0].交付数)/list06[0].交付数*100);
|
||||
if (list06.length > 0) {
|
||||
this.tongbi06 = Math.round((this.dayPayNum6 - list06[0].交付数) / list06[0].交付数 * 100);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//本月合格数&本月交付统计
|
||||
getMonthData(){
|
||||
getMonthData() {
|
||||
let that = this;
|
||||
let start_date = that.year_s+'-'+that.month_s+'-01';
|
||||
let end_date = that.year_s+'-'+that.month_s+'-'+that.day_s;
|
||||
let obj6 ={
|
||||
query: {start_date:start_date,end_date:end_date,mio_type: 'sale_out',material_id:''},
|
||||
};
|
||||
let obj7 ={
|
||||
query: {start_date:start_date,end_date:end_date,dept_name: "7车间"},
|
||||
};
|
||||
let obj10 ={
|
||||
query: {start_date:start_date,end_date:end_date,dept_name: "10车间"},
|
||||
};
|
||||
//7车间本月合格率
|
||||
that.$API.bi.dataset.exec.req('lineMonth', obj7).then((res7) => {
|
||||
// console.log('7车间本月合格率:',res7);
|
||||
let start_date = that.year_s + '-' + that.month_s + '-01';
|
||||
let end_date = that.year_s + '-' + that.month_s + '-' + that.day_s;
|
||||
let obj6 = {
|
||||
query: { start_date: start_date, end_date: end_date, mio_type: 'sale_out', material_id: '' },
|
||||
};
|
||||
let obj7 = {
|
||||
query: { start_date: start_date, end_date: end_date, dept_name: "7车间" },
|
||||
};
|
||||
let obj10 = {
|
||||
query: { start_date: start_date, end_date: end_date, dept_name: "10车间" },
|
||||
};
|
||||
//7车间本月合格率
|
||||
that.$API.bi.dataset.exec.req('lineMonth', obj7).then((res7) => {
|
||||
// console.log('7车间本月合格率:',res7);
|
||||
let list7 = res7.data2.ds0;
|
||||
let sum = 0,rate=0;
|
||||
if(list7.length>0){
|
||||
let sum = 0, rate = 0;
|
||||
if (list7.length > 0) {
|
||||
list7.forEach(item => {
|
||||
sum = sum+item.合格率;
|
||||
sum = sum + item.合格率;
|
||||
});
|
||||
rate = sum/list7.length;
|
||||
rate = sum / list7.length;
|
||||
}
|
||||
this.monthPassRate7 = Math.round(rate) ;
|
||||
this.monthPassRate7 = Math.round(rate);
|
||||
// console.log('7车间本月合格率:',this.monthPassRate7);
|
||||
// debugger;
|
||||
});
|
||||
// debugger;
|
||||
});
|
||||
//10车间本月合格率
|
||||
that.$API.bi.dataset.exec.req('lineMonth', obj10).then((res10) => {
|
||||
that.$API.bi.dataset.exec.req('lineMonth', obj10).then((res10) => {
|
||||
this.monthPassRate10 = 0;
|
||||
let list10 = res10.data2.ds0;
|
||||
let sum = 0,rate=0;
|
||||
if(list10.length>0){
|
||||
let sum = 0, rate = 0;
|
||||
if (list10.length > 0) {
|
||||
list10.forEach(item => {
|
||||
sum = sum+item.合格率;
|
||||
sum = sum + item.合格率;
|
||||
});
|
||||
rate = sum/list10.length;
|
||||
rate = sum / list10.length;
|
||||
}
|
||||
this.monthPassRate10 =Math.round(rate) ;
|
||||
this.monthPassRate10 = Math.round(rate);
|
||||
// console.log('10车间本月合格率:',this.monthPassRate10);
|
||||
// debugger;
|
||||
});
|
||||
// debugger;
|
||||
});
|
||||
//6车间本月交付数
|
||||
that.$API.bi.dataset.exec.req('saleOutMonth', obj6).then((res6) => {
|
||||
// console.log('6车间本月交付数:',res6);
|
||||
that.$API.bi.dataset.exec.req('saleOutMonth', obj6).then((res6) => {
|
||||
// console.log('6车间本月交付数:',res6);
|
||||
let list6 = res6.data2.ds0;
|
||||
let sum = 0;
|
||||
list6.forEach(item => {
|
||||
sum = sum+item.交付数;
|
||||
sum = sum + item.交付数;
|
||||
});
|
||||
this.monthPayNum6 = sum;
|
||||
// console.log('6车间本月交付数:',this.monthPayNum6);
|
||||
// debugger;
|
||||
});
|
||||
// debugger;
|
||||
});
|
||||
//本月合格率
|
||||
},
|
||||
},
|
||||
//获取昨日AVG的生产记录
|
||||
getAVGDayData(){
|
||||
getAVGDayData() {
|
||||
let that = this;
|
||||
let date = that.yesterday;
|
||||
let date0 = that.yesterdayBefore;
|
||||
this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date,handle_date__lte:date}).then(res=>{
|
||||
this.$API.wpm.otherlog.list.req({ product: 'AVG', page: 0, handle_date__gte: date, handle_date__lte: date }).then(res => {
|
||||
let list = res;
|
||||
let count_ok = 0,count_delivered = 0;
|
||||
if(list.length>0){
|
||||
list.forEach(item=>{
|
||||
count_ok=count_ok+item.count_ok;
|
||||
count_delivered = count_delivered+item.count_delivered;
|
||||
let count_ok = 0, count_delivered = 0;
|
||||
if (list.length > 0) {
|
||||
list.forEach(item => {
|
||||
count_ok = count_ok + item.count_ok;
|
||||
count_delivered = count_delivered + item.count_delivered;
|
||||
})
|
||||
that.dayAVGcountOk = count_ok;
|
||||
that.dayAVGcountDelivered = count_delivered;
|
||||
this.$API.wpm.otherlog.list.req({product:'AVG',page:0,handle_date__gte:date0,handle_date__lte:date0}).then(res0=>{
|
||||
this.$API.wpm.otherlog.list.req({ product: 'AVG', page: 0, handle_date__gte: date0, handle_date__lte: date0 }).then(res0 => {
|
||||
let list0 = res0;
|
||||
let count_ok0 = 0,count_delivered0 = 0;
|
||||
if(list0.length>0){
|
||||
list0.forEach(item0=>{
|
||||
count_ok0=count_ok0+item0.count_ok;
|
||||
count_delivered0 = count_delivered0+item0.count_delivered;
|
||||
let count_ok0 = 0, count_delivered0 = 0;
|
||||
if (list0.length > 0) {
|
||||
list0.forEach(item0 => {
|
||||
count_ok0 = count_ok0 + item0.count_ok;
|
||||
count_delivered0 = count_delivered0 + item0.count_delivered;
|
||||
})
|
||||
that.AVGOktongbi = Math.round((count_ok-count_ok0)/count_ok0*100);
|
||||
that.AVGDelivertongbi = Math.round((count_delivered-count_delivered0)/count_delivered0*100);
|
||||
that.AVGOktongbi = Math.round((count_ok - count_ok0) / count_ok0 * 100);
|
||||
that.AVGDelivertongbi = Math.round((count_delivered - count_delivered0) / count_delivered0 * 100);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAVGMonthData(){
|
||||
getAVGMonthData() {
|
||||
let that = this;
|
||||
let start_date = that.year_s+'-'+that.month_s+'-01';
|
||||
let end_date = that.year_s+'-'+that.month_s+'-'+that.day_s;
|
||||
let obj ={
|
||||
query: {start_date:start_date,end_date:end_date},
|
||||
};
|
||||
let start_date = that.year_s + '-' + that.month_s + '-01';
|
||||
let end_date = that.year_s + '-' + that.month_s + '-' + that.day_s;
|
||||
let obj = {
|
||||
query: { start_date: start_date, end_date: end_date },
|
||||
};
|
||||
that.$API.bi.dataset.exec.req('AVGMonth', obj).then((res) => {
|
||||
let list = res.data2.ds0;
|
||||
let sum = 0,count_real=0,count_ok=0;
|
||||
let sum = 0, count_real = 0, count_ok = 0;
|
||||
list.forEach(item => {
|
||||
sum = sum+item.交付数;
|
||||
count_ok = count_ok+item.count_ok;
|
||||
count_real = count_real+item.count_real;
|
||||
sum = sum + item.交付数;
|
||||
count_ok = count_ok + item.count_ok;
|
||||
count_real = count_real + item.count_real;
|
||||
});
|
||||
this.monthPayNumAVG = sum;
|
||||
if(count_real!=0){
|
||||
this.monthRateAVG = Math.round((count_ok/count_real)*100)
|
||||
}else{
|
||||
if (count_real != 0) {
|
||||
this.monthRateAVG = Math.round((count_ok / count_real) * 100)
|
||||
} else {
|
||||
this.monthRateAVG = 0;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
getProductStatistic(){
|
||||
getProductStatistic() {
|
||||
let that = this;
|
||||
let start_date = that.year_s+'-'+that.month_s+'-01';
|
||||
let end_date = that.year_s+'-'+that.month_s+'-'+that.day_s;
|
||||
let obj ={
|
||||
query: {start_date:start_date,end_date:end_date,dept_name:this.deptName},
|
||||
};
|
||||
let start_date = that.year_s + '-' + that.month_s + '-01';
|
||||
let end_date = that.year_s + '-' + that.month_s + '-' + that.day_s;
|
||||
let obj = {
|
||||
query: { start_date: start_date, end_date: end_date, dept_name: this.deptName },
|
||||
};
|
||||
that.$API.bi.dataset.exec.req('productStatistic', obj).then((res) => {
|
||||
console.log('productStatistic:',res);
|
||||
console.log('productStatistic:', res);
|
||||
let list = res.data2.ds0;
|
||||
let chartData = [],xAxisData=[];
|
||||
for(let i=0;i<that.day_s;i++){
|
||||
let dindex = i+1;
|
||||
xAxisData.push(dindex+'日')
|
||||
for(let j=0;j<list.length;j++){
|
||||
if(list[j].日==i){
|
||||
chartData[i]=Math.round((list[j].合格数/list[j].任务数)*100) ;
|
||||
let chartData = [], xAxisData = [], hgNumber = 0;
|
||||
for (let i = 0; i < that.day_s; i++) {
|
||||
let dindex = i + 1;
|
||||
xAxisData.push(dindex + '日')
|
||||
for (let j = 0; j < list.length; j++) {
|
||||
if (list[j].日 == i) {
|
||||
chartData[i] = list[j].合格数;
|
||||
if (list[j].合格数 >= list[j].任务数) {
|
||||
hgNumber++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.hgNumber = ((hgNumber / xAxisData.length) * 100).toFixed(2);
|
||||
this.chartData = chartData;
|
||||
this.option.xAxis.data = xAxisData;
|
||||
this.option.series.data = chartData;
|
||||
|
@ -605,9 +627,9 @@ export default {
|
|||
var dom = document.getElementById("barCharts");
|
||||
var myChart = echarts.init(dom);
|
||||
myChart.setOption(this.option, true);
|
||||
});
|
||||
});
|
||||
},
|
||||
deptNameChange(){
|
||||
deptNameChange() {
|
||||
this.getProductStatistic();
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue