From be75dd0702d1120f5fdf7005f7e1eb48e3f1c79b Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Wed, 19 Jun 2024 08:48:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A82=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 3 +- src/api/report/benchmarking.js | 38 +++ src/views/report/chipOEEBM/index.vue | 282 ++++++++++++------ .../components/bmBarComplete.vue | 227 ++++++++++++++ .../components/bmSearchBarComplete.vue | 138 +++++++++ .../report/completionStatusIntrBM/index.vue | 189 ++++-------- src/views/report/components/bmLineBar.vue | 8 +- src/views/report/components/bmSearchBar.vue | 77 +++-- .../report/conversionEfficiencyBM/index.vue | 282 ++++++++++++------ 9 files changed, 898 insertions(+), 346 deletions(-) create mode 100644 src/api/report/benchmarking.js create mode 100644 src/views/report/completionStatusIntrBM/components/bmBarComplete.vue create mode 100644 src/views/report/completionStatusIntrBM/components/bmSearchBarComplete.vue diff --git a/.env.dev b/.env.dev index 7f1c133..b1603db 100644 --- a/.env.dev +++ b/.env.dev @@ -13,7 +13,8 @@ VUE_APP_TITLE = 发电玻璃智能管控平台 # 芋道管理系统/开发环境 # VUE_APP_BASE_API = 'http://192.168.1.70:30307' -VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' +# VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' +VUE_APP_BASE_API = 'http://192.168.1.56:48080' # sara # VUE_APP_BASE_API = 'http://192.168.1.63:48080' # 张一丁 diff --git a/src/api/report/benchmarking.js b/src/api/report/benchmarking.js new file mode 100644 index 0000000..7ce4bd2 --- /dev/null +++ b/src/api/report/benchmarking.js @@ -0,0 +1,38 @@ +// 对标报表的接口 +import request from '@/utils/request' + +// 稼动率对标 +export function utilzationComparePage(data) { + return request({ + url: '/ip/utilzation-compare/page', + method: 'post', + data: data + }) +} +// 稼动率对标导出 +export function utilzationCompareExport(data) { + return request({ + url: '/ip/utilzation-compare/export-excel', + method: 'post', + responseType: 'blob', + data: data + }) +} + +// 芯片OEE对标 +export function chipoeeComparePage(data) { + return request({ + url: '/ip/chipoee-compare/page', + method: 'post', + data: data + }) +} +// 芯片OEE对标导出 +export function chipoeeCompareExport(data) { + return request({ + url: '/ip/chipoee-compare/export-excel', + method: 'post', + responseType: 'blob', + data: data + }) +} \ No newline at end of file diff --git a/src/views/report/chipOEEBM/index.vue b/src/views/report/chipOEEBM/index.vue index 55ee913..7f8cecb 100644 --- a/src/views/report/chipOEEBM/index.vue +++ b/src/views/report/chipOEEBM/index.vue @@ -4,7 +4,7 @@
-
4月芯片OEE
+
芯片OEE
import bmSearchBar from "../components/bmSearchBar.vue"; import BmLineBar from "../components/bmLineBar.vue"; -const tableProps = [ - { - prop: "factory", - label: "工厂名称", - // filter: (val) => factoryList[val], - minWidth: 200, - showOverflowtooltip: true, - }, - { - prop: "name", - label: "科目", - minWidth: 120, - showOverflowtooltip: true, - }, - { - prop: "unit", - label: "单位", - minWidth: 80, - showOverflowtooltip: true, - }, - { - prop: "time1", - label: "时间1", - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: "time2", - label: "时间2", - minWidth: 150, - showOverflowtooltip: true, - }, - { - prop: "mubiao", - label: "目标值", - minWidth: 150, - showOverflowtooltip: true, - }, -]; +import { + chipoeeComparePage, + chipoeeCompareExport, +} from "@/api/report/benchmarking.js"; +import moment from "moment"; export default { name: "ChipOEEBM", data() { return { - tableProps, + factoryList: [ + { id: 0, name: "瑞昌" }, + { id: 1, name: "邯郸" }, + ], + tableProps: [], + tableProps1: [ + { + prop: "factory", + label: "工厂名称", + filter: (val) => this.factoryList[val].name, + minWidth: 150, + showOverflowtooltip: true, + }, + { + prop: "item", + label: "科目", + minWidth: 120, + showOverflowtooltip: true, + }, + { + prop: "unit", + label: "单位", + minWidth: 80, + showOverflowtooltip: true, + }, + ], listQuery: { current: 1, - size: 1000, + size: 100, }, - tableData: [ - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - { factory: "工厂1" }, - ], + tableData: [], chartHeight: this.tableHeight(269) / 2, tableH: this.tableHeight(269) / 2, legendList: [ - { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, - { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, - { id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, + { id: 1, name: "", type: 2, color: "#FFCE6A" }, + { id: 2, name: "", type: 1, color: "#8EF0AB" }, + { id: 3, name: "", type: 1, color: "#288AFF" }, ], chartMsg: { color: ["#FFCE6A", "#8EF0AB", "#288AFF"], - xData: ["成都", "邯郸", "瑞昌"], + xData: [], yName: "单位/%", series: [ { - name: "2024年4月目标值", - data: [ - { name: "%", value: 85 }, - { name: "%", value: 85 }, - { name: "%", value: 85 }, - ], + name: "", + data: [], type: "line", symbol: "circle", symbolSize: 6, @@ -134,12 +93,8 @@ export default { }, }, { - name: "2023年4月", - data: [ - { name: "%", value: 57.5 }, - { name: "%", value: 21.66 }, - { name: "%", value: 18.4 }, - ], + name: "", + data: [], type: "bar", barWidth: 20, label: { @@ -152,12 +107,8 @@ export default { }, }, { - name: "2024年4月", - data: [ - { name: "%", value: 23.33 }, - { name: "%", value: 7.02 }, - { name: "%", value: 80.2 }, - ], + name: "", + data: [], type: "bar", barWidth: 20, label: { @@ -197,6 +148,13 @@ export default { this.chartHeight = this.tableHeight(269) / 2; window.addEventListener("resize", this._setTableHeight); }, + mounted() { + this.tableProp = this.tableProp1; + this.listQuery.type = 2; + this.listQuery.startDate = moment().format("yyyy-MM-DD"); + this.listQuery.factory = []; + this.getList(); + }, destroyed() { window.removeEventListener("resize", this._setTableHeight); }, @@ -215,11 +173,141 @@ export default { } }, getSearch(val) { - console.log(val); - console.log("========================="); + this.listQuery.type = val.type; + this.listQuery.startDate = val.startDate; + this.listQuery.factory = val.factory; + this.getList(); }, - handleExport() { - console.log("导出"); + getList() { + this.tableProps = []; + chipoeeComparePage({ ...this.listQuery }).then((res) => { + if (res.data && res.data.records.length > 0) { + let msg = res.data.records[0]; + let arr = [ + { + prop: "yoy", + label: msg.yoyColumn, + minWidth: 150, + }, + { + prop: "queryValue", + label: msg.queryColumn, + minWidth: 150, + }, + { + prop: "target", + label: msg.targetColumn, + minWidth: 150, + }, + ]; + this.tableProps = this.tableProps1.concat(arr); + this.tableData = res.data.records; + // 设置图例 + this.legendList[0].name = msg.targetColumn; + this.legendList[1].name = msg.yoyColumn; + this.legendList[2].name = msg.queryColumn; + this.chartMsg.series[0].name = msg.targetColumn; + this.chartMsg.series[1].name = msg.yoyColumn; + this.chartMsg.series[2].name = msg.queryColumn; + // 设置chartMsg的series的数据 + this.setChartMsg(res.data.records); + } else { + // 重置 + this.resetMsg(); + } + }); + }, + setChartMsg(val) { + let xData = []; + let lineData = []; + let barData1 = []; + let barData2 = []; + for (let i = 0; i < val.length; i++) { + this.factoryList.map((item) => { + if (item.id === val[i].factory) { + xData.push(item.name); + } + }); + lineData.push({ + name: "%", + value: val[i].target || 0, + }); + barData1.push({ name: "%", value: val[i].yoy || 0 }); + barData2.push({ + name: "%", + value: val[i].queryValue || 0, + }); + } + this.chartMsg.xData = xData; + this.chartMsg.series[0].data = lineData; + this.chartMsg.series[1].data = barData1; + this.chartMsg.series[2].data = barData2; + this.chartMsg.xData = xData; + }, + resetMsg() { + this.tableProps = this.tableProps1; + this.tableData = []; + this.chartMsg = { + color: ["#FFCE6A", "#8EF0AB", "#288AFF"], + xData: [], + yName: "单位/%", + series: [ + { + name: "1", + data: [], + type: "line", + symbol: "circle", + symbolSize: 6, + label: { + show: true, + color: "#FFAE17", + formatter: function (params) { + return params.value.toFixed(2) + "%"; + }, + }, + }, + { + name: "2", + data: [], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [-18, -16], + color: "#68C483", + formatter: function (params) { + return params.value.toFixed(2) + "%"; + }, + }, + }, + { + name: "3", + data: [], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "#288AFF", + formatter: function (params) { + return params.value.toFixed(2) + "%"; + }, + }, + }, + ], + }; + }, + handleExport(val) { + this.listQuery.type = val.type; + this.listQuery.startDate = val.startDate; + this.listQuery.factory = val.factory; + let fileName = "芯片OEE对标.xls"; + chipoeeCompareExport({ ...this.listQuery }) + .then((response) => { + this.$download.excel(response, fileName); + this.$message.success("导出成功"); + }) + .catch(() => {}); }, }, }; diff --git a/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue b/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue new file mode 100644 index 0000000..2eda8f4 --- /dev/null +++ b/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue @@ -0,0 +1,227 @@ + + + + diff --git a/src/views/report/completionStatusIntrBM/components/bmSearchBarComplete.vue b/src/views/report/completionStatusIntrBM/components/bmSearchBarComplete.vue new file mode 100644 index 0000000..05e3c9a --- /dev/null +++ b/src/views/report/completionStatusIntrBM/components/bmSearchBarComplete.vue @@ -0,0 +1,138 @@ + + + + diff --git a/src/views/report/completionStatusIntrBM/index.vue b/src/views/report/completionStatusIntrBM/index.vue index 39c0940..eca01e2 100644 --- a/src/views/report/completionStatusIntrBM/index.vue +++ b/src/views/report/completionStatusIntrBM/index.vue @@ -1,17 +1,20 @@