Commit f46ff2d4 authored by 仇晓婷's avatar 仇晓婷

ff

parent cacadce6
...@@ -7,4 +7,10 @@ export default { ...@@ -7,4 +7,10 @@ export default {
getpaged(params) { getpaged(params) {
return Api.post(`${workflowUrl}/instance/getpaged`, params); return Api.post(`${workflowUrl}/instance/getpaged`, params);
}, },
planorderstatuscount(params) {
return Api.post(`${PlanUrl}/mesplan/planorderstatuscount`, params);
},
orderstatuscount(params) {
return Api.post(`${PlanUrl}/mesorders/orderstatuscount`, params); //订单各车间下各状态的数量
},
} }
\ No newline at end of file
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
</div> </div>
</template> </template>
<script> <script>
import Api from "../api";
import ECharts from "vue-echarts"; import ECharts from "vue-echarts";
import echarts from "echarts/lib/echarts"; import echarts from "echarts/lib/echarts";
// import "echarts/lib/chart/pie"; // import "echarts/lib/chart/pie";
...@@ -50,13 +51,13 @@ import "echarts/lib/component/grid"; ...@@ -50,13 +51,13 @@ import "echarts/lib/component/grid";
export default { export default {
name: "echarts", name: "echarts",
components: { components: {
"v-chart": ECharts "v-chart": ECharts,
}, },
data() { data() {
return { return {
value2: "", value2: "",
braking: {}, braking: {},
braking1: {} braking1: {},
}; };
}, },
mounted() { mounted() {
...@@ -65,117 +66,143 @@ export default { ...@@ -65,117 +66,143 @@ export default {
}, },
methods: { methods: {
statistics() { statistics() {
let conditions = [
{
fieldName: "status",
fieldValue: "1",
conditionalType: "Equal"
}
];
let data = {
conditions: conditions,
};
Api.planorderstatuscount(data).then((r) => {
var allTotal = "";
var listData = [];
var status = ["计划数量"];
r.result.chidren.map((e) => {
status.push(e.status);
});
allTotal = r.result.allTotal;
listData = r.result.chidren;
this.braking = { this.braking = {
xAxis: { xAxis: {
// type: "category", // type: "category",
data: ["计划数量", "已完成", "执行中", "暂停中", "未开工"], data: ['计划数量',],
axisTick: { axisTick: {
show: false show: false,
}, },
axisLine: { axisLine: {
show: false show: false,
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: "#515A6E" color: "#515A6E",
} },
} },
}, },
yAxis: { yAxis: {
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: "#eee", color: "#eee",
type: "solid" type: "solid",
} },
}, },
axisTick: { axisTick: {
show: false show: false,
}, },
axisLine: { axisLine: {
show: false show: false,
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: "#515A6E" color: "#515A6E",
} },
} },
}, },
grid: { grid: {
left: "3%", left: "3%",
right: "4%", right: "4%",
bottom: "3%", bottom: "3%",
containLabel: true containLabel: true,
}, },
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
type: "shadow" type: "shadow",
} },
}, },
color: ["#73DDFF"], color: ["#73DDFF"],
series: [ series: [
{ {
data: [ data: [
{ {
value: 120, value: allTotal,
itemStyle: { itemStyle: {
normal: { normal: {
color: "#2680EB", color: "#2680EB",
barBorderRadius: [30, 30, 0, 0] barBorderRadius: [30, 30, 0, 0],
} },
} },
}, },
{ {
value: 60, value: listData[0].count,
itemStyle: { itemStyle: {
normal: { normal: {
color: "#0DD78D", color: "#0DD78D",
barBorderRadius: [30, 30, 0, 0] barBorderRadius: [30, 30, 0, 0],
} },
} },
}, },
{ {
value: 210, value: listData[1].count,
itemStyle: { itemStyle: {
normal: { normal: {
color: "#FFA000", color: "#FFA000",
barBorderRadius: [30, 30, 0, 0] barBorderRadius: [30, 30, 0, 0],
} },
} },
}, },
{ {
value: 210, value: listData[2].count,
itemStyle: { itemStyle: {
normal: { normal: {
color: "#FE7777", color: "#FE7777",
barBorderRadius: [30, 30, 0, 0] barBorderRadius: [30, 30, 0, 0],
} },
} },
}, },
{
value: 210,
itemStyle: {
normal: {
color: "#515A6E",
barBorderRadius: [30, 30, 0, 0]
}
}
}
], ],
type: "bar", type: "bar",
barWidth: 10, //柱图宽度 barWidth: 10, //柱图宽度
barGap: "-20%" //柱图间距 barGap: "-20%", //柱图间距
} },
] ],
}; };
});
}, },
statistics1() { statistics1() {
let conditions = [];
let data = {
conditions: conditions,
};
Api.orderstatuscount(data).then((r) => {
let listData = [];
let name = [];
let allTotal=[]
listData = r.result;
r.result.map((e) => {
name.push(e.name);
allTotal.push(e.allTotal)
});
this.braking1 = { this.braking1 = {
color: ["#2680EB", "#0DD78D", "#FFA000", "#FE7777", "#515A6E"], color: ["#2680EB", "#0DD78D", "#FFA000", "#FE7777", "#515A6E"],
legend: { legend: {
data: ["计划数量", "已完成", "执行中", "暂停中", "未开工"], data: ["计划数量", "已完成", "执行中", "暂停中", "未开工"],
top: 12 top: 12,
// textStyle: { // textStyle: {
// color: "#515A6E" // color: "#515A6E"
// }, // },
...@@ -187,31 +214,31 @@ export default { ...@@ -187,31 +214,31 @@ export default {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
// 坐标轴指示器,坐标轴触发有效 // 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow' type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
} },
}, },
grid: { grid: {
left: "0", left: "0",
right: "4%", right: "4%",
bottom: "3%", bottom: "3%",
containLabel: true containLabel: true,
}, },
xAxis: { xAxis: {
// type: "category", // type: "category",
data: ["三车间", "五车间", "六车间", "七车间"], data: name,
axisTick: { axisTick: {
show: false show: false,
}, },
axisLine: { axisLine: {
show: false show: false,
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: "#515A6E" color: "#515A6E",
} },
} },
}, },
yAxis: { yAxis: {
// type: "value", // type: "value",
...@@ -219,20 +246,20 @@ export default { ...@@ -219,20 +246,20 @@ export default {
show: true, show: true,
lineStyle: { lineStyle: {
color: "#eee", color: "#eee",
type: "solid" type: "solid",
} },
}, },
axisTick: { axisTick: {
show: false show: false,
}, },
axisLine: { axisLine: {
show: false show: false,
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: "#515A6E" color: "#515A6E",
} },
} },
}, },
series: [ series: [
...@@ -241,36 +268,37 @@ export default { ...@@ -241,36 +268,37 @@ export default {
type: "bar", type: "bar",
barWidth: 20, //柱图宽度 barWidth: 20, //柱图宽度
barGap: "100%", //柱图间距 barGap: "100%", //柱图间距
data: [110, 40, 100, 70, 50] data:allTotal,
}, },
{ {
name: "已完成", name: "已完成",
type: "bar", type: "bar",
barWidth: 20, //柱图宽度 barWidth: 20, //柱图宽度
data: [5, 40, 70, 50, 20] data: [5, 40, 70, 50, 20],
}, },
{ {
name: "执行中", name: "执行中",
type: "bar", type: "bar",
barWidth: 20, //柱图宽度 barWidth: 20, //柱图宽度
data: [50, 40, 60, 110, 40] data: [50, 40, 60, 110, 40],
}, },
{ {
name: "暂停中", name: "暂停中",
type: "bar", type: "bar",
barWidth: 20, //柱图宽度 barWidth: 20, //柱图宽度
data: [60, 110, 90, 50, 20] data: [60, 110, 90, 50, 20],
}, },
{ {
name: "未开工", name: "未开工",
type: "bar", type: "bar",
barWidth: 20, //柱图宽度 barWidth: 20, //柱图宽度
data: [50, 68, 40, 100, 55] data: [50, 68, 40, 100, 55],
} },
] ],
}; };
} });
} },
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment