Compare commits
No commits in common. "0eb17fa08b16bea65122dffd3cf57282acb72047" and "41d554f897d94ca9db66af60c0637480069dcc29" have entirely different histories.
0eb17fa08b
...
41d554f897
6
.env.dev
6
.env.dev
@ -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-20 10:16:40
|
# @LastEditTime: 2024-06-17 09:01:32
|
||||||
# @LastEditors: DY
|
# @LastEditors: DY
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
@ -14,10 +14,6 @@ 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
|
||||||
|
@ -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-19 15:22:10
|
* @LastEditTime: 2024-06-03 08:52:02
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@ -10,33 +10,23 @@ import request from '@/utils/request'
|
|||||||
// 查询生产数据管理分页
|
// 查询生产数据管理分页
|
||||||
export function getProduceDataPage(data) {
|
export function getProduceDataPage(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/ip/proddata/page',
|
url: 'ip/prod-output/prodOutputDataPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询图数据
|
export function getProduceDataDetail(id){
|
||||||
export function getproddata(data) {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/ip/proddata/list',
|
url: '/ip/prod-output/get?id=' + id,
|
||||||
method: 'post',
|
method: 'get'
|
||||||
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/proddata/export-excel',
|
url: '/ip/prod-output/output-export-excel',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
@ -1,219 +0,0 @@
|
|||||||
// 对标报表的接口
|
|
||||||
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 componentconvertrateCPage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/componentconvertrate-compare/page',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 转化效率对标导出
|
|
||||||
export function componentconvertrateCExport(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/componentconvertrate-compare/export-excel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 芯片良率对标
|
|
||||||
export function chipyieldRatePage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/chipyield-rate/page',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 芯片良率对标导出
|
|
||||||
export function chipyieldRateExport(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/chipyield-rate/export-excel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 标准组件良率对标
|
|
||||||
export function componentyieldRatePage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/componentyield-rate/page',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 标准组件良率对标导出
|
|
||||||
export function componentyieldRateExport(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/componentyield-rate/export-excel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 稼动率对标
|
|
||||||
export function utilzationComparePage(data) {
|
|
||||||
return request({
|
|
||||||
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 标准组件人均产量对标
|
|
||||||
export function componentAapPage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/prod-output/componentAap',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 标准组件人均产量对标导出
|
|
||||||
export function componentAapExport(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/prod-output/componentAap-export',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 指标完成情况对标
|
|
||||||
export function targetCompletionPage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/prod-output/TargetCompletion',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 指标完成情况对标导出
|
|
||||||
export function targetCompletionExport(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ip/prod-output/TargetCompletion-export',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
@ -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-20 15:39:21
|
* @LastEditTime: 2024-06-18 13:47:36
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@ -9,21 +9,11 @@ import request from '@/utils/request'
|
|||||||
export function getComprehensiveDataPage(data) {
|
export function getComprehensiveDataPage(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'ip/comprehensive/data/get/comprehensive/data',
|
url: 'ip/comprehensive/data/get/comprehensive/data',
|
||||||
method: 'post',
|
method: 'get',
|
||||||
data: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function exportComprehensiveDataPage(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/comprehensive/data/export/comprehensive/data',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export function getProduceTransData(data) {
|
export function getProduceTransData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'ip/prod-output/queryYCEReportByDateRange',
|
url: 'ip/prod-output/queryYCEReportByDateRange',
|
||||||
@ -31,65 +21,3 @@ export function getProduceTransData(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function exportProduceTransData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/prod-output/queryYCEReportByDateRangeExcel',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export function getProduceSituationData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/production/situation/get/production/situation',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function exportProduceSituationData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/production/situation/export/production/situation',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getProductionSituationMWData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/production/situation/power/get/production/situation',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function exportProductionSituationMWData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/production/situation/power/export/production/situation',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export function getProductionYieldSituationMWData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/product/yield/get/production/situation',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function exportProductionYieldSituationMWData(data) {
|
|
||||||
return request({
|
|
||||||
url: 'ip/product/yield/export/production/situation',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
responseType: 'blob',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@ -143,8 +143,6 @@ export const tyjxfactoryList =[
|
|||||||
|
|
||||||
// 暂时只有瑞昌邯郸数据
|
// 暂时只有瑞昌邯郸数据
|
||||||
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司']
|
export const factoryList =['瑞昌中建材光电材料有限公司', '邯郸中建材光电材料有限公司']
|
||||||
|
|
||||||
export const factoryListabbr =['瑞昌', '邯郸']
|
|
||||||
export const factoryArray =[
|
export const factoryArray =[
|
||||||
{
|
{
|
||||||
name: '瑞昌中建材光电材料有限公司',
|
name: '瑞昌中建材光电材料有限公司',
|
||||||
|
@ -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-18 14:41:07
|
* @LastEditTime: 2024-06-07 10:28:51
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<el-drawer class="drawer" :visible.sync="visible" size="65%" @closed="$emit('destroy')">
|
<el-drawer class="drawer" :visible.sync="visible" size="60%" @closed="$emit('destroy')">
|
||||||
<small-title slot="title" :no-padding="true">
|
<small-title slot="title" :no-padding="true">
|
||||||
{{ '碲化镉工厂生产数据详情' }}
|
{{ '碲化镉工厂生产数据详情' }}
|
||||||
</small-title>
|
</small-title>
|
||||||
@ -14,150 +14,142 @@
|
|||||||
<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">{{ factoryList[dataForm.factory] }}</p>
|
<p class="text">{{ 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.datestr }}</p>
|
<p class="text">{{ dataForm.reportDate?.length > 0 ? dataForm.reportDate[0] + '年' + dataForm.reportDate[1] + '月' + dataForm.reportDate[2] + '日' : '' }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-divider></el-divider>
|
<el-divider></el-divider>
|
||||||
<div v-if="glass === 0">
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
{{ '芯片' }}
|
||||||
{{ '芯片' }}
|
</small-title>
|
||||||
</small-title>
|
<el-row :gutter="24">
|
||||||
<el-row :gutter="24">
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">芯片产量(片)</p>
|
||||||
<p class="title">芯片产量(片)</p>
|
<p class="text">{{ }}</p>
|
||||||
<p class="text">{{ dataForm.chipYieldSum }}</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.yieldRate }}</p>
|
||||||
<p class="text">{{ dataForm.chipYieldRate }}</p>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">芯片BOM</p>
|
||||||
<p class="title">芯片BOM</p>
|
<p class="text">{{ dataForm.bom }}</p>
|
||||||
<p class="text">{{ dataForm.chipBom }}</p>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">芯片总功率(MW)</p>
|
||||||
<p class="title">芯片总功率(MW)</p>
|
<p class="text">{{ dataForm.totalPower }}</p>
|
||||||
<p class="text">{{ dataForm.chipTotalPower }}</p>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
<el-row :gutter="24">
|
||||||
<el-row :gutter="24">
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">FTO投入量(片)</p>
|
||||||
<p class="title">FTO投入量(片)</p>
|
<p class="text">{{ dataForm.chipInput }}</p>
|
||||||
<p class="text">{{ dataForm.ftoInput }}</p>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">CSS稼动率(%)</p>
|
||||||
<p class="title">CSS稼动率(%)</p>
|
<p class="text">{{ dataForm.marriageRate }}</p>
|
||||||
<p class="text">{{ dataForm.chipCssMarriageRate }}</p>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">芯片段OEE</p>
|
||||||
<p class="title">芯片段OEE</p>
|
<p class="text">{{ dataForm.oee }}</p>
|
||||||
<p class="text">{{ dataForm.chipOee }}</p>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">芯片平均功率(W)</p>
|
||||||
<p class="title">芯片平均功率(W)</p>
|
<p class="text">{{ dataForm.averagePower }}</p>
|
||||||
<p class="text">{{ dataForm.chipAveragePower }}</p>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
<el-row :gutter="24">
|
||||||
<el-row :gutter="24">
|
<el-col :span="6">
|
||||||
<el-col :span="6">
|
<p class="title">芯片人均产量(片/人)</p>
|
||||||
<p class="title">芯片人均产量(片/人)</p>
|
<p class="text">{{ dataForm.annualAverageProduction }}</p>
|
||||||
<p class="text">{{ dataForm.chipAnnualAverageProduction }}</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.capacityUtilizationRate }}</p>
|
||||||
<p class="text">{{ dataForm.chipCapacityUtilizationRate }}</p>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
</div>
|
{{ '标准组件' }}
|
||||||
<div v-if="glass === 1">
|
</small-title>
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
<el-row :gutter="24">
|
||||||
{{ '标准组件' }}
|
<el-col :span="6">
|
||||||
</small-title>
|
<p class="title">封装BOM</p>
|
||||||
<el-row :gutter="24">
|
<!-- 没参数 -->
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.bom }}</p> -->
|
||||||
<p class="title">封装BOM</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentBom }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">封装线OEE(%)</p>
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.code }}</p> -->
|
||||||
<p class="title">封装线OEE(%)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentOee }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">标准组件良率(%)</p>
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
<p class="title">标准组件良率(%)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentYieldRate }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">标准组件产量(片)</p>
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
<p class="title">标准组件产量(片)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentYield }}</p>
|
</el-row>
|
||||||
</el-col>
|
<el-row :gutter="24">
|
||||||
</el-row>
|
<el-col :span="6">
|
||||||
<el-row :gutter="24">
|
<p class="title">标准组件总功率(MW)</p>
|
||||||
<el-col :span="6">
|
<p class="text">{{ }}</p>
|
||||||
<p class="title">标准组件总功率(MW)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentTotalPower }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">封装产能利用率(%)</p>
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.code }}</p> -->
|
||||||
<p class="title">封装产能利用率(%)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentCapacityUtilizationRate }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">标准组件人均产量</p>
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
<p class="title">标准组件人均产量(片/人)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentAnnualAverageProduction }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">标准组件平均功率</p>
|
||||||
<el-col :span="6">
|
<!-- <p class="text">{{ dataForm.productName }}</p> -->
|
||||||
<p class="title">标准组件平均功率(W)</p>
|
</el-col>
|
||||||
<p class="text">{{ dataForm.componentAveragePower }}</p>
|
</el-row>
|
||||||
</el-col>
|
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
||||||
</el-row>
|
{{ 'BIPV产品' }}
|
||||||
</div>
|
</small-title>
|
||||||
<div v-if="glass === 2">
|
<el-row :gutter="24">
|
||||||
<small-title style=" margin: 0;padding: 26px 32px 24px;margin-bottom: 22px;" :no-padding="false">
|
<el-col :span="6">
|
||||||
{{ 'BIPV产品' }}
|
<p class="title">产品产量</p>
|
||||||
</small-title>
|
<p class="text">{{ }}</p>
|
||||||
<el-row :gutter="24">
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">产品产量(㎡)</p>
|
<p class="title">人均产量</p>
|
||||||
<p class="text">{{ dataForm.bipvProductOutput }}</p>
|
<p class="text">{{ dataForm.code }}</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.bipvAnnualAverageProduction }}</p>
|
<p class="text">{{ dataForm.productName }}</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.bipvChipUsage }}</p>
|
<p class="text">{{ dataForm.productName }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
</el-row>
|
||||||
<p class="title">芯片利用率(%)</p>
|
<el-row :gutter="24">
|
||||||
<p class="text">{{ dataForm.bipvChipUtilizationRate }}</p>
|
<el-col :span="6">
|
||||||
</el-col>
|
<p class="title">内部材料成本</p>
|
||||||
</el-row>
|
<p class="text">{{ }}</p>
|
||||||
<el-row :gutter="24">
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">内部材料成本(元/㎡)</p>
|
<p class="title">内部材料成本</p>
|
||||||
<p class="text">{{ dataForm.bipvInsideMaterialCost }}</p>
|
<p class="text">{{ dataForm.code }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<p class="title">OEM及委外材料成本(元/㎡)</p>
|
<p class="title">内部材料成本</p>
|
||||||
<p class="text">{{ dataForm.code }}</p>
|
<p class="text">{{ dataForm.productName }}</p>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
</el-row>
|
||||||
<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>
|
||||||
|
|
||||||
@ -165,18 +157,24 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import basicAdd from './basic-add';
|
// import basicAdd from './basic-add';
|
||||||
import { getProduceDataDetail } from "@/api/produceData";
|
import {
|
||||||
|
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,
|
||||||
@ -200,8 +198,6 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
sectionList: [],
|
sectionList: [],
|
||||||
glass: 0,
|
|
||||||
date: 0,
|
|
||||||
visible: false,
|
visible: false,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@ -233,16 +229,11 @@ export default {
|
|||||||
// this.getCurrentTime()
|
// this.getCurrentTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(id, type, glass) {
|
init(id) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.glass = glass
|
console.log('打印', id)
|
||||||
this.date = type
|
|
||||||
console.log('打印', id, glass)
|
|
||||||
if (id) {
|
if (id) {
|
||||||
getProduceDataDetail({
|
getProduceDataDetail(id).then(res => {
|
||||||
id: id,
|
|
||||||
type: type
|
|
||||||
}).then(res => {
|
|
||||||
this.dataForm = res.data
|
this.dataForm = res.data
|
||||||
console.log('你好', res.data)
|
console.log('你好', res.data)
|
||||||
})
|
})
|
||||||
|
@ -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-20 10:16:25
|
* @LastEditTime: 2024-06-07 09:41:56
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 200px - 31px)">
|
<div style="display: flex; flex-direction: column; min-height: calc(100vh - 96px - 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="type">
|
<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.date === ''" 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="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime" end-placeholder="结束日期">
|
start-placeholder="开始日期" value-format="timestamp" 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.type === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 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.type === 2" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 2" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-dd" range-separator="至"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime" type="monthrange" value-format="timestamp" 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.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.start" value-format="yyyy-MM-dd" type="year"
|
<el-date-picker size="small" clearable v-model="listQuery.start" format="yyyy-MM-dd" value-format="timestamp" type="year"
|
||||||
placeholder="开始时间">
|
placeholder="开始时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
~
|
~
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year" placeholder="结束时间"
|
<el-date-picker size="small" clearable v-model="listQuery.end" format="yyyy-MM-dd" value-format="timestamp" type="year" placeholder="结束时间"
|
||||||
@change="getYear">
|
@change="getYear">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工厂名称" prop="factory">
|
<el-form-item label="工厂名称" prop="factorys">
|
||||||
<el-select size="small" clearable v-model="listQuery.factory" placeholder="请选择工厂名称" multiple >
|
<el-select size="small" clearable v-model="listQuery.factorys" 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="glass">
|
<el-form-item label="玻璃类型" prop="type">
|
||||||
<el-select size="small" clearable v-model="listQuery.glass" multiple placeholder="请选择玻璃类型">
|
<el-select size="small" clearable v-model="listQuery.type" 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.pageNo" :limit="listQuery.pageSize"
|
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size"
|
||||||
:table-data="tableData" :max-height="tableH">
|
:table-data="tableData">
|
||||||
<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.pageSize"
|
:limit.sync="listQuery.size"
|
||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.current"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList"
|
@pagination="getDataList"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" @destroy="detailOrUpdateVisible = false" />
|
<add-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" :date="listQuery.date" @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,9 +106,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { parseTime } from "@/utils/ruoyi";
|
// import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import tableHeightMixin from "@/mixins/tableHeightMixin";
|
import { getProduceDataPage, prodOutputDataList, exportOutPutExcel } from '@/api/produceData';
|
||||||
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'
|
||||||
@ -119,22 +118,22 @@ import { factoryList, factoryArray, factoryArray1 } from "@/utils/constants";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { lineChart, ButtonNav, AddOrUpdate },
|
components: { lineChart, ButtonNav, AddOrUpdate },
|
||||||
mixins: [basicPage, tableHeightMixin],
|
mixins: [basicPage],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList,
|
factoryList,
|
||||||
factoryArray,
|
factoryArray,
|
||||||
factoryArray1,
|
factoryArray1,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageSize: 20,
|
size: 20,
|
||||||
pageNo: 1,
|
current: 1,
|
||||||
factory: undefined,
|
factorys: undefined,
|
||||||
total: 0,
|
total: 0,
|
||||||
type: 0, // 时间维度
|
date: 0,
|
||||||
glass: undefined, // 玻璃类型
|
type:undefined,
|
||||||
// reportType: 2,
|
// reportType: 2,
|
||||||
startDate: undefined,
|
beginTime: undefined,
|
||||||
endDate:undefined,
|
endTime:undefined,
|
||||||
reportTime: [],
|
reportTime: [],
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined
|
end: undefined
|
||||||
@ -154,7 +153,7 @@ export default {
|
|||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
typeList: [
|
typeList: [
|
||||||
{
|
{
|
||||||
name: '玻璃芯片',
|
name: '芯片',
|
||||||
id: 0,
|
id: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -165,10 +164,6 @@ export default {
|
|||||||
name: 'BIPV产品',
|
name: 'BIPV产品',
|
||||||
id: 2,
|
id: 2,
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// name: '定制组件',
|
|
||||||
// id: 3,
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
@ -202,16 +197,16 @@ export default {
|
|||||||
],
|
],
|
||||||
tableProps: [
|
tableProps: [
|
||||||
{
|
{
|
||||||
prop: 'datestr',
|
prop: 'groupTime',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
minWidth: 120,
|
minWidth: 100,
|
||||||
showOverflowtooltip: true
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'factory',
|
prop: 'factory',
|
||||||
label: '工厂名称',
|
label: '工厂名称',
|
||||||
filter: (val) => factoryList[val],
|
filter: (val) => factoryList[val],
|
||||||
minWidth: 180,
|
minWidth: 200,
|
||||||
showOverflowtooltip: true
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -220,43 +215,42 @@ export default {
|
|||||||
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
|
filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'inputNum',
|
prop: 'inputNumber',
|
||||||
label: '投入数量',
|
label: '投入数量',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outputNum',
|
prop: 'outputNumber',
|
||||||
label: '产出数量',
|
label: '产出数量',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodNum',
|
prop: 'goodNumber',
|
||||||
label: '良品数量',
|
label: '良品数量',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'goodRatio',
|
prop: 'yieldRate',
|
||||||
label: '良品率%',
|
label: '良品率%',
|
||||||
filter: (val) => val + '%'
|
filter: (val) => (val * 100) + '%'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
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.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD')
|
this.listQuery.beginTime = sevenDaysAgo.getTime()
|
||||||
this.listQuery.endDate = moment(today).format('yyyy-MM-DD')
|
this.listQuery.endTime = today.getTime()
|
||||||
this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate]
|
this.listQuery.reportTime = [this.listQuery.beginTime, this.listQuery.endTime]
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
@ -265,7 +259,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.listQuery.type, val.data.glassType);
|
this.$refs.detailOrUpdate.init(val.data.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getYear(e) {
|
getYear(e) {
|
||||||
@ -279,12 +273,8 @@ export default {
|
|||||||
this.listQuery.end = undefined
|
this.listQuery.end = undefined
|
||||||
// console.log();
|
// console.log();
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.startDate = this.listQuery.start
|
this.listQuery.beginTime = this.listQuery.start
|
||||||
this.listQuery.endDate = this.listQuery.end
|
this.listQuery.endTime = this.listQuery.end
|
||||||
}
|
|
||||||
if (!this.listQuery.start && !this.listQuery.end) {
|
|
||||||
this.listQuery.startDate = undefined
|
|
||||||
this.listQuery.endDate = undefined
|
|
||||||
}
|
}
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
@ -302,14 +292,10 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.listQuery.beginTime = this.listQuery.start.getTime() - 24 * 60 * 60 * 1000
|
||||||
this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.listQuery.endTime = this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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) {
|
||||||
@ -324,12 +310,10 @@ 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.endDate = undefined
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTime(value) {
|
changeTime(value) {
|
||||||
@ -342,115 +326,114 @@ 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
|
console.log(this.listQuery.reportTime[0])
|
||||||
this.listQuery.endDate = undefined
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
await getProduceDataPage(this.listQuery).then(res => {
|
const res = await getProduceDataPage(this.listQuery)
|
||||||
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 getproddata(this.listQuery).then(resp => {
|
await prodOutputDataList({
|
||||||
if (resp.data?.length > 0) {
|
current: 1,
|
||||||
const chartData = Object.groupBy(resp.data, (member) => member.datestr)
|
size: 99,
|
||||||
this.buildChart(chartData, resp.data)
|
beginTime: this.listQuery.beginTime,
|
||||||
} else {
|
endTime: this.listQuery.endTime,
|
||||||
this.$refs.lineChart.initChart([], [])
|
factorys: this.listQuery.factorys,
|
||||||
|
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(data, dataList) {
|
buildChart(list) {
|
||||||
|
let temp = []
|
||||||
let xAxisData = []
|
let xAxisData = []
|
||||||
this.seriesList = []
|
list.forEach(item => {
|
||||||
|
temp.push(item.groupTime)
|
||||||
|
})
|
||||||
// x轴数据
|
// x轴数据
|
||||||
xAxisData = Object.keys(data)
|
xAxisData = Array.from(new Set(temp))
|
||||||
|
|
||||||
// y轴数据
|
// y轴数据
|
||||||
this.factoryArray.forEach(fac => {
|
for (const y of this.factoryArray1) {
|
||||||
let i = 0
|
for (const type of this.typeList) {
|
||||||
while ( i < 3) {
|
const seriesItem = {
|
||||||
// 下标
|
name: y.name,
|
||||||
const index1 = ['chipYield', 'componentYield', 'bipvProductOutput'][i]
|
record: type.name,
|
||||||
// let oneChart = {}
|
type: 'bar',
|
||||||
xAxisData.forEach((x, index) => {
|
emphasis: {
|
||||||
if (this.listQuery.glass.length === 0 || this.listQuery.glass.length === 3) {
|
focus: 'series'
|
||||||
let series = {
|
},
|
||||||
name: ['玻璃芯片', '标准组件', 'BIPV'][i] + '-' + fac.id,
|
data: Array(xAxisData.length).fill(0)
|
||||||
type: 'bar',
|
}
|
||||||
stack: String(fac.id),
|
list.forEach(data => {
|
||||||
data: Array(xAxisData.length).fill(0),
|
xAxisData.forEach((x, index) => {
|
||||||
barWidth: 20,
|
if (x === data.groupTime && y.id === data.factory && type.id === data.glassType) {
|
||||||
itemStyle: {
|
seriesItem.data[index] = data.goodNumber
|
||||||
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)
|
|
||||||
})
|
})
|
||||||
i ++
|
this.seriesList.push(seriesItem)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
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.pageNo = 1;
|
this.listQuery.current = 1;
|
||||||
this.listQuery.pageSize = 20;
|
this.listQuery.size = 20;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
@ -465,8 +448,8 @@ export default {
|
|||||||
this.$modal.confirm('是否确认导出生产数据?').then(() => {
|
this.$modal.confirm('是否确认导出生产数据?').then(() => {
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
let params = {...this.listQuery};
|
let params = {...this.listQuery};
|
||||||
params.pageNo = 1;
|
params.current = 1;
|
||||||
params.pageSize = 999;
|
params.size = 999;
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
return exportOutPutExcel(params);
|
return exportOutPutExcel(params);
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
|
@ -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-06-19 15:13:23
|
* @LastEditTime: 2024-05-30 14:52:05
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -16,8 +16,6 @@
|
|||||||
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],
|
||||||
@ -74,68 +72,35 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initChart(xAxis, seriesList) {
|
initChart(xAxis, seriesList) {
|
||||||
console.log('2', xAxis, seriesList)
|
this.chart = echarts.init(document.getElementById(this.id))
|
||||||
if (xAxis.length === 0) {
|
console.log(this.$parent);
|
||||||
this.chart.clear()
|
this.chart.setOption({
|
||||||
}
|
|
||||||
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']
|
|
||||||
},
|
},
|
||||||
tooltip: {
|
// toolbox: {
|
||||||
trigger: 'axis',
|
// show: true,
|
||||||
formatter: function(params) {
|
// feature: {
|
||||||
let result = `
|
// dataView: { show: true, readOnly: false },
|
||||||
<div style="width: 270px; display: flex">
|
// magicType: { show: true, type: ['line', 'bar'] },
|
||||||
<div style="width: 150px">${params[0].name}</div>
|
// restore: { show: true },
|
||||||
<div style="width: 60px">${factoryListabbr[0]}</div>
|
// saveAsImage: { show: true }
|
||||||
<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: [
|
||||||
{
|
{
|
||||||
@ -158,17 +123,12 @@ 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%;
|
||||||
|
@ -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-20 16:41:48
|
* @LastEditTime: 2024-06-17 09:49:15
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -144,6 +144,7 @@
|
|||||||
import { parseTime } from '@/utils/ruoyi';
|
import { parseTime } from '@/utils/ruoyi';
|
||||||
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData';
|
import { prodTargetDiPage, prodTargetToPage, exportDiTargetExcel, exportToTargetExcel, delTarget, importToTarget, importDiTarget } from '@/api/produceData';
|
||||||
// import inputTable from './inputTable.vue';
|
// import inputTable from './inputTable.vue';
|
||||||
|
import lineChart from './lineChart';
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import ButtonNav from '@/components/ButtonNav'
|
import ButtonNav from '@/components/ButtonNav'
|
||||||
import basicPage from '@/mixins/basic-page'
|
import basicPage from '@/mixins/basic-page'
|
||||||
@ -156,7 +157,7 @@ import {getBaseHeader} from "@/utils/request";
|
|||||||
// import FileSaver from 'file-saver'
|
// import FileSaver from 'file-saver'
|
||||||
// import * as XLSX from 'xlsx'
|
// import * as XLSX from 'xlsx'
|
||||||
export default {
|
export default {
|
||||||
components: { ButtonNav, detailOrUpdate, addOrUpdate },
|
components: { lineChart, ButtonNav, detailOrUpdate, addOrUpdate },
|
||||||
mixins: [basicPage],
|
mixins: [basicPage],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -413,12 +414,12 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
// timeSelect:'month',
|
// timeSelect:'month',
|
||||||
// startTimeStamp:null, //开始时间
|
startTimeStamp:null, //开始时间
|
||||||
// endTimeStamp:null, //结束时间
|
endTimeStamp:null, //结束时间
|
||||||
// date:'凯盛玻璃控股成员企业2024生产数据',
|
// date:'凯盛玻璃控股成员企业2024生产数据',
|
||||||
// reportTime: '',
|
// reportTime: '',
|
||||||
// startTimeStamp: '',
|
startTimeStamp: '',
|
||||||
// endTimeStamp: '',
|
endTimeStamp: '',
|
||||||
tableData: [],
|
tableData: [],
|
||||||
facType: 0
|
facType: 0
|
||||||
// proLineList: [],
|
// proLineList: [],
|
||||||
@ -457,13 +458,13 @@ export default {
|
|||||||
this.changeTime()
|
this.changeTime()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clearTime() {
|
clearTime() {
|
||||||
this.listQuery.beginTime = undefined
|
this.listQuery.beginTime = undefined
|
||||||
this.listQuery.endTime = undefined
|
this.listQuery.endTime = undefined
|
||||||
this.listQuery.reportTime = []
|
this.listQuery.reportTime = []
|
||||||
this.start = undefined
|
this.start = undefined
|
||||||
this.end = undefined
|
this.end = undefined
|
||||||
},
|
},
|
||||||
handleImport() {
|
handleImport() {
|
||||||
this.upload.title = "生产目标导入";
|
this.upload.title = "生产目标导入";
|
||||||
this.upload.open = true;
|
this.upload.open = true;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,102 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
chipoeeComparePage,
|
{
|
||||||
chipoeeCompareExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipOEEBM",
|
name: "ChipOEEBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -93,8 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 57.5 },
|
||||||
|
{ name: "%", value: 21.66 },
|
||||||
|
{ name: "%", value: 18.4 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -107,8 +152,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 23.33 },
|
||||||
|
{ name: "%", value: 7.02 },
|
||||||
|
{ name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -144,17 +193,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -166,169 +208,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "ChipOEEBM") {
|
if (this.$route.name === "ChipOEEBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].target || 0,
|
|
||||||
});
|
|
||||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
|
||||||
barData2.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].queryValue || 0,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = lineData;
|
|
||||||
this.chartMsg.series[1].data = barData1;
|
|
||||||
this.chartMsg.series[2].data = barData2;
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/%",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [-18, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#288AFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "芯片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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,101 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
cPReportByDateRangePage,
|
{
|
||||||
cPReportByDateRangeExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipOutputBM",
|
name: "ChipOutputBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// 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: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -138,17 +184,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -160,184 +199,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "ChipOutputBM") {
|
if (this.$route.name === "ChipOutputBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.date = val.type;
|
console.log(val);
|
||||||
this.listQuery.queryTime = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factorys = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "currentone",
|
|
||||||
label: msg.currentone.reportTime,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "targetone",
|
|
||||||
label: msg.targetone.reportTime,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
// 整理表格数据
|
|
||||||
let tableArr = [];
|
|
||||||
res.data.forEach((item) => {
|
|
||||||
let obj = {};
|
|
||||||
obj.factory = item.factory;
|
|
||||||
obj.item = "芯片产量";
|
|
||||||
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];
|
|
||||||
}
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,101 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
chipAnnualAverageProductionPage,
|
{
|
||||||
chipAnnualAverageProductionExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipPerCapitaBM",
|
name: "ChipPerCapitaBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位:片/人",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// 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: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -138,17 +184,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -160,171 +199,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "ChipPerCapitaBM") {
|
if (this.$route.name === "ChipPerCapitaBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置偏移量
|
|
||||||
switch (this.listQuery.type) {
|
|
||||||
case 0:
|
|
||||||
this.chartMsg.series[1].label.position = [-5, -16];
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
this.chartMsg.series[1].label.position = [-5, -16];
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
this.chartMsg.series[1].label.position = [-10, -16];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.chartMsg.series[1].label.position = [-17, -16];
|
|
||||||
}
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push(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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,102 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
chipyieldRatePage,
|
{
|
||||||
chipyieldRateExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -93,8 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 57.5 },
|
||||||
|
{ name: "%", value: 21.66 },
|
||||||
|
{ name: "%", value: 18.4 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -107,8 +152,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 23.33 },
|
||||||
|
{ name: "%", value: 7.02 },
|
||||||
|
{ name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -144,17 +193,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -166,169 +208,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "ChipYieldBM") {
|
if (this.$route.name === "ChipYieldBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
chipyieldRatePage({ ...this.listQuery }).then((res) => {
|
|
||||||
if (res.data && res.data.records.length > 0) {
|
|
||||||
let msg = res.data.records[0];
|
|
||||||
let arr = [
|
|
||||||
{
|
|
||||||
prop: "yoy",
|
|
||||||
label: msg.yoyColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].target || 0,
|
|
||||||
});
|
|
||||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
|
||||||
barData2.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].queryValue || 0,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = lineData;
|
|
||||||
this.chartMsg.series[1].data = barData1;
|
|
||||||
this.chartMsg.series[2].data = barData2;
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/%",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [-18, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#288AFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "芯片良率对标.xls";
|
|
||||||
chipyieldRateExport({ ...this.listQuery })
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.containerTop {
|
|
||||||
height: 64px;
|
|
||||||
}
|
|
||||||
.containerTop,
|
.containerTop,
|
||||||
.containerBottom {
|
.containerBottom {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -1,157 +0,0 @@
|
|||||||
<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: 0,
|
|
||||||
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>
|
|
@ -1,149 +0,0 @@
|
|||||||
<!-- 只适用于指标完成情况对标 -->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!-- 图例 -->
|
|
||||||
<div
|
|
||||||
class="legend"
|
|
||||||
v-show="
|
|
||||||
this.chartMsg1.series[0].data.length > 0 ||
|
|
||||||
this.chartMsg2.series[0].data.length > 0
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<span class="item" v-for="item in legendList" :key="item.id">
|
|
||||||
<span
|
|
||||||
v-if="item.type === 1"
|
|
||||||
class="block"
|
|
||||||
:style="{ backgroundColor: item.color }"
|
|
||||||
></span>
|
|
||||||
<span
|
|
||||||
v-if="item.type === 2"
|
|
||||||
class="line"
|
|
||||||
:style="{ backgroundColor: item.color }"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="line-block"
|
|
||||||
:style="{ backgroundColor: item.color }"
|
|
||||||
></span>
|
|
||||||
</span>
|
|
||||||
{{ item.name }}</span
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<!-- 图 -->
|
|
||||||
<div>
|
|
||||||
<div style="display: inline-block; width: 79%; vertical-align: top">
|
|
||||||
<base-chart
|
|
||||||
v-show="this.chartMsg1.series[0].data.length > 0"
|
|
||||||
:chartHeight="chartHeight"
|
|
||||||
:chartWidth="chartWidth1"
|
|
||||||
:chartMsg="chartMsg1"
|
|
||||||
chartId="targetChartLeft"
|
|
||||||
:chartNum="chartNum"
|
|
||||||
/>
|
|
||||||
<!-- 暂无数据 -->
|
|
||||||
<div
|
|
||||||
:style="{ height: chartHeight + 'px' }"
|
|
||||||
v-show="this.chartMsg1.series[0].data.length === 0"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="no-data-bg"
|
|
||||||
style="position: relative; left: 50%; transform: translateX(-50%)"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="display: inline-block; width: 20%; vertical-align: top">
|
|
||||||
<base-chart
|
|
||||||
v-show="this.chartMsg2.series[0].data.length > 0"
|
|
||||||
:chartHeight="chartHeight"
|
|
||||||
:chartWidth="chartWidth2"
|
|
||||||
:chartMsg="chartMsg2"
|
|
||||||
chartId="targetChartRight"
|
|
||||||
:chartNum="chartNum"
|
|
||||||
/>
|
|
||||||
<!-- 暂无数据 -->
|
|
||||||
<div
|
|
||||||
:style="{ height: chartHeight + 'px' }"
|
|
||||||
v-show="this.chartMsg2.series[0].data.length === 0"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="no-data-bg"
|
|
||||||
style="
|
|
||||||
position: relative;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 80%;
|
|
||||||
"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import baseChart from "./baseChart.vue";
|
|
||||||
export default {
|
|
||||||
name: "bmBarComplete",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chartWidth1: "60%",
|
|
||||||
chartWidth2: "20%",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartHeight: {
|
|
||||||
type: Number,
|
|
||||||
default: 300,
|
|
||||||
},
|
|
||||||
legendList: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
chartMsg1: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {},
|
|
||||||
},
|
|
||||||
chartMsg2: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {},
|
|
||||||
},
|
|
||||||
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>
|
|
@ -1,142 +0,0 @@
|
|||||||
<!-- 只使用于指标完成情况对标页面 -->
|
|
||||||
<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('search')"
|
|
||||||
>查询</el-button
|
|
||||||
>
|
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
plain
|
|
||||||
@click="getDataList('export')"
|
|
||||||
>导出</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(val) {
|
|
||||||
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;
|
|
||||||
if (val === "search") {
|
|
||||||
this.$emit("getSearch", params);
|
|
||||||
} else {
|
|
||||||
this.$emit("handleExport", params);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</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>
|
|
@ -1,347 +0,0 @@
|
|||||||
<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"
|
|
||||||
:chartMsg1="chartMsg1"
|
|
||||||
:chartMsg2="chartMsg2"
|
|
||||||
: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";
|
|
||||||
import {
|
|
||||||
targetCompletionPage,
|
|
||||||
targetCompletionExport,
|
|
||||||
} from "@/api/report/benchmarking.js";
|
|
||||||
import moment from "moment";
|
|
||||||
export default {
|
|
||||||
name: "CompletionStatusIntrBM",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableProps: [],
|
|
||||||
tableProps1: [
|
|
||||||
{
|
|
||||||
prop: "item",
|
|
||||||
label: "指标名称",
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "unit",
|
|
||||||
label: "单位",
|
|
||||||
minWidth: 80,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
listQuery: {
|
|
||||||
current: 1,
|
|
||||||
size: 100,
|
|
||||||
},
|
|
||||||
tableData: [],
|
|
||||||
chartHeight: this.tableHeight(269) / 2,
|
|
||||||
tableH: this.tableHeight(269) / 2,
|
|
||||||
legendList: [
|
|
||||||
{ id: 1, name: "", type: 1, color: "#288AFF33" },
|
|
||||||
{ id: 2, name: "", type: 1, color: "#288AFF" },
|
|
||||||
],
|
|
||||||
chartMsg1: {
|
|
||||||
color: ["#288AFF33", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/MW",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
barGap: "-100%",
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#288AFF",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
chartMsg2: {
|
|
||||||
color: ["#288AFF33", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/㎡",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
barGap: "-100%",
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#288AFF",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
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);
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.tableProp = this.tableProp1;
|
|
||||||
this.listQuery.type = 2;
|
|
||||||
this.listQuery.startDate = moment().format("yyyy-MM-DD");
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
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) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
this.tableProps = [];
|
|
||||||
targetCompletionPage({ ...this.listQuery }).then((res) => {
|
|
||||||
if (res.data && res.data.records.length > 0) {
|
|
||||||
let msg = res.data.records[0];
|
|
||||||
let arr = [
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.queryColumn;
|
|
||||||
this.chartMsg1.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg1.series[1].name = msg.queryColumn;
|
|
||||||
this.chartMsg2.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg2.series[1].name = msg.queryColumn;
|
|
||||||
// 设置偏移量
|
|
||||||
switch (this.listQuery.type) {
|
|
||||||
case 0:
|
|
||||||
this.chartMsg1.series[1].label.position = [-5, -16];
|
|
||||||
this.chartMsg2.series[1].label.position = [-5, -16];
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
this.chartMsg1.series[1].label.position = [-5, -16];
|
|
||||||
this.chartMsg2.series[1].label.position = [-5, -16];
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
this.chartMsg1.series[1].label.position = [-10, -16];
|
|
||||||
this.chartMsg2.series[1].label.position = [-10, -16];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.chartMsg1.series[1].label.position = [-17, -16];
|
|
||||||
this.chartMsg2.series[1].label.position = [-17, -16];
|
|
||||||
}
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData1 = [];
|
|
||||||
let xData2 = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
let barData3 = [];
|
|
||||||
let barData4 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
if (val[i].unit !== "㎡") {
|
|
||||||
xData1.push(val[i].item);
|
|
||||||
barData1.push(val[i].target || 0);
|
|
||||||
barData2.push(val[i].queryValue || 0);
|
|
||||||
} else {
|
|
||||||
xData2.push(val[i].item);
|
|
||||||
barData3.push(val[i].target || 0);
|
|
||||||
barData4.push(val[i].queryValue || 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.chartMsg1.xData = xData1;
|
|
||||||
this.chartMsg2.xData = xData2;
|
|
||||||
this.chartMsg1.series[0].data = barData1;
|
|
||||||
this.chartMsg1.series[1].data = barData2;
|
|
||||||
this.chartMsg2.series[0].data = barData3;
|
|
||||||
this.chartMsg2.series[1].data = barData4;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg1 = {
|
|
||||||
color: ["#288AFF33", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/MW",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
barGap: "-100%",
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#288AFF",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
this.chartMsg2 = {
|
|
||||||
color: ["#288AFF33", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/㎡",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
barGap: "-100%",
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#288AFF",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
let fileName = "指标完成情况对标.xls";
|
|
||||||
targetCompletionExport({ ...this.listQuery })
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</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>
|
|
@ -2,16 +2,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<!-- 暂无数据 -->
|
<!-- 暂无数据 -->
|
||||||
<div
|
<div
|
||||||
:style="{ height: chartHeight + 'px' }"
|
class="no-data-bg"
|
||||||
v-show="this.chartMsg.series[0].data.length === 0"
|
style="position: relative; left: 50%; transform: translateX(-50%)"
|
||||||
>
|
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[0].data.length > 0">
|
<div v-show="this.chartMsg.series.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
|
||||||
@ -51,7 +47,7 @@ export default {
|
|||||||
color: [],
|
color: [],
|
||||||
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
||||||
grid: {
|
grid: {
|
||||||
left: 70,
|
left: 100,
|
||||||
right: 10,
|
right: 10,
|
||||||
bottom: 30,
|
bottom: 30,
|
||||||
top: 30,
|
top: 30,
|
||||||
@ -69,41 +65,17 @@ 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>` +
|
||||||
params[i].seriesType === "line"
|
`<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[i].seriesName}</span>` +
|
||||||
? '<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.00") +
|
? (params[i].value ? params[i].value.toFixed(2) : 0.0) +
|
||||||
params[i].name
|
params[i].name
|
||||||
: String(params[i].value).replace(
|
: params[i].value
|
||||||
/\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",
|
||||||
@ -209,9 +181,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.legend {
|
.legend {
|
||||||
position: absolute;
|
text-align: right;
|
||||||
right: 10px;
|
|
||||||
top: 15px;
|
|
||||||
.item {
|
.item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
@ -16,45 +16,41 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="form.type === 0" label="时间" prop="dayTime">
|
<el-form-item v-show="form.type === 1" 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 === 1" label="时间" prop="weekTime">
|
<el-form-item v-show="form.type === 2" label="时间" prop="weekTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.weekTime"
|
v-model="form.weekTime"
|
||||||
type="week"
|
type="week"
|
||||||
format="yyyy-MM-dd"
|
format="yyyy 第 WW 周"
|
||||||
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="monthTime">
|
<el-form-item v-show="form.type === 3" 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 === 3" label="时间" prop="yearTime">
|
<el-form-item v-show="form.type === 4" 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>
|
||||||
@ -77,72 +73,48 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" size="small" @click="getDataList('search')"
|
<el-button type="primary" size="small" @click="getDataList"
|
||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button
|
<el-button type="primary" size="small" plain @click="handleExport"
|
||||||
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: 2,
|
type: 1,
|
||||||
dayTime: moment().format("yyyy-MM-DD"),
|
dayTime: "",
|
||||||
weekTime: moment().format("yyyy-MM-DD"),
|
weekTime: "",
|
||||||
monthTime: moment().format("yyyy-MM-DD"),
|
monthTime: "",
|
||||||
yearTime: moment().format("yyyy-MM-DD"),
|
yearTime: "",
|
||||||
factory: [],
|
factory: "",
|
||||||
},
|
},
|
||||||
typeList: [
|
typeList: [
|
||||||
{ id: 0, name: "日" },
|
{ id: 1, name: "日" },
|
||||||
{ id: 1, name: "周" },
|
{ id: 2, name: "周" },
|
||||||
{ id: 2, name: "月" },
|
{ id: 3, name: "月" },
|
||||||
{ id: 3, name: "年" },
|
{ id: 4, name: "年" },
|
||||||
],
|
],
|
||||||
factoryList: [
|
factoryList: [
|
||||||
{ id: 0, name: "瑞昌" },
|
{ id: 1, name: "瑞昌" },
|
||||||
{ id: 1, name: "邯郸" },
|
{ id: 2, name: "邯郸" },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDataList(val) {
|
getDataList() {
|
||||||
let params = {};
|
console.log(this.form);
|
||||||
params.factory = this.form.factory;
|
this.$emit("getSearch", this.form);
|
||||||
switch (this.form.type) {
|
},
|
||||||
case 0:
|
handleExport() {
|
||||||
params.startDate = this.form.dayTime;
|
this.$emit("handleExport");
|
||||||
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);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,245 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-06-19 15:28:34
|
|
||||||
* @LastEditTime: 2024-06-20 20:49:07
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!-- 暂无数据 -->
|
|
||||||
<div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)"
|
|
||||||
v-show="this.chartMsg.series.length === 0"></div>
|
|
||||||
<!-- 图例 -->
|
|
||||||
<div v-show="this.chartMsg.series.length > 0">
|
|
||||||
<div class="legendData" v-if="show">
|
|
||||||
<span class="itemData" 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 :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as echarts from "echarts";
|
|
||||||
import { debounce } from "@/utils/debounce";
|
|
||||||
export default {
|
|
||||||
name: "bmLineBar",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
myChart: "",
|
|
||||||
option: {
|
|
||||||
color: [],
|
|
||||||
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
|
||||||
grid: {
|
|
||||||
left: 30,
|
|
||||||
right: 0,
|
|
||||||
bottom: 30,
|
|
||||||
top: 30,
|
|
||||||
containLabel:true,
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: "axis",
|
|
||||||
axisPointer: {
|
|
||||||
// type: "cross",
|
|
||||||
crossStyle: {
|
|
||||||
color: "rgba(237,237,237,0.5)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formatter: function (params) {
|
|
||||||
console.log('params', 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: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>` +
|
|
||||||
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率"
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
|
|
||||||
: params[i].seriesName === "转化效率"
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
|
|
||||||
: params[i].seriesName.search('总功率') != -1
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "MW"
|
|
||||||
: params[i].value + "片"
|
|
||||||
}</span>`;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: "category",
|
|
||||||
data: [],
|
|
||||||
axisTick: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
axisPointer: {
|
|
||||||
type: "shadow",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dataZoom: [//滚动条
|
|
||||||
{
|
|
||||||
// 设置滚动条的隐藏与显示
|
|
||||||
show: true,
|
|
||||||
// 设置滚动条类型
|
|
||||||
type: "slider",
|
|
||||||
// 设置背景颜色
|
|
||||||
backgroundColor: "rgb(19, 63, 100)",
|
|
||||||
// 设置选中范围的填充颜色
|
|
||||||
fillerColor: "rgb(16, 171, 198)",
|
|
||||||
// 设置边框颜色
|
|
||||||
borderColor: "rgb(19, 63, 100)",
|
|
||||||
// 是否显示detail,即拖拽时候显示详细数值信息
|
|
||||||
showDetail: false,
|
|
||||||
// 数据窗口范围的起始数值
|
|
||||||
startValue: 0,
|
|
||||||
// 数据窗口范围的结束数值(一页显示多少条数据)
|
|
||||||
endValue: 5,
|
|
||||||
// empty:当前数据窗口外的数据,被设置为空。
|
|
||||||
// 即不会影响其他轴的数据范围
|
|
||||||
filterMode: "empty",
|
|
||||||
// 设置滚动条宽度,相对于盒子宽度
|
|
||||||
width: "50%",
|
|
||||||
// 设置滚动条高度
|
|
||||||
height: 8,
|
|
||||||
// 设置滚动条显示位置
|
|
||||||
left: "center",
|
|
||||||
// 是否锁定选择区域(或叫做数据窗口)的大小
|
|
||||||
zoomLoxk: true,
|
|
||||||
// 控制手柄的尺寸
|
|
||||||
handleSize: 0,
|
|
||||||
// dataZoom-slider组件离容器下侧的距离
|
|
||||||
bottom: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// 没有下面这块的话,只能拖动滚动条,
|
|
||||||
// 鼠标滚轮在区域内不能控制外部滚动条
|
|
||||||
type: "inside",
|
|
||||||
// 滚轮是否触发缩放
|
|
||||||
zoomOnMouseWheel: false,
|
|
||||||
// 鼠标滚轮触发滚动
|
|
||||||
moveOnMouseMove: true,
|
|
||||||
moveOnMouseWheel: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
yAxis:undefined,
|
|
||||||
series: [],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartHeight: {
|
|
||||||
type: Number,
|
|
||||||
default: 300,
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
default: 2,
|
|
||||||
},
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
type() {
|
|
||||||
this.canvasReset();
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
|
|
||||||
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
|
|
||||||
this.option.series = this.chartMsg.series;
|
|
||||||
this.option.yAxis = this.chartMsg.yAxis;
|
|
||||||
|
|
||||||
this.myChart.setOption(this.option);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.legendData {
|
|
||||||
text-align: right;
|
|
||||||
position: relative;
|
|
||||||
// right: 30;
|
|
||||||
// top: 10px;
|
|
||||||
.itemData {
|
|
||||||
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>
|
|
@ -1,252 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-06-20 16:13:36
|
|
||||||
* @LastEditTime: 2024-06-20 20:49:23
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-06-19 15:28:34
|
|
||||||
* @LastEditTime: 2024-06-20 16:02:21
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!-- 暂无数据 -->
|
|
||||||
<div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)"
|
|
||||||
v-show="this.chartMsg.series.length === 0"></div>
|
|
||||||
<!-- 图例 -->
|
|
||||||
<div v-show="this.chartMsg.series.length > 0">
|
|
||||||
<div class="legendData" v-if="show">
|
|
||||||
<span class="itemData" 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 :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as echarts from "echarts";
|
|
||||||
import { debounce } from "@/utils/debounce";
|
|
||||||
export default {
|
|
||||||
name: "bmLineBar",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
myChart: "",
|
|
||||||
option: {
|
|
||||||
color: [],
|
|
||||||
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
|
||||||
grid: {
|
|
||||||
left: -30,
|
|
||||||
right: 0,
|
|
||||||
bottom: 30,
|
|
||||||
top: 30,
|
|
||||||
containLabel:true,
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: "axis",
|
|
||||||
axisPointer: {
|
|
||||||
// type: "cross",
|
|
||||||
crossStyle: {
|
|
||||||
color: "rgba(237,237,237,0.5)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formatter: function (params) {
|
|
||||||
// console.log('params', 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: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>` +
|
|
||||||
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率"
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
|
|
||||||
: params[i].seriesName === "转化效率"
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
|
|
||||||
: params[i].seriesName.search('总功率') != -1
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "MW"
|
|
||||||
: params[i].value + "片"
|
|
||||||
}</span>`;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: "category",
|
|
||||||
data: [],
|
|
||||||
axisTick: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
axisPointer: {
|
|
||||||
type: "shadow",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dataZoom: [//滚动条
|
|
||||||
{
|
|
||||||
// 设置滚动条的隐藏与显示
|
|
||||||
show: true,
|
|
||||||
// 设置滚动条类型
|
|
||||||
type: "slider",
|
|
||||||
// 设置背景颜色
|
|
||||||
backgroundColor: "rgb(19, 63, 100)",
|
|
||||||
// 设置选中范围的填充颜色
|
|
||||||
fillerColor: "rgb(16, 171, 198)",
|
|
||||||
// 设置边框颜色
|
|
||||||
borderColor: "rgb(19, 63, 100)",
|
|
||||||
// 是否显示detail,即拖拽时候显示详细数值信息
|
|
||||||
showDetail: false,
|
|
||||||
// 数据窗口范围的起始数值
|
|
||||||
startValue: 0,
|
|
||||||
// 数据窗口范围的结束数值(一页显示多少条数据)
|
|
||||||
endValue: 5,
|
|
||||||
// empty:当前数据窗口外的数据,被设置为空。
|
|
||||||
// 即不会影响其他轴的数据范围
|
|
||||||
filterMode: "empty",
|
|
||||||
// 设置滚动条宽度,相对于盒子宽度
|
|
||||||
width: "50%",
|
|
||||||
// 设置滚动条高度
|
|
||||||
height: 8,
|
|
||||||
// 设置滚动条显示位置
|
|
||||||
left: "center",
|
|
||||||
// 是否锁定选择区域(或叫做数据窗口)的大小
|
|
||||||
zoomLoxk: true,
|
|
||||||
// 控制手柄的尺寸
|
|
||||||
handleSize: 0,
|
|
||||||
// dataZoom-slider组件离容器下侧的距离
|
|
||||||
bottom: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// 没有下面这块的话,只能拖动滚动条,
|
|
||||||
// 鼠标滚轮在区域内不能控制外部滚动条
|
|
||||||
type: "inside",
|
|
||||||
// 滚轮是否触发缩放
|
|
||||||
zoomOnMouseWheel: false,
|
|
||||||
// 鼠标滚轮触发滚动
|
|
||||||
moveOnMouseMove: true,
|
|
||||||
moveOnMouseWheel: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
yAxis:undefined,
|
|
||||||
series: [],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartHeight: {
|
|
||||||
type: Number,
|
|
||||||
default: 300,
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
default: 2,
|
|
||||||
},
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
type() {
|
|
||||||
this.canvasReset();
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
|
|
||||||
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
|
|
||||||
this.option.series = this.chartMsg.series;
|
|
||||||
this.option.yAxis = this.chartMsg.yAxis;
|
|
||||||
|
|
||||||
this.myChart.setOption(this.option);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.legendData {
|
|
||||||
text-align: right;
|
|
||||||
position: relative;
|
|
||||||
// right: 30;
|
|
||||||
// top: 10px;
|
|
||||||
.itemData {
|
|
||||||
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>
|
|
@ -1,245 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2024-06-20 16:13:52
|
|
||||||
* @LastEditTime: 2024-06-20 20:49:28
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!-- 暂无数据 -->
|
|
||||||
<div class="no-data-bg" style="position: relative; left: 50%; transform: translateX(-50%)"
|
|
||||||
v-show="this.chartMsg.series.length === 0"></div>
|
|
||||||
<!-- 图例 -->
|
|
||||||
<div v-show="this.chartMsg.series.length > 0">
|
|
||||||
<div class="legendData" v-if="show">
|
|
||||||
<span class="itemData" 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 :id="chartId" :style="{ width: '100%', height: chartHeight + 'px' }"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import * as echarts from "echarts";
|
|
||||||
import { debounce } from "@/utils/debounce";
|
|
||||||
export default {
|
|
||||||
name: "bmLineBar",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
myChart: "",
|
|
||||||
option: {
|
|
||||||
color: [],
|
|
||||||
// color: ["#8EF0AB", "#63BDFF", "#288AFF"],
|
|
||||||
grid: {
|
|
||||||
left: 30,
|
|
||||||
right: 0,
|
|
||||||
bottom: 30,
|
|
||||||
top: 30,
|
|
||||||
containLabel:true,
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: "axis",
|
|
||||||
axisPointer: {
|
|
||||||
// type: "cross",
|
|
||||||
crossStyle: {
|
|
||||||
color: "rgba(237,237,237,0.5)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formatter: function (params) {
|
|
||||||
console.log('params', 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: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>` +
|
|
||||||
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[i].seriesName === "综合良率"
|
|
||||||
? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%"
|
|
||||||
: params[i].seriesName === "转化效率"
|
|
||||||
? params[i].value+ "%"
|
|
||||||
: params[i].seriesName.search('总功率') != -1
|
|
||||||
? params[i].value + "MW"
|
|
||||||
: params[i].value + "片"
|
|
||||||
}</span>`;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: "category",
|
|
||||||
data: [],
|
|
||||||
axisTick: {
|
|
||||||
show: false,
|
|
||||||
},
|
|
||||||
axisPointer: {
|
|
||||||
type: "shadow",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dataZoom: [//滚动条
|
|
||||||
{
|
|
||||||
// 设置滚动条的隐藏与显示
|
|
||||||
show: true,
|
|
||||||
// 设置滚动条类型
|
|
||||||
type: "slider",
|
|
||||||
// 设置背景颜色
|
|
||||||
backgroundColor: "rgb(19, 63, 100)",
|
|
||||||
// 设置选中范围的填充颜色
|
|
||||||
fillerColor: "rgb(16, 171, 198)",
|
|
||||||
// 设置边框颜色
|
|
||||||
borderColor: "rgb(19, 63, 100)",
|
|
||||||
// 是否显示detail,即拖拽时候显示详细数值信息
|
|
||||||
showDetail: false,
|
|
||||||
// 数据窗口范围的起始数值
|
|
||||||
startValue: 0,
|
|
||||||
// 数据窗口范围的结束数值(一页显示多少条数据)
|
|
||||||
endValue: 5,
|
|
||||||
// empty:当前数据窗口外的数据,被设置为空。
|
|
||||||
// 即不会影响其他轴的数据范围
|
|
||||||
filterMode: "empty",
|
|
||||||
// 设置滚动条宽度,相对于盒子宽度
|
|
||||||
width: "50%",
|
|
||||||
// 设置滚动条高度
|
|
||||||
height: 8,
|
|
||||||
// 设置滚动条显示位置
|
|
||||||
left: "center",
|
|
||||||
// 是否锁定选择区域(或叫做数据窗口)的大小
|
|
||||||
zoomLoxk: true,
|
|
||||||
// 控制手柄的尺寸
|
|
||||||
handleSize: 0,
|
|
||||||
// dataZoom-slider组件离容器下侧的距离
|
|
||||||
bottom: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// 没有下面这块的话,只能拖动滚动条,
|
|
||||||
// 鼠标滚轮在区域内不能控制外部滚动条
|
|
||||||
type: "inside",
|
|
||||||
// 滚轮是否触发缩放
|
|
||||||
zoomOnMouseWheel: false,
|
|
||||||
// 鼠标滚轮触发滚动
|
|
||||||
moveOnMouseMove: true,
|
|
||||||
moveOnMouseWheel: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
yAxis:undefined,
|
|
||||||
series: [],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
chartHeight: {
|
|
||||||
type: Number,
|
|
||||||
default: 300,
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
default: 2,
|
|
||||||
},
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
type() {
|
|
||||||
this.canvasReset();
|
|
||||||
},
|
|
||||||
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;
|
|
||||||
|
|
||||||
// this.option.yAxis.axisLabel = this.chartMsg.yAxisLabel;
|
|
||||||
this.option.series = this.chartMsg.series;
|
|
||||||
this.option.yAxis = this.chartMsg.yAxis;
|
|
||||||
|
|
||||||
this.myChart.setOption(this.option);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.legendData {
|
|
||||||
text-align: right;
|
|
||||||
position: relative;
|
|
||||||
// right: 30;
|
|
||||||
// top: 10px;
|
|
||||||
.itemData {
|
|
||||||
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>
|
|
@ -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-20 20:46:53
|
* @LastEditTime: 2024-06-18 13:41:03
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -13,48 +13,59 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto;">
|
<div class="app-container" style="margin-top: 8px;flex-grow: 1; height: auto;">
|
||||||
<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="type">
|
<el-form-item label="时间维度" prop="date">
|
||||||
<el-select size="small" clearable v-model="listQuery.type" 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.type === 0 || listQuery.type === ''" 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="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime"
|
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
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.type === 1" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周"
|
<el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
||||||
placeholder="选择周" style="width: 180px" @change="onValueChange">
|
style="width: 180px" @change="onValueChange">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
至
|
至
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周"
|
<el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
||||||
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">
|
|
||||||
{{ date1 }} 至 {{ date2 }},共 {{ weekNum }} 周
|
|
||||||
</span> -->
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="listQuery.type === 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"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
||||||
value-format="yyyy-MM-dd" 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.type === 3" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" 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>
|
||||||
~
|
~
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime[1]" value-format="yyyy" type="year"
|
||||||
placeholder="结束时间" @change="getYear">
|
placeholder="结束时间" @change="getYear">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="玻璃类型" prop="type">
|
||||||
|
<el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
|
||||||
|
<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 label="玻璃类型" prop="type">
|
||||||
|
<el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
|
||||||
|
<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>
|
<el-form-item>
|
||||||
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
|
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<!-- <el-button type="primary" size="small" plain @click="handleImport">导入</el-button> -->
|
||||||
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
|
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
|
||||||
|
<!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||||
@ -66,7 +77,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { parseTime } from '../../core/mixins/code-filter';
|
// import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import { getComprehensiveDataPage, exportComprehensiveDataPage } from '@/api/report';
|
import { getComprehensiveDataPage } from '@/api/report';
|
||||||
// import { getWorkOrderPage, exportExcel, getOverView } from '@/components/buttonNav'
|
// import { getWorkOrderPage, exportExcel, getOverView } from '@/components/buttonNav'
|
||||||
// import inputTable from './inputTable.vue';
|
// import inputTable from './inputTable.vue';
|
||||||
// import lineChart from './lineChart';
|
// import lineChart from './lineChart';
|
||||||
@ -86,19 +97,16 @@ export default {
|
|||||||
return {
|
return {
|
||||||
factoryList,
|
factoryList,
|
||||||
factoryArray,
|
factoryArray,
|
||||||
|
start: undefined,
|
||||||
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 999,
|
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factory: undefined,
|
factory: null,
|
||||||
// total: 0,
|
// total: 0,
|
||||||
type: 2,
|
type: 2,
|
||||||
startDate: undefined,
|
startDate: undefined,
|
||||||
endDate: undefined,
|
endDate: undefined,
|
||||||
start: undefined,
|
|
||||||
end: undefined,
|
|
||||||
reportTime: []
|
reportTime: []
|
||||||
},
|
},
|
||||||
timeList: [
|
timeList: [
|
||||||
@ -144,7 +152,68 @@ export default {
|
|||||||
id: 2,
|
id: 2,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
otherProps:[],
|
tableProps: [
|
||||||
|
{
|
||||||
|
prop: 'factory',
|
||||||
|
label: '玻璃类型',
|
||||||
|
fixed:true,
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
// minWidth: 200,
|
||||||
|
// showOverflowtooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workOrderNumber',
|
||||||
|
label: '科目/日期',
|
||||||
|
fixed: true,
|
||||||
|
// filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workOrderType',
|
||||||
|
label: '单位',
|
||||||
|
fixed: true,
|
||||||
|
// filter: publicFormatter('workorder_status')
|
||||||
|
// filter: (val) => ['', '芯片工单', '组件类型', 'bipv类型'][val],
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// prop: 'plannedInvestment',
|
||||||
|
// label: '计划投入',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'actualInvestment',
|
||||||
|
// label: '实际投入',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'targetProduction',
|
||||||
|
// label: '目标产量',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'actualProduction',
|
||||||
|
// label: '实际产量',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'productionProgress',
|
||||||
|
// label: '生产进度',
|
||||||
|
// filter: (val) => (val * 100) + '%'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'orderStatus',
|
||||||
|
// label: '工单状态',
|
||||||
|
// filter: publicFormatter('workorder_status')
|
||||||
|
// // filter: (val) => ['未开始', '生产中', '已完成'][val],
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'startTime',
|
||||||
|
// label: '开始时间',
|
||||||
|
// minWidth: 100,
|
||||||
|
// showOverflowtooltip: true
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// prop: 'endTime',
|
||||||
|
// label: '完成时间',
|
||||||
|
// minWidth: 100,
|
||||||
|
// showOverflowtooltip: true
|
||||||
|
// }
|
||||||
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
xAxis: [],
|
xAxis: [],
|
||||||
currentMenu:null,
|
currentMenu:null,
|
||||||
@ -158,32 +227,6 @@ export default {
|
|||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
tableProps() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
prop: 'type',
|
|
||||||
label: '玻璃类型',
|
|
||||||
fixed: true,
|
|
||||||
// filter: (val) => factoryList[val],
|
|
||||||
// minWidth: 200,
|
|
||||||
// showOverflowtooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'item',
|
|
||||||
label: '科目/日期',
|
|
||||||
fixed: true,
|
|
||||||
// filter: (val) => ['玻璃芯片', '标准组件', 'BIPV', '定制组件'][val]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
fixed: true,
|
|
||||||
// filter: publicFormatter('workorder_status')
|
|
||||||
// filter: (val) => ['', '芯片工单', '组件类型', 'bipv类型'][val],
|
|
||||||
},
|
|
||||||
...this.otherProps
|
|
||||||
]
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
// created() {
|
// created() {
|
||||||
// const currentMonth = new Date()
|
// const currentMonth = new Date()
|
||||||
@ -192,40 +235,67 @@ export default {
|
|||||||
// },
|
// },
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const today = new Date()
|
const currentMonth = new Date()
|
||||||
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
||||||
this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD')
|
this.changeTime()
|
||||||
this.listQuery.endDate = moment(today).format('yyyy-MM-DD')
|
|
||||||
this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate]
|
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getYear(e) {
|
getYear(e) {
|
||||||
if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) {
|
if (this.end && Number(this.end) - Number(this.start) > 10) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '年份起止时间不能超过十年',
|
message: '年份起止时间不能超过十年',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
this.listQuery.reportTime = []
|
this.start = undefined
|
||||||
this.listQuery.start = undefined
|
this.end = undefined
|
||||||
this.listQuery.end = undefined
|
|
||||||
// console.log();
|
// console.log();
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.startDate = this.listQuery.start
|
if (Number(this.end) < Number(this.start)) {
|
||||||
this.listQuery.endDate = this.listQuery.end
|
this.$message({
|
||||||
|
message: '结束年份不能小于开始年份',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.start = undefined
|
||||||
|
this.end = undefined
|
||||||
|
} else {
|
||||||
|
this.listQuery.startDate = Number(this.start)
|
||||||
|
this.listQuery.endDate = Number(this.end)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!this.listQuery.start && !this.listQuery.end) {
|
if (!this.start && !this.end) {
|
||||||
this.listQuery.startDate = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endDate = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
changeTime() {
|
||||||
// console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
|
if (this.listQuery.reportTime) {
|
||||||
if (this.listQuery.start && this.listQuery.end) {
|
|
||||||
console.log(this.listQuery.reportTime)
|
console.log(this.listQuery.reportTime)
|
||||||
this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
let start = new Date(this.listQuery.reportTime[0])
|
||||||
this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
let end = new Date(this.listQuery.reportTime[1])
|
||||||
|
// const years = Number(this.listQuery.reportTime[1].slice(0, 4)) - Number(this.listQuery.reportTime[0].slice(0, 4))
|
||||||
|
// const months = Number(this.listQuery.reportTime[1].slice(4)) - Number(this.listQuery.reportTime[0].slice(4))
|
||||||
|
// console.log(years);
|
||||||
|
if ((end - start) > 31104000000) {
|
||||||
|
this.$message({
|
||||||
|
message: '时间范围不能超过24个月',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.listQuery.reportTime = [];
|
||||||
|
} else {
|
||||||
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.listQuery.startDate = undefined
|
||||||
|
this.listQuery.endDate = undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
|
if (this.start && this.end) {
|
||||||
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -234,21 +304,20 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.listQuery.startDate = this.date1
|
||||||
this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.listQuery.endDate = this.date2
|
||||||
|
// this.listQuery.startDate = Number(moment(this.start.getTime()).format('YYYYWW'))
|
||||||
|
// this.listQuery.endDate = Number(moment(this.end.getTime()).format('YYYYWW'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.listQuery.start && !this.listQuery.end) {
|
if (!this.start && !this.end) {
|
||||||
this.listQuery.startDate = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endDate = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeDayTime() {
|
changeDayTime() {
|
||||||
if (this.listQuery.reportTime) {
|
if (this.listQuery.reportTime) {
|
||||||
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
|
||||||
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
console.log(this.listQuery.reportTime[1])
|
|
||||||
const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000);
|
|
||||||
if (numDays > 30) {
|
if (numDays > 30) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '时间范围不能超过30天',
|
message: '时间范围不能超过30天',
|
||||||
@ -264,209 +333,30 @@ export default {
|
|||||||
this.listQuery.endDate = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTime(value) {
|
getOverView() {
|
||||||
if (this.listQuery.reportTime) {
|
// getOverView().then(res => {
|
||||||
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0];
|
// this.data = res.data
|
||||||
if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) {
|
// console.log('aa', res.data)
|
||||||
this.$message({
|
// })
|
||||||
message: '时间范围不能超过24个月',
|
},
|
||||||
type: 'warning'
|
otherMethods(val) {
|
||||||
});
|
this.detailOrUpdateVisible = true;
|
||||||
this.listQuery.reportTime = [];
|
// this.addOrEditTitle = "详情";
|
||||||
} else {
|
this.$nextTick(() => {
|
||||||
this.listQuery.startDate = this.listQuery.reportTime[0]
|
// this.$refs.detailOrUpdate.init(val.data.id);
|
||||||
this.listQuery.endDate = this.listQuery.reportTime[1]
|
});
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.listQuery.startDate = undefined
|
|
||||||
this.listQuery.endDate = undefined
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
this.otherProps = []
|
console.log(this.listQuery);
|
||||||
|
if (this.listQuery.type == 3) {
|
||||||
|
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
||||||
|
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
||||||
|
}
|
||||||
let arr = []
|
let arr = []
|
||||||
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
|
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
|
||||||
this.listQuery.factory = arr
|
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
|
||||||
let dataArr = [{
|
|
||||||
type: '芯片',
|
|
||||||
item: 'FTO投入',
|
|
||||||
unit: '片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片产量',
|
|
||||||
unit: '片'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片平均功率',
|
|
||||||
unit: 'W'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片良率',
|
|
||||||
unit: '%'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片产量',
|
|
||||||
unit: '片'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片总功率',
|
|
||||||
unit: 'MW'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: 'CSS稼动率',
|
|
||||||
unit: '%'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片段OEE',
|
|
||||||
unit: '%'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片产能利用率',
|
|
||||||
unit: '%'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片人均产量',
|
|
||||||
unit: '片/人'
|
|
||||||
}, {
|
|
||||||
type: '芯片',
|
|
||||||
item: '芯片BOM',
|
|
||||||
unit: '元/片'
|
|
||||||
}, {
|
|
||||||
type: '标准组件',
|
|
||||||
item: '标准组件产量',
|
|
||||||
unit: '片'
|
|
||||||
}, {
|
|
||||||
type: '标准组件',
|
|
||||||
item: '标准组件平均功率',
|
|
||||||
unit: 'W'
|
|
||||||
}, {
|
|
||||||
type: '标准组件',
|
|
||||||
item: '标准组件良率',
|
|
||||||
unit: '%'
|
|
||||||
}, {
|
|
||||||
type: '标准组件',
|
|
||||||
item: '标准组件总功率',
|
|
||||||
unit: 'MW'
|
|
||||||
}, {
|
|
||||||
type: '标准组件',
|
|
||||||
item: '封装线OEE',
|
|
||||||
unit: '%'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '标准组件',
|
|
||||||
item: '封装线产能利用率',
|
|
||||||
unit: '%'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '标准组件',
|
|
||||||
item: '标准组件人均产量',
|
|
||||||
unit: '片/人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '标准组件',
|
|
||||||
item: '封装BOM',
|
|
||||||
unit: '元/片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: '芯片使用量',
|
|
||||||
unit: '%'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: 'BIPV产量',
|
|
||||||
unit: 'm2'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: '芯片使用率',
|
|
||||||
unit: '%'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: '人均产量',
|
|
||||||
unit: 'm2/人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: 'OEM及委外材料成本',
|
|
||||||
unit: '元/片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: '内部材料成本',
|
|
||||||
unit: '元/片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'BIPV',
|
|
||||||
item: '综合材料成本',
|
|
||||||
unit: '元/片'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
res.data.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
// this.chartMsg.xData.push(ele.titleValue)
|
|
||||||
this.otherProps.push({
|
|
||||||
label: ele.titleValue,
|
|
||||||
props: 'value' + i
|
|
||||||
})
|
|
||||||
})
|
|
||||||
console.log(this.otherProps)
|
|
||||||
res.data.forEach((item, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
let m = 'value' + i
|
|
||||||
// ele.productYieldDataVOList.forEach((item) => {
|
|
||||||
dataArr[0]['' + m + ''] = item.ftoInput
|
|
||||||
// dataArr[0].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[1].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[2].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[3].factory = item.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1]['' + m + ''] = item.chipYield
|
|
||||||
dataArr[2]['' + m + ''] = item.chipAveragePower
|
|
||||||
dataArr[4]['' + m + ''] = item.chipTotalPower
|
|
||||||
dataArr[5]['' + m + ''] = item.chipCssMarriageRate
|
|
||||||
dataArr[6]['' + m + ''] = item.chipOee
|
|
||||||
dataArr[7]['' + m + ''] = item.chipCapacityUtilizationRate
|
|
||||||
dataArr[8]['' + m + ''] = item.chipAnnualAverageProduction
|
|
||||||
dataArr[9]['' + m + ''] = item.chipBom
|
|
||||||
dataArr[10]['' + m + ''] = item.componentYield
|
|
||||||
dataArr[11]['' + m + ''] = item.componentAveragePower
|
|
||||||
dataArr[12]['' + m + ''] = item.componentYieldRate
|
|
||||||
dataArr[13]['' + m + ''] = item.componentTotalPower
|
|
||||||
dataArr[14]['' + m + ''] = item.componentOee
|
|
||||||
dataArr[15]['' + m + ''] = item.componentCapacityUtilizationRate
|
|
||||||
dataArr[16]['' + m + ''] = item.componentAnnualAverageProduction
|
|
||||||
dataArr[17]['' + m + ''] = item.componentBom
|
|
||||||
dataArr[18]['' + m + ''] = item.bipvChipUsage
|
|
||||||
dataArr[19]['' + m + ''] = item.bipvProductOutput
|
|
||||||
dataArr[20]['' + m + ''] = item.bipvChipUtilizationRate
|
|
||||||
dataArr[21]['' + m + ''] = item.bipvAnnualAverageProduction
|
|
||||||
dataArr[22]['' + m + ''] = item.bipvOeeMaterialCost
|
|
||||||
dataArr[23]['' + m + ''] = item.bipvInsideMaterialCost
|
|
||||||
dataArr[24]['' + m + ''] = item.bipvComprehensiveMaterialCost
|
|
||||||
|
|
||||||
// })
|
|
||||||
// ele.titleValue
|
|
||||||
// .push({
|
|
||||||
// label: ele.titleValue,
|
|
||||||
// props: 'value' + index + 1,
|
|
||||||
// })
|
|
||||||
})
|
|
||||||
if (res.data.length === 0) {
|
|
||||||
this.tableData = []
|
|
||||||
} else {
|
|
||||||
if (this.currentMenu !== '瑞昌') {
|
|
||||||
this.tableData = dataArr
|
|
||||||
} else {
|
|
||||||
this.tableData = dataArr.filter(function (item) {
|
|
||||||
return item.type !== "BIPV"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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 => {
|
||||||
@ -502,14 +392,6 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
|
||||||
let fileName = "综合数据.xls";
|
|
||||||
exportComprehensiveDataPage(this.listQuery)
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
// this.$modal.confirm('是否确认导出工单数据?').then(() => {
|
// this.$modal.confirm('是否确认导出工单数据?').then(() => {
|
||||||
// // 处理查询参数
|
// // 处理查询参数
|
||||||
// // let params = {...this.listQuery};
|
// // let params = {...this.listQuery};
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,102 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
utilzationComparePage,
|
{
|
||||||
utilzationCompareExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ConversionEfficiencyBM",
|
name: "ConversionEfficiencyBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -93,8 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 57.5 },
|
||||||
|
{ name: "%", value: 21.66 },
|
||||||
|
{ name: "%", value: 18.4 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -107,8 +152,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 23.33 },
|
||||||
|
{ name: "%", value: 7.02 },
|
||||||
|
{ name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -144,17 +193,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -166,169 +208,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "ConversionEfficiencyBM") {
|
if (this.$route.name === "ConversionEfficiencyBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].target || 0,
|
|
||||||
});
|
|
||||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
|
||||||
barData2.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].queryValue || 0,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = lineData;
|
|
||||||
this.chartMsg.series[1].data = barData1;
|
|
||||||
this.chartMsg.series[2].data = barData2;
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/%",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [-18, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#288AFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "稼动率对标.xls";
|
|
||||||
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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,101 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
fTOReportByDateRangePage,
|
{
|
||||||
fTOReportByDateRangeExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "FtoOutputBM",
|
name: "FtoOutputBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// 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: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -138,17 +184,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -160,184 +199,80 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "FtoOutputBM") {
|
if (this.$route.name === "FtoOutputBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.date = val.type;
|
console.log(val);
|
||||||
this.listQuery.queryTime = val.startDate;
|
console.log("==========下面是测试代码,需删除");
|
||||||
this.listQuery.factorys = val.factory;
|
this.chartMsg.series = [];
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出=====下面是测试代码,需删除");
|
||||||
fTOReportByDateRangePage({ ...this.listQuery }).then((res) => {
|
this.chartMsg.series = [
|
||||||
if (res.data && res.data.length > 0) {
|
{
|
||||||
// 设置表头
|
name: "2024年4月目标值1",
|
||||||
let msg = res.data[0];
|
// data: [3000, 2000, 3000],
|
||||||
let arr = [
|
// data: [6800, 5000, 8900],
|
||||||
{
|
// data: [12000, 17000, 19000],
|
||||||
prop: "lastone",
|
data: [560000, 540000, 600000],
|
||||||
label: msg.lastone.reportTime,
|
type: "line",
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
symbol: "circle",
|
||||||
minWidth: 150,
|
symbolSize: 6,
|
||||||
},
|
label: {
|
||||||
{
|
show: true,
|
||||||
prop: "currentone",
|
color: "#FFAE17",
|
||||||
label: msg.currentone.reportTime,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "targetone",
|
|
||||||
label: msg.targetone.reportTime,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
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];
|
|
||||||
}
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
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: [],
|
name: "2023年4月",
|
||||||
type: "bar",
|
// data: [2100, 800, 1500],
|
||||||
barWidth: 20,
|
// data: [9500, 7200, 9901],
|
||||||
label: {
|
// data: [14666, 15000, 17888],
|
||||||
show: true,
|
data: [550000, 456666, 590000],
|
||||||
// position: [-5, -16],
|
type: "bar",
|
||||||
// position: [-5, -16],
|
barWidth: 20,
|
||||||
position: [-10, -16],
|
label: {
|
||||||
// position: [-17, -16],
|
show: true,
|
||||||
color: "#68C483",
|
// position: [-5, -16],
|
||||||
},
|
// position: [-5, -16],
|
||||||
|
// position: [-10, -16],
|
||||||
|
position: [-17, -16],
|
||||||
|
color: "#68C483",
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
name: "3",
|
{
|
||||||
data: [],
|
name: "2024年4月",
|
||||||
type: "bar",
|
// data: [2100, 900, 1300],
|
||||||
barWidth: 20,
|
// data: [9100, 7300, 9700],
|
||||||
label: {
|
// data: [14666, 15300, 18000],
|
||||||
show: true,
|
data: [556666, 456666, 650000],
|
||||||
position: [0, -16],
|
type: "bar",
|
||||||
color: "#288AFF",
|
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 = "产量对标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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,102 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
componentOEEPage,
|
{
|
||||||
componentOEEExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "PackageOEEBM",
|
name: "PackageOEEBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -93,8 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 57.5 },
|
||||||
|
{ name: "%", value: 21.66 },
|
||||||
|
{ name: "%", value: 18.4 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -107,8 +152,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 23.33 },
|
||||||
|
{ name: "%", value: 7.02 },
|
||||||
|
{ name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -144,17 +193,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -166,169 +208,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "PackageOEEBM") {
|
if (this.$route.name === "PackageOEEBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].target || 0,
|
|
||||||
});
|
|
||||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
|
||||||
barData2.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].queryValue || 0,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = lineData;
|
|
||||||
this.chartMsg.series[1].data = barData1;
|
|
||||||
this.chartMsg.series[2].data = barData2;
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/%",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [-18, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#288AFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "封装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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<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="search">
|
<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.date" placeholder="请选择">
|
<el-select size="small" clearable v-model="listQuery.date" placeholder="请选择">
|
||||||
@ -12,9 +12,9 @@
|
|||||||
</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.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" @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.date === 1" label="时间范围" prop="reportTime">
|
<el-form-item v-show="listQuery.date === 1" label="时间范围" prop="reportTime">
|
||||||
@ -30,8 +30,9 @@
|
|||||||
</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.date === 2" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange" value-format="yyyy-MM-DD"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
||||||
range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @change="changeTime">
|
value-format="yyyy-MM-DD HH:mm:ss" range-separator="至" 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.date === 3" label="时间值" prop="reportTime">
|
||||||
@ -63,40 +64,11 @@
|
|||||||
<!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
|
<!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
<!-- <div class="smallTitle">产量转化效率</div> -->
|
||||||
<div class="containerTop">
|
|
||||||
<el-row v-if="listQuery.date === 2">
|
<!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> -->
|
||||||
<el-col :span="16">
|
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
||||||
<div class="blueTip">
|
:chartNum="chartNum" />
|
||||||
产量转化效率
|
|
||||||
</div>
|
|
||||||
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
|
||||||
:chartNum="chartNum" />
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div class="blueTip">
|
|
||||||
{{ title }}
|
|
||||||
</div>
|
|
||||||
<produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
|
|
||||||
:chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-else>
|
|
||||||
<!-- <el-col :span="24"> -->
|
|
||||||
<div class="blueTip">
|
|
||||||
产量转化效率
|
|
||||||
</div>
|
|
||||||
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
|
||||||
:chartNum="chartNum" />
|
|
||||||
<!-- </el-col> -->
|
|
||||||
<!-- <el-col :span="8">
|
|
||||||
<div class="blueTip">
|
|
||||||
{{ title }}
|
|
||||||
</div>
|
|
||||||
<produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
|
|
||||||
:chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
|
|
||||||
</el-col> -->
|
|
||||||
</el-row>
|
|
||||||
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
|
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
|
||||||
:max-height="tableH" />
|
:max-height="tableH" />
|
||||||
</div>
|
</div>
|
||||||
@ -107,23 +79,58 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getProduceTransData, exportProduceTransData } from '@/api/report';
|
import bmSearchBar from "./components/bmSearchBar.vue";
|
||||||
import bmSearchBar from "./components/bmSearchBar";
|
import BmLineBar from "./components/bmLineBar.vue";
|
||||||
import BmLineBar from "./components/produceLineBar.vue";
|
|
||||||
import produceLineBarYearTarget from "./components/produceLineBarYearTarget.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 = [
|
||||||
|
{
|
||||||
|
prop: "factory",
|
||||||
|
label: "玻璃类型",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
otherProps: [],
|
tableProps,
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 999,
|
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factorys: null,
|
factorys: null,
|
||||||
@ -151,137 +158,67 @@ export default {
|
|||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(137) / 2 - 111,
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
tableH: this.tableHeight(137) / 2 - 70,
|
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: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
{
|
|
||||||
id: 2, name: "FTO投入", type: 1, color: "#8EF0AB"
|
|
||||||
},
|
|
||||||
{ id: 3, name: "芯片产量", type: 1, color: "#288AFF" },
|
|
||||||
{
|
|
||||||
id: 3, name: "标准组件产量", type: 1, color: "#288AFF"
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
chartMsgYearTarget: {
|
|
||||||
color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
|
|
||||||
xData: [],
|
|
||||||
// yName: "单位/%",
|
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
name: "单位/片",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
// inverse: true,
|
|
||||||
name: "单位/%",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "",
|
|
||||||
// yAxisIndex: 0,
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
value: 1,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#8EF0AB'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 2,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#288AFF'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#64BDFF'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
yAxisIndex: 1,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#FFCE6A'
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [-18, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value + "片";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '销量折线图',
|
|
||||||
type: 'bar',
|
|
||||||
data: [0, 0, 0,
|
|
||||||
{
|
|
||||||
value: 5,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#FFCE6A'
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
barWith: "40%",
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
formatter: "{c}%"
|
|
||||||
},
|
|
||||||
lineStyle: {
|
|
||||||
color: "#ffb122"
|
|
||||||
},
|
|
||||||
yAxisIndex: 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "",
|
yName: "单位/%",
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
name: "单位/片",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
name: "单位/%",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "FTO投入",
|
name: "2024年4月目标值",
|
||||||
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
|
type: "line",
|
||||||
|
symbol: "circle",
|
||||||
|
symbolSize: 6,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
color: "#FFAE17",
|
||||||
|
formatter: function (params) {
|
||||||
|
return params.value.toFixed(2) + "%";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "2023年4月",
|
||||||
data: [
|
data: [
|
||||||
{ name: "%", value: 57.5 },
|
{ name: "%", value: 57.5 },
|
||||||
{ name: "%", value: 21.66 },
|
{ name: "%", value: 21.66 },
|
||||||
@ -299,7 +236,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "芯片产量",
|
name: "2024年4月",
|
||||||
data: [
|
data: [
|
||||||
{ name: "%", value: 23.33 },
|
{ name: "%", value: 23.33 },
|
||||||
{ name: "%", value: 7.02 },
|
{ name: "%", value: 7.02 },
|
||||||
@ -316,44 +253,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "标准组件产量",
|
|
||||||
data: [
|
|
||||||
{ name: "%", value: 23.33 },
|
|
||||||
{ name: "%", value: 7.02 },
|
|
||||||
{ name: "%", value: 80.2 },
|
|
||||||
],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#64BDFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "综合良率",
|
|
||||||
data: [
|
|
||||||
{ name: "%", value: 85 },
|
|
||||||
{ name: "%", value: 85 },
|
|
||||||
{ name: "%", value: 85 },
|
|
||||||
],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
// barWidth: 20,
|
|
||||||
symbolSize: 6,
|
|
||||||
yAxisIndex: 1,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
chartId: "chipYieldBMChart",
|
chartId: "chipYieldBMChart",
|
||||||
@ -363,35 +262,9 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
bmSearchBar,
|
bmSearchBar,
|
||||||
BmLineBar,
|
BmLineBar,
|
||||||
produceLineBarYearTarget,
|
|
||||||
ButtonNav
|
ButtonNav
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tableProps() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
prop: "factory",
|
|
||||||
label: "工厂名称",
|
|
||||||
// filter: (val) => factoryList[val],
|
|
||||||
minWidth: 200,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "item",
|
|
||||||
label: "科目",
|
|
||||||
// filter: (val) => factoryList[val],
|
|
||||||
minWidth: 200,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "unit",
|
|
||||||
label: "单位",
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
...this.otherProps
|
|
||||||
]
|
|
||||||
},
|
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
@ -424,7 +297,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const currentMonth = new Date()
|
const currentMonth = new Date()
|
||||||
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD'), moment(currentMonth).format('yyyy-MM-DD')]
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
||||||
this.changeTime()
|
this.changeTime()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@ -482,8 +355,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
if (this.start && this.end) {
|
if (this.start && this.end) {
|
||||||
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -535,177 +408,20 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
this.otherProps = []
|
|
||||||
this.chartMsg.xData = []
|
|
||||||
console.log(this.listQuery);
|
console.log(this.listQuery);
|
||||||
if (this.listQuery.type == 3) {
|
if (this.listQuery.date == 3) {
|
||||||
this.listQuery.beginTime = this.listQuery.reportTime[0]
|
this.listQuery.beginTime = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
||||||
this.listQuery.endTime = this.listQuery.reportTime[1]
|
this.listQuery.endTime = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
||||||
}
|
}
|
||||||
let arr = []
|
let arr = []
|
||||||
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(2)
|
||||||
this.listQuery.factorys = arr
|
this.listQuery.factorys = arr
|
||||||
const res = await getProduceTransData(this.listQuery)
|
const res = await getProduceTransData(this.listQuery)
|
||||||
let dataArr = [{
|
this.tableData = res.data.list
|
||||||
factory: null,
|
|
||||||
item: '芯片总功率',
|
|
||||||
unit: 'MW'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
factory: null,
|
|
||||||
item: '标准组件总功率',
|
|
||||||
unit: 'MW'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
factory: null,
|
|
||||||
item: '转化效率',
|
|
||||||
unit: '%'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
res.data.forEach(element => {
|
|
||||||
element.list.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
this.chartMsg.xData.push(ele.reportTimep)
|
|
||||||
this.otherProps.push({
|
|
||||||
label: ele.reportTimep,
|
|
||||||
props: 'value' + i
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
|
||||||
console.log(this.otherProps)
|
|
||||||
res.data.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
let m = 'value' + i
|
|
||||||
ele.list.forEach((item, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
let m = 'value' + i
|
|
||||||
// ele.productionSituationDataVOList.forEach((item) => {
|
|
||||||
dataArr[0]['' + m + ''] = item.chipTotalPowers
|
|
||||||
dataArr[0].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[2].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[3].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1]['' + m + ''] = ele.scTotalPowers
|
|
||||||
dataArr[2]['' + m + ''] = ele.conversionEfficiency
|
|
||||||
// dataArr[3]['' + m + ''] = ele.comprehensiveYieldRate
|
|
||||||
// })
|
|
||||||
// ele.titleValue
|
|
||||||
// .push({
|
|
||||||
// label: ele.titleValue,
|
|
||||||
// props: 'value' + index + 1,
|
|
||||||
// })
|
|
||||||
})
|
|
||||||
// ele.productionSituationDataVOList.forEach((item) => {
|
|
||||||
// dataArr[0]['' + m + ''] = item.chipTotalPowers
|
|
||||||
// dataArr[0].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[1].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[2].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[3].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[1]['' + m + ''] = ele.scTotalPowers
|
|
||||||
// dataArr[2]['' + m + ''] = ele.conversionEfficiency
|
|
||||||
// dataArr[3]['' + m + ''] = ele.comprehensiveYieldRate
|
|
||||||
// })
|
|
||||||
// ele.titleValue
|
|
||||||
// .push({
|
|
||||||
// label: ele.titleValue,
|
|
||||||
// props: 'value' + index + 1,
|
|
||||||
// })
|
|
||||||
})
|
|
||||||
for (let i in dataArr[0]) {
|
|
||||||
this.chartMsg.series[0].name = dataArr[0]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[0].data.push({
|
|
||||||
name: dataArr[0]['item'],
|
|
||||||
name: dataArr[0][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[1]) {
|
|
||||||
this.chartMsg.series[1].name = dataArr[1]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[1].data.push({
|
|
||||||
name: dataArr[1]['item'],
|
|
||||||
name: dataArr[1][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[2]) {
|
|
||||||
this.chartMsg.series[2].name = dataArr[2]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[2].data.push({
|
|
||||||
name: dataArr[2]['item'],
|
|
||||||
name: dataArr[2][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[3]) {
|
|
||||||
this.chartMsg.series[3].name = dataArr[3]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[3].data.push({
|
|
||||||
name: dataArr[3]['item'],
|
|
||||||
name: dataArr[3][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.tableProps = otherProps
|
|
||||||
// res.data.list.forEach((ele) => {
|
|
||||||
// console.log(ele);
|
|
||||||
// ele.productionSituationDataVOList.forEach((item) => {
|
|
||||||
// let obj = {
|
|
||||||
// bipvProductOutput: item.bipvProductOutput,
|
|
||||||
// chipYield: item.chipYield,
|
|
||||||
// componentYield: item.componentYield,
|
|
||||||
// factory: item.factory,
|
|
||||||
// ftoInput: item.ftoInput,
|
|
||||||
// titleValue:ele.titleValue
|
|
||||||
// }
|
|
||||||
// dataArr.push(obj)
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
for (let i in dataArr[0]) {
|
|
||||||
this.chartMsg.series[0].name = dataArr[0]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[0].data.push({
|
|
||||||
name: dataArr[0]['item'],
|
|
||||||
value: dataArr[0][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[1]) {
|
|
||||||
this.chartMsg.series[1].name = dataArr[1]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[1].data.push({
|
|
||||||
name: dataArr[1]['item'],
|
|
||||||
value: dataArr[1][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[2]) {
|
|
||||||
this.chartMsg.series[2].name = dataArr[2]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[2].data.push({
|
|
||||||
name: dataArr[2]['item'],
|
|
||||||
value: dataArr[2][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// for (let i in dataArr[3]) {
|
|
||||||
// this.chartMsg.series[3].name = dataArr[3]['item']
|
|
||||||
// if (i.search('value') === 0) {
|
|
||||||
// this.chartMsg.series[3].data.push({
|
|
||||||
// name: dataArr[3]['item'],
|
|
||||||
// name: dataArr[3][i]
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
console.log(dataArr)
|
|
||||||
this.tableData = dataArr
|
|
||||||
// this.tableProps.push()
|
|
||||||
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.beginTime = item.beginTime ? item.beginTime[0] + '-' + item.beginTime[1] + '-' + item.beginTime[2] : '--'
|
item.startTime = item.beginTime ? item.beginTime[0] + '-' + item.beginTime[1] + '-' + item.beginTime[2] : '--'
|
||||||
item.endTime = item.endTime ? item.endTime[0] + '-' + item.endTime[1] + '-' + item.endTime[2] : '--'
|
item.endTime = item.endTime ? item.endTime[0] + '-' + item.endTime[1] + '-' + item.endTime[2] : '--'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -722,13 +438,6 @@ export default {
|
|||||||
console.log("=========================");
|
console.log("=========================");
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
let fileName = "产量转化效率.xls";
|
|
||||||
exportProduceTransData(this.listQuery)
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
console.log("导出");
|
console.log("导出");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -741,10 +450,9 @@ export default {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 16px 16px 0 16px;
|
padding: 16px 16px 0 16px;
|
||||||
margin: 8px 0px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
.containerTop{
|
||||||
.containerTop {
|
|
||||||
height: calc((100vh - 170px));
|
height: calc((100vh - 170px));
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@ -761,7 +469,6 @@ export default {
|
|||||||
margin-right: 8PX;
|
margin-right: 8PX;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containerTop {
|
.containerTop {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4,86 +4,71 @@
|
|||||||
<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="search">
|
<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="type">
|
<el-form-item label="时间维度" prop="date">
|
||||||
<el-select size="small" clearable v-model="listQuery.type" 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.type === 0 || listQuery.type === ''" 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="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd" @change="changeDayTime"
|
start-placeholder="开始日期" value-format="yyyy-MM-dd HH:mm:ss" @change="changeDayTime" end-placeholder="结束日期">
|
||||||
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.type === 1" label="时间范围" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.start" type="week" format="yyyy 第 WW 周"
|
<el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
||||||
placeholder="选择周" style="width: 180px" @change="onValueChange">
|
style="width: 180px" @change="onValueChange">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
至
|
至
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.end" type="week" format="yyyy 第 WW 周"
|
<el-date-picker size="small" clearable v-model="end" type="week" format="yyyy 第 WW 周" placeholder="选择周"
|
||||||
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="start && 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.type === 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"
|
<el-date-picker size="small" v-model="listQuery.reportTime" type="monthrange"
|
||||||
value-format="yyyy-MM-dd" 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.type === 3" label="时间值" prop="reportTime">
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.start" value-format="yyyy-MM-dd" 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>
|
||||||
~
|
~
|
||||||
<el-date-picker size="small" clearable v-model="listQuery.end" value-format="yyyy-MM-dd" type="year"
|
<el-date-picker size="small" clearable v-model="listQuery.reportTime[1]" value-format="yyyy" type="year"
|
||||||
placeholder="结束时间" @change="getYear">
|
placeholder="结束时间" @change="getYear">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="玻璃类型" prop="type">
|
||||||
|
<el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
|
||||||
|
<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 label="玻璃类型" prop="type">
|
||||||
|
<el-select v-model="listQuery.type" placeholder="请选择玻璃类型">
|
||||||
|
<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>
|
<el-form-item>
|
||||||
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
|
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<!-- <el-button type="primary" size="small" plain @click="handleImport">导入</el-button> -->
|
||||||
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
|
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
|
||||||
|
<!-- <el-button type="success" size="small" plain @click="addFactory">新增</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
<!-- <div class="smallTitle">产量转化效率</div> -->
|
||||||
<div class="containerTop">
|
|
||||||
<el-row v-if="listQuery.type === 2">
|
<!-- <bmSearchBar @getSearch="getSearch" @handleExport="handleExport" /> -->
|
||||||
<el-col :span="16">
|
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
||||||
<div class="blueTip">
|
:chartNum="chartNum" />
|
||||||
产量及良率对比
|
|
||||||
</div>
|
|
||||||
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
|
||||||
:chartNum="chartNum" />
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div class="blueTip">
|
|
||||||
{{ title }}
|
|
||||||
</div>
|
|
||||||
<produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
|
|
||||||
:chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-else>
|
|
||||||
<!-- <el-col :span="24"> -->
|
|
||||||
<div class="blueTip">
|
|
||||||
产量及良率对比
|
|
||||||
</div>
|
|
||||||
<bm-line-bar :chartHeight="chartHeight" :legendList="legendList" :chartMsg="chartMsg" :chartId="chartId"
|
|
||||||
:chartNum="chartNum" />
|
|
||||||
<!-- </el-col> -->
|
|
||||||
<!-- <el-col :span="8">
|
|
||||||
<div class="blueTip">
|
|
||||||
{{ title }}
|
|
||||||
</div>
|
|
||||||
<produce-line-bar-year-target :chartHeight="chartHeight" :legendList="legendList"
|
|
||||||
:chartMsg="chartMsgYearTarget" :chartId=" 'yearData'" :chartNum="chartNum" />
|
|
||||||
</el-col> -->
|
|
||||||
</el-row>
|
|
||||||
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
|
<base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
|
||||||
:max-height="tableH" />
|
:max-height="tableH" />
|
||||||
</div>
|
</div>
|
||||||
@ -94,28 +79,60 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getProductionYieldSituationMWData, exportProductionYieldSituationMWData } from '@/api/report';
|
import bmSearchBar from "./components/bmSearchBar.vue";
|
||||||
import bmSearchBar from "./components/bmSearchBar";
|
import BmLineBar from "./components/bmLineBar.vue";
|
||||||
import BmLineBar from "./components/produceLineBar.vue";
|
|
||||||
import produceLineBarYearTarget from "./components/produceLineBarYearTarget.vue";
|
|
||||||
import ButtonNav from '@/components/ButtonNav'
|
import ButtonNav from '@/components/ButtonNav'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: "factory",
|
||||||
|
label: "玻璃类型",
|
||||||
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "ChipYieldBM",
|
name: "ChipYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
otherProps: [],
|
tableProps,
|
||||||
start: undefined,
|
start: undefined,
|
||||||
end: undefined,
|
end: undefined,
|
||||||
title: '',
|
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 999,
|
|
||||||
// size: 10,
|
// size: 10,
|
||||||
// current: 1,
|
// current: 1,
|
||||||
factory: null,
|
factory: null,
|
||||||
start: undefined,
|
|
||||||
end: undefined,
|
|
||||||
// total: 0,
|
// total: 0,
|
||||||
type: 2,
|
type: 2,
|
||||||
startDate: undefined,
|
startDate: undefined,
|
||||||
@ -140,136 +157,67 @@ export default {
|
|||||||
label: '年'
|
label: '年'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
chartHeight: this.tableHeight(137) / 2 - 111,
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
tableH: this.tableHeight(137) / 2 - 70,
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
id: 1, name: "综合良率", type: 1, color: "#FFCE6A" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
id: 2, name: "FTO投入", type: 1, color: "#8EF0AB" },
|
|
||||||
{ id: 3, name: "芯片产量", type: 1, color: "#288AFF" },
|
|
||||||
{
|
|
||||||
id: 4, name: "标准组件产量", type: 1, color: "#64BDFF" },
|
|
||||||
],
|
],
|
||||||
chartMsgYearTarget: {
|
chartMsg: {
|
||||||
color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
// yName: "单位/%",
|
yName: "单位/%",
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
name: "单位/片",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
// inverse: true,
|
|
||||||
name: "单位/%",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "",
|
name: "2024年4月目标值",
|
||||||
// yAxisIndex: 0,
|
|
||||||
data: [
|
data: [
|
||||||
{
|
{ name: "%", value: 85 },
|
||||||
value: 1,
|
{ name: "%", value: 85 },
|
||||||
itemStyle: {
|
{ name: "%", value: 85 },
|
||||||
color: '#8EF0AB'
|
],
|
||||||
}
|
type: "line",
|
||||||
},
|
symbol: "circle",
|
||||||
{
|
symbolSize: 6,
|
||||||
value: 2,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#288AFF'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 3,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#64BDFF'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 0,
|
|
||||||
yAxisIndex: 1,
|
|
||||||
itemStyle: {
|
|
||||||
color: '#FFCE6A'
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: [-18, -16],
|
color: "#FFAE17",
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
return params.value + "片";
|
return params.value.toFixed(2) + "%";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// name: '销量折线图',
|
|
||||||
// type: 'bar',
|
|
||||||
// data: [ 0,0,0,
|
|
||||||
// {
|
|
||||||
// value: 5,
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#FFCE6A'
|
|
||||||
// }
|
|
||||||
// }],
|
|
||||||
// barWith: "40%",
|
|
||||||
// label: {
|
|
||||||
// show: true,
|
|
||||||
// position: "top",
|
|
||||||
// formatter: "{c}%"
|
|
||||||
// },
|
|
||||||
// lineStyle: {
|
|
||||||
// color: "#ffb122"
|
|
||||||
// },
|
|
||||||
// yAxisIndex: 1
|
|
||||||
// }
|
|
||||||
],
|
|
||||||
},
|
|
||||||
chartMsg: {
|
|
||||||
color: ["#8EF0AB", "#288AFF", '#64BDFF', "#FFCE6A",],
|
|
||||||
xData: [],
|
|
||||||
// yName: "单位/%",
|
|
||||||
yAxis: [
|
|
||||||
{
|
{
|
||||||
type: "value",
|
name: "2023年4月",
|
||||||
name: "单位/片",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
// inverse: true,
|
|
||||||
name: "单位/%",
|
|
||||||
nameTextStyle: {
|
|
||||||
fontSize: 12,
|
|
||||||
align: "right",
|
|
||||||
},
|
|
||||||
axisLabel: {},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "",
|
|
||||||
// yAxisIndex: 0,
|
|
||||||
data: [
|
data: [
|
||||||
{ name: "%", value: 57.5 },
|
{ name: "%", value: 57.5 },
|
||||||
{ name: "%", value: 21.66 },
|
{ name: "%", value: 21.66 },
|
||||||
@ -282,13 +230,12 @@ export default {
|
|||||||
position: [-18, -16],
|
position: [-18, -16],
|
||||||
color: "#68C483",
|
color: "#68C483",
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
return params.value + "片";
|
return params.value.toFixed(2) + "%";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "2024年4月",
|
||||||
// yAxisIndex: 0,
|
|
||||||
data: [
|
data: [
|
||||||
{ name: "%", value: 23.33 },
|
{ name: "%", value: 23.33 },
|
||||||
{ name: "%", value: 7.02 },
|
{ name: "%", value: 7.02 },
|
||||||
@ -300,46 +247,6 @@ export default {
|
|||||||
show: true,
|
show: true,
|
||||||
position: [0, -16],
|
position: [0, -16],
|
||||||
color: "#288AFF",
|
color: "#288AFF",
|
||||||
formatter: function (params) {
|
|
||||||
return params.value + "片";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "",
|
|
||||||
// yAxisIndex: 0,
|
|
||||||
data: [
|
|
||||||
{ name: "%", value: 23.33 },
|
|
||||||
{ name: "%", value: 7.02 },
|
|
||||||
{ name: "%", value: 80.2 },
|
|
||||||
],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
stack: '标准组件产量',
|
|
||||||
color: "#64BDFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value+ "片";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "",
|
|
||||||
data: [
|
|
||||||
{ name: "%", value: 115 },
|
|
||||||
{ name: "%", value: 5 },
|
|
||||||
{ name: "%", value: 8 },
|
|
||||||
],
|
|
||||||
type: "line",
|
|
||||||
// barWidth: 20,
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
yAxisIndex: 1,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
return params.value.toFixed(2) + "%";
|
return params.value.toFixed(2) + "%";
|
||||||
},
|
},
|
||||||
@ -354,50 +261,18 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
bmSearchBar,
|
bmSearchBar,
|
||||||
BmLineBar,
|
BmLineBar,
|
||||||
produceLineBarYearTarget,
|
|
||||||
ButtonNav
|
ButtonNav
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tableProps() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
prop: "factory",
|
|
||||||
label: "工厂名称",
|
|
||||||
// filter: (val) => factoryList[val],
|
|
||||||
minWidth: 200,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "item",
|
|
||||||
label: "科目",
|
|
||||||
// filter: (val) => factoryList[val],
|
|
||||||
minWidth: 200,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "unit",
|
|
||||||
label: "单位",
|
|
||||||
minWidth: 120,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
},
|
|
||||||
...this.otherProps
|
|
||||||
]
|
|
||||||
},
|
|
||||||
weekNum() {
|
weekNum() {
|
||||||
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
return Math.round((this.end - this.start) / (24 * 60 * 60 * 1000 * 7)) + 1
|
||||||
},
|
},
|
||||||
isOpen() {
|
isOpen() {
|
||||||
return this.$store.getters.sidebar.opened;
|
return this.$store.getters.sidebar.opened;
|
||||||
},
|
},
|
||||||
type() {
|
|
||||||
return this.listQuery.type
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 监听左侧菜单栏是否展开
|
// 监听左侧菜单栏是否展开
|
||||||
type(val) {
|
|
||||||
|
|
||||||
},
|
|
||||||
isOpen(val) {
|
isOpen(val) {
|
||||||
if (this.$route.name === "ChipYieldBM") {
|
if (this.$route.name === "ChipYieldBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
@ -414,46 +289,73 @@ export default {
|
|||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
// 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新
|
// 图重新加载,为了防止窗口变化后尺寸图显示不佳,数据不更新
|
||||||
if (this.$route.name === "productionYield") {
|
if (this.$route.name === "ChipYieldBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.getOverView()
|
// this.getOverView()
|
||||||
const today = new Date()
|
const currentMonth = new Date()
|
||||||
const sevenDaysAgo = new Date(today.getTime() - (7 * 24 * 60 * 60 * 1000))
|
this.listQuery.reportTime = [moment(currentMonth).format('yyyy-MM-DD HH:mm:ss'), moment(currentMonth).format('yyyy-MM-DD HH:mm:ss')]
|
||||||
this.listQuery.startDate = moment(sevenDaysAgo).format('yyyy-MM-DD')
|
this.changeTime()
|
||||||
this.listQuery.endDate = moment(today).format('yyyy-MM-DD')
|
|
||||||
this.listQuery.reportTime = [this.listQuery.startDate, this.listQuery.endDate]
|
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getYear(e) {
|
getYear(e) {
|
||||||
if (this.listQuery.end - this.listQuery.start > 10 * 365 * 24 * 60 * 60 * 1000) {
|
if (this.end && Number(this.end) - Number(this.start) > 10) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '年份起止时间不能超过十年',
|
message: '年份起止时间不能超过十年',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
this.listQuery.reportTime = []
|
this.start = undefined
|
||||||
this.listQuery.start = undefined
|
this.end = undefined
|
||||||
this.listQuery.end = undefined
|
|
||||||
// console.log();
|
// console.log();
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.startDate = this.listQuery.start
|
if (Number(this.end) < Number(this.start)) {
|
||||||
this.listQuery.endDate = this.listQuery.end
|
this.$message({
|
||||||
|
message: '结束年份不能小于开始年份',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.start = undefined
|
||||||
|
this.end = undefined
|
||||||
|
} else {
|
||||||
|
this.listQuery.startDate = Number(this.start)
|
||||||
|
this.listQuery.endDate = Number(this.end)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!this.listQuery.start && !this.listQuery.end) {
|
if (!this.start && !this.end) {
|
||||||
this.listQuery.startDate = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endDate = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
// console.log(e);
|
// console.log(e);
|
||||||
},
|
},
|
||||||
onValueChange(picker, k) { // 选中近k周后触发的操作
|
changeTime() {
|
||||||
// console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
|
if (this.listQuery.reportTime) {
|
||||||
if (this.listQuery.start && this.listQuery.end) {
|
|
||||||
console.log(this.listQuery.reportTime)
|
console.log(this.listQuery.reportTime)
|
||||||
this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
let start = new Date(this.listQuery.reportTime[0])
|
||||||
this.date2 = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
let end = new Date(this.listQuery.reportTime[1])
|
||||||
|
// const years = Number(this.listQuery.reportTime[1].slice(0, 4)) - Number(this.listQuery.reportTime[0].slice(0, 4))
|
||||||
|
// const months = Number(this.listQuery.reportTime[1].slice(4)) - Number(this.listQuery.reportTime[0].slice(4))
|
||||||
|
// console.log(years);
|
||||||
|
if ((end - start) > 31104000000) {
|
||||||
|
this.$message({
|
||||||
|
message: '时间范围不能超过24个月',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
this.listQuery.reportTime = [];
|
||||||
|
} else {
|
||||||
|
this.listQuery.startDate = this.listQuery.reportTime[0]
|
||||||
|
this.listQuery.endDate = this.listQuery.reportTime[1]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.listQuery.startDate = undefined
|
||||||
|
this.listQuery.endDate = undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onValueChange(picker, k) { // 选中近k周后触发的操作
|
||||||
|
if (this.start && this.end) {
|
||||||
|
this.date1 = moment(this.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
this.date2 = moment(this.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||||
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
const numDays = (new Date(this.date2).getTime() - new Date(this.date1).getTime()) / (24 * 3600 * 1000);
|
||||||
if (numDays > 168) {
|
if (numDays > 168) {
|
||||||
console.log(numDays)
|
console.log(numDays)
|
||||||
@ -462,21 +364,20 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.listQuery.startDate = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.listQuery.startDate = this.date1
|
||||||
this.listQuery.endDate = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
this.listQuery.endDate = this.date2
|
||||||
|
// this.listQuery.startDate = Number(moment(this.start.getTime()).format('YYYYWW'))
|
||||||
|
// this.listQuery.endDate = Number(moment(this.end.getTime()).format('YYYYWW'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.listQuery.start && !this.listQuery.end) {
|
if (!this.start && !this.end) {
|
||||||
this.listQuery.startDate = undefined
|
this.listQuery.startDate = undefined
|
||||||
this.listQuery.endDate = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeDayTime() {
|
changeDayTime() {
|
||||||
if (this.listQuery.reportTime) {
|
if (this.listQuery.reportTime) {
|
||||||
// this.createStartDate = moment(new Date(this.listQuery.reportTime[0]), 'yyyy-MM-dd hh:mm:ss');
|
const numDays = Number(this.listQuery.reportTime[1]) - Number(this.listQuery.reportTime[0])
|
||||||
// this.createEndDate = moment(new Date(this.listQuery.reportTime[1]), 'yyyy-MM-dd hh:mm:ss');
|
|
||||||
console.log(this.listQuery.reportTime[1])
|
|
||||||
const numDays = (this.listQuery.reportTime[1] - this.listQuery.reportTime[0]) / (24 * 3600 * 1000);
|
|
||||||
if (numDays > 30) {
|
if (numDays > 30) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '时间范围不能超过30天',
|
message: '时间范围不能超过30天',
|
||||||
@ -492,222 +393,28 @@ export default {
|
|||||||
this.listQuery.endDate = undefined
|
this.listQuery.endDate = undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTime(value) {
|
getOverView() {
|
||||||
if (this.listQuery.reportTime) {
|
// getOverView().then(res => {
|
||||||
const numDays = this.listQuery.reportTime[1] - this.listQuery.reportTime[0];
|
// this.data = res.data
|
||||||
if (numDays > 2 * 365 * 24 * 60 * 60 * 1000) {
|
// console.log('aa', res.data)
|
||||||
this.$message({
|
// })
|
||||||
message: '时间范围不能超过24个月',
|
},
|
||||||
type: 'warning'
|
otherMethods(val) {
|
||||||
});
|
this.detailOrUpdateVisible = true;
|
||||||
this.listQuery.reportTime = [];
|
// this.addOrEditTitle = "详情";
|
||||||
} else {
|
this.$nextTick(() => {
|
||||||
this.listQuery.startDate = this.listQuery.reportTime[0]
|
// this.$refs.detailOrUpdate.init(val.data.id);
|
||||||
this.listQuery.endDate = this.listQuery.reportTime[1]
|
});
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.listQuery.startDate = undefined
|
|
||||||
this.listQuery.endDate = undefined
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
this.otherProps = []
|
console.log(this.listQuery);
|
||||||
this.chartMsg.xData = []
|
if (this.listQuery.type == 3) {
|
||||||
let arr = []
|
this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
|
||||||
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0)
|
this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
|
||||||
this.listQuery.factory = arr
|
|
||||||
const res = await getProductionYieldSituationMWData(this.listQuery)
|
|
||||||
let dataArr = [{
|
|
||||||
factory: null,
|
|
||||||
item: 'FTO投入',
|
|
||||||
unit: '片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
factory: null,
|
|
||||||
item: '芯片产量',
|
|
||||||
unit: '片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
factory: null,
|
|
||||||
item: '标准组件产量',
|
|
||||||
unit: '片'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
factory: null,
|
|
||||||
item: '综合良率',
|
|
||||||
unit: '%'
|
|
||||||
},]
|
|
||||||
if (this.listQuery.type == 2) {
|
|
||||||
res.data.list.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
this.chartMsg.xData.push(ele.titleValue)
|
|
||||||
this.otherProps.push({
|
|
||||||
label: ele.titleValue,
|
|
||||||
props: 'value' + i
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.chartMsgYearTarget.xData.push('FTO投入', '芯片产量', '标准组件产量', '综合良率')
|
|
||||||
res.data.list.slice(res.data.list.length - 1, res.data.list.length).forEach((ele) => {
|
|
||||||
this.title = ele.titleValue
|
|
||||||
ele.productYieldDataVOList.forEach((item) => {
|
|
||||||
// this.chartMsgYearTarget.series[0].name = 'FTO投入目标值',
|
|
||||||
// this.chartMsgYearTarget.series[1].name = '芯片产量目标值',
|
|
||||||
// this.chartMsgYearTarget.series[2].name = '标准组件产量目标值',
|
|
||||||
// this.chartMsgYearTarget.series[3].name = '综合良率目标值',
|
|
||||||
// this.chartMsgYearTarget.series[0].data = [
|
|
||||||
// {
|
|
||||||
// value: item.ftoInput,
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#8EF0AB'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: item.chipYield,
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#288AFF'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: item.componentYield,
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#64BDFF'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// value: item.ftoInput,
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#FFCE6A'
|
|
||||||
// }
|
|
||||||
// }]
|
|
||||||
// dataArr[0]['' + m + ''] = item.ftoInput
|
|
||||||
// dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
// dataArr[1]['' + m + ''] = item.chipYield
|
|
||||||
// dataArr[2]['' + m + ''] = item.componentYield
|
|
||||||
// dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
|
|
||||||
})
|
|
||||||
})
|
|
||||||
console.log(this.otherProps)
|
|
||||||
res.data.list.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
let m = 'value' + i
|
|
||||||
ele.productYieldDataVOList.forEach((item) => {
|
|
||||||
dataArr[0]['' + m + ''] = item.ftoInput
|
|
||||||
dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1]['' + m + ''] = item.chipYield
|
|
||||||
dataArr[2]['' + m + ''] = item.componentYield
|
|
||||||
dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
|
|
||||||
})
|
|
||||||
})
|
|
||||||
for (let i in dataArr[0]) {
|
|
||||||
this.chartMsg.series[0].name = dataArr[0]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[0].data.push({
|
|
||||||
name: dataArr[0]['item'],
|
|
||||||
value: dataArr[0][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[1]) {
|
|
||||||
this.chartMsg.series[1].name = dataArr[1]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[1].data.push({
|
|
||||||
name: dataArr[1]['item'],
|
|
||||||
value: dataArr[1][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[2]) {
|
|
||||||
this.chartMsg.series[2].name = dataArr[2]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[2].data.push({
|
|
||||||
name: dataArr[2]['item'],
|
|
||||||
value: dataArr[2][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[3]) {
|
|
||||||
this.chartMsg.series[3].name = dataArr[3]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[3].data.push({
|
|
||||||
name: dataArr[3]['item'],
|
|
||||||
value: dataArr[3][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
res.data.list.slice.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
this.chartMsg.xData.push(ele.titleValue)
|
|
||||||
this.otherProps.push({
|
|
||||||
label: ele.titleValue,
|
|
||||||
props: 'value' + i
|
|
||||||
})
|
|
||||||
})
|
|
||||||
console.log(this.otherProps)
|
|
||||||
if (this.listQuery.type == 2) {
|
|
||||||
|
|
||||||
}
|
|
||||||
res.data.list.forEach((ele, index) => {
|
|
||||||
let i = index + 1
|
|
||||||
let m = 'value' + i
|
|
||||||
ele.productYieldDataVOList.forEach((item) => {
|
|
||||||
dataArr[0]['' + m + ''] = item.ftoInput
|
|
||||||
dataArr[0].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[2].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[3].factory = item.factory == 1 ? '邯郸' : '瑞昌'
|
|
||||||
dataArr[1]['' + m + ''] = item.chipYield
|
|
||||||
dataArr[2]['' + m + ''] = item.componentYield
|
|
||||||
dataArr[3]['' + m + ''] = item.comprehensiveYieldRate
|
|
||||||
})
|
|
||||||
})
|
|
||||||
for (let i in dataArr[0]) {
|
|
||||||
this.chartMsg.series[0].name = dataArr[0]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[0].data.push({
|
|
||||||
name: dataArr[0]['item'],
|
|
||||||
value: dataArr[0][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[1]) {
|
|
||||||
this.chartMsg.series[1].name = dataArr[1]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[1].data.push({
|
|
||||||
name: dataArr[1]['item'],
|
|
||||||
value: dataArr[1][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[2]) {
|
|
||||||
this.chartMsg.series[2].name = dataArr[2]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[2].data.push({
|
|
||||||
name: dataArr[2]['item'],
|
|
||||||
value: dataArr[2][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i in dataArr[3]) {
|
|
||||||
this.chartMsg.series[3].name = dataArr[3]['item']
|
|
||||||
if (i.search('value') === 0) {
|
|
||||||
this.chartMsg.series[3].data.push({
|
|
||||||
name: dataArr[3]['item'],
|
|
||||||
value: dataArr[3][i]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2
|
||||||
console.log(dataArr)
|
const res = await getComprehensiveDataPage(this.listQuery)
|
||||||
this.tableData = dataArr
|
this.tableData = res.data.list
|
||||||
// this.tableProps.push()
|
|
||||||
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 => {
|
||||||
@ -728,16 +435,7 @@ export default {
|
|||||||
console.log("=========================");
|
console.log("=========================");
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
// this.listQuery.type = val.type;
|
console.log("导出");
|
||||||
// this.listQuery.startDate = val.startDate;
|
|
||||||
// this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "产品良率.xls";
|
|
||||||
exportProductionYieldSituationMWData(this.listQuery)
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -749,7 +447,7 @@ export default {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 16px 16px 0 16px;
|
padding: 16px 16px 0 16px;
|
||||||
margin:8px 0 8px 0px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.containerTop {
|
.containerTop {
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,101 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
sCPReportByDateRangePage,
|
{
|
||||||
sCPReportByDateRangeExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "SCOutputBM",
|
name: "SCOutputBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/片",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// 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: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -138,17 +184,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -160,184 +199,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "SCOutputBM") {
|
if (this.$route.name === "SCOutputBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.date = val.type;
|
console.log(val);
|
||||||
this.listQuery.queryTime = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factorys = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
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,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "currentone",
|
|
||||||
label: msg.currentone.reportTime,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "targetone",
|
|
||||||
label: msg.targetone.reportTime,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
// 整理表格数据
|
|
||||||
let tableArr = [];
|
|
||||||
res.data.forEach((item) => {
|
|
||||||
let obj = {};
|
|
||||||
obj.factory = item.factory;
|
|
||||||
obj.item = "标准组件产量";
|
|
||||||
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];
|
|
||||||
}
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,101 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
componentAapPage,
|
{
|
||||||
componentAapExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "SCPerCapitaBM",
|
name: "SCPerCapitaBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位:片/人",
|
yName: "单位/片",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
// data: [3000, 2000, 3000],
|
||||||
|
// data: [6800, 5000, 8900],
|
||||||
|
// data: [12000, 17000, 19000],
|
||||||
|
data: [560000, 540000, 600000],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -90,22 +130,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
// data: [2100, 800, 1500],
|
||||||
|
// 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: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
// data: [2100, 900, 1300],
|
||||||
|
// data: [9100, 7300, 9700],
|
||||||
|
// data: [14666, 15300, 18000],
|
||||||
|
data: [556666, 456666, 650000],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -138,17 +184,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -160,171 +199,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "SCPerCapitaBM") {
|
if (this.$route.name === "SCPerCapitaBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
componentAapPage({ ...this.listQuery }).then((res) => {
|
|
||||||
if (res.data && res.data.records.length > 0) {
|
|
||||||
let msg = res.data.records[0];
|
|
||||||
let arr = [
|
|
||||||
{
|
|
||||||
prop: "yoy",
|
|
||||||
label: msg.yoyColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置偏移量
|
|
||||||
switch (this.listQuery.type) {
|
|
||||||
case 0:
|
|
||||||
this.chartMsg.series[1].label.position = [-5, -16];
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
this.chartMsg.series[1].label.position = [-5, -16];
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
this.chartMsg.series[1].label.position = [-10, -16];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.chartMsg.series[1].label.position = [-17, -16];
|
|
||||||
}
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push(val[i].target || 0);
|
|
||||||
barData1.push(val[i].yoy || 0);
|
|
||||||
barData2.push(val[i].queryValue || 0);
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = lineData;
|
|
||||||
this.chartMsg.series[1].data = barData1;
|
|
||||||
this.chartMsg.series[2].data = barData2;
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/片",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
// position: [-5, -16],
|
|
||||||
// position: [-5, -16],
|
|
||||||
position: [-10, -16],
|
|
||||||
// position: [-17, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#288AFF",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "组件人均产量对标.xls";
|
|
||||||
componentAapExport({ ...this.listQuery })
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.containerTop {
|
|
||||||
height: 64px;
|
|
||||||
}
|
|
||||||
.containerTop,
|
.containerTop,
|
||||||
.containerBottom {
|
.containerBottom {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,61 +26,102 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
componentyieldRatePage,
|
{
|
||||||
componentyieldRateExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "SCYieldBM",
|
name: "SCYieldBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 2, color: "#FFCE6A" },
|
{ id: 1, name: "2024年4月目标值", type: 2, color: "#FFCE6A" },
|
||||||
{ id: 2, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
{ name: "%", value: 85 },
|
||||||
|
],
|
||||||
type: "line",
|
type: "line",
|
||||||
symbol: "circle",
|
symbol: "circle",
|
||||||
symbolSize: 6,
|
symbolSize: 6,
|
||||||
@ -93,8 +134,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 57.5 },
|
||||||
|
{ name: "%", value: 21.66 },
|
||||||
|
{ name: "%", value: 18.4 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -107,8 +152,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 23.33 },
|
||||||
|
{ name: "%", value: 7.02 },
|
||||||
|
{ name: "%", value: 80.2 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -144,17 +193,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -166,169 +208,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "SCYieldBM") {
|
if (this.$route.name === "SCYieldBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
componentyieldRatePage({ ...this.listQuery }).then((res) => {
|
|
||||||
if (res.data && res.data.records.length > 0) {
|
|
||||||
let msg = res.data.records[0];
|
|
||||||
let arr = [
|
|
||||||
{
|
|
||||||
prop: "yoy",
|
|
||||||
label: msg.yoyColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.tableProps = this.tableProps1.concat(arr);
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.targetColumn;
|
|
||||||
this.legendList[1].name = msg.yoyColumn;
|
|
||||||
this.legendList[2].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.queryColumn;
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let lineData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
lineData.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].target || 0,
|
|
||||||
});
|
|
||||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
|
||||||
barData2.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].queryValue || 0,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = lineData;
|
|
||||||
this.chartMsg.series[1].data = barData1;
|
|
||||||
this.chartMsg.series[2].data = barData2;
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/%",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "line",
|
|
||||||
symbol: "circle",
|
|
||||||
symbolSize: 6,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: "#FFAE17",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [-18, -16],
|
|
||||||
color: "#68C483",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: [0, -16],
|
|
||||||
color: "#288AFF",
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "标准组件良率对标.xls";
|
|
||||||
componentyieldRateExport({ ...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 {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<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"
|
||||||
@ -12,6 +9,9 @@
|
|||||||
: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,62 +26,109 @@
|
|||||||
<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";
|
||||||
import {
|
const tableProps = [
|
||||||
componentconvertrateCPage,
|
{
|
||||||
componentconvertrateCExport,
|
prop: "factory",
|
||||||
} from "@/api/report/benchmarking.js";
|
label: "工厂名称",
|
||||||
import moment from "moment";
|
// filter: (val) => factoryList[val],
|
||||||
|
minWidth: 200,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "科目",
|
||||||
|
minWidth: 120,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "unit",
|
||||||
|
label: "单位",
|
||||||
|
minWidth: 80,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time1",
|
||||||
|
label: "时间1",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "time2",
|
||||||
|
label: "时间2",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao",
|
||||||
|
label: "月目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "mubiao2",
|
||||||
|
label: "年目标值",
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
export default {
|
export default {
|
||||||
name: "TurnoverRateBM",
|
name: "TurnoverRateBM",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
factoryList: [
|
tableProps,
|
||||||
{ 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: 100,
|
size: 1000,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [
|
||||||
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" },
|
||||||
|
{ factory: "工厂1" },
|
||||||
|
],
|
||||||
|
chartHeight: this.tableHeight(137) / 2 - 111,
|
||||||
|
tableH: this.tableHeight(137) / 2 - 70,
|
||||||
legendList: [
|
legendList: [
|
||||||
{ id: 1, name: "", type: 1, color: "#8EF0AB" },
|
{ id: 1, name: "2024年4月", type: 1, color: "#8EF0AB" },
|
||||||
{ id: 2, name: "", type: 1, color: "#63BDFF" },
|
{ id: 2, name: "2023年4月", type: 1, color: "#63BDFF" },
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
{ id: 3, name: "2024年4月目标值", type: 1, color: "#288AFF" },
|
||||||
{ id: 4, name: "", type: 1, color: "#7164FF" },
|
{ id: 4, name: "2024年目标值", type: 1, color: "#7164FF" },
|
||||||
],
|
],
|
||||||
chartMsg: {
|
chartMsg: {
|
||||||
color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"],
|
color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"],
|
||||||
xData: [],
|
xData: ["成都", "邯郸", "瑞昌"],
|
||||||
yName: "单位/%",
|
yName: "单位/%",
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "1",
|
name: "2023年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 12.64444444 },
|
||||||
|
{ name: "%", value: 12.29 },
|
||||||
|
{ name: "%", value: 12.33 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
barGap: 0.5,
|
barGap: 0.5,
|
||||||
@ -96,8 +143,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "2",
|
name: "2024年4月",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 14.92 },
|
||||||
|
{ name: "%", value: 15.31 },
|
||||||
|
{ name: "%", value: 15.36 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -111,8 +162,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "3",
|
name: "2024年4月目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 15.36 },
|
||||||
|
{ name: "%", value: 15.52 },
|
||||||
|
{ name: "%", value: 15.63 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -126,8 +181,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "4",
|
name: "2024年目标值",
|
||||||
data: [],
|
data: [
|
||||||
|
{ name: "%", value: 15.63 },
|
||||||
|
{ name: "%", value: 15.69 },
|
||||||
|
{ name: "%", value: 15.78 },
|
||||||
|
],
|
||||||
type: "bar",
|
type: "bar",
|
||||||
barWidth: 20,
|
barWidth: 20,
|
||||||
label: {
|
label: {
|
||||||
@ -164,17 +223,10 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
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);
|
||||||
},
|
},
|
||||||
@ -186,284 +238,32 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_setTableHeight() {
|
_setTableHeight() {
|
||||||
this.tableH = this.tableHeight(269) / 2;
|
this.tableH = this.tableHeight(137) / 2 - 70;
|
||||||
this.chartHeight = this.tableHeight(269) / 2;
|
this.chartHeight = this.tableHeight(137) / 2 - 111;
|
||||||
if (this.$route.name === "TurnoverRateBM") {
|
if (this.$route.name === "TurnoverRateBM") {
|
||||||
this.chartNum++;
|
this.chartNum++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSearch(val) {
|
getSearch(val) {
|
||||||
this.listQuery.type = val.type;
|
console.log(val);
|
||||||
this.listQuery.startDate = val.startDate;
|
console.log("=========================");
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
handleExport() {
|
||||||
this.tableProps = [];
|
console.log("导出");
|
||||||
componentconvertrateCPage({ ...this.listQuery }).then((res) => {
|
|
||||||
if (res.data && res.data.records.length > 0) {
|
|
||||||
let msg = res.data.records[0];
|
|
||||||
let arr1 = [
|
|
||||||
{
|
|
||||||
prop: "yoy",
|
|
||||||
label: msg.yoyColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "queryValue",
|
|
||||||
label: msg.queryColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "target",
|
|
||||||
label: msg.targetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let arr2 = [
|
|
||||||
{
|
|
||||||
prop: "yearTarget",
|
|
||||||
label: msg.yearTargetColumn,
|
|
||||||
filter: (val) => (val || val === 0 ? val : "-"),
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
// 重置chart的series
|
|
||||||
this.chartMsg.series = [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
barGap: 0.5,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#68C483",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#63BDFF",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#288AFF",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "4",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#7164FF",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
// 维度为月时加年目标
|
|
||||||
if (this.listQuery.type === 2) {
|
|
||||||
this.tableProps = this.tableProps1.concat(arr1, arr2);
|
|
||||||
this.legendList = [
|
|
||||||
{ id: 1, name: "", type: 1, color: "#8EF0AB" },
|
|
||||||
{ id: 2, name: "", type: 1, color: "#63BDFF" },
|
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
|
||||||
{ id: 4, name: "", type: 1, color: "#7164FF" },
|
|
||||||
];
|
|
||||||
this.legendList[3].name = msg.yearTargetColumn;
|
|
||||||
this.chartMsg.series[3].name = msg.yearTargetColumn;
|
|
||||||
} else {
|
|
||||||
this.tableProps = this.tableProps1.concat(arr1);
|
|
||||||
this.legendList = [
|
|
||||||
{ id: 1, name: "", type: 1, color: "#8EF0AB" },
|
|
||||||
{ id: 2, name: "", type: 1, color: "#63BDFF" },
|
|
||||||
{ id: 3, name: "", type: 1, color: "#288AFF" },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
this.tableData = res.data.records;
|
|
||||||
// 设置图例
|
|
||||||
this.legendList[0].name = msg.yoyColumn;
|
|
||||||
this.legendList[1].name = msg.queryColumn;
|
|
||||||
this.legendList[2].name = msg.targetColumn;
|
|
||||||
this.chartMsg.series[0].name = msg.yoyColumn;
|
|
||||||
this.chartMsg.series[1].name = msg.queryColumn;
|
|
||||||
this.chartMsg.series[2].name = msg.targetColumn;
|
|
||||||
// 设置chartMsg的series的数据
|
|
||||||
this.setChartMsg(res.data.records);
|
|
||||||
} else {
|
|
||||||
// 重置
|
|
||||||
this.resetMsg();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setChartMsg(val) {
|
|
||||||
let xData = [];
|
|
||||||
let barData1 = [];
|
|
||||||
let barData2 = [];
|
|
||||||
let barData3 = [];
|
|
||||||
let barData4 = [];
|
|
||||||
for (let i = 0; i < val.length; i++) {
|
|
||||||
this.factoryList.map((item) => {
|
|
||||||
if (item.id === val[i].factory) {
|
|
||||||
xData.push(item.name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
barData1.push({ name: "%", value: val[i].yoy || 0 });
|
|
||||||
barData2.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].queryValue || 0,
|
|
||||||
});
|
|
||||||
barData3.push({ name: "%", value: val[i].target || 0 });
|
|
||||||
barData4.push({
|
|
||||||
name: "%",
|
|
||||||
value: val[i].yearTarget || 0,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
this.chartMsg.series[0].data = barData1;
|
|
||||||
this.chartMsg.series[1].data = barData2;
|
|
||||||
this.chartMsg.series[2].data = barData3;
|
|
||||||
this.chartMsg.series[3].data = barData4;
|
|
||||||
if (this.listQuery.type !== 2) {
|
|
||||||
this.chartMsg.series.pop();
|
|
||||||
}
|
|
||||||
this.chartMsg.xData = xData;
|
|
||||||
},
|
|
||||||
resetMsg() {
|
|
||||||
this.tableProps = this.tableProps1;
|
|
||||||
this.tableData = [];
|
|
||||||
this.chartMsg = {
|
|
||||||
color: ["#8EF0AB", "#63BDFF", "#288AFF", "#7164FF"],
|
|
||||||
xData: [],
|
|
||||||
yName: "单位/%",
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: "1",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
barGap: 0.5,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#68C483",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "2",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#63BDFF",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "3",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#288AFF",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "4",
|
|
||||||
data: [],
|
|
||||||
type: "bar",
|
|
||||||
barWidth: 20,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: "top",
|
|
||||||
color: "#7164FF",
|
|
||||||
fontSize: 9,
|
|
||||||
formatter: function (params) {
|
|
||||||
return params.value.toFixed(2) + "%";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
handleExport(val) {
|
|
||||||
this.listQuery.type = val.type;
|
|
||||||
this.listQuery.startDate = val.startDate;
|
|
||||||
this.listQuery.factory = val.factory;
|
|
||||||
let fileName = "转化效率对标.xls";
|
|
||||||
componentconvertrateCExport({ ...this.listQuery })
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, fileName);
|
|
||||||
this.$message.success("导出成功");
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.containerTop {
|
|
||||||
height: 64px;
|
|
||||||
}
|
|
||||||
.containerTop,
|
.containerTop,
|
||||||
.containerBottom {
|
.containerBottom {
|
||||||
position: relative;
|
height: calc((100vh - 137px) / 2);
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user