Commit 2b902dfb authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 07c8d9e9 bff946e9
...@@ -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,212 +66,239 @@ export default { ...@@ -65,212 +66,239 @@ export default {
}, },
methods: { methods: {
statistics() { statistics() {
this.braking = { let conditions = [
xAxis: { {
// type: "category", fieldName: "status",
data: ["计划数量", "已完成", "执行中", "暂停中", "未开工"], fieldValue: "1",
axisTick: { conditionalType: "Equal"
show: false }
}, ];
axisLine: { let data = {
show: false 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 = {
xAxis: {
// type: "category",
data: ['计划数量',],
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
textStyle: {
color: "#515A6E",
},
},
}, },
axisLabel: { yAxis: {
textStyle: { splitLine: {
color: "#515A6E" show: true,
} lineStyle: {
} color: "#eee",
}, type: "solid",
yAxis: { },
splitLine: { },
show: true, axisTick: {
lineStyle: { show: false,
color: "#eee", },
type: "solid" axisLine: {
} show: false,
},
axisLabel: {
textStyle: {
color: "#515A6E",
},
},
}, },
axisTick: { grid: {
show: false left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
}, },
axisLine: { tooltip: {
show: false trigger: "axis",
axisPointer: {
type: "shadow",
},
}, },
axisLabel: { color: ["#73DDFF"],
textStyle: { series: [
color: "#515A6E" {
} data: [
} {
}, value: allTotal,
grid: { itemStyle: {
left: "3%", normal: {
right: "4%", color: "#2680EB",
bottom: "3%", barBorderRadius: [30, 30, 0, 0],
containLabel: true },
}, },
tooltip: { },
trigger: "axis", {
axisPointer: { value: listData[0].count,
type: "shadow" itemStyle: {
} normal: {
}, color: "#0DD78D",
color: ["#73DDFF"], barBorderRadius: [30, 30, 0, 0],
series: [ },
{ },
data: [ },
{ {
value: 120, value: listData[1].count,
itemStyle: { itemStyle: {
normal: { normal: {
color: "#2680EB", color: "#FFA000",
barBorderRadius: [30, 30, 0, 0] barBorderRadius: [30, 30, 0, 0],
} },
} },
}, },
{ {
value: 60, value: listData[2].count,
itemStyle: { itemStyle: {
normal: { normal: {
color: "#0DD78D", color: "#FE7777",
barBorderRadius: [30, 30, 0, 0] barBorderRadius: [30, 30, 0, 0],
} },
} },
}, },
{ ],
value: 210, type: "bar",
itemStyle: { barWidth: 10, //柱图宽度
normal: { barGap: "-20%", //柱图间距
color: "#FFA000", },
barBorderRadius: [30, 30, 0, 0] ],
} };
} });
},
{
value: 210,
itemStyle: {
normal: {
color: "#FE7777",
barBorderRadius: [30, 30, 0, 0]
}
}
},
{
value: 210,
itemStyle: {
normal: {
color: "#515A6E",
barBorderRadius: [30, 30, 0, 0]
}
}
}
],
type: "bar",
barWidth: 10, //柱图宽度
barGap: "-20%" //柱图间距
}
]
};
}, },
statistics1() { statistics1() {
this.braking1 = { let conditions = [];
color: ["#2680EB", "#0DD78D", "#FFA000", "#FE7777", "#515A6E"], let data = {
legend: { conditions: conditions,
data: ["计划数量", "已完成", "执行中", "暂停中", "未开工"], };
top: 12 Api.orderstatuscount(data).then((r) => {
// textStyle: { let listData = [];
// color: "#515A6E" let name = [];
// }, let allTotal=[]
// itemWidth: 12, listData = r.result;
// itemHeight: 10 r.result.map((e) => {
}, name.push(e.name);
allTotal.push(e.allTotal)
tooltip: {
trigger: "axis", });
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: "0",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: { this.braking1 = {
// type: "category", color: ["#2680EB", "#0DD78D", "#FFA000", "#FE7777", "#515A6E"],
data: ["三车间", "五车间", "六车间", "七车间"], legend: {
axisTick: { data: ["计划数量", "已完成", "执行中", "暂停中", "未开工"],
show: false top: 12,
}, // textStyle: {
axisLine: { // color: "#515A6E"
show: false // },
// itemWidth: 12,
// itemHeight: 10
}, },
axisLabel: {
textStyle: {
color: "#515A6E"
}
}
},
yAxis: {
// type: "value",
splitLine: {
show: true,
lineStyle: {
color: "#eee",
type: "solid"
}
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
textStyle: {
color: "#515A6E"
}
}
},
series: [ tooltip: {
{ trigger: "axis",
name: "计划数量", axisPointer: {
type: "bar", // 坐标轴指示器,坐标轴触发有效
barWidth: 20, //柱图宽度 type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
barGap: "100%", //柱图间距 },
data: [110, 40, 100, 70, 50]
}, },
{
name: "已完成", grid: {
type: "bar", left: "0",
barWidth: 20, //柱图宽度 right: "4%",
data: [5, 40, 70, 50, 20] bottom: "3%",
containLabel: true,
}, },
{
name: "执行中", xAxis: {
type: "bar", // type: "category",
barWidth: 20, //柱图宽度 data: name,
data: [50, 40, 60, 110, 40] axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
textStyle: {
color: "#515A6E",
},
},
}, },
{ yAxis: {
name: "暂停中", // type: "value",
type: "bar", splitLine: {
barWidth: 20, //柱图宽度 show: true,
data: [60, 110, 90, 50, 20] lineStyle: {
color: "#eee",
type: "solid",
},
},
axisTick: {
show: false,
},
axisLine: {
show: false,
},
axisLabel: {
textStyle: {
color: "#515A6E",
},
},
}, },
{
name: "未开工", series: [
type: "bar", {
barWidth: 20, //柱图宽度 name: "计划数量",
data: [50, 68, 40, 100, 55] type: "bar",
} barWidth: 20, //柱图宽度
] barGap: "100%", //柱图间距
}; data:allTotal,
} },
} {
name: "已完成",
type: "bar",
barWidth: 20, //柱图宽度
data: [5, 40, 70, 50, 20],
},
{
name: "执行中",
type: "bar",
barWidth: 20, //柱图宽度
data: [50, 40, 60, 110, 40],
},
{
name: "暂停中",
type: "bar",
barWidth: 20, //柱图宽度
data: [60, 110, 90, 50, 20],
},
{
name: "未开工",
type: "bar",
barWidth: 20, //柱图宽度
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