tft-fe/src/views/qualityManagement/processFullInspection/fullInspectionDetail.vue

244 lines
5.4 KiB
Vue
Raw Normal View History

2023-03-09 17:01:02 +08:00
<template>
<div class="full-inspection-detail">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<div class="plot-total">
<defect-scatter-plot-total
ref="fullInspectionDetailPlot"
:detailObj="detailObj"
class="plot-total-box"
/>
</div>
<base-table
:page="listQuery.current"
:limit="listQuery.size"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
2023-05-15 17:25:05 +08:00
<pagination
:page.sync="listQuery.current"
:limit.sync="listQuery.size"
:total="total"
@pagination="getList()"
/>
<BaseDialog
dialogTitle="查看图片"
:dialogVisible="centervisible"
:close-on-click-modal="false"
:before-close="handleCancel"
>
<el-image
style="width: 100px; height: 100px"
src="https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg"
:preview-src-list="arr"
>
</el-image>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" class="btnTextStyle" @click="handleCancel"
>关闭</el-button
>
</el-col>
</el-row>
</BaseDialog>
2023-03-09 17:01:02 +08:00
</div>
</template>
<script>
import { tableHeight } from '@/utils/index'
import {
processCompleteInspetionListType,
processCompleteInspetionDetails,
pageIIS
} from '@/api/qualityManagement'
import defectScatterPlotTotal from './../components/defectScatterPlotTotal.vue'
const tableProps = [
{
2023-05-15 17:25:05 +08:00
prop: 'ypos',
2023-03-09 17:01:02 +08:00
label: 'Y轴位置(mm)'
},
{
2023-05-15 17:25:05 +08:00
prop: 'xpos',
2023-03-09 17:01:02 +08:00
label: 'X轴位置(mm)'
},
{
2023-05-15 17:25:05 +08:00
prop: 'defectclass',
2023-03-09 17:01:02 +08:00
label: '缺陷尺寸等级'
},
{
2023-05-15 17:25:05 +08:00
prop: 'defecttype',
2023-03-09 17:01:02 +08:00
label: '缺陷类型'
},
{
2023-05-15 17:25:05 +08:00
prop: 'length',
2023-03-09 17:01:02 +08:00
label: '长度(mm)'
},
{
2023-05-15 17:25:05 +08:00
prop: 'width',
2023-03-09 17:01:02 +08:00
label: '宽度(mm)'
}
]
const tableBtn = [
{
2023-05-15 17:25:05 +08:00
type: 'viewPic',
2023-03-09 17:01:02 +08:00
btnName: '查看图片'
}
]
export default {
name: 'FullInspectionDetail',
components: { defectScatterPlotTotal },
data() {
return {
2023-05-15 17:25:05 +08:00
arr: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg'
],
2023-03-09 17:01:02 +08:00
formConfig: [
{
type: 'select',
label: '缺陷类型',
selectOptions: [],
param: 'defectType',
labelField: 'defectType',
valueField: 'defectType',
defaultSelect: '',
filterable: true,
width: 200
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: 'button',
btnName: '返回',
name: 'export',
color: 'primary',
plain: true
}
],
detailObj: {},
tableProps,
tableData: [],
2023-05-15 17:25:05 +08:00
tableH: tableHeight(425),
2023-03-09 17:01:02 +08:00
tableBtn,
total: 0,
listQuery: {
current: 1,
size: 20,
2023-05-15 17:25:05 +08:00
glassId: '',
defectType: ''
},
// 查看图片
centervisible: false
2023-03-09 17:01:02 +08:00
}
},
mounted() {
const { virtualcode, filetype, time } = this.$route.query
this.listQuery.glassId = virtualcode
this.getDetail(virtualcode, filetype, time)
window.addEventListener('resize', () => {
2023-05-15 17:25:05 +08:00
this.tableH = tableHeight(425)
2023-03-09 17:01:02 +08:00
})
this.getListType()
2023-05-15 17:25:05 +08:00
this.getList()
2023-03-09 17:01:02 +08:00
},
methods: {
getDetail(virtualcode, filetype, time) {
processCompleteInspetionDetails({
virtualcode,
time,
defectType: decodeURIComponent(filetype)
}).then((res) => {
console.log(res)
this.detailObj = res.data
this.$nextTick(() => {
2023-05-15 17:25:05 +08:00
this.$refs.fullInspectionDetailPlot.init(this.detailObj)
2023-03-09 17:01:02 +08:00
})
})
},
getListType() {
processCompleteInspetionListType({
size: 500,
current: 1
}).then((res) => {
this.formConfig[0].selectOptions = res.data
})
},
getList() {
pageIIS({ ...this.listQuery }).then((res) => {
console.log(res)
2023-05-15 17:25:05 +08:00
if (res.code === 0) {
this.tableData = res.data.records
this.total = res.data.total
}
2023-03-09 17:01:02 +08:00
})
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.defectType = val.defectType
this.listQuery.current = 1
this.getList()
break
default:
this.$router.push({
path: '/qualityManagement/processFullInspection/fullInspection'
})
}
},
handleClick(val) {
2023-05-15 17:25:05 +08:00
if (val.type === 'viewPic') {
if (val.data.defectid) {
this.centervisible = true
} else {
this.$message({
message: '暂无图片',
type: 'warning'
})
}
}
},
handleCancel() {
this.centervisible = false
2023-03-09 17:01:02 +08:00
}
}
}
</script>
<style lang="scss" scoped>
.full-inspection-detail {
margin: 0 16px;
padding: 16px;
border-radius: 8px;
height: calc(100vh - 205px);
background-color: #fff;
.plot-total {
position: relative;
height: 115px;
.plot-total-box {
position: absolute;
width: 100%;
top: 25px;
left: 0px;
}
}
}
</style>