Merge branch 'projects/mescc/develop' into projects/mescc/zhp

This commit is contained in:
‘937886381’ 2024-06-20 20:38:45 +08:00
commit cc800eae5d
20 changed files with 1306 additions and 541 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-28 13:42:51 # @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-06-19 16:05:46 # @LastEditTime: 2024-06-20 10:16:40
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###

View File

@ -54,6 +54,62 @@ export function sCPReportByDateRangeExport(data) {
data: 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) { export function utilzationComparePage(data) {
return request({ return request({
@ -125,3 +181,39 @@ export function chipAnnualAverageProductionExport(data) {
data: data 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
})
}

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-19 15:47:17 * @LastEditTime: 2024-06-20 10:16:25
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -234,7 +234,7 @@ export default {
{ {
prop: 'goodRatio', prop: 'goodRatio',
label: '良品率%', label: '良品率%',
filter: (val) => (val * 100) + '%' filter: (val) => val + '%'
}, },
], ],
tableData: [], tableData: [],

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-17 09:49:15 * @LastEditTime: 2024-06-20 16:41:48
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -144,7 +144,6 @@
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData'; import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import lineChart from './lineChart';
import moment from 'moment' import moment from 'moment'
import ButtonNav from '@/components/ButtonNav' import ButtonNav from '@/components/ButtonNav'
import basicPage from '@/mixins/basic-page' import basicPage from '@/mixins/basic-page'
@ -157,7 +156,7 @@ import {getBaseHeader} from "@/utils/request";
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { lineChart, ButtonNav, detailOrUpdate, addOrUpdate }, components: { ButtonNav, detailOrUpdate, addOrUpdate },
mixins: [basicPage], mixins: [basicPage],
data() { data() {
return { return {
@ -414,12 +413,12 @@ export default {
}, },
], ],
// timeSelect:'month', // timeSelect:'month',
startTimeStamp:null, // // startTimeStamp:null, //
endTimeStamp:null, // // endTimeStamp:null, //
// date:'2024', // date:'2024',
// reportTime: '', // reportTime: '',
startTimeStamp: '', // startTimeStamp: '',
endTimeStamp: '', // endTimeStamp: '',
tableData: [], tableData: [],
facType: 0 facType: 0
// proLineList: [], // proLineList: [],
@ -458,13 +457,13 @@ export default {
this.changeTime() this.changeTime()
}, },
methods: { methods: {
clearTime() { clearTime() {
this.listQuery.beginTime = undefined this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined this.listQuery.endTime = undefined
this.listQuery.reportTime = [] this.listQuery.reportTime = []
this.start = undefined this.start = undefined
this.end = undefined this.end = undefined
}, },
handleImport() { handleImport() {
this.upload.title = "生产目标导入"; this.upload.title = "生产目标导入";
this.upload.open = true; this.upload.open = true;

View File

@ -187,16 +187,19 @@ export default {
{ {
prop: "yoy", prop: "yoy",
label: msg.yoyColumn, label: msg.yoyColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "queryValue", prop: "queryValue",
label: msg.queryColumn, label: msg.queryColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "target", prop: "target",
label: msg.targetColumn, label: msg.targetColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];

View File

@ -182,16 +182,19 @@ export default {
{ {
prop: "lastone", prop: "lastone",
label: msg.lastone.reportTime, label: msg.lastone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "currentone", prop: "currentone",
label: msg.currentone.reportTime, label: msg.currentone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "targetone", prop: "targetone",
label: msg.targetone.reportTime, label: msg.targetone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];
@ -201,7 +204,7 @@ export default {
res.data.forEach((item) => { res.data.forEach((item) => {
let obj = {}; let obj = {};
obj.factory = item.factory; obj.factory = item.factory;
obj.item = "FTO投入"; obj.item = "芯片产量";
obj.unit = "片"; obj.unit = "片";
obj.lastone = item.lastone.total; obj.lastone = item.lastone.total;
obj.currentone = item.currentone.total; obj.currentone = item.currentone.total;

View File

@ -76,7 +76,7 @@ export default {
chartMsg: { chartMsg: {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: [], xData: [],
yName: "单位/片", yName: "单位:片/人",
series: [ series: [
{ {
name: "1", name: "1",
@ -181,16 +181,19 @@ export default {
{ {
prop: "yoy", prop: "yoy",
label: msg.yoyColumn, label: msg.yoyColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "queryValue", prop: "queryValue",
label: msg.queryColumn, label: msg.queryColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "target", prop: "target",
label: msg.targetColumn, label: msg.targetColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];

View File

@ -4,7 +4,7 @@
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div> </div>
<div class="containerBottom"> <div class="containerBottom">
<div class="smallTitle">4芯片良率</div> <div class="smallTitle">芯片良率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -26,102 +26,61 @@
<script> <script>
import bmSearchBar from "../components/bmSearchBar.vue"; import bmSearchBar from "../components/bmSearchBar.vue";
import BmLineBar from "../components/bmLineBar.vue"; import BmLineBar from "../components/bmLineBar.vue";
const tableProps = [ import {
{ chipyieldRatePage,
prop: "factory", chipyieldRateExport,
label: "工厂名称", } from "@/api/report/benchmarking.js";
// filter: (val) => factoryList[val], import moment from "moment";
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,
},
];
export default { export default {
name: "ChipYieldBM", name: "ChipYieldBM",
data() { data() {
return { 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: { listQuery: {
current: 1, current: 1,
size: 1000, size: 100,
}, },
tableData: [ 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" },
],
chartHeight: this.tableHeight(269) / 2, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(269) / 2, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, { id: 1, name: "", type: 2, color: "#FFCE6A" },
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, { id: 2, name: "", type: 1, color: "#8EF0AB" },
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, { id: 3, name: "", type: 1, color: "#288AFF" },
], ],
chartMsg: { chartMsg: {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: [],
yName: "单位/%", yName: "单位/%",
series: [ series: [
{ {
name: "2024年4月目标值", name: "1",
data: [ data: [],
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -134,12 +93,8 @@ export default {
}, },
}, },
{ {
name: "2023年4月", name: "2",
data: [ data: [],
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -152,12 +107,8 @@ export default {
}, },
}, },
{ {
name: "2024年4月", name: "3",
data: [ data: [],
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -197,6 +148,13 @@ export default {
this.chartHeight = this.tableHeight(269) / 2; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); 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() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -215,11 +173,144 @@ export default {
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.type = val.type;
console.log("========================="); this.listQuery.startDate = val.startDate;
this.listQuery.factory = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); 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;
// chartMsgseries
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(() => {});
}, },
}, },
}; };

View File

@ -17,7 +17,7 @@ export default {
// color: ["#8EF0AB", "#63BDFF", "#288AFF"], // color: ["#8EF0AB", "#63BDFF", "#288AFF"],
grid: { grid: {
left: 70, left: 70,
right: 10, right: 0,
bottom: 30, bottom: 30,
top: 30, top: 30,
}, },

View File

@ -1,47 +1,81 @@
<!-- 只适用于指标完成情况对标 --> <!-- 只适用于指标完成情况对标 -->
<template> <template>
<div> <div>
<!-- 暂无数据 -->
<div
:style="{ height: chartHeight + 'px' }"
v-show="this.chartMsg.series[0].data.length === 0"
>
<div
class="no-data-bg"
style="position: relative; left: 50%; transform: translateX(-50%)"
></div>
</div>
<!-- 图例 --> <!-- 图例 -->
<div v-show="this.chartMsg.series[0].data.length > 0"> <div
<div class="legend"> class="legend"
<span class="item" v-for="item in legendList" :key="item.id"> v-show="
this.chartMsg1.series[0].data.length > 0 ||
this.chartMsg2.series[0].data.length > 0
"
>
<span class="item" v-for="item in legendList" :key="item.id">
<span
v-if="item.type === 1"
class="block"
:style="{ backgroundColor: item.color }"
></span>
<span
v-if="item.type === 2"
class="line"
:style="{ backgroundColor: item.color }"
>
<span <span
v-if="item.type === 1" class="line-block"
class="block"
:style="{ backgroundColor: item.color }" :style="{ backgroundColor: item.color }"
></span> ></span>
<span </span>
v-if="item.type === 2" {{ item.name }}</span
class="line" >
:style="{ backgroundColor: item.color }"
>
<span
class="line-block"
:style="{ backgroundColor: item.color }"
></span>
</span>
{{ item.name }}</span
>
</div>
</div> </div>
<!-- --> <!-- -->
<base-chart <div>
:chartHeight="chartHeight" <div style="display: inline-block; width: 79%; vertical-align: top">
:legendList="legendList" <base-chart
:chartMsg="chartMsg" v-show="this.chartMsg1.series[0].data.length > 0"
:chartId="chartId" :chartHeight="chartHeight"
:chartNum="chartNum" :chartWidth="chartWidth1"
/> :chartMsg="chartMsg1"
chartId="targetChartLeft"
:chartNum="chartNum"
/>
<!-- 暂无数据 -->
<div
:style="{ height: chartHeight + 'px' }"
v-show="this.chartMsg1.series[0].data.length === 0"
>
<div
class="no-data-bg"
style="position: relative; left: 50%; transform: translateX(-50%)"
></div>
</div>
</div>
<div style="display: inline-block; width: 20%; vertical-align: top">
<base-chart
v-show="this.chartMsg2.series[0].data.length > 0"
:chartHeight="chartHeight"
:chartWidth="chartWidth2"
:chartMsg="chartMsg2"
chartId="targetChartRight"
:chartNum="chartNum"
/>
<!-- 暂无数据 -->
<div
:style="{ height: chartHeight + 'px' }"
v-show="this.chartMsg2.series[0].data.length === 0"
>
<div
class="no-data-bg"
style="
position: relative;
left: 50%;
transform: translateX(-50%);
width: 80%;
"
></div>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -49,7 +83,10 @@ import baseChart from "./baseChart.vue";
export default { export default {
name: "bmBarComplete", name: "bmBarComplete",
data() { data() {
return; return {
chartWidth1: "60%",
chartWidth2: "20%",
};
}, },
props: { props: {
chartHeight: { chartHeight: {
@ -60,13 +97,13 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
chartMsg: { chartMsg1: {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
chartId: { chartMsg2: {
type: String, type: Object,
default: "bmChart", default: () => {},
}, },
chartNum: { chartNum: {
type: Number, type: Number,

View File

@ -61,11 +61,15 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="getDataList" <el-button type="primary" size="small" @click="getDataList('search')"
>查询</el-button >查询</el-button
> >
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button type="primary" size="small" plain @click="handleExport" <el-button
type="primary"
size="small"
plain
@click="getDataList('export')"
>导出</el-button >导出</el-button
> >
</el-form-item> </el-form-item>
@ -93,8 +97,7 @@ export default {
}; };
}, },
methods: { methods: {
getDataList() { getDataList(val) {
console.log(this.form);
let params = {}; let params = {};
switch (this.form.type) { switch (this.form.type) {
case 0: case 0:
@ -113,10 +116,11 @@ export default {
break; break;
} }
params.type = this.form.type; params.type = this.form.type;
this.$emit("getSearch", params); if (val === "search") {
}, this.$emit("getSearch", params);
handleExport() { } else {
this.$emit("handleExport"); this.$emit("handleExport", params);
}
}, },
}, },
}; };

View File

@ -11,8 +11,8 @@
<bm-bar-complete <bm-bar-complete
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
:chartMsg="chartMsg" :chartMsg1="chartMsg1"
:chartId="chartId" :chartMsg2="chartMsg2"
:chartNum="chartNum" :chartNum="chartNum"
/> />
<base-table <base-table
@ -29,88 +29,80 @@
<script> <script>
import BmSearchBarComplete from "./components/bmSearchBarComplete.vue"; import BmSearchBarComplete from "./components/bmSearchBarComplete.vue";
import BmBarComplete from "./components/bmBarComplete.vue"; import BmBarComplete from "./components/bmBarComplete.vue";
const tableProps = [ import {
{ targetCompletionPage,
prop: "factory", targetCompletionExport,
label: "指标名称", } from "@/api/report/benchmarking.js";
// filter: (val) => factoryList[val], import moment from "moment";
},
{
prop: "unit",
label: "单位",
},
{
prop: "time1",
label: "时间1",
},
{
prop: "time2",
label: "时间2",
},
];
export default { export default {
name: "CompletionStatusIntrBM", name: "CompletionStatusIntrBM",
data() { data() {
return { return {
tableProps, tableProps: [],
tableProps1: [
{
prop: "item",
label: "指标名称",
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: "unit",
label: "单位",
minWidth: 80,
showOverflowtooltip: true,
},
],
listQuery: { listQuery: {
current: 1, current: 1,
size: 1000, size: 100,
}, },
tableData: [ 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" },
],
chartHeight: this.tableHeight(269) / 2, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(269) / 2, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2023年4月", type: 1, color: "#288AFF33" }, { id: 1, name: "", type: 1, color: "#288AFF33" },
{ id: 2, name: "2024年4月", type: 1, color: "#288AFF" }, { id: 2, name: "", type: 1, color: "#288AFF" },
], ],
chartMsg: { chartMsg1: {
color: ["#288AFF33", "#288AFF"], color: ["#288AFF33", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: [],
yName: "单位/MW", yName: "单位/MW",
series: [ series: [
{ {
name: "2023年4月", name: "1",
data: [5505, 6578, 5500], data: [],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: {
show: true,
position: "top",
color: "#2789FF",
},
}, },
{ {
name: "2024年4月", name: "2",
data: [3503, 3456, 4500], data: [],
type: "bar",
barWidth: 20,
barGap: "-100%",
label: {
show: true,
position: "top",
color: "#288AFF",
},
},
],
},
chartMsg2: {
color: ["#288AFF33", "#288AFF"],
xData: [],
yName: "单位/㎡",
series: [
{
name: "1",
data: [],
type: "bar",
barWidth: 20,
},
{
name: "2",
data: [],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
barGap: "-100%", barGap: "-100%",
@ -122,7 +114,6 @@ export default {
}, },
], ],
}, },
chartId: "completionStatusIntrBMChart",
chartNum: 1, chartNum: 1,
}; };
}, },
@ -148,6 +139,12 @@ export default {
this.chartHeight = this.tableHeight(269) / 2; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
mounted() {
this.tableProp = this.tableProp1;
this.listQuery.type = 2;
this.listQuery.startDate = moment().format("yyyy-MM-DD");
this.getList();
},
destroyed() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -166,11 +163,153 @@ export default {
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.type = val.type;
console.log("========================="); this.listQuery.startDate = val.startDate;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); this.tableProps = [];
targetCompletionPage({ ...this.listQuery }).then((res) => {
if (res.data && res.data.records.length > 0) {
let msg = res.data.records[0];
let arr = [
{
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.queryColumn;
this.chartMsg1.series[0].name = msg.targetColumn;
this.chartMsg1.series[1].name = msg.queryColumn;
this.chartMsg2.series[0].name = msg.targetColumn;
this.chartMsg2.series[1].name = msg.queryColumn;
//
switch (this.listQuery.type) {
case 0:
this.chartMsg1.series[1].label.position = [-5, -16];
this.chartMsg2.series[1].label.position = [-5, -16];
break;
case 1:
this.chartMsg1.series[1].label.position = [-5, -16];
this.chartMsg2.series[1].label.position = [-5, -16];
break;
case 2:
this.chartMsg1.series[1].label.position = [-10, -16];
this.chartMsg2.series[1].label.position = [-10, -16];
break;
default:
this.chartMsg1.series[1].label.position = [-17, -16];
this.chartMsg2.series[1].label.position = [-17, -16];
}
// chartMsgseries
this.setChartMsg(res.data.records);
} else {
//
this.resetMsg();
}
});
},
setChartMsg(val) {
let xData1 = [];
let xData2 = [];
let barData1 = [];
let barData2 = [];
let barData3 = [];
let barData4 = [];
for (let i = 0; i < val.length; i++) {
if (val[i].unit !== "㎡") {
xData1.push(val[i].item);
barData1.push(val[i].target || 0);
barData2.push(val[i].queryValue || 0);
} else {
xData2.push(val[i].item);
barData3.push(val[i].target || 0);
barData4.push(val[i].queryValue || 0);
}
}
this.chartMsg1.xData = xData1;
this.chartMsg2.xData = xData2;
this.chartMsg1.series[0].data = barData1;
this.chartMsg1.series[1].data = barData2;
this.chartMsg2.series[0].data = barData3;
this.chartMsg2.series[1].data = barData4;
},
resetMsg() {
this.tableProps = this.tableProps1;
this.tableData = [];
this.chartMsg1 = {
color: ["#288AFF33", "#288AFF"],
xData: [],
yName: "单位/MW",
series: [
{
name: "1",
data: [],
type: "bar",
barWidth: 20,
},
{
name: "2",
data: [],
type: "bar",
barWidth: 20,
barGap: "-100%",
label: {
show: true,
position: "top",
color: "#288AFF",
},
},
],
};
this.chartMsg2 = {
color: ["#288AFF33", "#288AFF"],
xData: [],
yName: "单位/㎡",
series: [
{
name: "1",
data: [],
type: "bar",
barWidth: 20,
},
{
name: "2",
data: [],
type: "bar",
barWidth: 20,
barGap: "-100%",
label: {
show: true,
position: "top",
color: "#288AFF",
},
},
],
};
},
handleExport(val) {
this.listQuery.type = val.type;
this.listQuery.startDate = val.startDate;
let fileName = "指标完成情况对标.xls";
targetCompletionExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };

View File

@ -119,7 +119,6 @@ export default {
}, },
methods: { methods: {
getDataList(val) { getDataList(val) {
console.log(this.form);
let params = {}; let params = {};
params.factory = this.form.factory; params.factory = this.form.factory;
switch (this.form.type) { switch (this.form.type) {

View File

@ -187,16 +187,19 @@ export default {
{ {
prop: "yoy", prop: "yoy",
label: msg.yoyColumn, label: msg.yoyColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "queryValue", prop: "queryValue",
label: msg.queryColumn, label: msg.queryColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "target", prop: "target",
label: msg.targetColumn, label: msg.targetColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];

View File

@ -182,16 +182,19 @@ export default {
{ {
prop: "lastone", prop: "lastone",
label: msg.lastone.reportTime, label: msg.lastone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "currentone", prop: "currentone",
label: msg.currentone.reportTime, label: msg.currentone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "targetone", prop: "targetone",
label: msg.targetone.reportTime, label: msg.targetone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];

View File

@ -187,16 +187,19 @@ export default {
{ {
prop: "yoy", prop: "yoy",
label: msg.yoyColumn, label: msg.yoyColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "queryValue", prop: "queryValue",
label: msg.queryColumn, label: msg.queryColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "target", prop: "target",
label: msg.targetColumn, label: msg.targetColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];

View File

@ -182,16 +182,19 @@ export default {
{ {
prop: "lastone", prop: "lastone",
label: msg.lastone.reportTime, label: msg.lastone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "currentone", prop: "currentone",
label: msg.currentone.reportTime, label: msg.currentone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
{ {
prop: "targetone", prop: "targetone",
label: msg.targetone.reportTime, label: msg.targetone.reportTime,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150, minWidth: 150,
}, },
]; ];
@ -201,7 +204,7 @@ export default {
res.data.forEach((item) => { res.data.forEach((item) => {
let obj = {}; let obj = {};
obj.factory = item.factory; obj.factory = item.factory;
obj.item = "FTO投入"; obj.item = "标准组件产量";
obj.unit = "片"; obj.unit = "片";
obj.lastone = item.lastone.total; obj.lastone = item.lastone.total;
obj.currentone = item.currentone.total; obj.currentone = item.currentone.total;

View File

@ -4,7 +4,7 @@
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div> </div>
<div class="containerBottom"> <div class="containerBottom">
<div class="smallTitle">4组件人均产量</div> <div class="smallTitle">组件人均产量</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -26,101 +26,61 @@
<script> <script>
import bmSearchBar from "../components/bmSearchBar.vue"; import bmSearchBar from "../components/bmSearchBar.vue";
import BmLineBar from "../components/bmLineBar.vue"; import BmLineBar from "../components/bmLineBar.vue";
const tableProps = [ import {
{ componentAapPage,
prop: "factory", componentAapExport,
label: "工厂名称", } from "@/api/report/benchmarking.js";
// filter: (val) => factoryList[val], import moment from "moment";
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,
},
];
export default { export default {
name: "SCPerCapitaBM", name: "SCPerCapitaBM",
data() { data() {
return { 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: { listQuery: {
current: 1, current: 1,
size: 1000, size: 100,
}, },
tableData: [ 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" },
],
chartHeight: this.tableHeight(269) / 2, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(269) / 2, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, { id: 1, name: "", type: 2, color: "#FFCE6A" },
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, { id: 2, name: "", type: 1, color: "#8EF0AB" },
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, { id: 3, name: "", type: 1, color: "#288AFF" },
], ],
chartMsg: { chartMsg: {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: [],
yName: "单位/片", yName: "单位:片/人",
series: [ series: [
{ {
name: "2024年4月目标值", name: "1",
// data: [3000, 2000, 3000], data: [],
// data: [6800, 5000, 8900],
// data: [12000, 17000, 19000],
data: [560000, 540000, 600000],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -130,28 +90,22 @@ export default {
}, },
}, },
{ {
name: "2023年4月", name: "2",
// data: [2100, 800, 1500], data: [],
// data: [9500, 7200, 9901],
// data: [14666, 15000, 17888],
data: [550000, 456666, 590000],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
show: true, show: true,
// position: [-5, -16], // position: [-5, -16],
// position: [-5, -16], // position: [-5, -16],
// position: [-10, -16], position: [-10, -16],
position: [-17, -16], // position: [-17, -16],
color: "#68C483", color: "#68C483",
}, },
}, },
{ {
name: "2024年4月", name: "3",
// data: [2100, 900, 1300], data: [],
// data: [9100, 7300, 9700],
// data: [14666, 15300, 18000],
data: [556666, 456666, 650000],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -188,6 +142,13 @@ export default {
this.chartHeight = this.tableHeight(269) / 2; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); 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() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -206,11 +167,146 @@ export default {
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.type = val.type;
console.log("========================="); this.listQuery.startDate = val.startDate;
this.listQuery.factory = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); this.tableProps = [];
componentAapPage({ ...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;
//
switch (this.listQuery.type) {
case 0:
this.chartMsg.series[1].label.position = [-5, -16];
break;
case 1:
this.chartMsg.series[1].label.position = [-5, -16];
break;
case 2:
this.chartMsg.series[1].label.position = [-10, -16];
break;
default:
this.chartMsg.series[1].label.position = [-17, -16];
}
// chartMsgseries
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(val[i].target || 0);
barData1.push(val[i].yoy || 0);
barData2.push(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",
},
},
{
name: "2",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
// position: [-5, -16],
// position: [-5, -16],
position: [-10, -16],
// position: [-17, -16],
color: "#68C483",
},
},
{
name: "3",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [0, -16],
color: "#288AFF",
},
},
],
};
},
handleExport(val) {
this.listQuery.type = val.type;
this.listQuery.startDate = val.startDate;
this.listQuery.factory = val.factory;
let fileName = "组件人均产量对标.xls";
componentAapExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };

View File

@ -4,7 +4,7 @@
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div> </div>
<div class="containerBottom"> <div class="containerBottom">
<div class="smallTitle">4标准组件良率</div> <div class="smallTitle">标准组件良率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -26,102 +26,61 @@
<script> <script>
import bmSearchBar from "../components/bmSearchBar.vue"; import bmSearchBar from "../components/bmSearchBar.vue";
import BmLineBar from "../components/bmLineBar.vue"; import BmLineBar from "../components/bmLineBar.vue";
const tableProps = [ import {
{ componentyieldRatePage,
prop: "factory", componentyieldRateExport,
label: "工厂名称", } from "@/api/report/benchmarking.js";
// filter: (val) => factoryList[val], import moment from "moment";
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,
},
];
export default { export default {
name: "SCYieldBM", name: "SCYieldBM",
data() { data() {
return { 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: { listQuery: {
current: 1, current: 1,
size: 1000, size: 100,
}, },
tableData: [ 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" },
],
chartHeight: this.tableHeight(269) / 2, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(269) / 2, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, { id: 1, name: "", type: 2, color: "#FFCE6A" },
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, { id: 2, name: "", type: 1, color: "#8EF0AB" },
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" }, { id: 3, name: "", type: 1, color: "#288AFF" },
], ],
chartMsg: { chartMsg: {
color: ["#FFCE6A", "#8EF0AB", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"], xData: [],
yName: "单位/%", yName: "单位/%",
series: [ series: [
{ {
name: "2024年4月目标值", name: "1",
data: [ data: [],
{ name: "%", value: 85 },
{ name: "%", value: 85 },
{ name: "%", value: 85 },
],
type: "line", type: "line",
symbol: "circle", symbol: "circle",
symbolSize: 6, symbolSize: 6,
@ -134,12 +93,8 @@ export default {
}, },
}, },
{ {
name: "2023年4月", name: "2",
data: [ data: [],
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -152,12 +107,8 @@ export default {
}, },
}, },
{ {
name: "2024年4月", name: "3",
data: [ data: [],
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -197,6 +148,13 @@ export default {
this.chartHeight = this.tableHeight(269) / 2; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); 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() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -215,11 +173,144 @@ export default {
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.type = val.type;
console.log("========================="); this.listQuery.startDate = val.startDate;
this.listQuery.factory = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); this.tableProps = [];
componentyieldRatePage({ ...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;
// chartMsgseries
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";
componentyieldRateExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };

View File

@ -4,7 +4,7 @@
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div> </div>
<div class="containerBottom"> <div class="containerBottom">
<div class="smallTitle">4标准组件转化效率</div> <div class="smallTitle">标准组件转化效率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -26,109 +26,62 @@
<script> <script>
import bmSearchBar from "../components/bmSearchBar.vue"; import bmSearchBar from "../components/bmSearchBar.vue";
import BmLineBar from "../components/bmLineBar.vue"; import BmLineBar from "../components/bmLineBar.vue";
const tableProps = [ import {
{ componentconvertrateCPage,
prop: "factory", componentconvertrateCExport,
label: "工厂名称", } from "@/api/report/benchmarking.js";
// filter: (val) => factoryList[val], import moment from "moment";
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,
},
{
prop: "mubiao2",
label: "年目标值",
minWidth: 150,
showOverflowtooltip: true,
},
];
export default { export default {
name: "TurnoverRateBM", name: "TurnoverRateBM",
data() { data() {
return { 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: { listQuery: {
current: 1, current: 1,
size: 1000, size: 100,
}, },
tableData: [ 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" },
],
chartHeight: this.tableHeight(269) / 2, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(269) / 2, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月", type: 1, color: "#8EF0AB" }, { id: 1, name: "", type: 1, color: "#8EF0AB" },
{ id: 2, name: "2023年4月", type: 1, color: "#63BDFF" }, { id: 2, name: "", type: 1, color: "#63BDFF" },
{ id: 3, name: "2024年4月目标值", type: 1, color: "#288AFF" }, { id: 3, name: "", type: 1, color: "#288AFF" },
{ id: 4, name: "2024年目标值", type: 1, color: "#7164FF" }, { id: 4, name: "", type: 1, color: "#7164FF" },
], ],
chartMsg: { chartMsg: {
color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"], color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"],
xData: ["成都", "邯郸", "瑞昌"], xData: [],
yName: "单位/%", yName: "单位/%",
series: [ series: [
{ {
name: "2023年4月", name: "1",
data: [ data: [],
{ name: "%", value: 12.64444444 },
{ name: "%", value: 12.29 },
{ name: "%", value: 12.33 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
barGap: 0.5, barGap: 0.5,
@ -143,12 +96,8 @@ export default {
}, },
}, },
{ {
name: "2024年4月", name: "2",
data: [ data: [],
{ name: "%", value: 14.92 },
{ name: "%", value: 15.31 },
{ name: "%", value: 15.36 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -162,12 +111,8 @@ export default {
}, },
}, },
{ {
name: "2024年4月目标值", name: "3",
data: [ data: [],
{ name: "%", value: 15.36 },
{ name: "%", value: 15.52 },
{ name: "%", value: 15.63 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -181,12 +126,8 @@ export default {
}, },
}, },
{ {
name: "2024年目标值", name: "4",
data: [ data: [],
{ name: "%", value: 15.63 },
{ name: "%", value: 15.69 },
{ name: "%", value: 15.78 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -227,6 +168,13 @@ export default {
this.chartHeight = this.tableHeight(269) / 2; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); 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() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -245,11 +193,259 @@ export default {
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.type = val.type;
console.log("========================="); this.listQuery.startDate = val.startDate;
this.listQuery.factory = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); this.tableProps = [];
componentconvertrateCPage({ ...this.listQuery }).then((res) => {
if (res.data && res.data.records.length > 0) {
let msg = res.data.records[0];
let arr1 = [
{
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,
},
];
let arr2 = [
{
prop: "yearTarget",
label: msg.yearTargetColumn,
filter: (val) => (val || val === 0 ? val : "-"),
minWidth: 150,
},
];
// chartseries
this.chartMsg.series = [
{
name: "1",
data: [],
type: "bar",
barWidth: 20,
barGap: 0.5,
label: {
show: true,
position: "top",
color: "#68C483",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
{
name: "2",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#63BDFF",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
{
name: "3",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#288AFF",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
{
name: "4",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#7164FF",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
];
//
if (this.listQuery.type === 2) {
this.tableProps = this.tableProps1.concat(arr1, arr2);
this.legendList = [
{ id: 1, name: "", type: 1, color: "#8EF0AB" },
{ id: 2, name: "", type: 1, color: "#63BDFF" },
{ id: 3, name: "", type: 1, color: "#288AFF" },
{ id: 4, name: "", type: 1, color: "#7164FF" },
];
this.legendList[3].name = msg.yearTargetColumn;
this.chartMsg.series[3].name = msg.yearTargetColumn;
} else {
this.tableProps = this.tableProps1.concat(arr1);
this.legendList = [
{ id: 1, name: "", type: 1, color: "#8EF0AB" },
{ id: 2, name: "", type: 1, color: "#63BDFF" },
{ id: 3, name: "", type: 1, color: "#288AFF" },
];
}
this.tableData = res.data.records;
//
this.legendList[0].name = msg.yoyColumn;
this.legendList[1].name = msg.queryColumn;
this.legendList[2].name = msg.targetColumn;
this.chartMsg.series[0].name = msg.yoyColumn;
this.chartMsg.series[1].name = msg.queryColumn;
this.chartMsg.series[2].name = msg.targetColumn;
// chartMsgseries
this.setChartMsg(res.data.records);
} else {
//
this.resetMsg();
}
});
},
setChartMsg(val) {
let xData = [];
let barData1 = [];
let barData2 = [];
let barData3 = [];
let barData4 = [];
for (let i = 0; i < val.length; i++) {
this.factoryList.map((item) => {
if (item.id === val[i].factory) {
xData.push(item.name);
}
});
barData1.push({ name: "%", value: val[i].yoy || 0 });
barData2.push({
name: "%",
value: val[i].queryValue || 0,
});
barData3.push({ name: "%", value: val[i].target || 0 });
barData4.push({
name: "%",
value: val[i].yearTarget || 0,
});
}
this.chartMsg.xData = xData;
this.chartMsg.series[0].data = barData1;
this.chartMsg.series[1].data = barData2;
this.chartMsg.series[2].data = barData3;
this.chartMsg.series[3].data = barData4;
if (this.listQuery.type !== 2) {
this.chartMsg.series.pop();
}
this.chartMsg.xData = xData;
},
resetMsg() {
this.tableProps = this.tableProps1;
this.tableData = [];
this.chartMsg = {
color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"],
xData: [],
yName: "单位/%",
series: [
{
name: "1",
data: [],
type: "bar",
barWidth: 20,
barGap: 0.5,
label: {
show: true,
position: "top",
color: "#68C483",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
{
name: "2",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#63BDFF",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
{
name: "3",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#288AFF",
fontSize: 9,
formatter: function (params) {
return params.value.toFixed(2) + "%";
},
},
},
{
name: "4",
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#7164FF",
fontSize: 9,
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";
componentconvertrateCExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };