Compare commits

...

13 Commits

Author SHA1 Message Date
helloDy
2368916e62 merge 2024-06-19 16:06:12 +08:00
helloDy
2d5bd161f3 生产数据管理 2024-06-19 16:04:42 +08:00
ff424ca1b6 Merge pull request '对接报表' (#49) from projects/mescc/zjl into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #49
2024-06-19 16:01:50 +08:00
9de0dfc639 对接报表 2024-06-19 16:01:13 +08:00
fc0a97a9c6 Merge pull request 'projects/mescc/zjl' (#48) from projects/mescc/zjl into projects/mescc/develop
Some checks are pending
continuous-integration/drone/push Build is pending
Reviewed-on: #48
2024-06-19 08:50:56 +08:00
45538e80c4 mt 2024-06-19 08:50:24 +08:00
be75dd0702 报表2页面 2024-06-19 08:48:48 +08:00
6233ca4dca Merge pull request 'projects/mescc/zhp' (#47) from projects/mescc/zhp into projects/mescc/develop
Some checks are pending
continuous-integration/drone/push Build is pending
Reviewed-on: #47
2024-06-18 16:03:14 +08:00
‘937886381’
41d554f897 修改bug 2024-06-18 15:55:48 +08:00
‘937886381’
d95853dec2 Merge branch 'projects/mescc/develop' into projects/mescc/zhp 2024-06-18 10:25:39 +08:00
‘937886381’
eacf93e0db 修改bug 2024-06-18 10:25:13 +08:00
1e941180b0 Merge pull request 'projects/mescc/dy' (#46) from projects/mescc/dy into projects/mescc/develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #46
2024-06-18 08:49:31 +08:00
89b71d5aa2 报表样式2.0 2024-06-17 13:40:30 +08:00
35 changed files with 2871 additions and 1272 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-17 09:01:32 # @LastEditTime: 2024-06-19 16:05:46
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###
@ -14,6 +14,10 @@ VUE_APP_TITLE = 发电玻璃智能管控平台
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://192.168.1.70:30307' # 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.81:48080'
# 徐
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
# 郭 # 郭
# VUE_APP_BASE_API = 'http://192.168.1.61:48080' # VUE_APP_BASE_API = 'http://192.168.1.61:48080'
# sara # sara

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 08:54:59 * @Date: 2024-05-07 08:54:59
* @LastEditTime: 2024-06-03 08:52:02 * @LastEditTime: 2024-06-19 15:22:10
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -10,23 +10,33 @@ import request from '@/utils/request'
// 查询生产数据管理分页 // 查询生产数据管理分页
export function getProduceDataPage(data) { export function getProduceDataPage(data) {
return request({ return request({
url: 'ip/prod-output/prodOutputDataPage', url: '/ip/proddata/page',
method: 'post', method: 'post',
data: data data: data
}) })
} }
export function getProduceDataDetail(id){ // 查询图数据
export function getproddata(data) {
return request({ return request({
url: '/ip/prod-output/get?id=' + id, url: '/ip/proddata/list',
method: 'get' method: 'post',
data: data
})
}
export function getProduceDataDetail(data){
return request({
url: '/ip/proddata/get',
method: 'post',
data: data
}) })
} }
// 导出生产数据 // 导出生产数据
export function exportOutPutExcel(data) { export function exportOutPutExcel(data) {
return request({ return request({
url: '/ip/prod-output/output-export-excel', url: '/ip/proddata/export-excel',
method: 'post', method: 'post',
data: data, data: data,
responseType: 'blob' responseType: 'blob'

View File

@ -0,0 +1,127 @@
// 对标报表的接口
import request from '@/utils/request'
// 产量对标FTO
export function fTOReportByDateRangePage(data) {
return request({
url: '/ip/prod-output/queryOBFTOReportByDateRange',
method: 'post',
data: data
})
}
// 产量对标FTO导出
export function fTOReportByDateRangeExport(data) {
return request({
url: '/ip/prod-output/queryOBFTOReportByDateRangeExcel',
method: 'post',
responseType: 'blob',
data: data
})
}
// 芯片产量对标
export function cPReportByDateRangePage(data) {
return request({
url: '/ip/prod-output/queryCPReportByDateRange',
method: 'post',
data: data
})
}
// 芯片产量对标导出
export function cPReportByDateRangeExport(data) {
return request({
url: '/ip/prod-output/queryCPReportByDateRangeExport',
method: 'post',
responseType: 'blob',
data: data
})
}
// 标准组件产量对标
export function sCPReportByDateRangePage(data) {
return request({
url: '/ip/prod-output/querySCPReportByDateRange',
method: 'post',
data: data
})
}
// 标准组件产量对标导出
export function sCPReportByDateRangeExport(data) {
return request({
url: '/ip/prod-output/querySCPReportByDateRangeExport',
method: 'post',
responseType: 'blob',
data: data
})
}
// 稼动率对标
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
})
}
// 封装OEE对标
export function componentOEEPage(data) {
return request({
url: '/ip/component-oee/page',
method: 'post',
data: data
})
}
// 封装OEE对标导出
export function componentOEEExport(data) {
return request({
url: '/ip/component-oee/export',
method: 'post',
responseType: 'blob',
data: data
})
}
// 芯片人均产量
export function chipAnnualAverageProductionPage(data) {
return request({
url: '/ip/chip-annual-average-production/page',
method: 'post',
data: data
})
}
// 芯片人均产量导出
export function chipAnnualAverageProductionExport(data) {
return request({
url: '/ip/chip-annual-average-production/export',
method: 'post',
responseType: 'blob',
data: data
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-06-17 09:41:03 * @Date: 2024-06-17 09:41:03
* @LastEditTime: 2024-06-17 09:54:26 * @LastEditTime: 2024-06-18 13:47:36
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -13,3 +13,11 @@ export function getComprehensiveDataPage(data) {
params: data params: data
}) })
} }
export function getProduceTransData(data) {
return request({
url: 'ip/prod-output/queryYCEReportByDateRange',
method: 'post',
data: data
})
}

View File

@ -232,6 +232,8 @@ aside {
background-color: #d9d9d9; background-color: #d9d9d9;
} }
// 大屏滚动表格
.no-data-bg { .no-data-bg {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
@ -252,3 +254,13 @@ aside {
letter-spacing: 1px; letter-spacing: 1px;
} }
} }
.dv-scroll-board .rows .ceil,
.dv-scroll-board .header .header-item {
border-right: 1px solid rgba(13, 23, 40, 1);
}
.dv-scroll-board .rows .ceil:last-child,
.dv-scroll-board .header .header-item:last-child {
border-right: none;
}

View File

@ -407,7 +407,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
console.log('prodOutputFtoListRes',preFtoData); console.log('prodOutputFtoListRes',preFtoData);
// 初始数据 // 初始数据
const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init() const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init()
if (prodOutputFtoListRes) { if (prodOutputFtoListRes.length !== 0 ) {
for (const factory of prodOutputFtoListRes) { for (const factory of prodOutputFtoListRes) {
console.log(factory); console.log(factory);
const fId = getFactoryId(factory); const fId = getFactoryId(factory);
@ -433,7 +433,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
// } // }
} }
} }
if (preData && preData[0] != null) { if (preData) {
for (const factory of preData) { for (const factory of preData) {
const fId = getPreFactoryId(factory); const fId = getPreFactoryId(factory);
if (factory.previousGlassType === 0) { if (factory.previousGlassType === 0) {
@ -452,7 +452,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
} }
} }
// console.log('ftoInvest',ftoInvest) // console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) { if (factoryListResponse) {
for (const factory of factoryListResponse) { for (const factory of factoryListResponse) {
const fId = getFactoryId(factory); const fId = getFactoryId(factory);
console.log('factory.inputNumber', factory, fId); console.log('factory.inputNumber', factory, fId);

View File

@ -163,4 +163,4 @@ textarea {
.el-upload__tip { .el-upload__tip {
line-height: 1.2; line-height: 1.2;
} }

View File

@ -143,6 +143,8 @@ export const tyjxfactoryList =[
// 暂时只有瑞昌邯郸数据 // 暂时只有瑞昌邯郸数据
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司'] export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司']
export const factoryListabbr =['瑞昌', '邯郸']
export const factoryArray =[ export const factoryArray =[
{ {
name: '瑞昌中建材光电材料有限公司', name: '瑞昌中建材光电材料有限公司',

View File

@ -107,7 +107,7 @@ export default {
gap: 8px; gap: 8px;
} }
.factory-header > .menu2 { .factory-header > .menu2 {
width: 26vw; width: 20vw;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;

View File

@ -8,7 +8,7 @@ export default ({
preName, preName,
}) => ({ }) => ({
grid: { grid: {
left: '0%', left: 300,
right: 0, right: 0,
bottom: 0, bottom: 0,
top: 0, top: 0,
@ -17,7 +17,7 @@ export default ({
tooltip: {}, tooltip: {},
title: { title: {
text: titleValue, text: titleValue,
left: "44%", left: "48%",
top: "37%", top: "37%",
textAlign: "center", textAlign: "center",
textStyle: { textStyle: {
@ -39,7 +39,7 @@ export default ({
type: "pie", type: "pie",
name: "当前良率", name: "当前良率",
radius: ["70%", "85%"], radius: ["70%", "85%"],
center: ["45%", "52%"], center: ["50%", "52%"],
emptyCircleStyle: { emptyCircleStyle: {
color: "#003982", color: "#003982",
}, },
@ -48,7 +48,7 @@ export default ({
{ {
type: "pie", type: "pie",
radius: ["70%", "85%"], radius: ["70%", "85%"],
center: ["45%", "52%"], center: ["50%", "52%"],
avoidLabelOvervlap: false, avoidLabelOvervlap: false,
label: { label: {
show: false, show: false,
@ -97,7 +97,7 @@ export default ({
{ {
type: "pie", type: "pie",
radius: ["55%", "70%"], radius: ["55%", "70%"],
center: ["45%", "52%"], center: ["50%", "52%"],
avoidLabelOvervlap: false, avoidLabelOvervlap: false,
label: { label: {
show: false, show: false,

View File

@ -73,12 +73,25 @@ export default {
}, },
}, },
axisLabel: { axisLabel: {
// rotate:45, interval: 0,//
rotate:45,
color: "rgba(255, 255, 255, 0.7)", color: "rgba(255, 255, 255, 0.7)",
fontSize: 12, fontSize: 12,
// formatter: function (value) {
// console.log(value);
// return value;
// },
}, },
data: [], data: [],
}, },
// dataZoom: [
// {
// // show: true,
// start: 0,
// end: 50
// }
// ],
yAxis: { yAxis: {
type: "value", type: "value",
name: "单位/片", name: "单位/片",
@ -92,7 +105,7 @@ export default {
}, },
axisLabel: { axisLabel: {
color: "rgba(255, 255, 255, 0.7)", color: "rgba(255, 255, 255, 0.7)",
fontSize: 12, fontSize: 10,
}, },
axisLine: { axisLine: {
show: true, show: true,
@ -226,9 +239,9 @@ export default {
// this.actualOptions = actualOptions; // this.actualOptions = actualOptions;
// this.initOptions(actualOptions); // this.initOptions(actualOptions);
// }, // },
energyCockpits() { // energyCockpits() {
this.initChart(); // this.initChart();
}, // },
isOpen(val) { isOpen(val) {
this.canvasReset(); this.canvasReset();
}, },
@ -263,6 +276,9 @@ export default {
if (this.energyCockpits) { if (this.energyCockpits) {
this.energyCockpits.forEach(ele => { this.energyCockpits.forEach(ele => {
this.data.push(ele.targetProduction) this.data.push(ele.targetProduction)
if (ele.workOrderNumber.length > 4) {
ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + "..";
}
this.orderXAxis.push(ele.workOrderNumber) this.orderXAxis.push(ele.workOrderNumber)
}); });
} }
@ -273,6 +289,9 @@ export default {
if (this.energyCockpits) { if (this.energyCockpits) {
this.energyCockpits.forEach(ele => { this.energyCockpits.forEach(ele => {
this.data.push(ele.plannedInvestment) this.data.push(ele.plannedInvestment)
if (ele.workOrderNumber.length > 4) {
ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + "..";
}
this.orderXAxis.push(ele.workOrderNumber) this.orderXAxis.push(ele.workOrderNumber)
}); });
} }
@ -282,6 +301,9 @@ export default {
if (this.energyCockpits) { if (this.energyCockpits) {
this.energyCockpits.forEach(ele => { this.energyCockpits.forEach(ele => {
this.data.push(ele.actualInvestment) this.data.push(ele.actualInvestment)
if (ele.workOrderNumber.length > 4) {
ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + "..";
}
this.orderXAxis.push(ele.workOrderNumber) this.orderXAxis.push(ele.workOrderNumber)
}); });
} }
@ -291,6 +313,9 @@ export default {
if (this.energyCockpits) { if (this.energyCockpits) {
this.energyCockpits.forEach(ele => { this.energyCockpits.forEach(ele => {
this.data.push(ele.actualProduction) this.data.push(ele.actualProduction)
if (ele.workOrderNumber.length > 4) {
ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + "..";
}
this.orderXAxis.push(ele.workOrderNumber) this.orderXAxis.push(ele.workOrderNumber)
}); });
} }
@ -300,6 +325,9 @@ export default {
if (this.energyCockpits) { if (this.energyCockpits) {
this.energyCockpits.forEach(ele => { this.energyCockpits.forEach(ele => {
this.data.push(ele.wasteNum) this.data.push(ele.wasteNum)
if (ele.workOrderNumber.length > 4) {
ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + "..";
}
this.orderXAxis.push(ele.workOrderNumber) this.orderXAxis.push(ele.workOrderNumber)
}); });
} }
@ -310,6 +338,9 @@ export default {
this.energyCockpits.forEach(ele => { this.energyCockpits.forEach(ele => {
console.log(ele.reworkNum); console.log(ele.reworkNum);
this.data.push(ele.reworkNum) this.data.push(ele.reworkNum)
if (ele.workOrderNumber.length > 4) {
ele.workOrderNumber = ele.workOrderNumber.substring(0, 4) + "..";
}
this.orderXAxis.push(ele.workOrderNumber) this.orderXAxis.push(ele.workOrderNumber)
}); });
} }

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-29 14:48:06 * @Date: 2024-05-29 14:48:06
* @LastEditTime: 2024-06-17 16:40:15 * @LastEditTime: 2024-06-18 14:49:25
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -173,8 +173,11 @@ function getTemplate(period, dataList, than) {
// console.log('dataList',dataList); // console.log('dataList',dataList);
let items = []; let items = [];
var day1 = new Date(); var day1 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); var day2 = new Date();
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000)
day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000)
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -187,11 +190,11 @@ function getTemplate(period, dataList, than) {
if (period === 1 && than === '同比') { if (period === 1 && than === '同比') {
items = [ items = [
{ {
name: `${year-1}${month}${today}`, name: `${year - 1}${yesterday}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
@ -199,11 +202,11 @@ function getTemplate(period, dataList, than) {
} else if (period ===1 && than === '环比') { } else if (period ===1 && than === '环比') {
items = [ items = [
{ {
name: `${yesterday}`, name: `${dayBeYes}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="order-container"> <div class="order-container">
<div class="table"> <div class="table">
<dv-scroll-board v-if="showTable" :config="config" style="width: 100%; height: 100%" ref="orderScrollBoard" /> <dv-scroll-board v-if="showTable" :config="config" style="width: 100%; height: 100%; color: rgba(255, 255, 255, .6);" ref="orderScrollBoard" />
</div> </div>
<div class="chart"> <div class="chart">
<div class="chart-title"> <div class="chart-title">
@ -42,7 +42,7 @@ export default {
rowNum: 12, rowNum: 12,
waitTime: 3000, waitTime: 3000,
columnWidth: [150], columnWidth: [150],
align: ["center"], align: ["left"],
carousel: "page", carousel: "page",
}, },
}; };
@ -101,51 +101,37 @@ export default {
arr.push( arr.push(
`<span title=${this.prodOrder[i].workOrderNumber || ""}>${ `<span title=${this.prodOrder[i].workOrderNumber || ""}>${
this.prodOrder[i].workOrderNumber || "" this.prodOrder[i].workOrderNumber || ""
}</span>` }</span>`,
); `<span title=${this.prodOrder[i].orderStatus || ""}>${this.prodOrder[i].orderStatus === 1 ? '未开始' : this.prodOrder[i].orderStatus === 2 ? '进行中' : '已完成' || ""
arr.push( }</span>`,
`<span title=${this.prodOrder[i].orderStatus || ""}>${ `<span title=${this.prodOrder[i].plannedInvestment || ""}>${this.prodOrder[i].plannedInvestment || ""
this.prodOrder[i].orderStatus === 1 ? '未开始' : this.prodOrder[i].orderStatus === 2 ? '进行中' : '已完成' || "" }</span>`,
}</span>` `<span title=${this.prodOrder[i].actualInvestment || ""}>${this.prodOrder[i].actualInvestment || ""
); }</span>`,
arr.push( `<span title=${this.prodOrder[i].targetProduction || ""}>${this.prodOrder[i].targetProduction || ""
`<span title=${this.prodOrder[i].plannedInvestment || ""}>${ }</span>`,
this.prodOrder[i].plannedInvestment || "" `<span title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || ""
}</span>` }</span>`,
); `<span style="display:inline-block;width:45px;">${this.prodOrder[i].productionProgress
arr.push( ? this.prodOrder[i].productionProgress.toFixed(0) + "%"
`<span title=${this.prodOrder[i].actualInvestment || ""}>${this.prodOrder[i].actualInvestment || "" : "0%"
}</span>` }</span>
);
arr.push(
`<span title=${this.prodOrder[i].targetProduction || ""}>${this.prodOrder[i].targetProduction || ""
}</span>`
);
arr.push(
`<span title=${this.prodOrder[i].actualProduction || ""}>${this.prodOrder[i].actualProduction || ""
}</span>`
);
arr.push(`<span style="display:inline-block;width:45px;">${
this.prodOrder[i].productionProgress
? this.prodOrder[i].productionProgress.toFixed(0) + "%"
: "0%"
}</span>
<div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;"> <div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;">
<svg xmlns="http://www.w3.org/200/svg" height="20" width="20"> <svg xmlns="http://www.w3.org/200/svg" height="20" width="20">
<circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/> <circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/>
<circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${ <circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${this.prodOrder[i].productionProgress
this.prodOrder[i].productionProgress ? this.prodOrder[i].productionProgress.toFixed(0) *
? this.prodOrder[i].productionProgress.toFixed(0) * 37.68 *
37.68 * 0.01 +
0.01 + "," +
"," + (1 -
(1 - this.prodOrder[i].productionProgress.toFixed(0) * 0.01) *
this.prodOrder[i].productionProgress.toFixed(0) * 0.01) * 37.68
37.68 : 0 + "," + 37.68
: 0 + "," + 37.68
}"/> }"/>
</svg> </svg>
</div>`); </div>`
)
outArr.push(arr); outArr.push(arr);
} }
this.config.data = outArr; this.config.data = outArr;

View File

@ -1,12 +1,12 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-06-07 10:28:51 * @LastEditTime: 2024-06-18 14:41:07
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer class="drawer" :visible.sync="visible" size="60%" @closed="$emit('destroy')"> <el-drawer class="drawer" :visible.sync="visible" size="65%" @closed="$emit('destroy')">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ '碲化镉工厂生产数据详情' }} {{ '碲化镉工厂生产数据详情' }}
</small-title> </small-title>
@ -14,142 +14,150 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<p class="title">工厂名称</p> <p class="title">工厂名称</p>
<p class="text">{{ dataForm.factory }}</p> <p class="text">{{ factoryList[dataForm.factory] }}</p>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<p class="title">时间维度</p> <p class="title">时间维度</p>
<p class="text">{{ date }}</p> <p class="text">{{ ['日', '周', '月', '年'][date] }}</p>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<p class="title">时间</p> <p class="title">时间</p>
<p class="text">{{ dataForm.reportDate?.length > 0 ? dataForm.reportDate[0] + '年' + dataForm.reportDate[1] + '月' + dataForm.reportDate[2] + '日' : '' }}</p> <p class="text">{{ dataForm.datestr }}</p>
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> <div v-if="glass === 0">
{{ '芯片' }} <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
</small-title> {{ '芯片' }}
<el-row :gutter="24"> </small-title>
<el-col :span="6"> <el-row :gutter="24">
<p class="title">芯片产量()</p> <el-col :span="6">
<p class="text">{{ }}</p> <p class="title">芯片产量()</p>
</el-col> <p class="text">{{ dataForm.chipYieldSum }}</p>
<el-col :span="6"> </el-col>
<p class="title">芯片良率(%)</p> <el-col :span="6">
<p class="text">{{ dataForm.yieldRate }}</p> <p class="title">芯片良率(%)</p>
</el-col> <p class="text">{{ dataForm.chipYieldRate }}</p>
<el-col :span="6"> </el-col>
<p class="title">芯片BOM</p> <el-col :span="6">
<p class="text">{{ dataForm.bom }}</p> <p class="title">芯片BOM</p>
</el-col> <p class="text">{{ dataForm.chipBom }}</p>
<el-col :span="6"> </el-col>
<p class="title">芯片总功率(MW)</p> <el-col :span="6">
<p class="text">{{ dataForm.totalPower }}</p> <p class="title">芯片总功率(MW)</p>
</el-col> <p class="text">{{ dataForm.chipTotalPower }}</p>
</el-row> </el-col>
<el-row :gutter="24"> </el-row>
<el-col :span="6"> <el-row :gutter="24">
<p class="title">FTO投入量()</p> <el-col :span="6">
<p class="text">{{ dataForm.chipInput }}</p> <p class="title">FTO投入量()</p>
</el-col> <p class="text">{{ dataForm.ftoInput }}</p>
<el-col :span="6"> </el-col>
<p class="title">CSS稼动率(%)</p> <el-col :span="6">
<p class="text">{{ dataForm.marriageRate }}</p> <p class="title">CSS稼动率(%)</p>
</el-col> <p class="text">{{ dataForm.chipCssMarriageRate }}</p>
<el-col :span="6"> </el-col>
<p class="title">芯片段OEE</p> <el-col :span="6">
<p class="text">{{ dataForm.oee }}</p> <p class="title">芯片段OEE</p>
</el-col> <p class="text">{{ dataForm.chipOee }}</p>
<el-col :span="6"> </el-col>
<p class="title">芯片平均功率(W)</p> <el-col :span="6">
<p class="text">{{ dataForm.averagePower }}</p> <p class="title">芯片平均功率(W)</p>
</el-col> <p class="text">{{ dataForm.chipAveragePower }}</p>
</el-row> </el-col>
<el-row :gutter="24"> </el-row>
<el-col :span="6"> <el-row :gutter="24">
<p class="title">芯片人均产量(/)</p> <el-col :span="6">
<p class="text">{{ dataForm.annualAverageProduction }}</p> <p class="title">芯片人均产量(/)</p>
</el-col> <p class="text">{{ dataForm.chipAnnualAverageProduction }}</p>
<el-col :span="6"> </el-col>
<p class="title">芯片产能利用率(%)</p> <el-col :span="6">
<p class="text">{{ dataForm.capacityUtilizationRate }}</p> <p class="title">芯片产能利用率(%)</p>
</el-col> <p class="text">{{ dataForm.chipCapacityUtilizationRate }}</p>
</el-row> </el-col>
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> </el-row>
{{ '标准组件' }} </div>
</small-title> <div v-if="glass === 1">
<el-row :gutter="24"> <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
<el-col :span="6"> {{ '标准组件' }}
<p class="title">封装BOM</p> </small-title>
<!-- 没参数 --> <el-row :gutter="24">
<!-- <p class="text">{{ dataForm.bom }}</p> --> <el-col :span="6">
</el-col> <p class="title">封装BOM</p>
<el-col :span="6"> <p class="text">{{ dataForm.componentBom }}</p>
<p class="title">封装线OEE(%)</p> </el-col>
<!-- <p class="text">{{ dataForm.code }}</p> --> <el-col :span="6">
</el-col> <p class="title">封装线OEE(%)</p>
<el-col :span="6"> <p class="text">{{ dataForm.componentOee }}</p>
<p class="title">标准组件良率(%)</p> </el-col>
<!-- <p class="text">{{ dataForm.productName }}</p> --> <el-col :span="6">
</el-col> <p class="title">标准组件良率(%)</p>
<el-col :span="6"> <p class="text">{{ dataForm.componentYieldRate }}</p>
<p class="title">标准组件产量()</p> </el-col>
<!-- <p class="text">{{ dataForm.productName }}</p> --> <el-col :span="6">
</el-col> <p class="title">标准组件产量()</p>
</el-row> <p class="text">{{ dataForm.componentYield }}</p>
<el-row :gutter="24"> </el-col>
<el-col :span="6"> </el-row>
<p class="title">标准组件总功率(MW)</p> <el-row :gutter="24">
<p class="text">{{ }}</p> <el-col :span="6">
</el-col> <p class="title">标准组件总功率(MW)</p>
<el-col :span="6"> <p class="text">{{ dataForm.componentTotalPower }}</p>
<p class="title">封装产能利用率(%)</p> </el-col>
<!-- <p class="text">{{ dataForm.code }}</p> --> <el-col :span="6">
</el-col> <p class="title">封装产能利用率(%)</p>
<el-col :span="6"> <p class="text">{{ dataForm.componentCapacityUtilizationRate }}</p>
<p class="title">标准组件人均产量</p> </el-col>
<!-- <p class="text">{{ dataForm.productName }}</p> --> <el-col :span="6">
</el-col> <p class="title">标准组件人均产量(/)</p>
<el-col :span="6"> <p class="text">{{ dataForm.componentAnnualAverageProduction }}</p>
<p class="title">标准组件平均功率</p> </el-col>
<!-- <p class="text">{{ dataForm.productName }}</p> --> <el-col :span="6">
</el-col> <p class="title">标准组件平均功率(W)</p>
</el-row> <p class="text">{{ dataForm.componentAveragePower }}</p>
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false"> </el-col>
{{ 'BIPV产品' }} </el-row>
</small-title> </div>
<el-row :gutter="24"> <div v-if="glass === 2">
<el-col :span="6"> <small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
<p class="title">产品产量</p> {{ 'BIPV产品' }}
<p class="text">{{ }}</p> </small-title>
</el-col> <el-row :gutter="24">
<el-col :span="6"> <el-col :span="6">
<p class="title">人均产量</p> <p class="title">产品产量()</p>
<p class="text">{{ dataForm.code }}</p> <p class="text">{{ dataForm.bipvProductOutput }}</p>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<p class="title">芯片使用量</p> <p class="title">人均产量(/)</p>
<p class="text">{{ dataForm.productName }}</p> <p class="text">{{ dataForm.bipvAnnualAverageProduction }}</p>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<p class="title">芯片使用量</p> <p class="title">芯片使用量()</p>
<p class="text">{{ dataForm.productName }}</p> <p class="text">{{ dataForm.bipvChipUsage }}</p>
</el-col> </el-col>
</el-row> <el-col :span="6">
<el-row :gutter="24"> <p class="title">芯片利用率(%)</p>
<el-col :span="6"> <p class="text">{{ dataForm.bipvChipUtilizationRate }}</p>
<p class="title">内部材料成本</p> </el-col>
<p class="text">{{ }}</p> </el-row>
</el-col> <el-row :gutter="24">
<el-col :span="6"> <el-col :span="6">
<p class="title">内部材料成本</p> <p class="title">内部材料成本(/)</p>
<p class="text">{{ dataForm.code }}</p> <p class="text">{{ dataForm.bipvInsideMaterialCost }}</p>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<p class="title">内部材料成本</p> <p class="title">OEM及委外材料成本(/)</p>
<p class="text">{{ dataForm.productName }}</p> <p class="text">{{ dataForm.code }}</p>
</el-col> </el-col>
</el-row> <el-col :span="6">
<p class="title">综合材料成本(/)</p>
<p class="text">{{ dataForm.bipvComprehensiveMaterialCost }}</p>
</el-col>
</el-row>
</div>
<div v-if="glass === 4">
<!-- 铜铟镓硒待完成 -->
</div>
</div> </div>
</el-drawer> </el-drawer>
@ -157,24 +165,18 @@
<script> <script>
// import basicAdd from './basic-add'; // import basicAdd from './basic-add';
import { import { getProduceDataDetail } from "@/api/produceData";
getProduceDataDetail
} from "@/api/produceData";
// import { getList, } from "@/api/base/qualityScrapType"; // import { getList, } from "@/api/base/qualityScrapType";
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { factoryList } from "@/utils/constants";
export default { export default {
components: { components: {
SmallTitle, SmallTitle,
}, },
// mixins: [basicAdd],
props: {
date: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
factoryList,
urlOptions: { urlOptions: {
isGetCode: false, isGetCode: false,
// codeURL: getCode, // codeURL: getCode,
@ -198,6 +200,8 @@ export default {
} }
], ],
sectionList: [], sectionList: [],
glass: 0,
date: 0,
visible: false, visible: false,
dataForm: { dataForm: {
id: undefined, id: undefined,
@ -229,11 +233,16 @@ export default {
// this.getCurrentTime() // this.getCurrentTime()
}, },
methods: { methods: {
init(id) { init(id, type, glass) {
this.visible = true this.visible = true
console.log('打印', id) this.glass = glass
this.date = type
console.log('打印', id, glass)
if (id) { if (id) {
getProduceDataDetail(id).then(res => { getProduceDataDetail({
id: id,
type: type
}).then(res => {
this.dataForm = res.data this.dataForm = res.data
console.log('你好', res.data) console.log('你好', res.data)
}) })

View File

@ -1,26 +1,26 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-07 09:41:56 * @LastEditTime: 2024-06-19 15:47:17
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 31px)"> <div style="display: flex; flex-direction: column; min-height: calc(100vh - 200px - 31px)">
<div class="app-container" style="padding: 16px 24px 0;height: auto; flex-grow: 1;"> <div class="app-container" style="padding: 16px 24px 0; height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="date"> <el-form-item label="时间维度" prop="type">
<el-select size="small" clearable v-model="listQuery.date" placeholder="请选择"> <el-select size="small" clearable v-model="listQuery.type" placeholder="请选择">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 0 || listQuery.date === ''" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator="" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="datetimerange" range-separator=""
start-placeholder="开始日期" value-format="timestamp" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期"> start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
@ -28,26 +28,26 @@
<el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
<span v-if="listQuery.start && listQuery.end" style="margin-left: 10px"> <!-- <span v-if="listQuery.start && listQuery.end" style="margin-left: 10px">
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> </span> -->
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.type === 2" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" range-separator="" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-dd" range-separator=""
start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime"> start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.date === 3" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.type === 3" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year" <el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" type="year"
placeholder="开始时间"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
~ ~
<el-date-picker size="small" clearable v-model="listQuery.end" format="yyyy-MM-dd" value-format="timestamp" type="year" placeholder="结束时间" <el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" placeholder="结束时间"
@change="getYear"> @change="getYear">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="工厂名称" prop="factorys"> <el-form-item label="工厂名称" prop="factory">
<el-select size="small" clearable v-model="listQuery.factorys" placeholder="请选择工厂名称" multiple > <el-select size="small" clearable v-model="listQuery.factory" placeholder="请选择工厂名称" multiple >
<el-option v-for="item in factoryArray" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in factoryArray" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -58,8 +58,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="玻璃类型" prop="type"> <el-form-item label="玻璃类型" prop="glass">
<el-select size="small" clearable v-model="listQuery.type" multiple placeholder="请选择玻璃类型"> <el-select size="small" clearable v-model="listQuery.glass" multiple placeholder="请选择玻璃类型">
<el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -82,19 +82,19 @@
</div> </div>
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;"> <div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto; padding: 16px;">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" style="margin-bottom: 0" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" style="margin-bottom: 0" />
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="tableData"> :table-data="tableData" :max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right"
:method-list="tableBtn" @clickBtn="handleClick" /> :method-list="tableBtn" @clickBtn="handleClick" />
</base-table> </base-table>
<pagination <pagination
:limit.sync="listQuery.size" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.current" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getDataList" @pagination="getDataList"
/> />
</div> </div>
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" /> <add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" />
<!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <!-- <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
:type="listQuery.reportType" @refreshDataList="getDataList" /> --> :type="listQuery.reportType" @refreshDataList="getDataList" /> -->
<!-- <pagination <!-- <pagination
@ -106,8 +106,9 @@
</template> </template>
<script> <script>
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from "@/utils/ruoyi";
import { getProduceDataPage, prodOutputDataList, exportOutPutExcel } from '@/api/produceData'; import tableHeightMixin from "@/mixins/tableHeightMixin";
import { getProduceDataPage, getproddata, exportOutPutExcel } from '@/api/produceData';
// import inputTable from './inputTable.vue'; // import inputTable from './inputTable.vue';
import lineChart from './lineChart'; import lineChart from './lineChart';
import moment from 'moment' import moment from 'moment'
@ -118,22 +119,22 @@ import { factoryList, factoryArray, factoryArray1 } from "@/utils/constants";
export default { export default {
components: { lineChart, ButtonNav, AddOrUpdate }, components: { lineChart, ButtonNav, AddOrUpdate },
mixins: [basicPage], mixins: [basicPage, tableHeightMixin],
data() { data() {
return { return {
factoryList, factoryList,
factoryArray, factoryArray,
factoryArray1, factoryArray1,
listQuery: { listQuery: {
size: 20, pageSize: 20,
current: 1, pageNo: 1,
factorys: undefined, factory: undefined,
total: 0, total: 0,
date: 0, type: 0, //
type:undefined, glass: undefined, //
// reportType: 2, // reportType: 2,
beginTime: undefined, startDate: undefined,
endTime:undefined, endDate:undefined,
reportTime: [], reportTime: [],
start: undefined, start: undefined,
end: undefined end: undefined
@ -153,7 +154,7 @@ export default {
].filter((v) => v), ].filter((v) => v),
typeList: [ typeList: [
{ {
name: '芯片', name: '玻璃芯片',
id: 0, id: 0,
}, },
{ {
@ -164,6 +165,10 @@ export default {
name: 'BIPV产品', name: 'BIPV产品',
id: 2, id: 2,
}, },
// {
// name: '',
// id: 3,
// },
], ],
formConfig: [ formConfig: [
{ {
@ -197,16 +202,16 @@ export default {
], ],
tableProps: [ tableProps: [
{ {
prop: 'groupTime', prop: 'datestr',
label: '日期', label: '日期',
minWidth: 100, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'factory', prop: 'factory',
label: '工厂名称', label: '工厂名称',
filter: (val) => factoryList[val], filter: (val) => factoryList[val],
minWidth: 200, minWidth: 180,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
@ -215,19 +220,19 @@ export default {
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val] filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
}, },
{ {
prop: 'inputNumber', prop: 'inputNum',
label: '投入数量', label: '投入数量',
}, },
{ {
prop: 'outputNumber', prop: 'outputNum',
label: '产出数量', label: '产出数量',
}, },
{ {
prop: 'goodNumber', prop: 'goodNum',
label: '良品数量', label: '良品数量',
}, },
{ {
prop: 'yieldRate', prop: 'goodRatio',
label: '良品率%', label: '良品率%',
filter: (val) => (val * 100) + '%' filter: (val) => (val * 100) + '%'
}, },
@ -235,22 +240,23 @@ export default {
tableData: [], tableData: [],
lineData: [], lineData: [],
chart: null, chart: null,
seriesList: [] seriesList: [],
colorList: ['#2760FF', '#8167F6', '#5B9BFF', '#FFD160']
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
}, },
computed: { // computed: {
weekNum() { // weekNum() {
return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1 // return Math.round((this.listQuery.end - this.listQuery.start) / (24 * 60 * 60 * 1000 * 7)) + 1
}, // },
}, // },
created() { created() {
const today = new Date() const today = new Date()
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000)) const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
this.listQuery.beginTime = sevenDaysAgo.getTime() this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD')
this.listQuery.endTime = today.getTime() this.listQuery.endDate = moment(today).format('yyyy-MM-DD')
this.listQuery.reportTime = [this.listQuery.beginTime, this.listQuery.endTime] this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate]
}, },
mounted() { mounted() {
}, },
@ -259,7 +265,7 @@ export default {
this.detailOrUpdateVisible = true; this.detailOrUpdateVisible = true;
this.addOrEditTitle = "详情"; this.addOrEditTitle = "详情";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detailOrUpdate.init(val.data.id); this.$refs.detailOrUpdate.init(val.data.id, this.listQuery.type, val.data.glassType);
}); });
}, },
getYear(e) { getYear(e) {
@ -273,8 +279,12 @@ export default {
this.listQuery.end = undefined this.listQuery.end = undefined
// console.log(); // console.log();
} else { } else {
this.listQuery.beginTime = this.listQuery.start this.listQuery.startDate = this.listQuery.start
this.listQuery.endTime = this.listQuery.end this.listQuery.endDate = this.listQuery.end
}
if (!this.listQuery.start && !this.listQuery.end) {
this.listQuery.startDate = undefined
this.listQuery.endDate = undefined
} }
// console.log(e); // console.log(e);
}, },
@ -292,10 +302,14 @@ export default {
type: 'warning' type: 'warning'
}); });
} else { } else {
this.listQuery.beginTime = this.listQuery.start.getTime() - 24 * 60 * 60 * 1000 this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
this.listQuery.endTime = this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000 this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
} }
} }
if (!this.listQuery.start && !this.listQuery.end) {
this.listQuery.startDate = undefined
this.listQuery.endDate = undefined
}
}, },
changeDayTime() { changeDayTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
@ -310,10 +324,12 @@ export default {
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
} else { } else {
this.listQuery.beginTime = this.listQuery.reportTime[0] this.listQuery.startDate = this.listQuery.reportTime[0]
this.listQuery.endTime = this.listQuery.reportTime[1] this.listQuery.endDate = this.listQuery.reportTime[1]
} }
} else { } else {
this.listQuery.startDate = undefined
this.listQuery.endDate = undefined
} }
}, },
changeTime(value) { changeTime(value) {
@ -326,114 +342,115 @@ export default {
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
} else { } else {
this.listQuery.beginTime = this.listQuery.reportTime[0] this.listQuery.startDate = this.listQuery.reportTime[0]
this.listQuery.endTime = this.listQuery.reportTime[1] this.listQuery.endDate = this.listQuery.reportTime[1]
} }
} else { } else {
console.log(this.listQuery.reportTime[0]) this.listQuery.startDate = undefined
this.listQuery.endDate = undefined
} }
}, },
async getDataList() { async getDataList() {
const res = await getProduceDataPage(this.listQuery) await getProduceDataPage(this.listQuery).then(res => {
console.log(res) console.log(res)
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.records this.tableData = res.data.records
this.listQuery.total = res.data.total this.listQuery.total = res.data.total
// if (this.listQuery.total > 0) { }
// this.tableData.forEach(item => { })
// item.tableTime = item?.reportDate?.length > 0 ? item.reportDate[0] + '-' + item.reportDate[1] + '-' + item.reportDate[2] : '--'
// })
// }
}
// //
await prodOutputDataList({ await getproddata(this.listQuery).then(resp => {
current: 1, if (resp.data?.length > 0) {
size: 99, const chartData = Object.groupBy(resp.data, (member) => member.datestr)
beginTime: this.listQuery.beginTime, this.buildChart(chartData, resp.data)
endTime: this.listQuery.endTime, } else {
factorys: this.listQuery.factorys, this.$refs.lineChart.initChart([], [])
date: this.listQuery.date,
type: this.listQuery.type
}).then(resp => {
console.log('Aaa', resp.data)
this.lineData = resp?.data || []
if (this.lineData.length > 0) {
this.buildChart(this.lineData)
} }
}) })
// this.buildChart(this.tableData)
}, },
buildChart(list) { buildChart(data, dataList) {
let temp = []
let xAxisData = [] let xAxisData = []
list.forEach(item => { this.seriesList = []
temp.push(item.groupTime)
})
// x // x
xAxisData = Array.from(new Set(temp)) xAxisData = Object.keys(data)
// y // y
for (const y of this.factoryArray1) { this.factoryArray.forEach(fac => {
for (const type of this.typeList) { let i = 0
const seriesItem = { while ( i < 3) {
name: y.name, //
record: type.name, const index1 = ['chipYield', 'componentYield', 'bipvProductOutput'][i]
type: 'bar', // let oneChart = {}
emphasis: { xAxisData.forEach((x, index) => {
focus: 'series' if (this.listQuery.glass.length === 0 || this.listQuery.glass.length === 3) {
}, let series = {
data: Array(xAxisData.length).fill(0) name: ['玻璃芯片', '标准组件', 'BIPV'][i] + '-' + fac.id,
} type: 'bar',
list.forEach(data => { stack: String(fac.id),
xAxisData.forEach((x, index) => { data: Array(xAxisData.length).fill(0),
if (x === data.groupTime && y.id === data.factory && type.id === data.glassType) { barWidth: 20,
seriesItem.data[index] = data.goodNumber itemStyle: {
color: this.colorList[i]
}
} }
}) dataList.forEach(item => {
if (fac.id === item.factory && item.datestr === x) {
series.data[index] = item[index1]
}
})
this.seriesList.push(series)
} else {
this.listQuery.glass.forEach(gl => {
if (gl === i) {
let series = {
name: ['玻璃芯片', '标准组件', 'BIPV'][i] + '-' + fac.id,
type: 'bar',
stack: String(fac.id),
data: Array(xAxisData.length).fill(0),
barWidth: 20,
itemStyle: {
color: this.colorList[i]
}
}
dataList.forEach(item => {
if (fac.id === item.factory && item.datestr === x) {
series.data[index] = item[index1]
}
})
this.seriesList.push(series)
}
})
}
// let series = {
// name: ['', '', 'BIPV'][i] + '-' + fac.id,
// type: 'bar',
// stack: String(fac.id),
// data: Array(xAxisData.length).fill(0),
// barWidth: 20,
// itemStyle: {
// color: this.colorList[i]
// }
// }
// dataList.forEach(item => {
// if (fac.id === item.factory && item.datestr === x) {
// series.data[index] = item[index1]
// }
// })
// this.seriesList.push(series)
}) })
this.seriesList.push(seriesItem) i ++
} }
} })
console.log('啊啊', this.seriesList) console.log('你好', this.seriesList)
this.$refs.lineChart.initChart(xAxisData, this.seriesList) this.$refs.lineChart.initChart(xAxisData, this.seriesList)
// const chartList = Object.groupBy(list, (item) => item.tableTime)
// this.xAxis = []
// this.seriesList = []
// for (const keyIndex in chartList) {
// // X
// this.xAxis.push(keyIndex)
// }
// // y
// for (const y of this.factoryArray) {
// // y: {name: , id: }
// const seriesItem = {
// name: y.name,
// type: 'bar',
// emphasis: {
// focus: 'series'
// },
// data: Array(this.xAxis.length).fill(0)
// }
// for (const a in chartList) {
// for (const z of chartList[a]) {
// this.xAxis.forEach((item, index) => {
// if (z.factory === y.id && a === item) {
// seriesItem.data[index] = z.goodNumber
// }
// })
// }
// }
// this.seriesList.push(seriesItem)
// }
// this.$refs.lineChart.initChart(this.xAxis, this.seriesList)
}, },
buttonClick(val) { buttonClick(val) {
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined; this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.current = 1; this.listQuery.pageNo = 1;
this.listQuery.size = 20; this.listQuery.pageSize = 20;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':
@ -448,8 +465,8 @@ export default {
this.$modal.confirm('是否确认导出生产数据?').then(() => { this.$modal.confirm('是否确认导出生产数据?').then(() => {
// //
let params = {...this.listQuery}; let params = {...this.listQuery};
params.current = 1; params.pageNo = 1;
params.size = 999; params.pageSize = 999;
this.exportLoading = true; this.exportLoading = true;
return exportOutPutExcel(params); return exportOutPutExcel(params);
}).then(response => { }).then(response => {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-01-21 14:43:06 * @Date: 2022-01-21 14:43:06
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-05-30 14:52:05 * @LastEditTime: 2024-06-19 15:13:23
* @Description: * @Description:
--> -->
<template> <template>
@ -16,6 +16,8 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import 'echarts/theme/macarons' // echarts theme import 'echarts/theme/macarons' // echarts theme
import resize from '@/mixins/resize' import resize from '@/mixins/resize'
import { factoryListabbr } from "@/utils/constants";
export default { export default {
name: 'OverviewBar', name: 'OverviewBar',
mixins: [resize], mixins: [resize],
@ -72,35 +74,68 @@ export default {
}, },
methods: { methods: {
initChart(xAxis, seriesList) { initChart(xAxis, seriesList) {
this.chart = echarts.init(document.getElementById(this.id)) console.log('2', xAxis, seriesList)
console.log(this.$parent); if (xAxis.length === 0) {
this.chart.setOption({ this.chart.clear()
}
else {
this.chart = echarts.init(document.getElementById(this.id))
console.log(this.$parent);
this.chart.setOption({
title: { title: {
text: '', text: '',
// subtext: 'Fake Data' // subtext: 'Fake Data'
}, },
tooltip: {
trigger: 'axis'
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
legend: { legend: {
// data: ['1', '2'],
right: '90px', right: '90px',
top: '0%', top: '0%',
icon: 'rect', icon: 'rect',
itemWidth: 10, itemWidth: 10,
itemHeight: 10, itemHeight: 10,
itemGap: 40, itemGap: 40,
formatter(name) {
return name.split('-')[0]
},
data: ['玻璃芯片-0', '标准组件-0', 'BIPV-0']
}, },
// toolbox: { tooltip: {
// show: true, trigger: 'axis',
// feature: { formatter: function(params) {
// dataView: { show: true, readOnly: false }, let result = `
// magicType: { show: true, type: ['line', 'bar'] }, <div style="width: 270px; display: flex">
// restore: { show: true }, <div style="width: 150px">${params[0].name}</div>
// saveAsImage: { show: true } <div style="width: 60px">${factoryListabbr[0]}</div>
// } <div style="width: 60px">${factoryListabbr[1]}</div>
// }, </div>`
const newArray = params.map(p => {
return {
glass: p.seriesName.split('-')[0], //
factoryName: factoryListabbr[p.seriesName.split('-')[1]], //
value: p.value,
name: p.name,
marker: p.marker
}
})
const analyzeList = Object.groupBy(newArray, (member) => member.glass)
for (let g in analyzeList) {
// date =>
let oneData = `<div style="width: 270px; display: flex">
<div style="width: 150px">${analyzeList[g][0].marker} ${g}</div>`
for (let fac of factoryListabbr) {
let goodNum = 0
for (let ana of analyzeList[g]) {
if (ana.factoryName === fac && ana.value !== 0) {
goodNum = ana.value
}
}
oneData += `<div style="width: 60px">${goodNum}</div>`
}
result = result + oneData + '</div>'
}
return result
}
},
grid: { top: 100, right: 90, bottom: 10, left: 10, containLabel: true },
calculable: true, calculable: true,
xAxis: [ xAxis: [
{ {
@ -123,12 +158,17 @@ export default {
}, },
series: seriesList series: seriesList
}, true) }, true)
}
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.chartTooltipSpan {
width: 50px;
background: #787878;
}
/* .reportChart { /* .reportChart {
position: absolute; position: absolute;
height: 100%; height: 100%;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片OEE</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片OEE对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ chipoeeComparePage,
prop: "factory", chipoeeCompareExport,
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: "ChipOEEBM", name: "ChipOEEBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: "",
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: "",
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: "",
data: [ data: [],
{ name: "%", value: 23.33 },
{ name: "%", value: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -193,10 +144,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; 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);
}, },
@ -208,32 +166,166 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "ChipOEEBM") { if (this.$route.name === "ChipOEEBM") {
this.chartNum++; this.chartNum++;
} }
}, },
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 = [];
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;
// 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 = "芯片OEE对标.xls";
chipoeeCompareExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片产量</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片产量对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ cPReportByDateRangePage,
prop: "factory", cPReportByDateRangeExport,
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: "ChipOutputBM", name: "ChipOutputBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: {
@ -184,10 +138,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
mounted() {
this.tableProp = this.tableProp1;
this.listQuery.date = 2;
this.listQuery.queryTime = moment().format("yyyy-MM-DD");
this.listQuery.factorys = [];
this.getList();
},
destroyed() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -199,32 +160,181 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "ChipOutputBM") { if (this.$route.name === "ChipOutputBM") {
this.chartNum++; this.chartNum++;
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.date = val.type;
console.log("========================="); this.listQuery.queryTime = val.startDate;
this.listQuery.factorys = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); this.tableProps = [];
cPReportByDateRangePage({ ...this.listQuery }).then((res) => {
if (res.data && res.data.length > 0) {
//
let msg = res.data[0];
let arr = [
{
prop: "lastone",
label: msg.lastone.reportTime,
minWidth: 150,
},
{
prop: "currentone",
label: msg.currentone.reportTime,
minWidth: 150,
},
{
prop: "targetone",
label: msg.targetone.reportTime,
minWidth: 150,
},
];
this.tableProps = this.tableProps1.concat(arr);
//
let tableArr = [];
res.data.forEach((item) => {
let obj = {};
obj.factory = item.factory;
obj.item = "FTO投入";
obj.unit = "片";
obj.lastone = item.lastone.total;
obj.currentone = item.currentone.total;
obj.targetone = item.targetone.total;
tableArr.push(obj);
});
this.tableData = tableArr;
//
this.legendList[0].name = msg.targetone.reportTime;
this.legendList[1].name = msg.lastone.reportTime;
this.legendList[2].name = msg.currentone.reportTime;
this.chartMsg.series[0].name = msg.targetone.reportTime;
this.chartMsg.series[1].name = msg.lastone.reportTime;
this.chartMsg.series[2].name = msg.currentone.reportTime;
//
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);
} 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].targetone.total || 0);
barData1.push(val[i].lastone.total || 0);
barData2.push(val[i].currentone.total || 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";
cPReportByDateRangeExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片人均产量</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片人均产量对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ chipAnnualAverageProductionPage,
prop: "factory", chipAnnualAverageProductionExport,
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: "ChipPerCapitaBM", name: "ChipPerCapitaBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: {
@ -184,10 +138,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; 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);
}, },
@ -199,32 +160,168 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "ChipPerCapitaBM") { if (this.$route.name === "ChipPerCapitaBM") {
this.chartNum++; this.chartNum++;
} }
}, },
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 = [];
chipAnnualAverageProductionPage({ ...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;
//
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";
chipAnnualAverageProductionExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">4月芯片良率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片良率对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -103,8 +103,8 @@ export default {
{ factory: "工厂1" }, { factory: "工厂1" },
{ factory: "工厂1" }, { factory: "工厂1" },
], ],
chartHeight: this.tableHeight(137) / 2 - 111, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(137) / 2 - 70, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
@ -193,8 +193,8 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
destroyed() { destroyed() {
@ -208,8 +208,8 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "ChipYieldBM") { if (this.$route.name === "ChipYieldBM") {
this.chartNum++; this.chartNum++;
} }
@ -226,14 +226,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -0,0 +1,157 @@
<template>
<div
:id="chartId"
:style="{ width: '100%', height: chartHeight + 'px' }"
></div>
</template>
<script>
import * as echarts from "echarts";
import { debounce } from "@/utils/debounce";
export default {
name: "BaseChart",
data() {
return {
myChart: "",
option: {
color: [],
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
grid: {
left: 70,
right: 10,
bottom: 30,
top: 30,
},
tooltip: {
trigger: "axis",
axisPointer: {
// type: "cross",
crossStyle: {
color: "rgba(237,237,237,0.5)",
},
},
formatter: function (params) {
var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
for (var i = 0, l = params.length; i < l; i++) {
res +=
"<br/>" +
`${
params[i].seriesType === "line"
? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />'
: `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>`
}` +
`<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${
params[i].name === "%"
? (params[i].value ? params[i].value.toFixed(2) : "0.00") +
params[i].name
: String(params[i].value).replace(
/\B(?=(\d{3})+(?!\d))/g,
","
)
}</span>`;
}
return res;
},
},
xAxis: {
type: "category",
data: [],
axisTick: {
show: false,
},
axisPointer: {
type: "shadow",
},
},
yAxis: {
type: "value",
name: "",
nameTextStyle: {
fontSize: 12,
align: "right",
},
axisLabel: {},
},
series: [],
},
};
},
props: {
chartHeight: {
type: Number,
default: 300,
},
legendList: {
type: Array,
default: () => [],
},
chartMsg: {
type: Object,
default: () => {},
},
chartId: {
type: String,
default: "bmChart",
},
chartNum: {
type: Number,
default: 1,
},
},
watch: {
chartHeight: {
handler(newVal) {
this.chartHeight = newVal;
},
},
chartNum(val) {
this.canvasReset();
},
chartMsg: {
handler(newVal) {
this.canvasReset();
},
deep: true,
},
},
mounted() {
this.canvasReset();
},
methods: {
canvasReset() {
debounce(() => {
this.getMes();
}, 500)();
},
getMes() {
if (this.myChart) {
this.myChart.dispose();
}
var chartDom = document.getElementById(this.chartId);
this.myChart = echarts.init(chartDom);
this.option.color = this.chartMsg.color;
this.option.xAxis.data = this.chartMsg.xData;
this.option.yAxis.name = this.chartMsg.yName;
if (
this.chartMsg.series.length > 0 &&
this.chartMsg.series[0].data[0].name === "%"
) {
this.option.yAxis.axisLabel = {
formatter: function (value) {
return value + ".00%";
},
};
} else {
this.option.yAxis.axisLabel = {
formatter: function (value) {
return value;
},
};
}
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
this.option.series = this.chartMsg.series;
this.myChart.setOption(this.option);
},
},
};
</script>

View File

@ -0,0 +1,112 @@
<!-- 只适用于指标完成情况对标 -->
<template>
<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 class="legend">
<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
class="line-block"
:style="{ backgroundColor: item.color }"
></span>
</span>
{{ item.name }}</span
>
</div>
</div>
<!-- -->
<base-chart
:chartHeight="chartHeight"
:legendList="legendList"
:chartMsg="chartMsg"
:chartId="chartId"
:chartNum="chartNum"
/>
</div>
</template>
<script>
import baseChart from "./baseChart.vue";
export default {
name: "bmBarComplete",
data() {
return;
},
props: {
chartHeight: {
type: Number,
default: 300,
},
legendList: {
type: Array,
default: () => [],
},
chartMsg: {
type: Object,
default: () => {},
},
chartId: {
type: String,
default: "bmChart",
},
chartNum: {
type: Number,
default: 1,
},
},
components: { baseChart },
};
</script>
<style lang="scss" scoped>
.legend {
position: absolute;
right: 10px;
top: 15px;
.item {
display: inline-block;
margin-right: 10px;
font-size: 14px;
color: #8c8c8c;
.block {
width: 10px;
height: 10px;
display: inline-block;
margin-right: 4px;
}
.line {
width: 10px;
height: 10px;
border-radius: 5px;
display: inline-block;
margin-right: 4px;
position: relative;
.line-block {
position: absolute;
width: 20px;
height: 2px;
left: -5px;
top: 4px;
}
}
}
}
</style>

View File

@ -0,0 +1,138 @@
<!-- 只使用于指标完成情况对标页面 -->
<template>
<el-form :model="form" :inline="true" ref="bmSearchBarForm" class="blueTip">
<el-form-item label="时间维度" prop="type">
<el-select
size="small"
v-model="form.type"
placeholder="请选择"
style="width: 100px"
>
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item v-show="form.type === 0" label="时间" prop="dayTime">
<el-date-picker
size="small"
clearable
v-model="form.dayTime"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width: 150px"
>
</el-date-picker>
</el-form-item>
<el-form-item v-show="form.type === 1" label="时间" prop="weekTime">
<el-date-picker
v-model="form.weekTime"
type="week"
format="yyyy-MM-dd"
placeholder="选择周"
value-format="yyyy-MM-dd"
style="width: 150px"
>
</el-date-picker>
</el-form-item>
<el-form-item v-show="form.type === 2" label="时间" prop="monthTime">
<el-date-picker
v-model="form.monthTime"
type="month"
placeholder="选择月份"
value-format="yyyy-MM-dd"
style="width: 150px"
>
</el-date-picker>
</el-form-item>
<el-form-item v-show="form.type === 3" label="时间" prop="yearTime">
<el-date-picker
v-model="form.yearTime"
type="year"
placeholder="选择年份"
value-format="yyyy-MM-dd"
style="width: 150px"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getDataList"
>查询</el-button
>
<el-divider direction="vertical"></el-divider>
<el-button type="primary" size="small" plain @click="handleExport"
>导出</el-button
>
</el-form-item>
</el-form>
</template>
<script>
import moment from "moment";
export default {
name: "bmSearchBarComplete",
data() {
return {
form: {
type: 2,
dayTime: moment().format("yyyy-MM-DD"),
weekTime: moment().format("yyyy-MM-DD"),
monthTime: moment().format("yyyy-MM-DD"),
yearTime: moment().format("yyyy-MM-DD"),
},
typeList: [
{ id: 0, name: "日" },
{ id: 1, name: "周" },
{ id: 2, name: "月" },
{ id: 3, name: "年" },
],
};
},
methods: {
getDataList() {
console.log(this.form);
let params = {};
switch (this.form.type) {
case 0:
params.startDate = this.form.dayTime;
break;
case 1:
params.startDate = this.form.weekTime;
break;
case 2:
params.startDate = this.form.monthTime;
break;
case 3:
params.startDate = this.form.yearTime;
break;
default:
break;
}
params.type = this.form.type;
this.$emit("getSearch", params);
},
handleExport() {
this.$emit("handleExport");
},
},
};
</script>
<style lang="scss" scoped>
.el-divider--vertical {
height: 24px;
}
.blueTip::before {
display: inline-block;
content: "";
width: 4px;
height: 18px;
background: #0b58ff;
border-radius: 1px;
margin-right: 8px;
margin-top: 8px;
}
</style>

View File

@ -0,0 +1,208 @@
<template>
<div>
<div class="containerTop">
<bm-search-bar-complete
@getSearch="getSearch"
@handleExport="handleExport"
/>
</div>
<div class="containerBottom">
<div class="smallTitle">凯盛玻璃控股指标完成情况</div>
<bm-bar-complete
:chartHeight="chartHeight"
:legendList="legendList"
:chartMsg="chartMsg"
:chartId="chartId"
:chartNum="chartNum"
/>
<base-table
:table-props="tableProps"
:page="listQuery.current"
:limit="listQuery.size"
:table-data="tableData"
:max-height="tableH"
/>
</div>
</div>
</template>
<script>
import BmSearchBarComplete from "./components/bmSearchBarComplete.vue";
import BmBarComplete from "./components/bmBarComplete.vue";
const tableProps = [
{
prop: "factory",
label: "指标名称",
// filter: (val) => factoryList[val],
},
{
prop: "unit",
label: "单位",
},
{
prop: "time1",
label: "时间1",
},
{
prop: "time2",
label: "时间2",
},
];
export default {
name: "CompletionStatusIntrBM",
data() {
return {
tableProps,
listQuery: {
current: 1,
size: 1000,
},
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,
tableH: this.tableHeight(269) / 2,
legendList: [
{ id: 1, name: "2023年4月", type: 1, color: "#288AFF33" },
{ id: 2, name: "2024年4月", type: 1, color: "#288AFF" },
],
chartMsg: {
color: ["#288AFF33", "#288AFF"],
xData: ["成都", "邯郸", "瑞昌"],
yName: "单位/MW",
series: [
{
name: "2023年4月",
data: [5505, 6578, 5500],
type: "bar",
barWidth: 20,
label: {
show: true,
position: "top",
color: "#2789FF",
},
},
{
name: "2024年4月",
data: [3503, 3456, 4500],
type: "bar",
barWidth: 20,
barGap: "-100%",
label: {
show: true,
position: "top",
color: "#288AFF",
},
},
],
},
chartId: "completionStatusIntrBMChart",
chartNum: 1,
};
},
components: {
BmBarComplete,
BmSearchBarComplete,
},
computed: {
isOpen() {
return this.$store.getters.sidebar.opened;
},
},
watch: {
//
isOpen(val) {
if (this.$route.name === "CompletionStatusIntrBM") {
this.chartNum++;
}
},
},
created() {
this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight);
},
destroyed() {
window.removeEventListener("resize", this._setTableHeight);
},
activated() {
//
if (this.$route.name === "CompletionStatusIntrBM") {
this.chartNum++;
}
},
methods: {
_setTableHeight() {
this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "CompletionStatusIntrBM") {
this.chartNum++;
}
},
getSearch(val) {
console.log(val);
console.log("=========================");
},
handleExport() {
console.log("导出");
},
},
};
</script>
<style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop,
.containerBottom {
position: relative;
background-color: #fff;
border-radius: 8px;
padding: 16px;
}
.containerBottom {
height: calc(100vh - 201px);
margin-top: 8px;
.smallTitle {
font-size: 16px;
color: #000;
margin-bottom: 15px;
}
.smallTitle::before {
display: inline-block;
width: 4px;
height: 16px;
background: #0b58ff;
content: "";
margin-right: 8px;
vertical-align: -3px;
}
}
</style>

View File

@ -2,12 +2,16 @@
<div> <div>
<!-- 暂无数据 --> <!-- 暂无数据 -->
<div <div
class="no-data-bg" :style="{ height: chartHeight + 'px' }"
style="position: relative; left: 50%; transform: translateX(-50%)" v-show="this.chartMsg.series[0].data.length === 0"
v-show="this.chartMsg.series.length === 0" >
></div> <div
class="no-data-bg"
style="position: relative; left: 50%; transform: translateX(-50%)"
></div>
</div>
<!-- 图例 --> <!-- 图例 -->
<div v-show="this.chartMsg.series.length > 0"> <div v-show="this.chartMsg.series[0].data.length > 0">
<div class="legend"> <div class="legend">
<span class="item" v-for="item in legendList" :key="item.id"> <span class="item" v-for="item in legendList" :key="item.id">
<span <span
@ -47,7 +51,7 @@ export default {
color: [], color: [],
// color: ["#8EF0AB", "#63BDFF", "#288AFF"], // color: ["#8EF0AB", "#63BDFF", "#288AFF"],
grid: { grid: {
left: 100, left: 70,
right: 10, right: 10,
bottom: 30, bottom: 30,
top: 30, top: 30,
@ -65,17 +69,41 @@ export default {
for (var i = 0, l = params.length; i < l; i++) { for (var i = 0, l = params.length; i < l; i++) {
res += res +=
"<br/>" + "<br/>" +
`<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[i].color}'></span>` + `${
`<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` + params[i].seriesType === "line"
? '<img width="10" height="10" style="margin-right:4px;" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTIuNzIxNjM5NXB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDEyLjcyMTYzOTUgOCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDx0aXRsZT7nvJbnu4QgNjwvdGl0bGU+CiAgICA8ZyBpZD0iMDTmiqXooajnrqHnkIYiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLmjIfmoIflrozmiJDmg4XlhrUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDUxLjYzOTE4MCwgLTQyNS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9Iue8lue7hC025aSH5Lu9LTQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMjEuNTAwMDAwLCAzNDQuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uELTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI5LjUwMDAwMCwgNzguMDAwMDAwKSI+CiAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgeD0iMCIgeT0iMCIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuMTM5MTgwMjYsMyBDOS4wMDMxMDczNywzIDEwLjU2OTI2NzMsNC4yNzQ4OTI3MiAxMS4wMTMyMjU0LDYuMDAwMjQzNDcgTDEyLjM2MDgxOTcsNiBDMTIuOTEzMTA0NSw2IDEzLjM2MDgxOTcsNi40NDc3MTUyNSAxMy4zNjA4MTk3LDcgQzEzLjM2MDgxOTcsNy41NTIyODQ3NSAxMi45MTMxMDQ1LDggMTIuMzYwODE5Nyw4IEwxMS4wMTI5NjY3LDguMDAwNzYxMzQgQzEwLjU2ODY1OTIsOS43MjU2MDIyNCA5LjAwMjc0NTUxLDExIDcuMTM5MTgwMjYsMTEgQzUuMjc1NjE1MDEsMTEgMy43MDk3MDEzMSw5LjcyNTYwMjI0IDMuMjY1MzkzNzgsOC4wMDA3NjEzNCBMMS42MzkxODAyNiw4IEMxLjA4Njg5NTUxLDggMC42MzkxODAyNTgsNy41NTIyODQ3NSAwLjYzOTE4MDI1OCw3IEMwLjYzOTE4MDI1OCw2LjQ0NzcxNTI1IDEuMDg2ODk1NTEsNiAxLjYzOTE4MDI2LDYgTDMuMjY1MTM1MDksNi4wMDAyNDM0NyBDMy43MDkwOTMyLDQuMjc0ODkyNzIgNS4yNzUyNTMxNSwzIDcuMTM5MTgwMjYsMyBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjRkZDRTZBIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+" />'
: `<span style="display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}"></span>`
}` +
`<span style='display:inline-block;width:180px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${ `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${
params[i].name === "%" params[i].name === "%"
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + ? (params[i].value ? params[i].value.toFixed(2) : "0.00") +
params[i].name params[i].name
: params[i].value : String(params[i].value).replace(
/\B(?=(\d{3})+(?!\d))/g,
","
)
}</span>`; }</span>`;
} }
return res; return res;
}, },
// formatter: function (params) {
// console.log(params);
// var res = `<span style='color:rgba(0,0,0,0.8)'>${params[0].axisValueLabel}</span>`;
// for (var i = 0, l = params.length; i < l; i++) {
// res +=
// "<br/>" +
// `<span style='display:inline-block;margin-right:4px;border-radius:2px;width:10px;height:10px;background-color:${params[i].color}'></span>` +
// `<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
// `<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${
// params[i].name === "%"
// ? (params[i].value ? params[i].value.toFixed(2) : 0.0) +
// params[i].name
// : params[i].value
// }</span>`;
// }
// return res;
// },
}, },
xAxis: { xAxis: {
type: "category", type: "category",
@ -181,7 +209,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.legend { .legend {
text-align: right; position: absolute;
right: 10px;
top: 15px;
.item { .item {
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;

View File

@ -16,41 +16,45 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="form.type === 1" label="时间" prop="dayTime"> <el-form-item v-show="form.type === 0" label="时间" prop="dayTime">
<el-date-picker <el-date-picker
size="small" size="small"
clearable clearable
v-model="form.dayTime" v-model="form.dayTime"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="form.type === 2" label="时间" prop="weekTime"> <el-form-item v-show="form.type === 1" label="时间" prop="weekTime">
<el-date-picker <el-date-picker
v-model="form.weekTime" v-model="form.weekTime"
type="week" type="week"
format="yyyy 第 WW 周" format="yyyy-MM-dd"
placeholder="选择周" placeholder="选择周"
value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="form.type === 3" label="时间" prop="monthTime"> <el-form-item v-show="form.type === 2" label="时间" prop="monthTime">
<el-date-picker <el-date-picker
v-model="form.monthTime" v-model="form.monthTime"
type="month" type="month"
placeholder="选择月份" placeholder="选择月份"
value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="form.type === 4" label="时间" prop="yearTime"> <el-form-item v-show="form.type === 3" label="时间" prop="yearTime">
<el-date-picker <el-date-picker
v-model="form.yearTime" v-model="form.yearTime"
type="year" type="year"
placeholder="选择年份" placeholder="选择年份"
value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
> >
</el-date-picker> </el-date-picker>
@ -73,48 +77,73 @@
</el-select> </el-select>
</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>
</el-form> </el-form>
</template> </template>
<script> <script>
import moment from "moment";
export default { export default {
name: "bmSearchBar", name: "bmSearchBar",
data() { data() {
return { return {
form: { form: {
type: 1, type: 2,
dayTime: "", dayTime: moment().format("yyyy-MM-DD"),
weekTime: "", weekTime: moment().format("yyyy-MM-DD"),
monthTime: "", monthTime: moment().format("yyyy-MM-DD"),
yearTime: "", yearTime: moment().format("yyyy-MM-DD"),
factory: "", factory: [],
}, },
typeList: [ typeList: [
{ id: 1, name: "日" }, { id: 0, name: "日" },
{ id: 2, name: "周" }, { id: 1, name: "周" },
{ id: 3, name: "月" }, { id: 2, name: "月" },
{ id: 4, name: "年" }, { id: 3, name: "年" },
], ],
factoryList: [ factoryList: [
{ id: 1, name: "瑞昌" }, { id: 0, name: "瑞昌" },
{ id: 2, name: "邯郸" }, { id: 1, name: "邯郸" },
], ],
}; };
}, },
methods: { methods: {
getDataList() { getDataList(val) {
console.log(this.form); console.log(this.form);
this.$emit("getSearch", this.form); let params = {};
}, params.factory = this.form.factory;
handleExport() { switch (this.form.type) {
this.$emit("handleExport"); case 0:
params.startDate = this.form.dayTime;
break;
case 1:
params.startDate = this.form.weekTime;
break;
case 2:
params.startDate = this.form.monthTime;
break;
case 3:
params.startDate = this.form.yearTime;
break;
default:
break;
}
params.type = this.form.type;
if (val === "search") {
this.$emit("getSearch", params);
} else {
this.$emit("handleExport", params);
}
}, },
}, },
}; };

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 14:01:39 * @LastEditTime: 2024-06-18 13:41:03
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -352,7 +352,9 @@ export default {
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00' this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59' this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
} }
this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2 let arr = []
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
this.listQuery.factory = arr
const res = await getComprehensiveDataPage(this.listQuery) const res = await getComprehensiveDataPage(this.listQuery)
this.tableData = res.data.list this.tableData = res.data.list
this.listQuery.total = res.data.total this.listQuery.total = res.data.total

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">CSS/PID6稼动率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">稼动率对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ utilzationComparePage,
prop: "factory", utilzationCompareExport,
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: "ConversionEfficiencyBM", name: "ConversionEfficiencyBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: {
@ -193,10 +144,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; 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);
}, },
@ -208,32 +166,166 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "ConversionEfficiencyBM") { if (this.$route.name === "ConversionEfficiencyBM") {
this.chartNum++; this.chartNum++;
} }
}, },
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 = [];
utilzationComparePage({ ...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;
// 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";
utilzationCompareExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">FTO/基片投入</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">产量对标FTO</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ fTOReportByDateRangePage,
prop: "factory", fTOReportByDateRangeExport,
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: "FtoOutputBM", name: "FtoOutputBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: {
@ -184,10 +138,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
mounted() {
this.tableProp = this.tableProp1;
this.listQuery.date = 2;
this.listQuery.queryTime = moment().format("yyyy-MM-DD");
this.listQuery.factorys = [];
this.getList();
},
destroyed() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -199,80 +160,181 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "FtoOutputBM") { if (this.$route.name === "FtoOutputBM") {
this.chartNum++; this.chartNum++;
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.date = val.type;
console.log("==========下面是测试代码,需删除"); this.listQuery.queryTime = val.startDate;
this.chartMsg.series = []; this.listQuery.factorys = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出=====下面是测试代码,需删除"); this.tableProps = [];
this.chartMsg.series = [ fTOReportByDateRangePage({ ...this.listQuery }).then((res) => {
{ if (res.data && res.data.length > 0) {
name: "2024年4月目标值1", //
// data: [3000, 2000, 3000], let msg = res.data[0];
// data: [6800, 5000, 8900], let arr = [
// data: [12000, 17000, 19000], {
data: [560000, 540000, 600000], prop: "lastone",
type: "line", label: msg.lastone.reportTime,
symbol: "circle", minWidth: 150,
symbolSize: 6, },
label: { {
show: true, prop: "currentone",
color: "#FFAE17", label: msg.currentone.reportTime,
minWidth: 150,
},
{
prop: "targetone",
label: msg.targetone.reportTime,
minWidth: 150,
},
];
this.tableProps = this.tableProps1.concat(arr);
//
let tableArr = [];
res.data.forEach((item) => {
let obj = {};
obj.factory = item.factory;
obj.item = "FTO投入";
obj.unit = "片";
obj.lastone = item.lastone.total;
obj.currentone = item.currentone.total;
obj.targetone = item.targetone.total;
tableArr.push(obj);
});
this.tableData = tableArr;
//
this.legendList[0].name = msg.targetone.reportTime;
this.legendList[1].name = msg.lastone.reportTime;
this.legendList[2].name = msg.currentone.reportTime;
this.chartMsg.series[0].name = msg.targetone.reportTime;
this.chartMsg.series[1].name = msg.lastone.reportTime;
this.chartMsg.series[2].name = msg.currentone.reportTime;
//
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);
} 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].targetone.total || 0);
barData1.push(val[i].lastone.total || 0);
barData2.push(val[i].currentone.total || 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",
name: "2023年4月", data: [],
// data: [2100, 800, 1500], type: "bar",
// data: [9500, 7200, 9901], barWidth: 20,
// data: [14666, 15000, 17888], label: {
data: [550000, 456666, 590000], show: true,
type: "bar", // position: [-5, -16],
barWidth: 20, // position: [-5, -16],
label: { position: [-10, -16],
show: true, // position: [-17, -16],
// position: [-5, -16], color: "#68C483",
// position: [-5, -16], },
// position: [-10, -16],
position: [-17, -16],
color: "#68C483",
}, },
}, {
{ name: "3",
name: "2024年4月", data: [],
// data: [2100, 900, 1300], type: "bar",
// data: [9100, 7300, 9700], barWidth: 20,
// data: [14666, 15300, 18000], label: {
data: [556666, 456666, 650000], show: true,
type: "bar", position: [0, -16],
barWidth: 20, color: "#288AFF",
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 = "产量对标FTO.xls";
fTOReportByDateRangeExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">封装OEE</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">封装OEE对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ componentOEEPage,
prop: "factory", componentOEEExport,
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: "PackageOEEBM", name: "PackageOEEBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: {
@ -193,10 +144,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; 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);
}, },
@ -208,32 +166,166 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "PackageOEEBM") { if (this.$route.name === "PackageOEEBM") {
this.chartNum++; this.chartNum++;
} }
}, },
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 = [];
componentOEEPage({ ...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;
// 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 = "封装OEE对标.xls";
componentOEEExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -1,23 +1,23 @@
<template> <template>
<div> <div>
<!-- <div class="search"> --> <!-- <div class="search"> -->
<ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event"> <ButtonNav style="padding: 0;" :menus="['邯郸', '瑞昌']" :button-mode="true" @change="currentMenu = $event">
</ButtonNav> </ButtonNav>
<!-- </div> --> <!-- </div> -->
<div class="containerTop"> <div class="containerTop">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="date"> <el-form-item label="时间维度" prop="date">
<el-select size="small" clearable v-model="listQuery.type" placeholder="请选择"> <el-select size="small" clearable v-model="listQuery.date" placeholder="请选择">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.type === 0 || listQuery.type === ''" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 0 || listQuery.type === ''" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator="" <el-date-picker size="small" clearable v-model="listQuery.reportTime" type="daterange" range-separator=""
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期"> start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.type === 1" label="时间范围" prop="reportTime"> <el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime">
<el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周" <el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
style="width: 180px" @change="onValueChange"> style="width: 180px" @change="onValueChange">
</el-date-picker> </el-date-picker>
@ -29,13 +29,13 @@
{{ date1 }} {{ date2 }} {{ weekNum }} {{ date1 }} {{ date2 }} {{ weekNum }}
</span> --> </span> -->
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.type === 2" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date === 2" label="时间值" prop="reportTime">
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" <el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
@change="changeTime"> @change="changeTime">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-show="listQuery.type === 3" label="时间值" prop="reportTime"> <el-form-item v-show="listQuery.date === 3" label="时间值" prop="reportTime">
<el-date-picker size="small" clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year" <el-date-picker size="small" clearable v-model="listQuery.reportTime[0]" value-format="yyyy" type="year"
placeholder="开始时间"> placeholder="开始时间">
</el-date-picker> </el-date-picker>
@ -83,6 +83,7 @@ import bmSearchBar from "./components/bmSearchBar.vue";
import BmLineBar from "./components/bmLineBar.vue"; import BmLineBar from "./components/bmLineBar.vue";
import ButtonNav from '@/components/ButtonNav' import ButtonNav from '@/components/ButtonNav'
import moment from 'moment' import moment from 'moment'
import { getProduceTransData } from '@/api/report';
const tableProps = [ const tableProps = [
{ {
prop: "factory", prop: "factory",
@ -132,11 +133,11 @@ export default {
listQuery: { listQuery: {
// size: 10, // size: 10,
// current: 1, // current: 1,
factory: null, factorys: null,
// total: 0, // total: 0,
type: 2, date: 2,
startDate: undefined, beginTime: undefined,
endDate: undefined, endTime: undefined,
reportTime: [] reportTime: []
}, },
timeList: [ timeList: [
@ -319,13 +320,13 @@ export default {
this.start = undefined this.start = undefined
this.end = undefined this.end = undefined
} else { } else {
this.listQuery.startDate = Number(this.start) this.listQuery.beginTime = Number(this.start)
this.listQuery.endDate = Number(this.end) this.listQuery.endTime = Number(this.end)
} }
} }
if (!this.start && !this.end) { if (!this.start && !this.end) {
this.listQuery.startDate = undefined this.listQuery.beginTime = undefined
this.listQuery.endDate = undefined this.listQuery.endTime = undefined
} }
// console.log(e); // console.log(e);
}, },
@ -344,12 +345,12 @@ export default {
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
} else { } else {
this.listQuery.startDate = this.listQuery.reportTime[0] this.listQuery.beginTime = this.listQuery.reportTime[0]
this.listQuery.endDate = this.listQuery.reportTime[1] this.listQuery.endTime = this.listQuery.reportTime[1]
} }
} else { } else {
this.listQuery.startDate = undefined this.listQuery.beginTime = undefined
this.listQuery.endDate = undefined this.listQuery.endTime = undefined
} }
}, },
onValueChange(picker, k) { // k onValueChange(picker, k) { // k
@ -364,15 +365,15 @@ export default {
type: 'warning' type: 'warning'
}); });
} else { } else {
this.listQuery.startDate = this.date1 this.listQuery.beginTime = this.date1
this.listQuery.endDate = this.date2 this.listQuery.endTime = this.date2
// this.listQuery.startDate = Number(moment(this.start.getTime()).format('YYYYWW')) // this.listQuery.beginTime = Number(moment(this.start.getTime()).format('YYYYWW'))
// this.listQuery.endDate = Number(moment(this.end.getTime()).format('YYYYWW')) // this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
} }
} }
if (!this.start && !this.end) { if (!this.start && !this.end) {
this.listQuery.startDate = undefined this.listQuery.beginTime = undefined
this.listQuery.endDate = undefined this.listQuery.endTime = undefined
} }
}, },
changeDayTime() { changeDayTime() {
@ -385,12 +386,12 @@ export default {
}); });
this.listQuery.reportTime = []; this.listQuery.reportTime = [];
} else { } else {
this.listQuery.startDate = this.listQuery.reportTime[0] this.listQuery.beginTime = this.listQuery.reportTime[0]
this.listQuery.endDate = this.listQuery.reportTime[1] this.listQuery.endTime = this.listQuery.reportTime[1]
} }
} else { } else {
this.listQuery.startDate = undefined this.listQuery.beginTime = undefined
this.listQuery.endDate = undefined this.listQuery.endTime = undefined
} }
}, },
getOverView() { getOverView() {
@ -408,18 +409,20 @@ export default {
}, },
async getDataList() { async getDataList() {
console.log(this.listQuery); console.log(this.listQuery);
if (this.listQuery.type == 3) { if (this.listQuery.date == 3) {
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00' this.listQuery.beginTime = this.listQuery.reportTime[0] + '-01-01 00:00:00'
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59' this.listQuery.endTime = this.listQuery.reportTime[1] + '-12-31 23:59:59'
} }
this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2 let arr = []
const res = await getComprehensiveDataPage(this.listQuery) this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
this.listQuery.factorys = arr
const res = await getProduceTransData(this.listQuery)
this.tableData = res.data.list this.tableData = res.data.list
this.listQuery.total = res.data.total this.listQuery.total = res.data.total
if (this.listQuery.total > 0) { if (this.listQuery.total > 0) {
this.tableData.forEach(item => { this.tableData.forEach(item => {
item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--' item.startTime = item.beginTime ? item.beginTime[0] + '-' + item.beginTime[1] + '-' + item.beginTime[2] : '--'
item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--' item.endTime = item.endTime ? item.endTime[0] + '-' + item.endTime[1] + '-' + item.endTime[2] : '--'
}) })
} }
}, },

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">标准组件产量</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">标准组件产量对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -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 {
{ sCPReportByDateRangePage,
prop: "factory", sCPReportByDateRangeExport,
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: "SCOutputBM", name: "SCOutputBM",
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" }, chartHeight: this.tableHeight(269) / 2,
{ factory: "工厂1" }, tableH: this.tableHeight(269) / 2,
{ 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(137) / 2 - 111,
tableH: this.tableHeight(137) / 2 - 70,
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: {
@ -184,10 +138,17 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
mounted() {
this.tableProp = this.tableProp1;
this.listQuery.date = 2;
this.listQuery.queryTime = moment().format("yyyy-MM-DD");
this.listQuery.factorys = [];
this.getList();
},
destroyed() { destroyed() {
window.removeEventListener("resize", this._setTableHeight); window.removeEventListener("resize", this._setTableHeight);
}, },
@ -199,32 +160,181 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "SCOutputBM") { if (this.$route.name === "SCOutputBM") {
this.chartNum++; this.chartNum++;
} }
}, },
getSearch(val) { getSearch(val) {
console.log(val); this.listQuery.date = val.type;
console.log("========================="); this.listQuery.queryTime = val.startDate;
this.listQuery.factorys = val.factory;
this.getList();
}, },
handleExport() { getList() {
console.log("导出"); this.tableProps = [];
sCPReportByDateRangePage({ ...this.listQuery }).then((res) => {
if (res.data && res.data.length > 0) {
//
let msg = res.data[0];
let arr = [
{
prop: "lastone",
label: msg.lastone.reportTime,
minWidth: 150,
},
{
prop: "currentone",
label: msg.currentone.reportTime,
minWidth: 150,
},
{
prop: "targetone",
label: msg.targetone.reportTime,
minWidth: 150,
},
];
this.tableProps = this.tableProps1.concat(arr);
//
let tableArr = [];
res.data.forEach((item) => {
let obj = {};
obj.factory = item.factory;
obj.item = "FTO投入";
obj.unit = "片";
obj.lastone = item.lastone.total;
obj.currentone = item.currentone.total;
obj.targetone = item.targetone.total;
tableArr.push(obj);
});
this.tableData = tableArr;
//
this.legendList[0].name = msg.targetone.reportTime;
this.legendList[1].name = msg.lastone.reportTime;
this.legendList[2].name = msg.currentone.reportTime;
this.chartMsg.series[0].name = msg.targetone.reportTime;
this.chartMsg.series[1].name = msg.lastone.reportTime;
this.chartMsg.series[2].name = msg.currentone.reportTime;
//
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);
} 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].targetone.total || 0);
barData1.push(val[i].lastone.total || 0);
barData2.push(val[i].currentone.total || 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";
sCPReportByDateRangeExport({ ...this.listQuery })
.then((response) => {
this.$download.excel(response, fileName);
this.$message.success("导出成功");
})
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">4月组件人均产量</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">组件人均产量对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -103,8 +103,8 @@ export default {
{ factory: "工厂1" }, { factory: "工厂1" },
{ factory: "工厂1" }, { factory: "工厂1" },
], ],
chartHeight: this.tableHeight(137) / 2 - 111, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(137) / 2 - 70, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
@ -184,8 +184,8 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
destroyed() { destroyed() {
@ -199,8 +199,8 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "SCPerCapitaBM") { if (this.$route.name === "SCPerCapitaBM") {
this.chartNum++; this.chartNum++;
} }
@ -217,14 +217,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">4月标准组件良率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">芯片良率对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -103,8 +103,8 @@ export default {
{ factory: "工厂1" }, { factory: "工厂1" },
{ factory: "工厂1" }, { factory: "工厂1" },
], ],
chartHeight: this.tableHeight(137) / 2 - 111, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(137) / 2 - 70, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" }, { id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" }, { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
@ -193,8 +193,8 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
destroyed() { destroyed() {
@ -208,8 +208,8 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "SCYieldBM") { if (this.$route.name === "SCYieldBM") {
this.chartNum++; this.chartNum++;
} }
@ -226,14 +226,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;

View File

@ -2,6 +2,9 @@
<div> <div>
<div class="containerTop"> <div class="containerTop">
<bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" />
</div>
<div class="containerBottom">
<div class="smallTitle">4月标准组件转化效率</div>
<bm-line-bar <bm-line-bar
:chartHeight="chartHeight" :chartHeight="chartHeight"
:legendList="legendList" :legendList="legendList"
@ -9,9 +12,6 @@
:chartId="chartId" :chartId="chartId"
:chartNum="chartNum" :chartNum="chartNum"
/> />
</div>
<div class="containerBottom">
<div class="smallTitle">封装OEE对标</div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.current" :page="listQuery.current"
@ -109,8 +109,8 @@ export default {
{ factory: "工厂1" }, { factory: "工厂1" },
{ factory: "工厂1" }, { factory: "工厂1" },
], ],
chartHeight: this.tableHeight(137) / 2 - 111, chartHeight: this.tableHeight(269) / 2,
tableH: this.tableHeight(137) / 2 - 70, tableH: this.tableHeight(269) / 2,
legendList: [ legendList: [
{ id: 1, name: "2024年4月", type: 1, color: "#8EF0AB" }, { id: 1, name: "2024年4月", type: 1, color: "#8EF0AB" },
{ id: 2, name: "2023年4月", type: 1, color: "#63BDFF" }, { id: 2, name: "2023年4月", type: 1, color: "#63BDFF" },
@ -223,8 +223,8 @@ export default {
}, },
}, },
created() { created() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
window.addEventListener("resize", this._setTableHeight); window.addEventListener("resize", this._setTableHeight);
}, },
destroyed() { destroyed() {
@ -238,8 +238,8 @@ export default {
}, },
methods: { methods: {
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(269) / 2;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(269) / 2;
if (this.$route.name === "TurnoverRateBM") { if (this.$route.name === "TurnoverRateBM") {
this.chartNum++; this.chartNum++;
} }
@ -256,14 +256,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.containerTop {
height: 64px;
}
.containerTop, .containerTop,
.containerBottom { .containerBottom {
height: calc((100vh - 137px) / 2); position: relative;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 16px;
} }
.containerBottom { .containerBottom {
height: calc(100vh - 201px);
margin-top: 8px; margin-top: 8px;
.smallTitle { .smallTitle {
font-size: 16px; font-size: 16px;