过程全检
This commit is contained in:
@@ -144,7 +144,25 @@ export default {
|
||||
[31, 187, 143, 201, 1.39, 89, 53, '中度污染']
|
||||
]
|
||||
var option = {
|
||||
color: ['#dd4444', '#fec42c', '#80F1BE'],
|
||||
color: [
|
||||
'#5d7ab7',
|
||||
'#ec795f',
|
||||
'#925041',
|
||||
'#fb5099',
|
||||
'#f6bd16',
|
||||
'#E8684A',
|
||||
'#6DC8EC',
|
||||
'#9270CA',
|
||||
'#FF9D4D',
|
||||
'#269A99',
|
||||
'#FF99C3',
|
||||
'#BDD2FD',
|
||||
'#5AD8A6',
|
||||
'#FDABAB',
|
||||
'#BDEFDB',
|
||||
'#5B8FF9',
|
||||
'#404E67'
|
||||
],
|
||||
legend: {
|
||||
top: 10,
|
||||
left: 0,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="bottom-left">
|
||||
<ul class="dataTab">
|
||||
<div class="title">颗粒数据</div>
|
||||
<li v-for="(item, index) in a" :key="index">
|
||||
<li v-for="(item, index) in leftList" :key="index">
|
||||
<p class="tabHead">{{ item.name }}</p>
|
||||
<p class="tabValue">{{ item.value }}</p>
|
||||
</li>
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="bottom-right">
|
||||
<ul class="dataTab">
|
||||
<div class="title">面检数据</div>
|
||||
<li v-for="(item, index) in b" :key="index">
|
||||
<li v-for="(item, index) in rightList" :key="index">
|
||||
<p class="tabHead">{{ item.name }}</p>
|
||||
<p class="tabValue">{{ item.value }}</p>
|
||||
</li>
|
||||
@@ -23,30 +23,50 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'DefectScatterPlot',
|
||||
props: {
|
||||
detailObj: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
a: [
|
||||
{ name: 'S', value: 65323 },
|
||||
{ name: 'M', value: 65323 },
|
||||
{ name: 'L', value: 65323 },
|
||||
{ name: 'XL', value: 65323 }
|
||||
leftList: [
|
||||
{ name: 'S', value: null, key: 's' },
|
||||
{ name: 'M', value: null, key: 'm' },
|
||||
{ name: 'L', value: null, key: 'l' },
|
||||
{ name: 'XL', value: null, key: 'xl' }
|
||||
],
|
||||
b: [
|
||||
{ name: '气泡', value: 65323 },
|
||||
{ name: '变形', value: 65323 },
|
||||
{ name: '纤维', value: 65323 },
|
||||
{ name: '划伤', value: 65323 },
|
||||
{ name: '点状缺陷', value: 65323 },
|
||||
{ name: '结石', value: 65323 },
|
||||
{ name: '铂金', value: 65323 },
|
||||
{ name: '结节', value: 65323 },
|
||||
{ name: '拖尾', value: 65323 },
|
||||
{ name: 'ADG', value: 65323 },
|
||||
{ name: '锡缺陷(顶部)', value: 65323 },
|
||||
{ name: '锡缺陷(底部)', value: 65323 },
|
||||
{ name: '无法识别', value: 65323 }
|
||||
rightList: [
|
||||
{ name: '气泡', value: null, key: 'bl' },
|
||||
{ name: '变形', value: null, key: 'distortion' },
|
||||
{ name: '纤维', value: null, key: 'fiber' },
|
||||
{ name: '划伤', value: null, key: 'scratch' },
|
||||
{ name: '点状缺陷', value: null, key: 'tin' },
|
||||
{ name: '结石', value: null, key: 'stone' },
|
||||
{ name: '铂金', value: null, key: 'pt' },
|
||||
{ name: '结节', value: null, key: 'knot' },
|
||||
{ name: '拖尾', value: null, key: 'tail' },
|
||||
{ name: 'ADG', value: null, key: 'adg' },
|
||||
{ name: '锡缺陷(顶部)', value: null, key: 'top' },
|
||||
{ name: '锡缺陷(底部)', value: null, key: 'bottom' },
|
||||
{ name: '无法识别', value: null, key: 'iisrest' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
console.log(this.detailObj)
|
||||
for (let i = 0; i < this.leftList.length; i++) {
|
||||
this.leftList[i].value = this.detailObj[this.leftList[i].key]
|
||||
? this.detailObj[this.leftList[i].key]
|
||||
: null
|
||||
}
|
||||
for (let i = 0; i < this.rightList.length; i++) {
|
||||
this.rightList[i].value = this.detailObj[this.rightList[i].key]
|
||||
? this.detailObj[this.rightList[i].key]
|
||||
: null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -28,7 +28,11 @@
|
||||
<el-radio-button label="1">颗粒全选</el-radio-button>
|
||||
<el-radio-button label="2">面检全选</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button type="primary" size="small" style="margin-right: 14px"
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="margin-right: 14px"
|
||||
@click="drawPic"
|
||||
>绘图</el-button
|
||||
>
|
||||
<el-button type="primary" size="small" plain>导出</el-button>
|
||||
@@ -63,6 +67,7 @@
|
||||
import { tableHeight } from '@/utils/index'
|
||||
import defectScatterPlotTotal from './../components/defectScatterPlotTotal.vue'
|
||||
import defectScatterPlotChart from './../components/defectScatterPlotChart.vue'
|
||||
import { queryPoint, drawPoint, queryPointClear } from '@/api/qualityManagement'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'id',
|
||||
@@ -162,13 +167,26 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let arr = []
|
||||
for (let i = 0; i < 30; i++) {
|
||||
let obj = {}
|
||||
obj.id = i + 10
|
||||
arr.push(obj)
|
||||
}
|
||||
this.tableData = arr
|
||||
// let arr = []
|
||||
// for (let i = 0; i < 30; i++) {
|
||||
// let obj = {}
|
||||
// obj.id = i + 10
|
||||
// arr.push(obj)
|
||||
// }
|
||||
// this.tableData = arr
|
||||
queryPoint({ ...this.listQuery }).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
drawPic() {
|
||||
drawPoint().then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
queryPointClear().then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
|
||||
@@ -27,38 +27,46 @@
|
||||
</template>
|
||||
<script>
|
||||
import { tableHeight } from '@/utils/index'
|
||||
import {
|
||||
processCompleteInspetion,
|
||||
completeInspetionExport
|
||||
} from '@/api/qualityManagement'
|
||||
import moment from 'moment'
|
||||
import { timeFormatter } from '@/utils'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'glassId',
|
||||
prop: 'virtualcode',
|
||||
label: '玻璃ID'
|
||||
},
|
||||
{
|
||||
prop: 'fullInspectionType',
|
||||
prop: 'filetype',
|
||||
label: '全检类型'
|
||||
},
|
||||
{
|
||||
prop: 'long',
|
||||
prop: 'glassLength',
|
||||
label: '长/mm'
|
||||
},
|
||||
{
|
||||
prop: 'width',
|
||||
prop: 'glassWidth',
|
||||
label: '宽/mm'
|
||||
},
|
||||
{
|
||||
prop: 'thick',
|
||||
prop: 'glassHeight',
|
||||
label: '厚/mm'
|
||||
},
|
||||
{
|
||||
prop: 'productQuality',
|
||||
prop: 'grade',
|
||||
label: '产品质量'
|
||||
},
|
||||
{
|
||||
prop: 'productionLine',
|
||||
prop: 'line',
|
||||
label: '产线'
|
||||
},
|
||||
{
|
||||
prop: 'testOfTime',
|
||||
label: '检验时间'
|
||||
prop: 'time',
|
||||
label: '检验时间',
|
||||
filter: timeFormatter,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
const tableBtn = [
|
||||
@@ -82,24 +90,27 @@ export default {
|
||||
type: 'select',
|
||||
label: '全检类型',
|
||||
selectOptions: [
|
||||
{ id: '1', name: '精切后边检' },
|
||||
{ id: '2', name: '终检边检' },
|
||||
{ id: '3', name: '面检' },
|
||||
{ id: '4', name: '复检' }
|
||||
{ id: '精切后边检', name: '精切后边检' },
|
||||
{ id: '终检边检', name: '终检边检' },
|
||||
{ id: '面检', name: '面检' },
|
||||
{ id: '复检', name: '复检' }
|
||||
],
|
||||
param: 'fullInspectionType',
|
||||
param: 'grindType',
|
||||
defaultSelect: '',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '检验时间',
|
||||
dateType: 'datetime',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
placeholder: '抽检时间',
|
||||
param: 'testTime',
|
||||
width: 200
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -133,36 +144,72 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = tableHeight(330)
|
||||
})
|
||||
for (let i = 0; i < 30; i++) {
|
||||
let obj = {}
|
||||
obj.glassId = i
|
||||
obj.fullInspectionType = '全检类型' + i
|
||||
obj.long = i
|
||||
obj.width = i
|
||||
obj.thick = i
|
||||
obj.productQuality = '产品质量' + i
|
||||
obj.productionLine = '产线' + i
|
||||
obj.testOfTime = '2022-08-08 13:59:13'
|
||||
this.tableData.push(obj)
|
||||
}
|
||||
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() {
|
||||
console.log('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
|
||||
}
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : ''
|
||||
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : ''
|
||||
this.listQuery.grindType = val.grindType
|
||||
this.listQuery.glassId = val.glassId
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
alert('导出')
|
||||
completeInspetionExport({ ...this.listQuery }).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)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
if (val.type === 'detail') {
|
||||
alert('详情')
|
||||
this.$router.push({
|
||||
path: '/qualityManagement/processFullInspection/fullInspectionDetail',
|
||||
query: {
|
||||
virtualcode: val.data.virtualcode,
|
||||
filetype: encodeURIComponent(val.data.filetype),
|
||||
time: val.data.time
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
<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>
|
||||
<pagination :limit="listQuery.size" :total="total" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { tableHeight } from '@/utils/index'
|
||||
import {
|
||||
processCompleteInspetionListType,
|
||||
processCompleteInspetionDetails,
|
||||
pageIIS
|
||||
} from '@/api/qualityManagement'
|
||||
import defectScatterPlotTotal from './../components/defectScatterPlotTotal.vue'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'virtualcode',
|
||||
label: '缺陷编号'
|
||||
},
|
||||
{
|
||||
prop: 'filetype',
|
||||
label: 'Y轴位置(mm)'
|
||||
},
|
||||
{
|
||||
prop: 'glassLength',
|
||||
label: 'X轴位置(mm)'
|
||||
},
|
||||
{
|
||||
prop: 'glassWidth',
|
||||
label: '缺陷尺寸等级'
|
||||
},
|
||||
{
|
||||
prop: 'glassHeight',
|
||||
label: '缺陷类型'
|
||||
},
|
||||
{
|
||||
prop: 'grade',
|
||||
label: '长度(mm)'
|
||||
},
|
||||
{
|
||||
prop: 'line',
|
||||
label: '宽度(mm)'
|
||||
}
|
||||
]
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '查看图片'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: 'FullInspectionDetail',
|
||||
components: { defectScatterPlotTotal },
|
||||
data() {
|
||||
return {
|
||||
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: [],
|
||||
tableH: tableHeight(330),
|
||||
tableBtn,
|
||||
total: 0,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 20,
|
||||
glassId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const { virtualcode, filetype, time } = this.$route.query
|
||||
this.listQuery.glassId = virtualcode
|
||||
this.getDetail(virtualcode, filetype, time)
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = tableHeight(330)
|
||||
})
|
||||
this.getListType()
|
||||
},
|
||||
methods: {
|
||||
getDetail(virtualcode, filetype, time) {
|
||||
processCompleteInspetionDetails({
|
||||
virtualcode,
|
||||
time,
|
||||
defectType: decodeURIComponent(filetype)
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.detailObj = res.data
|
||||
this.$nextTick(() => {
|
||||
this.$refs.fullInspectionDetailPlot.init()
|
||||
})
|
||||
})
|
||||
},
|
||||
getListType() {
|
||||
processCompleteInspetionListType({
|
||||
size: 500,
|
||||
current: 1
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
pageIIS({ ...this.listQuery }).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
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) {
|
||||
console.log(val)
|
||||
alert('图片详情')
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
Reference in New Issue
Block a user