6.28
This commit is contained in:
@@ -23,6 +23,14 @@ export function performanceUpdatePlan(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
// 利用率分析
|
||||
export function getUtilization(data) {
|
||||
return request({
|
||||
url: '/equipment/PerformanceAnalysis/getUtilization',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 托盘指标分析
|
||||
export function palletIndicatorAnalysisPage(data) {
|
||||
return request({
|
||||
|
||||
@@ -138,3 +138,19 @@ export function claGlassData(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
// 终检数据-玻璃判废统计报表数据查询
|
||||
export function getGlassVoid(data) {
|
||||
return request({
|
||||
url: '/report/GlassReport/getGlassVoid',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 终检数据-判废机组报表数据查询
|
||||
export function getUnitVoid(data) {
|
||||
return request({
|
||||
url: '/report/GlassReport/getUnitVoid',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
let failurePercentList = []
|
||||
let combinedEfficiencyList = []
|
||||
for (let i = 0; i < this.chartMsg.length; i++) {
|
||||
dateList.push(new Date(this.chartMsg[i].date).getDate())
|
||||
dateList.push(new Date(this.chartMsg[i].recordDate).getDate())
|
||||
activationList.push(this.chartMsg[i].activation)
|
||||
performanceList.push(this.chartMsg[i].performance)
|
||||
failurePercentList.push(this.chartMsg[i].failurePercent)
|
||||
|
||||
@@ -21,33 +21,49 @@ export default {
|
||||
chartHeight: tableHeight(214) - 35
|
||||
}
|
||||
},
|
||||
props: {
|
||||
chartData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.chartDom = document.getElementById('rateChart')
|
||||
this.chart = echarts.init(this.chartDom)
|
||||
this.getChart()
|
||||
this.$nextTick(() => {
|
||||
this.getChart()
|
||||
})
|
||||
window.addEventListener('resize', () => {
|
||||
this.chartHeight = tableHeight(214) - 35
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
chartData: function () {
|
||||
this.getChart()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getChart() {
|
||||
if (
|
||||
this.chart !== null &&
|
||||
this.chart !== '' &&
|
||||
this.chart !== undefined
|
||||
) {
|
||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
||||
}
|
||||
this.chartDom = document.getElementById('rateChart')
|
||||
this.chart = echarts.init(this.chartDom)
|
||||
const xData = []
|
||||
const yData1 = []
|
||||
const yData2 = []
|
||||
for (let i = 1; i <= 31; i++) {
|
||||
const yData3 = new Array(31).fill(24)
|
||||
for (let i = 1; i <= this.chartData.length; i++) {
|
||||
let num = ''
|
||||
num = i + ''
|
||||
xData.push(num)
|
||||
}
|
||||
for (let i = 1; i <= 31; i++) {
|
||||
let num = ''
|
||||
num = parseInt(Math.random() * 23 + 1)
|
||||
yData1.push(num)
|
||||
}
|
||||
for (let i = 1; i <= 31; i++) {
|
||||
let num = ''
|
||||
num = parseInt(Math.random() * 10 + 90)
|
||||
yData2.push(num)
|
||||
yData1.push(this.chartData[i - 1].operationHours)
|
||||
yData2.push(this.chartData[i - 1].utilization.substring(0, 5))
|
||||
}
|
||||
const color = ['#73A0FA', '#F6BE19', '#5AD8A6']
|
||||
var option = {
|
||||
@@ -95,7 +111,7 @@ export default {
|
||||
type: 'bar',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' ml'
|
||||
return value + ' h'
|
||||
}
|
||||
},
|
||||
data: yData1
|
||||
@@ -105,10 +121,10 @@ export default {
|
||||
type: 'line',
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + ' ml'
|
||||
return value + ' h'
|
||||
}
|
||||
},
|
||||
data: yData1
|
||||
data: yData3
|
||||
},
|
||||
{
|
||||
name: '设备利用率',
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
<div class="left-box">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
node-key="id"
|
||||
node-key="name"
|
||||
:props="defaultTime"
|
||||
default-expand-all
|
||||
:highlight-current="true"
|
||||
@node-click="clickDevice"
|
||||
ref="deviceTree"
|
||||
>
|
||||
</el-tree>
|
||||
</div>
|
||||
@@ -112,11 +114,15 @@ export default {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
eqName: '',
|
||||
chooseDate: '',
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 500
|
||||
size: 500,
|
||||
type: '',
|
||||
time: '',
|
||||
name: ''
|
||||
},
|
||||
chooseDate: '',
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableH: tableHeight(350),
|
||||
@@ -134,6 +140,11 @@ export default {
|
||||
getTree() {
|
||||
getTreeData().then((res) => {
|
||||
this.treeData = res.data
|
||||
this.eqName = res.data[0].children[0].children[0].name
|
||||
this.listQuery.name = this.eqName
|
||||
setTimeout(() => {
|
||||
this.$refs.deviceTree.setCurrentKey(this.eqName)
|
||||
}, 100)
|
||||
})
|
||||
},
|
||||
clickDevice(val) {
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
<div class="left-box">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
node-key="id"
|
||||
:props="defaultTime"
|
||||
node-key="name"
|
||||
:props="defaultTree"
|
||||
:highlight-current="true"
|
||||
default-expand-all
|
||||
@node-click="clickDevice"
|
||||
ref="deviceTree"
|
||||
>
|
||||
</el-tree>
|
||||
</div>
|
||||
@@ -16,7 +18,7 @@
|
||||
<el-col :span="20">
|
||||
<div class="right-box">
|
||||
<search-bar :formConfigs="formConfig" @headBtnClick="buttonClick" />
|
||||
<rate-analysis-chart></rate-analysis-chart>
|
||||
<rate-analysis-chart :chartData="chartData"></rate-analysis-chart>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -25,15 +27,17 @@
|
||||
<script>
|
||||
import { getTreeData } from '@/api/app'
|
||||
import rateAnalysisChart from './../components/rateAnalysisChart.vue'
|
||||
import { getUtilization } from '@/api/deviceManagement'
|
||||
export default {
|
||||
name: 'utilizationRateAnalysis',
|
||||
data() {
|
||||
return {
|
||||
treeData: [],
|
||||
defaultTime: {
|
||||
defaultTree: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
eqName: '',
|
||||
chooseMonth: '',
|
||||
formConfig: [
|
||||
{
|
||||
@@ -43,7 +47,8 @@ export default {
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'yyyy-MM',
|
||||
placeholder: '月份选择',
|
||||
param: 'testTime',
|
||||
param: 'timePosition',
|
||||
defaultSelect: '',
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
@@ -52,28 +57,63 @@ export default {
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
}
|
||||
]
|
||||
],
|
||||
listQuery: {
|
||||
timePosition: '',
|
||||
name: ''
|
||||
},
|
||||
chartData: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
rateAnalysisChart
|
||||
},
|
||||
mounted() {
|
||||
this.setDefaultVal()
|
||||
this.getTree()
|
||||
},
|
||||
methods: {
|
||||
setDefaultVal() {
|
||||
let date = new Date()
|
||||
let year = date.getFullYear()
|
||||
let month =
|
||||
date.getMonth() + 1 < 10
|
||||
? '0' + (date.getMonth() + 1)
|
||||
: date.getMonth() + 1
|
||||
this.formConfig[0].defaultSelect = year + '-' + month
|
||||
this.listQuery.timePosition = year + '-' + month
|
||||
},
|
||||
getTree() {
|
||||
getTreeData().then((res) => {
|
||||
this.treeData = res.data
|
||||
this.eqName = res.data[0].children[0].children[0].name
|
||||
this.listQuery.name = this.eqName
|
||||
setTimeout(() => {
|
||||
this.$refs.deviceTree.setCurrentKey(this.eqName)
|
||||
}, 100)
|
||||
})
|
||||
this.getData()
|
||||
},
|
||||
getData() {
|
||||
getUtilization({ ...this.listQuery }).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code === 0 && res.data) {
|
||||
this.chartData = res.data
|
||||
} else {
|
||||
this.chartData = []
|
||||
}
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
this.listQuery.timePosition = val.timePosition
|
||||
this.getData()
|
||||
},
|
||||
clickDevice(val) {
|
||||
console.log(val)
|
||||
if (!val.children) {
|
||||
console.log(val.children)
|
||||
// 设备
|
||||
this.listQuery.name = val.name
|
||||
this.eqName = val.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,10 +166,12 @@ export default {
|
||||
console.log(val)
|
||||
this.processParametersVisible = true
|
||||
pageProcessParameter({
|
||||
unitName: val.unitName,
|
||||
eqName: val.eqName,
|
||||
startTime: val.inEquipmentTime,
|
||||
endTime: val.outEquipmentTime
|
||||
current: 1,
|
||||
size: 500,
|
||||
unitId: val.data.unitId,
|
||||
equipmentId: val.data.equipmentId,
|
||||
startTime: val.data.inEquipmentTime,
|
||||
endTime: val.data.outEquipmentTime
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
@@ -40,6 +40,14 @@ export default {
|
||||
chartHeight: tableHeight(320)
|
||||
}
|
||||
},
|
||||
props: {
|
||||
chartMsg: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.chartDom = document.getElementById('thicknessChart')
|
||||
this.chart = echarts.init(this.chartDom)
|
||||
@@ -48,6 +56,11 @@ export default {
|
||||
this.chartHeight = tableHeight(320)
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
chartMsg: function () {
|
||||
this.getChart()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getChart() {
|
||||
let long = []
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="right-box">
|
||||
<thickness-distribution-chart />
|
||||
<thickness-distribution-chart :chartMsg="chartData" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -82,14 +82,19 @@ export default {
|
||||
}
|
||||
],
|
||||
listQuery: {
|
||||
glassId: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
listQuery2: {
|
||||
glassType: '',
|
||||
testTime: '',
|
||||
glassId: ''
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableH: tableHeight(350),
|
||||
drawGlassId: ''
|
||||
chartData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -117,10 +122,14 @@ export default {
|
||||
0
|
||||
)
|
||||
})
|
||||
_this.drawGlassId = _this.tableData[0].id
|
||||
_this.listQuery2.glassId = _this.tableData[0].glassId
|
||||
_this.listQuery2.glassType = _this.tableData[0].grindType
|
||||
_this.listQuery2.testTime = _this.tableData[0].testTime
|
||||
} else {
|
||||
this.tableData = []
|
||||
this.drawGlassId = ''
|
||||
this.listQuery2.glassId = ''
|
||||
this.listQuery2.glassType = ''
|
||||
this.listQuery2.testTime = ''
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -133,13 +142,16 @@ export default {
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
drawThickness(this.drawGlassId).then((res) => {
|
||||
drawThickness({ ...this.listQuery2 }).then((res) => {
|
||||
console.log(res)
|
||||
this.chartData = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.drawGlassId = val.newVal.id
|
||||
this.listQuery2.glassId = val.newVal.glassId
|
||||
this.listQuery2.glassType = val.newVal.grindType
|
||||
this.listQuery2.testTime = val.newVal.testTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,9 @@ import {
|
||||
qualityReportexport,
|
||||
thickReportexport,
|
||||
queryGlassData,
|
||||
claGlassData
|
||||
claGlassData,
|
||||
getGlassVoid,
|
||||
getUnitVoid
|
||||
} from '@/api/reportManagement'
|
||||
import glassQualityReport from './finalInspectionDataReport/glassQualityReport.vue'
|
||||
import glassThickReport from './finalInspectionDataReport/glassThickReport.vue'
|
||||
@@ -91,12 +93,12 @@ const tablePropsL = [
|
||||
{
|
||||
prop: 'glassId',
|
||||
label: 'ID',
|
||||
minWidth: 100
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
prop: 'unloadTime',
|
||||
label: '检测时间',
|
||||
minWidth: 120,
|
||||
minWidth: 160,
|
||||
filter: timeFormatter
|
||||
},
|
||||
{
|
||||
@@ -222,15 +224,9 @@ export default {
|
||||
packReportArr: [], //下片包装
|
||||
packClaReportArr: [],
|
||||
wasteReportArr: [{ name1: 11 }, { name1: 22 }], // 玻璃判废
|
||||
wasteMachineArr: [
|
||||
{ name: '颗粒/面检数超标', name1: '11' },
|
||||
{ name: '颗粒/缺陷聚集', name1: '22' },
|
||||
{ name: '划伤', name1: '33' },
|
||||
{ name: '面磨印记', name1: '44' },
|
||||
{ name: '磨痕', name1: '55' }
|
||||
],
|
||||
wasteMachineArr: [],
|
||||
wasteLocationArr: [
|
||||
{ name: '颗粒/面检数超标', name1: '11' },
|
||||
{ name: '颗粒/面检数超标', dd1: '11', dd2: '0' },
|
||||
{ name: '颗粒/缺陷聚集', name1: '22' },
|
||||
{ name: '划伤', name1: '33' },
|
||||
{ name: '面磨印记', name1: '44' },
|
||||
@@ -317,6 +313,8 @@ export default {
|
||||
this.thickReportArr = []
|
||||
this.packReportArr = []
|
||||
this.packClaReportArr = []
|
||||
this.wasteReportArr = []
|
||||
this.wasteMachineArr = []
|
||||
console.log(val)
|
||||
if (val.value === '判废位置统计表') {
|
||||
this.formConfig[3].type = 'select'
|
||||
@@ -360,10 +358,20 @@ export default {
|
||||
case '厚度汇总报表':
|
||||
this.getThickReport(arr)
|
||||
break
|
||||
default:
|
||||
case '终检下片包装':
|
||||
this.getGlassData(arr)
|
||||
break
|
||||
case '玻璃判废统计表':
|
||||
this.getWasteData(arr)
|
||||
break
|
||||
case '判废机组统计表':
|
||||
this.getWasteMachineData(arr)
|
||||
break
|
||||
default:
|
||||
console.log('111')
|
||||
}
|
||||
},
|
||||
// 玻璃基板品质报表
|
||||
getGlassReport(arr) {
|
||||
qualityReport({
|
||||
// glassId: [122206240688, 122206240692],
|
||||
@@ -404,6 +412,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 厚度汇总报表
|
||||
getThickReport(arr) {
|
||||
thickReport({
|
||||
glassId: arr,
|
||||
@@ -457,6 +466,28 @@ export default {
|
||||
console.log(res)
|
||||
this.packClaReportArr = res.data
|
||||
})
|
||||
},
|
||||
// 玻璃判废统计表
|
||||
getWasteData(arr) {
|
||||
getGlassVoid({
|
||||
size: 1000,
|
||||
current: 1,
|
||||
glassId: arr
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.wasteReportArr = res.data
|
||||
})
|
||||
},
|
||||
// 判废机组统计表
|
||||
getWasteMachineData(arr) {
|
||||
getUnitVoid({
|
||||
size: 1000,
|
||||
current: 1,
|
||||
glassId: arr
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.wasteMachineArr = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:page="1"
|
||||
:limit="20"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -18,7 +19,7 @@ const tableProps = [
|
||||
label: 'ID'
|
||||
},
|
||||
{
|
||||
prop: 'name1',
|
||||
prop: 'qualified',
|
||||
label: '合格'
|
||||
},
|
||||
{
|
||||
@@ -26,51 +27,51 @@ const tableProps = [
|
||||
label: '前工程不良',
|
||||
children: [
|
||||
{
|
||||
prop: 'name2',
|
||||
prop: 'bubblesNum',
|
||||
label: '气泡数量'
|
||||
},
|
||||
{
|
||||
prop: 'name3',
|
||||
prop: 'bubblesSize',
|
||||
label: '气泡尺寸'
|
||||
},
|
||||
{
|
||||
prop: 'name4',
|
||||
prop: 'topNum',
|
||||
label: '上表锡数量'
|
||||
},
|
||||
{
|
||||
prop: 'name5',
|
||||
prop: 'topSize',
|
||||
label: '上表锡尺寸'
|
||||
},
|
||||
{
|
||||
prop: 'name6',
|
||||
prop: 'bottomNum',
|
||||
label: '下表锡数量'
|
||||
},
|
||||
{
|
||||
prop: 'name7',
|
||||
prop: 'bottomSize',
|
||||
label: '下表锡尺寸'
|
||||
},
|
||||
{
|
||||
prop: 'name8',
|
||||
prop: 'defectNum',
|
||||
label: '欠点数合计'
|
||||
},
|
||||
{
|
||||
prop: 'name9',
|
||||
prop: 'defectGather',
|
||||
label: '缺陷聚集'
|
||||
},
|
||||
{
|
||||
prop: 'name10',
|
||||
prop: 'tumor',
|
||||
label: '结瘤'
|
||||
},
|
||||
{
|
||||
prop: 'name11',
|
||||
prop: 'pt',
|
||||
label: 'PT'
|
||||
},
|
||||
{
|
||||
prop: 'name12',
|
||||
prop: 'stone',
|
||||
label: '结石'
|
||||
},
|
||||
{
|
||||
prop: 'name13',
|
||||
prop: 'otherPre',
|
||||
label: '其他'
|
||||
}
|
||||
]
|
||||
@@ -80,59 +81,59 @@ const tableProps = [
|
||||
label: '后工程不良',
|
||||
children: [
|
||||
{
|
||||
prop: 'age',
|
||||
prop: 'kqOutnumber',
|
||||
label: '颗粒/面检数超'
|
||||
},
|
||||
{
|
||||
prop: 'age1',
|
||||
prop: 'scratch',
|
||||
label: '划伤'
|
||||
},
|
||||
{
|
||||
prop: 'age2',
|
||||
prop: 'kqGather',
|
||||
label: '颗粒/缺陷聚集'
|
||||
},
|
||||
{
|
||||
prop: 'age3',
|
||||
prop: 'wheelMark',
|
||||
label: '轮印'
|
||||
},
|
||||
{
|
||||
prop: 'age4',
|
||||
prop: 'grindingMark',
|
||||
label: '面磨印记'
|
||||
},
|
||||
{
|
||||
prop: 'age5',
|
||||
prop: 'residue',
|
||||
label: '残留'
|
||||
},
|
||||
{
|
||||
prop: 'age6',
|
||||
prop: 'stain',
|
||||
label: '污渍'
|
||||
},
|
||||
{
|
||||
prop: 'age7',
|
||||
prop: 'fiber',
|
||||
label: '纤维'
|
||||
},
|
||||
{
|
||||
prop: 'age8',
|
||||
prop: 'waterStain',
|
||||
label: '水渍'
|
||||
},
|
||||
{
|
||||
prop: 'age9',
|
||||
prop: 'grindingCrack',
|
||||
label: '磨痕'
|
||||
},
|
||||
{
|
||||
prop: 'age10',
|
||||
prop: 'airAbrasion',
|
||||
label: '气浮擦伤'
|
||||
},
|
||||
{
|
||||
prop: 'age11',
|
||||
prop: 'fogSurface',
|
||||
label: '雾面'
|
||||
},
|
||||
{
|
||||
prop: 'age12',
|
||||
prop: 'foreignBody',
|
||||
label: '异物'
|
||||
},
|
||||
{
|
||||
prop: 'age13',
|
||||
prop: 'otherPost',
|
||||
label: '其他'
|
||||
}
|
||||
]
|
||||
@@ -160,7 +161,37 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
methods: {
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '汇总'
|
||||
return
|
||||
}
|
||||
if (index === 1) {
|
||||
sums[index] = ' '
|
||||
return
|
||||
}
|
||||
const values = data.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
} else {
|
||||
sums[index] = '0'
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -12,10 +12,13 @@
|
||||
:max-height="tableH"
|
||||
:show-header="false"
|
||||
/>
|
||||
<button @click="exportData">导出,(开发自测用,后续会删除)</button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { tableHeight } from '@/utils'
|
||||
import * as XLSX from 'xlsx/xlsx.mjs'
|
||||
import FileSaver from 'file-saver'
|
||||
let tableProps = []
|
||||
for (let j = 0; j < 21; j++) {
|
||||
let obj = {}
|
||||
@@ -365,6 +368,33 @@ export default {
|
||||
console.log(tableD)
|
||||
this.exportDD = exportD
|
||||
this.tableDD = tableD
|
||||
},
|
||||
exportData() {
|
||||
const filename = '厚度表.xlsx'
|
||||
const ws_name = 'Sheet1'
|
||||
const wb = XLSX.utils.book_new()
|
||||
const ws = XLSX.utils.aoa_to_sheet(this.exportDD)
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
: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: '研磨机组',
|
||||
@@ -57,170 +54,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
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'
|
||||
]
|
||||
]
|
||||
tableH: tableHeight(292)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -237,36 +71,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user