报表样式修改

This commit is contained in:
2023-06-26 16:03:30 +08:00
parent 0aa208aa0b
commit a11ef7da48
23 changed files with 947 additions and 98 deletions

View File

@@ -149,18 +149,26 @@ export default {
window.addEventListener('resize', () => {
this.tableH = tableHeight(330)
})
this.formConfig[2].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'
const { listQuery } = this.$route.params
if (listQuery) {
let obj = JSON.parse(listQuery)
this.listQuery = obj
this.formConfig[0].defaultSelect = obj.glassId
this.formConfig[1].defaultSelect = obj.grindType
this.formConfig[2].defaultSelect = [obj.startTime, obj.endTime]
} else {
this.formConfig[2].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.getList()
},
methods: {
getList() {
processCompleteInspetion({ ...this.listQuery }).then((res) => {
console.log(res)
if (res.code === 0 && res.data) {
this.tableData = res.data.records
this.total = res.data.total
@@ -207,11 +215,13 @@ export default {
console.log(val)
if (val.type === 'detail') {
this.$router.push({
path: '/qualityManagement/processFullInspection/fullInspectionDetail',
query: {
// path: '/qualityManagement/processFullInspection/fullInspectionDetail',
name: 'fullInspectionDetail',
params: {
virtualcode: val.data.virtualcode,
filetype: encodeURIComponent(val.data.filetype),
time: val.data.time
time: val.data.time,
listQuery: JSON.stringify(this.listQuery)
}
})
}

View File

@@ -106,6 +106,13 @@ export default {
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
],
formConfig: [
{
type: 'input',
label: '玻璃ID',
param: 'glassId',
defaultSelect: '',
disabled: true
},
{
type: 'select',
label: '缺陷类型',
@@ -147,12 +154,15 @@ export default {
defectType: ''
},
// 查看图片
centervisible: false
centervisible: false,
beforeListQuery: ''
}
},
mounted() {
const { virtualcode, filetype, time } = this.$route.query
const { virtualcode, filetype, time, listQuery } = this.$route.params
this.beforeListQuery = listQuery
this.listQuery.glassId = virtualcode
this.formConfig[0].defaultSelect = virtualcode
this.getDetail(virtualcode, filetype, time)
window.addEventListener('resize', () => {
this.tableH = tableHeight(425)
@@ -179,7 +189,7 @@ export default {
size: 500,
current: 1
}).then((res) => {
this.formConfig[0].selectOptions = res.data
this.formConfig[1].selectOptions = res.data
})
},
getList() {
@@ -200,7 +210,11 @@ export default {
break
default:
this.$router.push({
path: '/qualityManagement/processFullInspection/fullInspection'
// path: '/qualityManagement/processFullInspection/fullInspection',
name: 'fullInspection',
params: {
listQuery: this.beforeListQuery
}
})
}
},

View File

@@ -5,57 +5,65 @@
<div class="search-box">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
@select-changed="selectChanged"
/>
</div>
</el-col>
</el-row>
<el-row :gutter="8" class="box">
<el-col :span="9">
<div class="left-box">
<span class="table-button" @click="generateReport">生成表格</span>
<base-table
:selectWidth="40"
:table-props="tablePropsL"
:table-data="tableDataL"
:max-height="tableHL"
@selection-change="selectChange"
/>
</div>
</el-col>
<el-col :span="15">
<div class="right-box">
<div v-if="reportTitle">
<span class="title">{{ reportTitle }}</span>
</div>
<div class="table-box" v-if="reportTitle === '玻璃基板品质报表'">
<glass-quality-report :tableData="glassQualityArr" />
</div>
<div class="table-box" v-if="reportTitle === '厚度汇总报表'">
<glass-thick-report :tableData="thickReportArr" />
</div>
<div class="table-box" v-if="reportTitle === '终检下片包装'">
<glass-pack-report
:tableData1="packClaReportArr"
:tableData2="packReportArr"
<div class="box">
<split-pane v-model="split1">
<template #left>
<div class="split-pane left-box">
<span class="table-button" @click="generateReport">生成表格</span>
<base-table
:selectWidth="40"
:table-props="tablePropsL"
:table-data="tableDataL"
:max-height="tableHL"
@selection-change="selectChange"
/>
</div>
<div class="table-box" v-if="reportTitle === '玻璃判废统计表'">
<glass-waste-report :tableData="wasteReportArr" />
</template>
<template #right>
<div class="split-pane right-box">
<div class="inner-box">
<div v-if="reportTitle">
<span class="title">{{ reportTitle }}</span>
</div>
<div class="table-box" v-if="reportTitle === '玻璃基板品质报表'">
<glass-quality-report :tableData="glassQualityArr" />
</div>
<div class="table-box" v-if="reportTitle === '厚度汇总报表'">
<glass-thick-report :tableData="thickReportArr" />
</div>
<div class="table-box" v-if="reportTitle === '终检下片包装'">
<glass-pack-report
:tableData1="packClaReportArr"
:tableData2="packReportArr"
/>
</div>
<div class="table-box" v-if="reportTitle === '玻璃判废统计表'">
<glass-waste-report :tableData="wasteReportArr" />
</div>
<div class="table-box" v-if="reportTitle === '判废机组统计表'">
<waste-machine-report :tableData="wasteMachineArr" />
</div>
<div class="table-box" v-if="reportTitle === '判废位置统计表'">
<waste-location-report :tableData="wasteLocationArr" />
</div>
<div class="table-box" v-if="reportTitle === '玻璃基板缺陷报表'">
<glass-defect-report :tableData="glassDefectArr" />
</div>
<div class="table-box" v-if="reportTitle === '厚度检查机报表'">
<thickness-report :tableData="glassDefectArr" />
</div>
</div>
</div>
<div class="table-box" v-if="reportTitle === '判废机组统计表'">
<waste-machine-report :tableData="wasteMachineArr" />
</div>
<div class="table-box" v-if="reportTitle === '判废位置统计表'">
<waste-location-report :tableData="wasteLocationArr" />
</div>
<div class="table-box" v-if="reportTitle === '玻璃基板缺陷报表'">
<glass-defect-report :tableData="glassDefectArr" />
</div>
</div>
</el-col>
</el-row>
</template>
</split-pane>
</div>
</div>
</template>
<script>
@@ -76,6 +84,7 @@ import glassWasteReport from './finalInspectionDataReport/glassWasteReport.vue'
import wasteMachineReport from './finalInspectionDataReport/wasteMachineReport.vue'
import wasteLocationReport from './finalInspectionDataReport/wasteLocationReport.vue'
import glassDefectReport from './finalInspectionDataReport/glassDefectReport.vue'
import thicknessReport from './finalInspectionDataReport/thicknessReport.vue'
import moment from 'moment'
import { timeFormatter } from '@/utils'
const tablePropsL = [
@@ -94,6 +103,16 @@ const tablePropsL = [
prop: 'grindtype',
label: '研磨类型',
minWidth: 80
},
{
prop: 'rackId',
label: '玻璃架',
minWidth: 80
},
{
prop: 'glassNum',
label: '数量',
minWidth: 80
}
]
export default {
@@ -105,11 +124,31 @@ export default {
glassWasteReport,
wasteMachineReport,
wasteLocationReport,
glassDefectReport
glassDefectReport,
thicknessReport
},
data() {
return {
split1: 0.3,
formConfig: [
{
type: 'select',
label: '报表类型',
selectOptions: [
{ id: '玻璃基板品质报表', name: '玻璃基板品质报表' },
{ id: '终检下片包装', name: '终检下片包装' },
{ id: '厚度汇总报表', name: '厚度汇总报表' },
{ id: '玻璃判废统计表', name: '玻璃判废统计表' },
{ id: '判废机组统计表', name: '判废机组统计表' },
{ id: '判废位置统计表', name: '判废位置统计表' },
{ id: '玻璃基板缺陷报表', name: '玻璃基板缺陷报表' },
{ id: '厚度检查机报表', name: '厚度检查机报表' }
],
param: 'fullInspectionType',
defaultSelect: '',
onchange: true,
width: 150
},
{
type: 'datePicker',
label: '检验时间',
@@ -133,21 +172,21 @@ export default {
clearable: false
},
{
type: 'select',
label: '报表类型',
type: '',
label: '',
selectOptions: [
{ id: '玻璃基板品质报表', name: '玻璃基板品质报表' },
{ id: '终检下片包装', name: '终检下片包装' },
{ id: '厚度汇总报表', name: '厚度汇总报表' },
{ id: '玻璃判废统计表', name: '玻璃判废统计表' },
{ id: '判废机组统计表', name: '判废机组统计表' },
{ id: '判废位置统计表', name: '判废位置统计表' },
{ id: '玻璃基板缺陷报表', name: '玻璃基板缺陷报表' }
{ id: '1', name: '1' },
{ id: '2', name: '2' },
{ id: '3', name: '3' },
{ id: '4', name: '4' },
{ id: '5', name: '5' },
{ id: '6', name: '6' },
{ id: '全部', name: '全部' }
],
param: 'fullInspectionType1',
defaultSelect: '',
onchange: true,
width: 150
param: 'glassFrame1',
defaultSelect: '全部',
width: 150,
clearable: false
},
{
type: 'button',
@@ -205,7 +244,7 @@ export default {
window.addEventListener('resize', () => {
this.tableHL = tableHeight(300)
})
this.formConfig[0].defaultSelect = [
this.formConfig[1].defaultSelect = [
moment().format('yyyy-MM-DD') + 'T00:00:00',
moment().format('yyyy-MM-DD') + 'T23:59:59'
]
@@ -233,7 +272,7 @@ export default {
name: item.dataName
}))
newArr.push({ id: '全部', name: '全部' }, { id: '废片', name: '废片' })
this.formConfig[1].selectOptions = newArr
this.formConfig[2].selectOptions = newArr
console.log(newArr)
},
buttonClick(val) {
@@ -272,11 +311,24 @@ export default {
}
},
selectChanged(val) {
// 清除右侧表格数据
this.reportTitle = val.value
this.glassQualityArr = []
this.thickReportArr = []
this.packReportArr = []
this.packClaReportArr = []
console.log(val)
if (val.value === '判废位置统计表') {
this.formConfig[3].type = 'select'
this.formConfig[3].label = '研磨类型'
} else {
this.formConfig[3].type = ''
this.formConfig[3].label = ''
}
this.formConfig[1].defaultSelect =
this.$refs.searchBarForm.formInline.timeVal
this.formConfig[2].defaultSelect =
this.$refs.searchBarForm.formInline.glassFrame
},
selectChange(val) {
this.selectArr = val
@@ -424,21 +476,15 @@ export default {
}
}
.box {
width: 100%;
padding: 8px 8px 0 16px;
.left-box,
.right-box {
height: calc(100vh - 220px);
padding: 16px;
height: calc(100vh - 215px);
margin: 8px 16px 0 16px;
.split-pane {
height: 100%;
border-radius: 8px;
background-color: #fff;
.table-box {
margin-top: 16px;
height: calc(100vh - 290px);
overflow: auto;
}
}
.left-box {
padding: 16px;
background-color: #fff;
.table-button {
display: inline-block;
height: 30px;
@@ -454,6 +500,19 @@ export default {
}
}
.right-box {
.inner-box {
height: 100%;
margin-left: 16px;
padding: 16px 16px 0;
border-radius: 8px;
overflow: auto;
background-color: #fff;
.table-box {
margin-top: 16px;
height: calc(100vh - 290px);
overflow: auto;
}
}
.title::before {
content: '';
display: inline-block;

View File

@@ -43,6 +43,10 @@ const tableProps = [
prop: 'sums',
label: '颗粒总数'
},
{
prop: 'tin',
label: '点状缺陷'
},
{
prop: 'distortion',
label: '变形'

View File

@@ -0,0 +1,396 @@
<template>
<div class="thicknessReport">
<ul class="baseMsg">
<li><span>厚度检查机报表(此表接口还未调试)</span></li>
<li :title="glassId"><span>玻璃ID:</span>{{ glassId }}</li>
<li><span>检测时间:</span>2022.12.24 14:45:34</li>
<li><span>研磨类型:</span>4ABC</li>
</ul>
<base-table
:table-props="tableProps"
:table-data="tableDD"
:max-height="tableH"
:show-header="false"
/>
</div>
</template>
<script>
import { tableHeight } from '@/utils'
let tableProps = []
for (let j = 0; j < 21; j++) {
let obj = {}
obj.prop = 'a' + (j + 1)
obj.label = 'a' + (j + 1)
obj.minWidth = 75
tableProps.push(obj)
}
export default {
name: 'thickReport',
data() {
return {
tableProps,
tableH: tableHeight(292),
exportDD: [],
tableDD: [],
glassId: ''
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = tableHeight(292)
})
this.getList()
},
props: {
tableData: {
type: Array,
required: true,
default: () => {
return []
}
}
},
methods: {
getList() {
let exportD = Array(7)
.fill()
.map(() => Array(21))
let tableD = []
for (let j = 0; j < 7; j++) {
let obj = {
a1: '',
a2: '',
a3: '',
a4: '',
a5: '',
a6: '',
a7: '',
a8: '',
a9: '',
a10: '',
a11: '',
a12: '',
a13: '',
a14: '',
a15: '',
a16: '',
a17: '',
a18: '',
a19: '',
a20: '',
a21: ''
}
tableD.push(obj)
}
let mockData = [
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
},
{
glassId: '1212121212',
testTime: '2022-06-24T16:59:55',
grindType: '2AB',
thickOne: '502.457',
thickTwo: '503.226',
thickThree: '503.203',
thickFour: '502.220',
thickFive: '503.411',
thickSix: '500.904',
thickSeven: '499.810'
}
]
this.glassId = mockData[0].glassId
exportD.unshift(Array.from({ length: 21 }, () => null))
exportD[0][0] = '厚度检查机报表'
exportD[0][6] = '玻璃ID:'
exportD[0][8] = mockData[0].glassId
exportD[0][11] = '检测时间:'
exportD[0][13] = mockData[0].testTime
exportD[0][16] = '研磨类型:'
exportD[0][18] = mockData[0].grindType
for (let i = 0; i < mockData.length; i++) {
exportD[1][i] = mockData[i].thickOne
exportD[2][i] = mockData[i].thickTwo
exportD[3][i] = mockData[i].thickThree
exportD[4][i] = mockData[i].thickFour
exportD[5][i] = mockData[i].thickFive
exportD[6][i] = mockData[i].thickSix
exportD[7][i] = mockData[i].thickSeven
tableD[0]['a' + (i + 1)] = mockData[i].thickOne
tableD[1]['a' + (i + 1)] = mockData[i].thickTwo
tableD[2]['a' + (i + 1)] = mockData[i].thickThree
tableD[3]['a' + (i + 1)] = mockData[i].thickFour
tableD[4]['a' + (i + 1)] = mockData[i].thickFive
tableD[5]['a' + (i + 1)] = mockData[i].thickSix
tableD[6]['a' + (i + 1)] = mockData[i].thickSeven
}
console.log(exportD)
console.log(tableD)
this.exportDD = exportD
this.tableDD = tableD
}
}
}
</script>
<style lang="scss">
.thicknessReport {
.baseMsg {
font-size: 14px;
height: 40px;
line-height: 40px;
display: flex;
border: 1px solid #e8e8e8;
border-radius: 4px;
margin-bottom: 20px;
li {
width: 25%;
text-align: center;
padding: 0 10px;
border-right: 1px solid #e8e8e8;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
span {
font-weight: 600;
}
}
}
}
</style>

View File

@@ -5,10 +5,13 @@
:table-data="tableData"
:max-height="tableH"
/>
<button @click="exportD">导出,开发自测用后续会删除</button>
</div>
</template>
<script>
import { tableHeight } from '@/utils'
import * as XLSX from 'xlsx/xlsx.mjs'
import FileSaver from 'file-saver'
const tableProps = [
{
label: '研磨机组',
@@ -54,7 +57,170 @@ export default {
data() {
return {
tableProps,
tableH: tableHeight(292)
tableH: tableHeight(292),
tData: [
[
'厚度检查机报表',
null,
null,
null,
null,
null,
'玻璃ID:',
null,
'132334530057',
null,
null,
'检测时间',
null,
'2023/5/12 12:01:16',
null,
null,
'研磨类型',
null,
'4ABC',
null,
null
],
[
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443'
],
[
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443'
],
[
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443'
],
[
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443'
],
[
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443'
],
[
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443',
'494.105',
'498.234',
'345.654',
'345.654',
'234.567',
'234.567',
'556.443'
]
]
}
},
mounted() {
@@ -70,6 +236,36 @@ export default {
return []
}
}
},
methods: {
exportD() {
// debugger
const filename = '厚度表.xlsx'
const ws_name = 'Sheet1'
const wb = XLSX.utils.book_new()
const ws = XLSX.utils.aoa_to_sheet(this.tData)
XLSX.utils.book_append_sheet(wb, ws, ws_name)
ws['!merges'] = [
{ s: { r: 0, c: 0 }, e: { r: 0, c: 5 } },
{ s: { r: 0, c: 6 }, e: { r: 0, c: 7 } },
{ s: { r: 0, c: 8 }, e: { r: 0, c: 10 } },
{ s: { r: 0, c: 11 }, e: { r: 0, c: 12 } },
{ s: { r: 0, c: 13 }, e: { r: 0, c: 15 } },
{ s: { r: 0, c: 16 }, e: { r: 0, c: 17 } },
{ s: { r: 0, c: 18 }, e: { r: 0, c: 20 } }
]
let wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'array'
})
FileSaver.saveAs(
new Blob([wbout], {
type: 'application/octet-stream'
}),
filename
)
}
}
}
</script>

View File

@@ -554,9 +554,9 @@ export default {
</script>
<style lang="scss" scoped>
.production-report-box {
height: calc(100vh - 203px);
height: calc(100vh - 145px);
padding: 12px 16px;
margin: 0px 16px;
margin: 8px 16px;
border-radius: 8px;
background-color: #fff;
}