diff --git a/src/api/report/benchmarking.js b/src/api/report/benchmarking.js index b863bbd..9d16394 100644 --- a/src/api/report/benchmarking.js +++ b/src/api/report/benchmarking.js @@ -54,6 +54,62 @@ export function sCPReportByDateRangeExport(data) { data: data }) } + +// 转化效率对标 +export function componentconvertrateCPage(data) { + return request({ + url: '/ip/componentconvertrate-compare/page', + method: 'post', + data: data + }) +} +// 转化效率对标导出 +export function componentconvertrateCExport(data) { + return request({ + url: '/ip/componentconvertrate-compare/export-excel', + method: 'post', + responseType: 'blob', + data: data + }) +} + +// 芯片良率对标 +export function chipyieldRatePage(data) { + return request({ + url: '/ip/chipyield-rate/page', + method: 'post', + data: data + }) +} +// 芯片良率对标导出 +export function chipyieldRateExport(data) { + return request({ + url: '/ip/chipyield-rate/export-excel', + method: 'post', + responseType: 'blob', + data: data + }) +} + +// 标准组件良率对标 +export function componentyieldRatePage(data) { + return request({ + url: '/ip/componentyield-rate/page', + method: 'post', + data: data + }) +} +// 标准组件良率对标导出 +export function componentyieldRateExport(data) { + return request({ + url: '/ip/componentyield-rate/export-excel', + method: 'post', + responseType: 'blob', + data: data + }) +} + + // 稼动率对标 export function utilzationComparePage(data) { return request({ @@ -124,4 +180,40 @@ export function chipAnnualAverageProductionExport(data) { responseType: 'blob', data: data }) +} + +// 标准组件人均产量对标 +export function componentAapPage(data) { + return request({ + url: '/ip/prod-output/componentAap', + method: 'post', + data: data + }) +} +// 标准组件人均产量对标导出 +export function componentAapExport(data) { + return request({ + url: '/ip/prod-output/componentAap-export', + method: 'post', + responseType: 'blob', + data: data + }) +} + +// 指标完成情况对标 +export function targetCompletionPage(data) { + return request({ + url: '/ip/prod-output/TargetCompletion', + method: 'post', + data: data + }) +} +// 指标完成情况对标导出 +export function targetCompletionExport(data) { + return request({ + url: '/ip/prod-output/TargetCompletion-export', + 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 7f8cecb..cee6997 100644 --- a/src/views/report/chipOEEBM/index.vue +++ b/src/views/report/chipOEEBM/index.vue @@ -187,16 +187,19 @@ export default { { prop: "yoy", label: msg.yoyColumn, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, { prop: "queryValue", label: msg.queryColumn, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, { prop: "target", label: msg.targetColumn, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, ]; diff --git a/src/views/report/chipOutputBM/index.vue b/src/views/report/chipOutputBM/index.vue index d3d09e1..a321f91 100644 --- a/src/views/report/chipOutputBM/index.vue +++ b/src/views/report/chipOutputBM/index.vue @@ -182,16 +182,19 @@ export default { { prop: "lastone", label: msg.lastone.reportTime, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, { prop: "currentone", label: msg.currentone.reportTime, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, { prop: "targetone", label: msg.targetone.reportTime, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, ]; @@ -201,7 +204,7 @@ export default { res.data.forEach((item) => { let obj = {}; obj.factory = item.factory; - obj.item = "FTO投入"; + obj.item = "芯片产量"; obj.unit = "片"; obj.lastone = item.lastone.total; obj.currentone = item.currentone.total; diff --git a/src/views/report/chipPerCapitaBM/index.vue b/src/views/report/chipPerCapitaBM/index.vue index 01c40e3..ca9ffbd 100644 --- a/src/views/report/chipPerCapitaBM/index.vue +++ b/src/views/report/chipPerCapitaBM/index.vue @@ -76,7 +76,7 @@ export default { chartMsg: { color: ["#FFCE6A", "#8EF0AB", "#288AFF"], xData: [], - yName: "单位/片", + yName: "单位:片/人", series: [ { name: "1", @@ -181,16 +181,19 @@ export default { { prop: "yoy", label: msg.yoyColumn, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, { prop: "queryValue", label: msg.queryColumn, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, { prop: "target", label: msg.targetColumn, + filter: (val) => (val || val === 0 ? val : "-"), minWidth: 150, }, ]; diff --git a/src/views/report/chipYieldBM/index.vue b/src/views/report/chipYieldBM/index.vue index 5ee5ae2..dd86f68 100644 --- a/src/views/report/chipYieldBM/index.vue +++ b/src/views/report/chipYieldBM/index.vue @@ -4,7 +4,7 @@
-
4月芯片良率
+
芯片良率
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 { + chipyieldRatePage, + chipyieldRateExport, +} from "@/api/report/benchmarking.js"; +import moment from "moment"; export default { name: "ChipYieldBM", 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: "1", + 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: "2", + 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: "3", + 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,144 @@ 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 = []; + chipyieldRatePage({ ...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, + filter: (val) => (val || val === 0 ? val : "-"), + minWidth: 150, + }, + { + prop: "queryValue", + label: msg.queryColumn, + filter: (val) => (val || val === 0 ? val : "-"), + minWidth: 150, + }, + { + prop: "target", + label: msg.targetColumn, + filter: (val) => (val || val === 0 ? val : "-"), + 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 = "芯片良率对标.xls"; + chipyieldRateExport({ ...this.listQuery }) + .then((response) => { + this.$download.excel(response, fileName); + this.$message.success("导出成功"); + }) + .catch(() => {}); }, }, }; diff --git a/src/views/report/completionStatusIntrBM/components/baseChart.vue b/src/views/report/completionStatusIntrBM/components/baseChart.vue index 125293a..a0cddf0 100644 --- a/src/views/report/completionStatusIntrBM/components/baseChart.vue +++ b/src/views/report/completionStatusIntrBM/components/baseChart.vue @@ -17,7 +17,7 @@ export default { // color: ["#8EF0AB", "#63BDFF", "#288AFF"], grid: { left: 70, - right: 10, + right: 0, bottom: 30, top: 30, }, diff --git a/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue b/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue index 81fbde3..460d48a 100644 --- a/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue +++ b/src/views/report/completionStatusIntrBM/components/bmBarComplete.vue @@ -1,47 +1,81 @@