This commit is contained in:
shijing 2022-03-24 15:10:26 +08:00
parent 9c9982ab06
commit 886cba24dc
2 changed files with 177 additions and 197 deletions

View File

@ -31,67 +31,33 @@
return { return {
options: {}, options: {},
cdata: { cdata: {
category: [
"JH5jhx463-1",
"JH5jhx463-2",
"JH5jhx463-3",
"JH5jhx463-4",
"JH5jhx463-5",
"JH5jhx463-6",
"JH5jhx463-7",
"JH5jhx463-8",
"JH5jhx463-9",
"JH5jhx463-10",
"JH5jhx463-11",
"JH5jhx463-12",
"JH5jhx463-13",
"JH5jhx463-14",
"JH5jhx463-15"
],
planData: [
18092,
20728,
24045,
28348,
32808,
36097,
39867,
18092,
20728,
24045,
28348,
32808,
36097,
39867,
44715,
],
barData: [
9600,
19000,
19500,
20500,
19500,
28500,
31900,
12500,
14000,
21500,
23200,
24450,
25250,
33300,
40715
],
rateData: [] rateData: []
} }
}; };
}, },
mounted() { props:{
this.setData(); category:{
type:Array,
default:()=>{
return []
}
}, },
watch: { planData:{
cdata: { type:Array,
handler(newData) { default:()=>{
return []
}
},
realData:{
type:Array,
default:()=>{
return []
}
}
},
mounted() {
let that=this;
this.setData();
this.options = { this.options = {
/*tooltip: { /*tooltip: {
trigger: "axis", trigger: "axis",
@ -143,7 +109,7 @@
} }
},*/ },*/
legend: { legend: {
data: ["已完成", "计划完成"], data: [" 计划完成", " 已完成 "],
textStyle: { textStyle: {
color: "#B4B4B4" color: "#B4B4B4"
}, },
@ -155,7 +121,7 @@
y: "4%" y: "4%"
}, },
xAxis: { xAxis: {
data: newData.category, data: that.category,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: "#B4B4B4" color: "#B4B4B4"
@ -167,7 +133,10 @@
}, },
yAxis:{ yAxis:{
splitLine: { splitLine: {
show: false type:"dashed",
color: "#B4B4B4",
width:"1",
// show: true,
}, },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
@ -192,7 +161,7 @@
]) ])
} }
}, },
data: newData.barData data: that.realData
}, },
{ {
name: "计划完成", name: "计划完成",
@ -210,22 +179,18 @@
} }
}, },
z: -12, z: -12,
data: newData.planData data: that.planData
} }
] ]
} }
}, },
immediate: true,
deep: true
},
},
methods: { methods: {
// 根据自己的业务情况修改 // 根据自己的业务情况修改
setData() { setData() {
for (let i = 0; i < this.cdata.barData.length - 1; i++) { /*for (let i = 0; i < this.cdata.realData.length - 1; i++) {
let rate = this.cdata.barData[i] / this.cdata.planData[i]; let rate = this.cdata.realData[i] / this.cdata.planData[i];
this.cdata.rateData.push(rate.toFixed(2)); this.cdata.rateData.push(rate.toFixed(2));
} }*/
}, },
} }
} }

View File

@ -104,6 +104,9 @@
<dv-border-box-13> <dv-border-box-13>
<bottomLeft <bottomLeft
v-if="limitedTwo" v-if="limitedTwo"
:category="category"
:planData="planData"
:realData="realData"
/> />
</dv-border-box-13> </dv-border-box-13>
</div> </div>
@ -126,7 +129,7 @@
import bottomRight from './bottomRight' import bottomRight from './bottomRight'
import {getPlanGantt} from "@/api/srm"; import {getPlanGantt} from "@/api/srm";
import {getProductionplanList} from "@/api/pm"; import {getProductionplanList} from "@/api/pm";
import {getProcessYield, productCount, getProcessNow, planCount, orderCount} from "@/api/srm"; import {getProcessYield, productCount, getProcessNow} from "@/api/srm";
import {getContractList, getOrderList} from "@/api/sam"; import {getContractList, getOrderList} from "@/api/sam";
import {getArticles} from "@/api/cms"; import {getArticles} from "@/api/cms";
@ -139,10 +142,11 @@
dateDay: null, dateDay: null,
dateYear: null, dateYear: null,
dateWeek: null, dateWeek: null,
planGanttList: [],
numberShow: false, numberShow: false,
processRate: false, processRate: false,
listUser: false, listUser: false,
listNews: false,
listProcess: false,
create_time_start: '', create_time_start: '',
titleItem: [ titleItem: [
{ {
@ -428,7 +432,10 @@
// columnWidth: [50], // columnWidth: [50],
align: ['center'] align: ['center']
}, },
weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'] weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
category:[],
planData:[],
realData:[],
} }
}, },
components: { components: {
@ -480,16 +487,6 @@
this.dateWeek = this.weekday[new Date().getDay()] this.dateWeek = this.weekday[new Date().getDay()]
}, 1000) }, 1000)
}, },
getPageData() {
let that = this;
getPlanGantt({type: 'big_screen'}).then(res => {
if (res.code === 200) {
this.planGanttList = res.data.results;
} else {
that.$message.error(res.msg);
}
})
},
cancelLoading() { cancelLoading() {
setTimeout(() => { setTimeout(() => {
this.loading = false this.loading = false
@ -676,6 +673,7 @@
//企业资讯 //企业资讯
getArticle() { getArticle() {
let that = this; let that = this;
that.listNews = false;
getArticles({type: 'big_screen', page: 0}).then((response) => { getArticles({type: 'big_screen', page: 0}).then((response) => {
if (response.data) { if (response.data) {
// this.configArticle = response.data; // this.configArticle = response.data;
@ -694,11 +692,28 @@
data.push(obj) data.push(obj)
}); });
that.configArticle.data = data; that.configArticle.data = data;
that.listNews = true;
} }
}); });
}, },
//任务完成进度 //任务完成进度
getPageData() {
let that = this;
that.listNews = false;
getPlanGantt({type: 'big_screen'}).then(res => {
if (res.code === 200) {
let list = res.data.results;
list.forEach(item=>{
that.category.push(item.number);
that.planData.push(item.count);
that.realData.push(item.count_ok);
})
that.listNews = true;
} else {
that.$message.error(res.msg);
}
})
},
} }
} }
</script> </script>