基板报表&厚度汇总报表

This commit is contained in:
朱菊兰 2023-05-04 16:15:57 +08:00
parent 65beb245d6
commit 9613c361be
7 changed files with 732 additions and 69 deletions

View File

@ -137,3 +137,46 @@ export function drawThickness(val) {
data: val data: val
}) })
} }
// 终检数据-获取玻璃列表数据
export function listGlass(data) {
return request({
url: '/report/GlassReport/listGlass',
method: 'post',
data
})
}
// 终检数据-基板品质报表查询
export function qualityReport(data) {
return request({
url: '/report/GlassReport/qualityReport',
method: 'post',
data
})
}
// 终检数据-基板品质报表导出
export function qualityReportexport(data) {
return request({
url: '/report/GlassReport/qualityReportexport',
method: 'post',
responseType: 'blob',
data
})
}
// 终检数据-厚度汇总报表查询
export function thickReport(data) {
return request({
url: '/report/GlassReport/thickReport',
method: 'post',
data
})
}
// 终检数据-厚度汇总报表导出
export function thickReportexport(data) {
return request({
url: '/report/GlassReport/thickReportexport',
method: 'post',
responseType: 'blob',
data
})
}

View File

@ -3,35 +3,37 @@
<el-row class="box-top"> <el-row class="box-top">
<el-col> <el-col>
<div class="search-box"> <div class="search-box">
<search-bar :formConfigs="formConfig" @headBtnClick="buttonClick" /> <search-bar
:formConfigs="formConfig"
@headBtnClick="buttonClick"
@select-changed="selectChanged"
/>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="8" class="box"> <el-row :gutter="8" class="box">
<el-col :span="9"> <el-col :span="9">
<div class="left-box"> <div class="left-box">
<span class="table-button">生成表格</span> <span class="table-button" @click="generateReport">生成表格</span>
<base-table <base-table
:selectWidth="40" :selectWidth="40"
:table-props="tablePropsL" :table-props="tablePropsL"
:table-data="tableDataL" :table-data="tableDataL"
:max-height="tableHL" :max-height="tableHL"
@selection-change="selectChange"
/> />
</div> </div>
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<div class="right-box"> <div class="right-box">
<div> <div v-if="reportTitle">
<span class="title">成品玻璃基本缺陷统计</span> <span class="title">{{ reportTitle }}</span>
</div> </div>
<ul class="tip"> <div class="table-box" v-if="reportTitle === '单片玻璃基板缺陷统计'">
<li>单位um</li> <glass-quality-report :tableData="glassQualityArr" />
<li>玻璃ID26522322323</li> </div>
<li>生产日期2022.12.24 15:56:24</li> <div class="table-box" v-if="reportTitle === '厚度汇总报表'">
<li>等级G1</li> <glass-thick-report :tableData="thickReportArr" />
</ul>
<div class="table-box">
<final-data-table />
</div> </div>
</div> </div>
</el-col> </el-col>
@ -40,64 +42,74 @@
</template> </template>
<script> <script>
import { tableHeight } from '@/utils/index' import { tableHeight } from '@/utils/index'
import finalDataTable from './components/finalDataTable' import {
listGlass,
qualityReport,
thickReport,
qualityReportexport,
thickReportexport
} from '@/api/qualityManagement'
import glassQualityReport from './finalInspectionDataReport/glassQualityReport.vue'
import glassThickReport from './finalInspectionDataReport/glassThickReport.vue'
import moment from 'moment'
import { timeFormatter } from '@/utils'
const tablePropsL = [ const tablePropsL = [
{ {
prop: 'id', prop: 'glassId',
label: 'ID', label: 'ID',
minWidth: 100 minWidth: 100
}, },
{ {
prop: 'time', prop: 'unloadTime',
label: '检测时间', label: '检测时间',
minWidth: 100 minWidth: 120,
filter: timeFormatter
}, },
{ {
prop: 'type', prop: 'grindtype',
label: '研磨类型', label: '研磨类型',
minWidth: 100 minWidth: 80
} }
] ]
export default { export default {
name: 'FinalInspectionData', name: 'FinalInspectionData',
components: { finalDataTable }, components: { glassQualityReport, glassThickReport },
data() { data() {
return { return {
formConfig: [ formConfig: [
{ {
type: 'datePicker', type: 'datePicker',
label: '检验时间', label: '检验时间',
dateType: 'datetime', dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-ddTHH:mm:ss',
placeholder: '检验时间', rangeSeparator: '-',
param: 'testTime', startPlaceholder: '开始时间',
width: 200 endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
}, },
{ {
type: 'select', type: 'select',
label: '玻璃架', label: '玻璃架',
selectOptions: [ selectOptions: [],
{ id: '1', name: '521321545' }, param: 'glassFrame',
{ id: '2', name: '932234561' }, defaultSelect: '全部',
{ id: '3', name: '542121212' }, width: 150,
{ id: '4', name: '354855321' } clearable: false
],
param: 'fullInspectionType',
defaultSelect: '',
width: 150
}, },
{ {
type: 'select', type: 'select',
label: '报表类型', label: '报表类型',
selectOptions: [ selectOptions: [
{ id: '1', name: '单片玻璃基板缺陷统计' }, { id: '单片玻璃基板缺陷统计', name: '单片玻璃基板缺陷统计' },
{ id: '2', name: '932234561' }, { id: '终检下片包装', name: '终检下片包装' },
{ id: '3', name: '542121212' }, { id: '厚度汇总报表', name: '厚度汇总报表' }
{ id: '4', name: '354855321' }
], ],
param: 'fullInspectionType1', param: 'fullInspectionType1',
defaultSelect: '', defaultSelect: '',
onchange: true,
width: 150 width: 150
}, },
{ {
@ -119,33 +131,207 @@ export default {
], ],
tablePropsL, tablePropsL,
tableDataL: [], tableDataL: [],
tableHL: tableHeight(300) tableHL: tableHeight(300),
reportTitle: '',
listQuery: {
startTime: '2020-07-06T16:59:23',
endTime: '2023-07-06T16:59:23',
glassFrame: '',
current: 1,
size: 500
},
selectArr: [], //
glassQualityArr: [], //
thickReportArr: [] //
} }
}, },
mounted() { mounted() {
this.getOption()
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableHL = tableHeight(300) this.tableHL = tableHeight(300)
}) })
this.formConfig[0].defaultSelect = [
moment().format('yyyy-MM-DD') + 'T00:00:00',
moment().format('yyyy-MM-DD') + 'T23:59:59'
]
this.listQuery.startTime = moment().format('yyyy-MM-DD') + 'T00:00:00'
this.listQuery.endTime = moment().format('yyyy-MM-DD') + 'T23:59:59'
this.listQuery.glassFrame = '全部'
this.getList() this.getList()
}, },
methods: { methods: {
getList() {
listGlass({ ...this.listQuery }).then((res) => {
if (res.code === 0) {
this.tableDataL = res.data
} else {
this.tableDataL = []
}
})
},
getOption() {
let arr = JSON.parse(
localStorage.getItem('publicList')
).glassRackStationVoList
let newArr = arr.map((item) => ({
id: item.dataName,
name: item.dataName
}))
newArr.push({ id: '全部', name: '全部' }, { id: '废片', name: '废片' })
this.formConfig[1].selectOptions = newArr
console.log(newArr)
},
buttonClick(val) { buttonClick(val) {
let arr = []
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : ''
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : ''
this.listQuery.glassFrame = val.glassFrame
this.getList() this.getList()
break break
default: default:
alert('导出') if (this.selectArr.length === 0) {
this.$message({
message: '请勾选左侧表格数据',
type: 'warning'
})
return false
}
if (this.reportTitle === '') {
this.$message({
message: '请选择报表类型',
type: 'warning'
})
return false
}
console.log(this.selectArr)
for (let i of this.selectArr) {
arr.push(i.glassId)
}
if (this.reportTitle === '单片玻璃基板缺陷统计') {
this.exportGlassReport(arr)
} else if (this.reportTitle === '厚度汇总报表') {
this.exportThickReport(arr)
}
} }
}, },
getList() { selectChanged(val) {
let arr = [] this.reportTitle = val.value
for (let i = 0; i < 30; i++) { this.glassQualityArr = []
let obj = {} this.thickReportArr = []
obj.type = i },
arr.push(obj) selectChange(val) {
this.selectArr = val
},
//
generateReport() {
if (this.selectArr.length === 0) {
this.$message({
message: '请勾选左侧表格数据',
type: 'warning'
})
return false
} }
this.tableDataL = arr if (this.reportTitle === '') {
this.$message({
message: '请选择报表类型',
type: 'warning'
})
return false
}
let arr = []
for (let i of this.selectArr) {
arr.push(i.glassId)
}
switch (this.reportTitle) {
case '单片玻璃基板缺陷统计':
this.getGlassReport(arr)
break
case '厚度汇总报表':
this.getThickReport(arr)
break
default:
}
},
getGlassReport(arr) {
qualityReport({
// glassId: [122206240688, 122206240692],
glassId: arr,
size: 1000,
current: 1
}).then((res) => {
console.log(res)
this.glassQualityArr = res.data
})
},
exportGlassReport(arr) {
qualityReportexport({
glassId: arr,
size: 1000,
current: 1
}).then((response) => {
console.log(response)
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
fileName = decodeURIComponent(
contentDisposition.slice(
contentDisposition.indexOf('filename=') + 9
)
)
}
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
},
getThickReport(arr) {
thickReport({
glassId: arr,
size: 1000,
current: 1
}).then((res) => {
console.log(res)
this.thickReportArr = res.data
})
},
exportThickReport(arr) {
thickReportexport({
glassId: arr,
size: 1000,
current: 1
}).then((response) => {
console.log(response)
let fileName = ''
const contentDisposition = response.headers['content-disposition']
if (contentDisposition) {
fileName = decodeURIComponent(
contentDisposition.slice(
contentDisposition.indexOf('filename=') + 9
)
)
}
const blob = new Blob([response.data])
const reader = new FileReader()
reader.readAsDataURL(blob)
reader.onload = (e) => {
const a = document.createElement('a')
a.download = fileName
a.href = e.target.result
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
} }
} }
} }
@ -174,7 +360,8 @@ export default {
border-radius: 8px; border-radius: 8px;
background-color: #fff; background-color: #fff;
.table-box { .table-box {
height: calc(100vh - 352px); margin-top: 16px;
height: calc(100vh - 290px);
overflow: auto; overflow: auto;
} }
} }
@ -204,25 +391,6 @@ export default {
margin-right: 8px; margin-right: 8px;
vertical-align: middle; vertical-align: middle;
} }
.tip {
display: flex;
flex-flow: row wrap;
height: 40px;
margin: 16px 0 20px;
li {
width: 25%;
font-size: 14px;
font-weight: 500;
text-align: center;
padding-top: 10px;
border-top: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
border-left: 1px solid #e8e8e8;
}
:last-child {
border-right: 1px solid #e8e8e8;
}
}
} }
} }
} }

