Compare commits

..

No commits in common. "3c5163bd66510871310b1d2c344cd5ce2965100a" and "510f12e40b3a30b09366b1e08c27dab018ed16f2" have entirely different histories.

23 changed files with 1165 additions and 4427 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-28 13:42:51 # @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-06-24 16:57:53 # @LastEditTime: 2024-06-20 10:16:40
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###
@ -24,8 +24,7 @@ VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com'
# VUE_APP_BASE_API = 'http://192.168.1.63:48080' # VUE_APP_BASE_API = 'http://192.168.1.63:48080'
# 张一丁 # 张一丁
# VUE_APP_BASE_API = 'http://192.168.4.139:48080' # VUE_APP_BASE_API = 'http://192.168.4.139:48080'
# 蔡
# VUE_APP_BASE_API = 'http://192.168.1.54:48080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-06-17 09:41:03 * @Date: 2024-06-17 09:41:03
* @LastEditTime: 2024-06-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',
})
}

View File

@ -1,9 +1,8 @@
<!-- <!--
* @Author: zhp filename: chip-invest.vue
* @Date: 2024-06-03 15:38:31 author: liubin
* @LastEditTime: 2024-06-21 15:06:39 date: 2024-04-10 08:59:28
* @LastEditors: zhp description:
* @Description:
--> -->
<template> <template>
@ -35,7 +34,6 @@ export default {
xAxis: cities, xAxis: cities,
}; };
}, },
computed: { computed: {
series() { series() {
const chipInvest = this.$store.getters.home.chipInvest; const chipInvest = this.$store.getters.home.chipInvest;

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-28 13:42:51 * @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-06-21 15:02:27 * @LastEditTime: 2024-06-14 09:16:09
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -123,30 +123,30 @@ export default {
itemStyle: { itemStyle: {
color: "#f3c000", color: "#f3c000",
}, },
// areaStyle: { areaStyle: {
// color: { color: {
// type: "linear", type: "linear",
// x: 0, x: 0,
// y: 0, y: 0,
// x2: 0, x2: 0,
// y2: 1, y2: 1,
// colorStops: [ colorStops: [
// { {
// offset: 0, offset: 0,
// color: "#f3c000", // 0% color: "#f3c000", // 0%
// }, },
// { {
// offset: 0.55, offset: 0.55,
// color: "#f3c00033", color: "#f3c00033",
// }, },
// { {
// offset: 1, offset: 1,
// color: "transparent", // 100% color: "transparent", // 100%
// }, },
// ], ],
// global: false, // false global: false, // false
// }, },
// }, },
data: [], // this.series[0].data, data: [], // this.series[0].data,
}, },
{ {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-06-24 15:15:02 * @LastEditTime: 2024-06-18 14:41:07
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -116,10 +116,6 @@
<p class="title">标准组件平均功率(W)</p> <p class="title">标准组件平均功率(W)</p>
<p class="text">{{ dataForm.componentAveragePower }}</p> <p class="text">{{ dataForm.componentAveragePower }}</p>
</el-col> </el-col>
<el-col :span="6">
<p class="title">标准组件转化效率</p>
<p class="text">{{ dataForm.componentTransRate }}</p>
</el-col>
</el-row> </el-row>
</div> </div>
<div v-if="glass === 2"> <div v-if="glass === 2">

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-24 14:38:17 * @LastEditTime: 2024-06-20 10:16:25
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -10,7 +10,7 @@
<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="type">
<el-select v-model="listQuery.type" size="small" clearable 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>
@ -74,7 +74,7 @@
<!-- <el-row :gutter="24"> --> <!-- <el-row :gutter="24"> -->
<!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> --> <!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> -->
<search-bar :formConfigs="formConfig1" ref="searchBarForm1" style="margin-bottom: 0" /> <search-bar :formConfigs="formConfig1" ref="searchBarForm1" style="margin-bottom: 0" />
<line-chart ref="lineChart" class="yearChart" style="height: 45vh;width: 100%"></line-chart> <line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
<!-- </el-col> --> <!-- </el-col> -->
<!-- <el-col :span="12"> <!-- <el-col :span="12">
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> <line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
@ -135,9 +135,9 @@ export default {
// reportType: 2, // reportType: 2,
startDate: undefined, startDate: undefined,
endDate:undefined, endDate:undefined,
reportTime: null, reportTime: [],
start: null, start: undefined,
end: null end: undefined
}, },
detailOrUpdateVisible:false, detailOrUpdateVisible:false,
date1: undefined, date1: undefined,
@ -241,7 +241,7 @@ export default {
lineData: [], lineData: [],
chart: null, chart: null,
seriesList: [], seriesList: [],
colorList: ['#7164FF', '#63BDFF', '#8EF0AB', '#FFCE6A'] colorList: ['#2760FF', '#8167F6', '#5B9BFF', '#FFD160']
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
@ -289,6 +289,7 @@ export default {
// console.log(e); // console.log(e);
}, },
onValueChange(picker, k) { // k onValueChange(picker, k) { // k
// console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
if (this.listQuery.start && this.listQuery.end) { 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') this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
@ -350,31 +351,23 @@ export default {
} }
}, },
async getDataList() { async getDataList() {
if (this.listQuery.type === '') { await getProduceDataPage(this.listQuery).then(res => {
this.$message.warning('请选择时间维度!') console.log(res)
return if (res.code === 0) {
} this.tableData = res.data.records
if (this.listQuery.startDate === undefined) { this.listQuery.total = res.data.total
this.$message.warning('请选择时间范围!') }
} else { })
await getProduceDataPage(this.listQuery).then(res => {
console.log(res)
if (res.code === 0) {
this.tableData = res.data.records
this.listQuery.total = res.data.total
}
})
// //
await getproddata(this.listQuery).then(resp => { await getproddata(this.listQuery).then(resp => {
if (resp.data?.length > 0) { if (resp.data?.length > 0) {
const chartData = Object.groupBy(resp.data, (member) => member.datestr) const chartData = Object.groupBy(resp.data, (member) => member.datestr)
this.buildChart(chartData, resp.data) this.buildChart(chartData, resp.data)
} else { } else {
this.$refs.lineChart.initChart([], []) this.$refs.lineChart.initChart([], [])
} }
}) })
}
}, },
buildChart(data, dataList) { buildChart(data, dataList) {
let xAxisData = [] let xAxisData = []
@ -399,13 +392,6 @@ export default {
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
color: this.colorList[i] color: this.colorList[i]
},
label: {
show: i === 2 ? true : false,
position: 'top',
formatter(params) {
return fac.name.substring(0, 2)
}
} }
} }
dataList.forEach(item => { dataList.forEach(item => {
@ -425,18 +411,6 @@ export default {
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
color: this.colorList[i] color: this.colorList[i]
},
label: {
show: true,
position: 'top',
formatter(params) {
if (params.value === 0) {
return ''
} else {
// return ['', ''][params.seriesName.split('-')[1]]
return fac.name.substring(0, 2)
}
}
} }
} }
dataList.forEach(item => { dataList.forEach(item => {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-01-21 14:43:06 * @Date: 2022-01-21 14:43:06
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-06-24 11:13:48 * @LastEditTime: 2024-06-19 15:13:23
* @Description: * @Description:
--> -->
<template> <template>
@ -40,7 +40,7 @@ export default {
}, },
height: { height: {
type: String, type: String,
default: '35vh' default: '30vh'
}, },
legendPosition: { legendPosition: {
type: String, type: String,
@ -140,24 +140,20 @@ export default {
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
name: '日期', // prettier-ignore
data: xAxis, data: xAxis
axisLabel: {
rotate: 25
}
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value'
name: '单位:个'
} }
], ],
grid: { grid: {
top: '10%', top: '20%',
left: "1%", left: "1%",
right: "5%", right: "3%",
bottom: "0%", bottom: "1%",
containLabel: true containLabel: true
}, },
series: seriesList series: seriesList

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-17 16:31:51 * @Date: 2024-04-17 16:31:51
* @LastEditTime: 2024-06-24 15:43:50 * @LastEditTime: 2024-06-17 16:55:04
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -375,12 +375,7 @@ export default {
this.visible = true this.visible = true
if (this.dataForm.id) { if (this.dataForm.id) {
getProduceTargetDetail(this.dataForm.id).then(res => { getProduceTargetDetail(this.dataForm.id).then(res => {
// this.dataForm = res.data this.dataForm = res.data
for (const i in res.data) {
if (res.data[i] !== null) {
this.dataForm[i] = res.data[i]
}
}
if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) { if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) {
// this.dataForm.reportTime = String(this.dataForm.targetTime) // this.dataForm.reportTime = String(this.dataForm.targetTime)
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetTime)) this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetTime))

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-24 15:08:34 * @LastEditTime: 2024-06-17 16:32:02
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -76,8 +76,7 @@ import tableHeightMixin from "@/mixins/tableHeightMixin";
import basicPage from '@/mixins/basic-page' import basicPage from '@/mixins/basic-page'
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import { factoryList, factoryArray } from "@/utils/constants"; import { factoryList, factoryArray } from "@/utils/constants";
// import { publicFormatter } from "@/utils/dict"; import { publicFormatter } from "@/utils/dict";
import statusChart from "./statusChart.vue";
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
@ -207,13 +206,13 @@ export default {
prop: 'factory', prop: 'factory',
label: '工厂名称', label: '工厂名称',
filter: (val) => factoryList[val], filter: (val) => factoryList[val],
minWidth: 220, minWidth: 200,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'workOrderNumber', prop: 'workOrderNumber',
label: '工单号', label: '工单号',
minWidth: 130, minWidth: 120,
showOverflowtooltip: true showOverflowtooltip: true
// filter: (val) => ['', '', 'BIPV', ''][val] // filter: (val) => ['', '', 'BIPV', ''][val]
}, },
@ -247,8 +246,8 @@ export default {
{ {
prop: 'orderStatus', prop: 'orderStatus',
label: '工单状态', label: '工单状态',
subcomponent: statusChart // filter: publicFormatter('workorder_status')
// filter: (val) => ['', '', '', ''][val], filter: (val) => ['', '未开始', '生产中', '已完成'][val],
}, },
{ {
prop: 'startTime', prop: 'startTime',

View File

@ -1,51 +0,0 @@
<!--
* @Author: Do not edit
* @Date: 2024-06-24 15:03:19
* @LastEditTime: 2024-06-24 15:07:42
* @LastEditors: DY
* @Description:
-->
<template>
<div>
<span class="dot" :class="myClass"></span>
<span>{{ state }}</span>
</div>
</template>
<script>
export default {
name: "statusChart",
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
computed: {
state() {
return ['', '未开始', '生产中', '已完成'][this.injectData.orderStatus]
},
myClass() {
return ['', 'yellow', 'blue', 'green'][this.injectData.orderStatus]
}
},
};
</script>
<style scoped>
.dot {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 3px;
vertical-align: middle;
margin-right: 8px;
}
.green {
background: #10DC76;
}
.yellow {
background: #FFBD02;
}
.blue {
background: #3B79FF;
}
</style>

View File

@ -20,33 +20,29 @@
<el-form-item v-show="form.type === 0" label="时间" prop="dayTime"> <el-form-item v-show="form.type === 0" label="时间" prop="dayTime">
<el-date-picker <el-date-picker
size="small" size="small"
:clearable="false" clearable
v-model="form.dayTime" v-model="form.dayTime"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
:picker-options="pickerOptions"
> >
</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 === 1" label="时间" prop="weekTime">
<el-date-picker <el-date-picker
v-model="form.weekTime" v-model="form.weekTime"
:clearable="false"
type="week" type="week"
format="yyyy-MM-dd" format="yyyy-MM-dd"
placeholder="选择周" placeholder="选择周"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
:picker-options="pickerOptions"
> >
</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 === 2" label="时间" prop="monthTime">
<el-date-picker <el-date-picker
v-model="form.monthTime" v-model="form.monthTime"
:clearable="false"
type="month" type="month"
placeholder="选择月份" placeholder="选择月份"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -57,7 +53,6 @@
<el-form-item v-show="form.type === 3" label="时间" prop="yearTime"> <el-form-item v-show="form.type === 3" label="时间" prop="yearTime">
<el-date-picker <el-date-picker
v-model="form.yearTime" v-model="form.yearTime"
:clearable="false"
type="year" type="year"
placeholder="选择年份" placeholder="选择年份"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -99,9 +94,6 @@ export default {
{ id: 2, name: "月" }, { id: 2, name: "月" },
{ id: 3, name: "年" }, { id: 3, name: "年" },
], ],
pickerOptions: {
firstDayOfWeek: 1,
},
}; };
}, },
methods: { methods: {
@ -124,10 +116,6 @@ export default {
break; break;
} }
params.type = this.form.type; params.type = this.form.type;
if (!params.startDate) {
this.$message.warning("时间不能为空");
return;
}
if (val === "search") { if (val === "search") {
this.$emit("getSearch", params); this.$emit("getSearch", params);
} else { } else {

View File

@ -249,51 +249,44 @@ export default {
resetMsg() { resetMsg() {
this.tableProps = this.tableProps1; this.tableProps = this.tableProps1;
this.tableData = []; this.tableData = [];
this.chartMsg1 = { this.chartMsg = {
color: ["#288AFF33", "#288AFF"], color: ["#FFCE6A", "#8EF0AB", "#288AFF"],
xData: [], xData: [],
yName: "单位/MW", yName: "单位/",
series: [ series: [
{ {
name: "1", name: "1",
data: [], data: [],
type: "bar", type: "line",
barWidth: 20, symbol: "circle",
}, symbolSize: 6,
{
name: "2",
data: [],
type: "bar",
barWidth: 20,
barGap: "-100%",
label: { label: {
show: true, show: true,
position: "top", color: "#FFAE17",
color: "#288AFF",
}, },
}, },
],
};
this.chartMsg2 = {
color: ["#288AFF33", "#288AFF"],
xData: [],
yName: "单位/㎡",
series: [
{
name: "1",
data: [],
type: "bar",
barWidth: 20,
},
{ {
name: "2", name: "2",
data: [], data: [],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
barGap: "-100%",
label: { label: {
show: true, show: true,
position: "top", // 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", color: "#288AFF",
}, },
}, },

View File

@ -19,33 +19,29 @@
<el-form-item v-show="form.type === 0" label="时间" prop="dayTime"> <el-form-item v-show="form.type === 0" label="时间" prop="dayTime">
<el-date-picker <el-date-picker
size="small" size="small"
:clearable="false" clearable
v-model="form.dayTime" v-model="form.dayTime"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
:picker-options="pickerOptions"
> >
</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 === 1" label="时间" prop="weekTime">
<el-date-picker <el-date-picker
v-model="form.weekTime" v-model="form.weekTime"
:clearable="false"
type="week" type="week"
format="yyyy-MM-dd" format="yyyy-MM-dd"
placeholder="选择周" placeholder="选择周"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 150px" style="width: 150px"
:picker-options="pickerOptions"
> >
</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 === 2" label="时间" prop="monthTime">
<el-date-picker <el-date-picker
v-model="form.monthTime" v-model="form.monthTime"
:clearable="false"
type="month" type="month"
placeholder="选择月份" placeholder="选择月份"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -56,7 +52,6 @@
<el-form-item v-show="form.type === 3" label="时间" prop="yearTime"> <el-form-item v-show="form.type === 3" label="时间" prop="yearTime">
<el-date-picker <el-date-picker
v-model="form.yearTime" v-model="form.yearTime"
:clearable="false"
type="year" type="year"
placeholder="选择年份" placeholder="选择年份"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -120,9 +115,6 @@ export default {
{ id: 0, name: "瑞昌" }, { id: 0, name: "瑞昌" },
{ id: 1, name: "邯郸" }, { id: 1, name: "邯郸" },
], ],
pickerOptions: {
firstDayOfWeek: 1,
},
}; };
}, },
methods: { methods: {
@ -146,10 +138,6 @@ export default {
break; break;
} }
params.type = this.form.type; params.type = this.form.type;
if (!params.startDate) {
this.$message.warning("时间不能为空");
return;
}
if (val === "search") { if (val === "search") {
this.$emit("getSearch", params); this.$emit("getSearch", params);
} else { } else {

View File

@ -1,245 +0,0 @@
<!--
* @Author: zhp
* @Date: 2024-06-19 15:28:34
* @LastEditTime: 2024-06-24 08:46:34
* @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] : 0) + "MW"
: (params[i].value ? params[i].value : 0) + "片"
}</span>`;
}
return res;
},
},
xAxis: {
type: "category",
data: [],
axisTick: {
show: false,
},
axisPointer: {
type: "shadow",
},
},
dataZoom: [//
{
//
show: false,
//
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>

View File

@ -1,245 +0,0 @@
<!--
* @Author: zhp
* @Date: 2024-06-20 16:13:36
* @LastEditTime: 2024-06-24 08:46:42
* @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] : 0) + "MW"
: (params[i].value ? params[i].value : 0) + "片"
}</span>`;
}
return res;
},
},
xAxis: {
type: "category",
data: [],
axisTick: {
show: false,
},
axisPointer: {
type: "shadow",
},
},
dataZoom: [//
{
//
show: false,
//
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>

View File

@ -1,245 +0,0 @@
<!--
* @Author: zhp
* @Date: 2024-06-20 16:13:52
* @LastEditTime: 2024-06-24 08:46:46
* @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 ? params[i] : 0) + "MW"
: (params[i].value ? params[i].value : 0) + "片"
}</span>`;
}
return res;
},
},
xAxis: {
type: "category",
data: [],
axisTick: {
show: false,
},
axisPointer: {
type: "shadow",
},
},
dataZoom: [//
{
//
show: false,
//
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>

View File

@ -1,263 +0,0 @@
<!--
* @Author: zhp
* @Date: 2024-06-21 09:05:14
* @LastEditTime: 2024-06-24 08:46:49
* @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)
let arr = []
var res = ``;
// for (var i = 0, l = params.length; i < l; i++) {
console.log()
if (params[0].axisValue === 'FTO投入' || params[0].axisValue === '芯片产量' || params[0].axisValue === '标准组件产量') {
res +=
"<br/>" +
`<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[0].color}'></span>` +
`<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[0].axisValueLabel}</span>` +
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[0].name === "综合良率"
? (params[0].value ? params[0].value.toFixed(2) : 0.0) + "%"
: params[0].name === "转化效率"
? (params[0].value ? params[0].value.toFixed(2) : 0.0) + "%"
: params[i].seriesName.search('总功率') != -1
? (params[i].value ? params[i] : 0) + "MW"
: (params[i].value ? params[i].value : 0) + "片"
}</span>`;
// }
}
if (params[1].axisValue === '综合良率' || params[1].axisValue === '转化效率') {
res +=
"<br/>" +
`<span style='display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${params[1].color}'></span>` +
`<span style='display:inline-block;width:150px;color:rgba(0,0,0,0.8);font-size:14px;'>${params[1].axisValueLabel}</span>` +
`<span style='color:rgba(0,0,0,0.48);font-size:14px;'>${params[1].name === "综合良率"
? (params[1].value ? params[1].value.toFixed(2) : 0.0) + "%"
: params[1].name === "转化效率"
? (params[1].value ? params[1].value.toFixed(2) : 0.0) + "%"
: params[i].seriesName.search('总功率') != -1
? (params[i].value ? params[i] : 0) + "MW"
: (params[i].value ? params[i].value : 0) + "片"
}</span>`;
}
return res;
},
},
xAxis: {
type: "category",
data: [],
axisTick: {
show: false,
},
axisPointer: {
type: "shadow",
},
},
dataZoom: [//
{
//
show: false,
//
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>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-24 09:39:27 * @LastEditTime: 2024-06-18 13:41:03
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -13,52 +13,63 @@
</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" :picker-options="{'firstDayOfWeek': 1}"> 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" :picker-options="{'firstDayOfWeek': 1}"> 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 :span-method="objectSpanMethod" :table-props="tableProps" :page="listQuery.pageNo" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:limit="listQuery.pageSize" :table-data="tableData" :max-height="tableH"> :table-data="tableData">
</base-table> </base-table>
</div> </div>
</div> </div>
@ -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,22 +97,18 @@ export default {
return { return {
factoryList, factoryList,
factoryArray, factoryArray,
currentMenu:'邯郸', 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: []
}, },
tableH: this.tableHeight(269),
timeList: [ timeList: [
{ {
value: 0, value: 0,
@ -145,10 +152,71 @@ 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,
lineData: {}, lineData: {},
data: {} data: {}
// proLineList: [], // proLineList: [],
@ -159,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,71 +234,68 @@ export default {
// this.changeTime() // this.changeTime()
// }, // },
mounted() { mounted() {
this.tableH = this.tableHeight(269);
// 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: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
// let spanTwoArr = [], concatTwo = 0;
this.tableData.map((item, index) => {
// console.log(inde);
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.type === this.tableData[index - 1].type) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 1) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
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)
@ -265,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天',
@ -295,209 +333,36 @@ 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 = [{ this.listQuery.total = res.data.total
type: '芯片', if (this.listQuery.total > 0) {
item: 'FTO投入', this.tableData.forEach(item => {
unit: '片' item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--'
}, item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--'
{
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,
prop: '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,
// })
})
console.log(dataArr);
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"
});
}
} }
}, },
buttonClick(val) { buttonClick(val) {
@ -527,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};

View File

@ -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,80 +12,65 @@
</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="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.date === 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 周" <el-date-picker size="small" clearable v-model="start" type="week" format="yyyy 第 WW 周" placeholder="选择周"
placeholder="选择周" style="width: 180px" @change="onValueChange" :picker-options="{'firstDayOfWeek': 1}"> 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" :picker-options="{'firstDayOfWeek': 1}"> 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.date === 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" <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.date === 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.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.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" />
产量转化效率 <base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
</div> :max-height="tableH" />
<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="legendListTarget"
: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 :key="showTable" :span-method="objectSpanMethod" :table-props="tableProps" :page="listQuery.current"
:limit="listQuery.size" :table-data="tableData" :max-height="tableH" />
</div> </div>
<!-- <div class="containerBottom"> <!-- <div class="containerBottom">
@ -94,24 +79,60 @@
</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/produceLineYieldBarTarget.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,
title: '', start: undefined,
currentMenu: '邯郸', end: undefined,
showTable:false,
listQuery: { listQuery: {
start: undefined, // size: 10,
end: undefined, // current: 1,
factorys: null, factorys: null,
// total: 0, // total: 0,
date: 2, date: 2,
@ -137,123 +158,71 @@ 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: 2, name: "芯片总功率", type: 1, color: "#8EF0AB" { id: 2, name: "2023年4月", type: 1, color: "#8EF0AB" },
}, { id: 3, name: "2024年4月", type: 1, color: "#288AFF" },
{ id: 3, name: "标准组件总功率", type: 1, color: "#288AFF" },
{
id: 1, name: "转化效率", type: 2, color: "#FFCE6A"
},
// {
// id: 3, name: "", type: 1, color: "#288AFF"
// },
], ],
legendListTarget: [
{
id: 2, name: "芯片总功率", type: 1, color: "#8EF0AB"
},
{
id: 3, name: "标准组件总功率", type: 1, color: "#288AFF"
},
{
id: 1, name: "转化效率", type: 1, color: "#64BDFF"
},
// {
// id: 3, name: "", type: 1, color: "#288AFF"
// },
],
chartMsgYearTarget: {
color: ["#8EF0AB", "#288AFF","#64BDFF",],
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: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [-18, -16],
color: "#68C483",
formatter: function (params) {
return params.value + "MW";
},
},
},
{
name: '',
type: 'bar',
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [-18, -16],
color: "#68C483",
formatter: function (params) {
return params.value + "%";
},
},
yAxisIndex: 1
}
],
},
chartMsg: { chartMsg: {
color: ["#8EF0AB", "#288AFF","#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: "芯片总功率", name: "2024年4月目标值",
data: [ 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: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
], ],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
@ -262,13 +231,16 @@ export default {
position: [-18, -16], position: [-18, -16],
color: "#68C483", color: "#68C483",
formatter: function (params) { formatter: function (params) {
return params.value.toFixed(2) + "MW"; return params.value.toFixed(2) + "%";
}, },
}, },
}, },
{ {
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,
@ -276,23 +248,6 @@ export default {
show: true, show: true,
position: [0, -16], position: [0, -16],
color: "#288AFF", color: "#288AFF",
formatter: function (params) {
return params.value.toFixed(2) + "MW";
},
},
},
{
name: "转化效率",
data: [
],
type: "line",
symbol: "circle",
// barWidth: 20,
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) + "%";
}, },
@ -307,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
}, },
@ -346,7 +275,7 @@ export default {
watch: { watch: {
// //
isOpen(val) { isOpen(val) {
if (this.$route.name === "produceConversion") { if (this.$route.name === "ChipYieldBM") {
this.chartNum++; this.chartNum++;
} }
}, },
@ -361,75 +290,73 @@ export default {
}, },
activated() { activated() {
// //
if (this.$route.name === "produceConversion") { 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.beginTime = moment(sevenDaysAgo).format('yyyy-MM-DD') this.changeTime()
this.listQuery.endTime = moment(today).format('yyyy-MM-DD')
this.listQuery.reportTime = [this.listQuery.beginTime, this.listQuery.endTime]
this.getDataList() this.getDataList()
}, },
methods: { methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
// let spanTwoArr = [], concatTwo = 0;
this.tableData.map((item, index) => {
// console.log(inde);
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.factory === this.tableData[index - 1].factory) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
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.beginTime = this.listQuery.start if (Number(this.end) < Number(this.start)) {
this.listQuery.endTime = this.listQuery.end this.$message({
message: '结束年份不能小于开始年份',
type: 'warning'
});
this.start = undefined
this.end = undefined
} else {
this.listQuery.beginTime = Number(this.start)
this.listQuery.endTime = Number(this.end)
}
} }
if (!this.listQuery.start && !this.listQuery.end) { if (!this.start && !this.end) {
this.listQuery.beginTime = undefined this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined this.listQuery.endTime = 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.beginTime = this.listQuery.reportTime[0]
this.listQuery.endTime = this.listQuery.reportTime[1]
}
} else {
this.listQuery.beginTime = undefined
this.listQuery.endTime = 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)
@ -438,21 +365,20 @@ export default {
type: 'warning' type: 'warning'
}); });
} else { } else {
this.listQuery.beginTime = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD') this.listQuery.beginTime = this.date1
this.listQuery.endTime = moment(this.listQuery.end.getTime() + 5 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD') this.listQuery.endTime = this.date2
// this.listQuery.beginTime = Number(moment(this.start.getTime()).format('YYYYWW'))
// this.listQuery.endTime = Number(moment(this.end.getTime()).format('YYYYWW'))
} }
} }
if (!this.listQuery.start && !this.listQuery.end) { if (!this.start && !this.end) {
this.listQuery.beginTime = undefined this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined this.listQuery.endTime = undefined
} }
}, },
changeDayTime() { changeDayTime() {
if (this.listQuery.reportTime) { if (this.listQuery.reportTime) {
// this.createbeginTime = 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.createendTime = 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天',
@ -468,198 +394,42 @@ export default {
this.listQuery.endTime = undefined this.listQuery.endTime = 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.beginTime = this.listQuery.reportTime[0] // this.$refs.detailOrUpdate.init(val.data.id);
this.listQuery.endTime = this.listQuery.reportTime[1] });
}
} else {
this.listQuery.beginTime = undefined
this.listQuery.endTime = undefined
}
}, },
async getDataList() { async getDataList() {
this.otherProps = []
this.chartMsg.xData = []
this.chartMsg.series[0].data = []
this.chartMsg.series[1].data = []
this.chartMsg.series[2].data = []
this.chartMsgYearTarget.series[0].data = []
this.chartMsgYearTarget.series[1].data = []
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, this.listQuery.total = res.data.total
item: '芯片总功率', if (this.listQuery.total > 0) {
unit: 'MW' this.tableData.forEach(item => {
}, 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] : '--'
factory: null,
item: '标准组件总功率',
unit: 'MW'
},
{
factory: null,
item: '转化效率',
unit: '%'
}
]
res.data.forEach(element => {
element.list.reverse().forEach((ele, index) => {
let i = index + 1
this.chartMsg.xData.push(ele.reportTimep)
this.otherProps.push({
label: ele.reportTimep,
prop: 'value' + i
})
}) })
})
if (res.data[0].list.length != 0) {
this.chartMsg.xData.push(res.data[0].list[0].reportTimep + '目标')
if (this.listQuery.date === 0 || this.listQuery.date === 1 || this.listQuery.date === 2) {
this.otherProps.push({
label: res.data[0].list[0].reportTimep + '目标',
prop: 'dayData'
})
dataArr[0]['dayData'] = res.data[0].list[0].chipTarget
dataArr[1]['dayData'] = res.data[0].list[0].standTarget
dataArr[2]['dayData'] = res.data[0].list[0].conversionEfficiencyTarget
}
if (this.listQuery.date === 2 || this.listQuery.date === 3) {
this.otherProps.push({
label: res.data[0].yearTarget.targetTime,
prop: 'yearData'
})
dataArr[0]['yearData'] = res.data[0].yearTarget.chipTotalPower
dataArr[1]['yearData'] = res.data[0].yearTarget.componentTotalPower
dataArr[2]['yearData'] = res.data[0].yearTarget.componentConversionEfficiency
}
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[1]['' + m + ''] = item.scTotalPowers
dataArr[2]['' + m + ''] = item.conversionEfficiency
dataArr[0].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
dataArr[1].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
dataArr[2].factory = ele.factory === 1 ? '邯郸' : '瑞昌'
// dataArr[3]['' + m + ''] = ele.comprehensiveYieldRate
// })
// ele.titleValue
// .push({
// label: ele.titleValue,
// props: 'value' + index + 1,
// })
})
})
this.title = res.data[0].yearTarget.targetTime + '目标值'
this.chartMsgYearTarget.series[0].data = [
{
value: res.data[0].yearTarget.chipTotalPower,
itemStyle: {
color: '#8EF0AB'
}
},
{
value: res.data[0].yearTarget.componentTotalPower,
itemStyle: {
color: '#288AFF'
}
},
{
value: null,
itemStyle: {
color: '#64BDFF'
}
}]
this.chartMsgYearTarget.series[1].data = [
{
value: null,
itemStyle: {
color: '#8EF0AB'
}
},
{
value: null,
itemStyle: {
color: '#288AFF'
}
},
{
value: res.data[0].yearTarget.componentConversionEfficiency,
itemStyle: {
color: '#64BDFF'
}
}]
console.log(dataArr);
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]
})
}
}
} else {
this.chartMsgYearTarget.series[0].data = []
this.chartMsgYearTarget.series[1].data = []
} }
// 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.tableData = res.data[0].list.length !== 0 ? dataArr : []
this.showTable = !this.showTable
}, },
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(137) / 2 - 70;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(137) / 2 - 111;
if (this.$route.name === "produceConversion") { if (this.$route.name === "ChipYieldBM") {
this.chartNum++; this.chartNum++;
} }
}, },
@ -668,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("导出");
}, },
}, },
@ -687,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;
@ -707,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

View File

@ -4,88 +4,73 @@
<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" :picker-options="{'firstDayOfWeek': 1}"> 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" :picker-options="{'firstDayOfWeek': 1}"> 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" />
产量及良率对比 <base-table :table-props="tableProps" :page="listQuery.current" :limit="listQuery.size" :table-data="tableData"
</div> :max-height="tableH" />
<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="legendListTarget"
: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 :key="showTable" :span-method="objectSpanMethod" :table-props="tableProps" :page="listQuery.current"
:limit="listQuery.size" :table-data="tableData" :max-height="tableH" />
</div> </div>
<!-- <div class="containerBottom"> <!-- <div class="containerBottom">
@ -94,29 +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/produceLineYieldBarTarget.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: '',
showTable:false,
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,
@ -141,119 +157,72 @@ 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: 4, name: "标准组件产量", type: 1, color: "#64BDFF" },
], ],
legendListTarget: [
{
id: 2, name: "FTO投入", type: 1, color: "#8EF0AB"
},
{ id: 3, name: "芯片产量", type: 1, color: "#288AFF" },
{
id: 4, name: "标准组件产量", type: 1, color: "#64BDFF"
},
{
id: 1, name: "综合良率", type: 1, color: "#7164FF"
},
],
chartMsgYearTarget: {
color: ["#8EF0AB", "#288AFF", '#64BDFF', "#7164FF",],
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: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [-18, -16],
color: "#68C483",
formatter: function (params) {
return params.value
},
},
},
{
name: '',
// type: 'bar',
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [-18, -16],
color: "#68C483",
formatter: function (params) {
return params.value
},
},
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',
// inverse: true,
name: "单位/%",
nameTextStyle: {
fontSize: 12,
align: "right",
},
axisLabel: {},
}
],
series: [ series: [
{ {
name: "", name: "2024年4月目标值",
// yAxisIndex: 0, data: [
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: [
{ name: "%", value: 57.5 },
{ name: "%", value: 21.66 },
{ name: "%", value: 18.4 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
@ -261,51 +230,23 @@ 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: 7.02 },
{ name: "%", value: 80.2 },
],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
label: { label: {
show: true, show: true,
position: [0, -16], position: [0, -16],
color: "#288AFF", color: "#288AFF",
formatter: function (params) {
return params.value + "片";
},
},
},
{
name: "",
// yAxisIndex: 0,
data: [],
type: "bar",
barWidth: 20,
label: {
show: true,
position: [0, -16],
color: "#64BDFF",
formatter: function (params) {
return params.value+ "片";
},
},
},
{
name: "",
data: [],
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) + "%";
}, },
@ -320,52 +261,20 @@ 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 === "productionYield") { if (this.$route.name === "ChipYieldBM") {
this.chartNum++; this.chartNum++;
} }
}, },
@ -380,75 +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: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
// let spanTwoArr = [], concatTwo = 0;
this.tableData.map((item, index) => {
// console.log(inde);
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.factory === this.tableData[index - 1].factory) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
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)
@ -457,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天',
@ -487,256 +393,40 @@ 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) {
this.chartMsg.series[0].data = [] this.listQuery.startDate = this.listQuery.reportTime[0] + '-01-01 00:00:00'
this.chartMsg.series[1].data = [] this.listQuery.endDate = this.listQuery.reportTime[1] + '-12-31 23:59:59'
this.chartMsg.series[2].data = [] }
this.chartMsg.series[3].data = [] this.listQuery.factory = this.currentMenu === '邯郸' ? 1 : 2
this.chartMsgYearTarget.series[0].data = [] const res = await getComprehensiveDataPage(this.listQuery)
this.chartMsgYearTarget.series[1].data = [] this.tableData = res.data.list
let arr = [] this.listQuery.total = res.data.total
this.currentMenu === '邯郸' ? arr.push(1) : arr.push(0) if (this.listQuery.total > 0) {
this.listQuery.factory = arr this.tableData.forEach(item => {
const res = await getProductionYieldSituationMWData(this.listQuery) item.startTime = item.startDate ? item.startDate[0] + '-' + item.startDate[1] + '-' + item.startDate[2] : '--'
let dataArr = [{ item.endTime = item.endDate ? item.endDate[0] + '-' + item.endDate[1] + '-' + item.endDate[2] : '--'
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,
prop: '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: null,
itemStyle: {
color: '#FFCE6A'
}
}]
this.chartMsgYearTarget.series[1].data = [
{
value: null,
itemStyle: {
color: '#8EF0AB'
}
},
{
value: null,
itemStyle: {
color: '#288AFF'
}
},
{
value: null,
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.forEach((ele, index) => {
let i = index + 1
this.chartMsg.xData.push(ele.titleValue)
this.otherProps.push({
label: ele.titleValue,
prop: 'value' + i
})
})
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]
})
}
}
} }
console.log(dataArr)
this.tableData = res.data.length != 0 ? dataArr : []
this.showTable = !this.showTable
// this.tableProps.push()
}, },
_setTableHeight() { _setTableHeight() {
this.tableH = this.tableHeight(137) / 2 - 70; this.tableH = this.tableHeight(137) / 2 - 70;
this.chartHeight = this.tableHeight(137) / 2 - 111; this.chartHeight = this.tableHeight(137) / 2 - 111;
if (this.$route.name === "productionYield") { if (this.$route.name === "ChipYieldBM") {
this.chartNum++; this.chartNum++;
} }
}, },
@ -745,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(() => { });
}, },
}, },
}; };
@ -766,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 {

View File

@ -254,7 +254,6 @@ export default {
data: [], data: [],
type: "bar", type: "bar",
barWidth: 20, barWidth: 20,
barGap: "100%",
label: { label: {
show: true, show: true,
position: "top", position: "top",