diff --git a/src/views/statistics/statistics_guan.vue b/src/views/statistics/statistics_guan.vue index fa8d100f..2e8732b0 100644 --- a/src/views/statistics/statistics_guan.vue +++ b/src/views/statistics/statistics_guan.vue @@ -121,7 +121,7 @@ - + - + + + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + @@ -461,115 +461,115 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + diff --git a/src/views/statistics/stock_statistics.vue b/src/views/statistics/stock_statistics.vue index 07b11023..92d425d9 100644 --- a/src/views/statistics/stock_statistics.vue +++ b/src/views/statistics/stock_statistics.vue @@ -279,7 +279,7 @@ export default { }, methods: { queryTypeChnge() { - this.query.queryDate = ""; + this.queryDate =null; }, getTableData1() { let that = this; diff --git a/src/views/statistics/task_rate.vue b/src/views/statistics/task_rate.vue index 1ccb0338..423b1602 100644 --- a/src/views/statistics/task_rate.vue +++ b/src/views/statistics/task_rate.vue @@ -67,13 +67,11 @@ :data="tableData1" id="exportDiv7" :height="tableHeight" + :summary-method="getSummaries" + show-summary > - + @@ -96,13 +94,11 @@ :data="tableData2" id="exportDiv10" :height="tableHeight" + :summary-method="getSummaries" + show-summary > - + @@ -125,13 +121,11 @@ :data="tableData3" id="exportDiv6" :height="tableHeight" + :summary-method="getSummaries" + show-summary > - + @@ -178,8 +172,8 @@ export default { series: { name: "7车间完成率", type: "pie", - radius: ["40%", "70%"], - center: ["50%", "60%"], + radius: ["35%", "65%"], + center: ["50%", "58%"], label: { show: true, position: "outside", @@ -194,7 +188,6 @@ export default { option2: { title: { text: "10车间完成率", - // subtext: '', }, tooltip: { trigger: "item", @@ -207,8 +200,8 @@ export default { series: { name: "10车间完成率", type: "pie", - radius: ["40%", "70%"], - center: ["50%", "60%"], + radius: ["35%", "65%"], + center: ["50%", "58%"], label: { show: true, position: "outside", @@ -235,8 +228,8 @@ export default { series: { name: "6车间完成率", type: "pie", - radius: ["40%", "70%"], - center: ["50%", "60%"], + radius: ["35%", "65%"], + center: ["50%", "58%"], label: { show: true, position: "outside", @@ -276,8 +269,7 @@ export default { this.currentYear = year; this.currentMonth = month > 9 ? month : "0" + month; this.start_date = year + "-" + month + "-01"; - this.end_date = - year + "-" + month + "-" + new Date(year, month, 0).getDate(); + this.end_date = year + "-" + month + "-" + days; let month1 = month > 9 ? month : "0" + month; this.queryDate = year + "-" + month1; let height = document.getElementById("elMain").clientHeight - 40; @@ -430,6 +422,34 @@ export default { this.getData7(); this.getData10(); }, + getSummaries({ columns, data }) { + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = "合计"; + return; + } + if (index == 2||index == 3) { + const values = data.map((item) => + Number(item[column.property]) + ); + if (!values.every((value) => Number.isNaN(value))) { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); //Number转换为数值 + let sum = Number( + Number(prev) + Number(curr) + ).toFixed(2); //toFixed(2)数据项保留两位小数 + if (!isNaN(value)) { + return sum; + } else { + return prev; + } + }, 0); + } + } + }); + return sums; + }, handleExport(val) { this.exportLoading = true; let id = "#exportDiv" + val;