View File

@ -0,0 +1,229 @@
<template>
<div class="finalInspectionData">
<el-row class="box-top">
<el-col>
<div class="search-box">
<search-bar :formConfigs="formConfig" @headBtnClick="buttonClick" />
</div>
</el-col>
</el-row>
<el-row :gutter="8" class="box">
<el-col :span="9">
<div class="left-box">
<span class="table-button">生成表格</span>
<base-table
:selectWidth="40"
:table-props="tablePropsL"
:table-data="tableDataL"
:max-height="tableHL"
/>
</div>
</el-col>
<el-col :span="15">
<div class="right-box">
<div>
<span class="title">成品玻璃基本缺陷统计</span>
</div>
<ul class="tip">
<li>单位um</li>
<li>玻璃ID26522322323</li>
<li>生产日期2022.12.24 15:56:24</li>
<li>等级G1</li>
</ul>
<div class="table-box">
<final-data-table />
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { tableHeight } from '@/utils/index'
import finalDataTable from './components/finalDataTable'
const tablePropsL = [
{
prop: 'id',
label: 'ID',
minWidth: 100
},
{
prop: 'time',
label: '检测时间',
minWidth: 100
},
{
prop: 'type',
label: '研磨类型',
minWidth: 100
}
]
export default {
name: 'FinalInspectionData',
components: { finalDataTable },
data() {
return {
formConfig: [
{
type: 'datePicker',
label: '检验时间',
dateType: 'datetime',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
placeholder: '检验时间',
param: 'testTime',
width: 200
},
{
type: 'select',
label: '玻璃架',
selectOptions: [
{ id: '1', name: '521321545' },
{ id: '2', name: '932234561' },
{ id: '3', name: '542121212' },
{ id: '4', name: '354855321' }
],
param: 'fullInspectionType',
defaultSelect: '',
width: 150
},
{
type: 'select',
label: '报表类型',
selectOptions: [
{ id: '1', name: '单片玻璃基板缺陷统计' },
{ id: '2', name: '终检下片包装' },
{ id: '3', name: '厚度检查机报表' },
{ id: '4', name: '厚度汇总报表' }
],
param: 'fullInspectionType1',
defaultSelect: '',
width: 150
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: 'button',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
tablePropsL,
tableDataL: [],
tableHL: tableHeight(300)
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableHL = tableHeight(300)
})
this.getList()
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.getList()
break
default:
alert('导出')
}
},
getList() {
let arr = []
for (let i = 0; i < 30; i++) {
let obj = {}
obj.type = i
arr.push(obj)
}
this.tableDataL = arr
}
}
}
</script>
<style lang="scss" scoped>
.finalInspectionData {
width: 100%;
.box-top {
width: 100%;
padding: 8px 16px 0;
.search-box {
height: 62px;
padding: 10px 16px;
box-sizing: border-box;
border-radius: 8px;
background-color: #fff;
}
}
.box {
width: 100%;
padding: 8px 8px 0 16px;
.left-box,
.right-box {
height: calc(100vh - 220px);
padding: 16px;
border-radius: 8px;
background-color: #fff;
.table-box {
height: calc(100vh - 352px);
overflow: auto;
}
}
.left-box {
.table-button {
display: inline-block;
height: 30px;
width: 100%;
text-align: center;
padding-top: 4px;
margin-bottom: 16px;
font-size: 14px;
color: #0b58ff;
border-radius: 4px;
border: 1px dotted #0b58ff;
cursor: pointer;
}
}
.right-box {
.title::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background: #0b58ff;
border-radius: 1px;
margin-right: 8px;
vertical-align: middle;
}
.tip {
display: flex;
flex-flow: row wrap;
height: 40px;
margin: 16px 0 20px;
li {
width: 25%;
font-size: 14px;
font-weight: 500;
text-align: center;
padding-top: 10px;
border-top: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
border-left: 1px solid #e8e8e8;
}
:last-child {
border-right: 1px solid #e8e8e8;
}
}
}
}
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<div>
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
</div>
</template>
<script>
import { timeFormatter, tableHeight } from '@/utils'
const tableProps = [
{
prop: 'time',
label: '检测时间',
filter: timeFormatter,
minWidth: 160
},
{
prop: 'virtualcode',
label: '玻璃ID',
minWidth: 120
},
{
prop: 'lineA',
label: '加工条件',
children: [
{
prop: 'palletId',
label: '托盘ID'
},
{
prop: 'grindtype',
label: '研磨类型'
}
]
},
{
prop: 'lineB',
label: '检测数据',
children: [
{
prop: 'sums',
label: '颗粒总数'
},
{
prop: 'distortion',
label: '变形'
},
{
prop: 'tail',
label: '拖尾'
},
{
prop: 'bl',
label: '气泡'
},
{
prop: 'stone',
label: '结石'
},
{
prop: 'scratch',
label: '划伤'
},
{
prop: 'surfaceSum',
label: '面检总数'
}
]
},
{
prop: 'lineC',
label: '研磨电流(A)',
children: [
{
prop: 'ae',
label: 'A机台'
},
{
prop: 'be',
label: 'B机台'
},
{
prop: 'ce',
label: 'C机台'
},
{
prop: 'alle',
label: '总电流'
}
]
},
{
prop: 'eletricityConform',
label: '工艺符合性',
minWidth: 100
},
{
prop: 'lineD',
label: '研磨时间(S)',
children: [
{
prop: 'ae',
label: 'A机台'
},
{
prop: 'be',
label: 'B机台'
},
{
prop: 'ce',
label: 'C机台'
},
{
prop: 'allt',
label: '总研磨时间',
minWidth: 100
}
]
}
]
export default {
name: 'glassQualityReport',
data() {
return {
tableProps,
tableH: tableHeight(292)
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = tableHeight(292)
})
},
props: {
tableData: {
type: Array,
required: true,
default: () => {
return []
}
}
}
}
</script>

View File

@ -0,0 +1,78 @@
<template>
<div>
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
</div>
</template>
<script>
import { timeFormatter, tableHeight } from '@/utils'
const tableProps = [
{
prop: 'glassId',
label: '玻璃ID',
minWidth: 120
},
{
prop: 'testTime',
label: '检测时间',
filter: timeFormatter,
minWidth: 160
},
{
prop: 'palletId',
label: '托盘ID',
minWidth: 120
},
{
prop: 'grindType',
label: '研磨类型',
minWidth: 120
},
{
prop: 'maxValue',
label: '最大值',
minWidth: 120
},
{
prop: 'minValue',
label: '最小值',
minWidth: 120
},
{
prop: 'avgValue',
label: '平均值',
minWidth: 120
},
{
prop: 'ttvValue',
label: '厚薄差',
minWidth: 120
}
]
export default {
name: 'glassThickReport',
data() {
return {
tableProps,
tableH: tableHeight(292)
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = tableHeight(292)
})
},
props: {
tableData: {
type: Array,
required: true,
default: () => {
return []
}
}
}
}
</script>

View File

@ -130,7 +130,6 @@ export default {
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : '' this.listQuery.startTime = val.timeVal ? val.timeVal[0] : ''
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : '' this.listQuery.endTime = val.timeVal ? val.timeVal[1] : ''
this.listQuery.glassId = val.glassId this.listQuery.glassId = val.glassId
this.listQuery.current = 1
this.getList() this.getList()
break break
default: default:

View File

@ -65,7 +65,7 @@ export default {
this.resetSize() this.resetSize()
this.resetSize2() this.resetSize2()
this.getGlass() this.getGlass()
this.getAlarm() // this.getAlarm() //
// this.timer = setInterval(this.getGlassAndAlarm, 1000) // this.timer = setInterval(this.getGlassAndAlarm, 1000)
}, },
methods: { methods: {
@ -100,8 +100,8 @@ export default {
this.getArea3() this.getArea3()
this.getText() this.getText()
}, },
getArea1() {
// 1 // 1
getArea1() {
this.drawRect(22, 43, 28, 22, '#B2FFC8', true) this.drawRect(22, 43, 28, 22, '#B2FFC8', true)
this.drawRect(66, 43, 28, 22, '#B2FFC8', true) this.drawRect(66, 43, 28, 22, '#B2FFC8', true)
this.drawRect(22, 161, 28, 22, '#B2FFC8', true) this.drawRect(22, 161, 28, 22, '#B2FFC8', true)