过程全检

This commit is contained in:
2023-03-09 17:01:02 +08:00
parent 2f8b5eb8a1
commit 6aadadea13
124 changed files with 584 additions and 580 deletions

View File

@@ -221,3 +221,36 @@ export function getEqCode(data) {
data
})
}
// 报表管理
export function getReportlist(data) {
return request({
url: '/report/report-sheet/page',
method: 'post',
data
})
}
export function updateReportlist(data) {
return request({
url: '/report/report-sheet/update',
method: 'post',
data
})
}
export function delReportlist(data) {
return request({
url: '/report/report-sheet/delete',
method: 'post',
data
})
}
// by id
export function getReport(data) {
return request({
url: '/report/report-sheet/get',
method: 'post',
data
})
}

View File

@@ -44,6 +44,72 @@ export function processDetectExport(data) {
})
}
// 过程全检
export function processCompleteInspetion(data) {
return request({
url: '/quality/processCompleteInspetion/page',
method: 'post',
data
})
}
export function processCompleteInspetionDetails(data) {
return request({
url: '/quality/processCompleteInspetion/getDetails',
method: 'post',
data
})
}
export function processCompleteInspetionListType(data) {
return request({
url: '/quality/processCompleteInspetion/listType',
method: 'post',
data
})
}
// 全检导出
export function completeInspetionExport(data) {
return request({
url: '/quality/processCompleteInspetion/export',
method: 'post',
data
})
}
export function pageIIS(data) {
return request({
url: '/quality/processCompleteInspetion/pageIIS',
method: 'post',
data
})
}
// 缺陷散点图
export function queryPoint(data) {
return request({
url: '/quality/ProcessFull/queryPoint',
method: 'post',
data
})
}
export function drawPoint(data) {
return request({
url: '/quality/ProcessFull/drawPoint',
method: 'post',
data
})
}
export function queryPointClear(data) {
return request({
url: '/quality/ProcessFull/queryPointClear',
method: 'post',
data
})
}
// 颗粒折线图
export function getProcessFull(data) {
return request({

View File

@@ -457,6 +457,17 @@ export const routes = [
'../views/qualityManagement/processFullInspection/fullInspection'
)
},
{
path: 'fullInspectionDetail',
name: 'fullInspectionDetail',
meta: {
title: '全检详情'
},
component: () =>
import(
'../views/qualityManagement/processFullInspection/fullInspectionDetail'
)
},
{
path: 'defectScatterPlot',
name: 'defectScatterPlot',

View File

@@ -3,8 +3,12 @@
<el-form-item label="报表名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="报表分类" prop="type">
<el-select v-model="form.type" placeholder="报表分类" style="width: 100%">
<el-form-item label="报表分类" prop="category">
<el-select
v-model="form.category"
placeholder="报表分类"
style="width: 100%"
>
<el-option
v-for="(item, i) in typeList"
:key="i"
@@ -16,13 +20,15 @@
</el-form>
</template>
<script>
import { getReport, updateReportlist } from '@/api/basicConfig'
export default {
name: 'ReportNameEdit',
data() {
return {
form: {
id: '',
name: ''
name: '',
category: ''
},
typeList: [
{ dataName: '能源', id: 1 },
@@ -31,10 +37,8 @@ export default {
{ dataName: '人员', id: 4 }
],
rules: {
name: [
{ required: true, message: '请输入报表分类名', trigger: 'blur' }
],
type: [{ required: true, message: '请选择分类', trigger: 'change' }]
name: [{ required: true, message: '请输入报表分类名', trigger: 'blur' }]
// category: [{ required: true, message: '请选择分类', trigger: 'change' }]
}
}
},
@@ -42,32 +46,28 @@ export default {
init(id) {
if (id) {
this.form.id = id
// getAccount({ id }).then((res) => {
// if (res.code === 0) {
// this.form.account = res.data.account
// this.form.password = res.data.password
// this.form.name = res.data.name
// this.form.proLineId = res.data.proLineId
// this.form.role = res.data.role
// this.form.enabled = res.data.enabled
// }
// })
getReport({ id }).then((res) => {
if (res.code === 0) {
this.form.category = res.data.category
this.form.name = res.data.name
}
})
}
},
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
//编辑
// accountUpdate({ ...this.form }).then((res) => {
// if (res.code === 0) {
// this.$message({
// message: '操作成功',
// type: 'success',
// duration: 1500
// })
// this.$emit('successSubmit')
// }
// })
updateReportlist({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
this.$emit('successSubmit')
}
})
this.$emit('successSubmit')
} else {
return false

View File

@@ -13,8 +13,8 @@ export default {
},
mounted() {
const vm = this
// const { name } = this.$route.query
// this.url += name ? '?_u=db:' + this.$route.query.name : ''
const { name } = this.$route.query
this.url += name ? '?_u=db:' + this.$route.query.name : ''
const ifream = document.getElementById('reportDesign')
ifream.onload = function () {
console.log('加载完成')

View File

@@ -18,7 +18,7 @@
<p class="letter">Reports</p>
</div>
</div>
<div class="detail" @click="toDetail">了解详情</div>
<div class="detail" @click="toAll">了解详情</div>
</div>
</div>
</div>
@@ -31,7 +31,7 @@
<p class="letter">Reports</p>
</div>
</div>
<div class="detail" @click="bbb">了解详情</div>
<div class="detail" @click="toDetail">了解详情</div>
</div>
</div>
</div>
@@ -53,13 +53,17 @@ export default {
}
},
methods: {
toDetail() {
toAll() {
this.$router.push({
path: '/basicConfig/reportManagement/reportListDetail'
})
},
bbb() {
this.$router.push({ path: '/basicConfig/reportManagement/reportDesign' })
toDetail(name) {
// this.$router.push({ path: '/basicConfig/reportManagement/reportDesign' })
this.$router.push({
path: '/basicConfig/reportManagement/reportListDetail',
params: { category: name }
})
}
}
}

View File

@@ -40,20 +40,22 @@
</div>
</template>
<script>
import { tableHeight } from '@/utils/index'
import ReportNameEdit from './../components/reportNameEdit.vue'
import { getReportlist, delReportlist } from '@/api/basicConfig'
import { tableHeight, timeFormatter } from '@/utils'
const tableProps = [
{
prop: 'name',
label: '报表名称'
},
{
prop: 'type',
prop: 'category',
label: '报表分类'
},
{
prop: 'time',
label: '添加时间'
prop: 'createTime',
label: '添加时间',
filter: timeFormatter
}
]
const tableBtn = [
@@ -125,28 +127,30 @@ export default {
},
methods: {
getList() {
let arr = []
for (let i = 0; i < 30; i++) {
let obj = {}
obj.name = '名称' + i
obj.type = '分类' + i
obj.time = '2023-2-8 13:59:59'
obj.id = i + 1
arr.push(obj)
}
this.tableData = arr
this.total = 30
getReportlist({ ...this.listQuery }).then((res) => {
console.log(res)
if (res.code === 0 && res.data) {
this.tableData = res.data.records
this.total = res.data.total
} else {
this.tableData = []
this.total = 0
}
})
},
handleClick(val) {
console.log(val.data.name)
switch (val.type) {
case 'view':
this.$router.push({
path: '/basicConfig/reportManagement/reportView'
path: '/basicConfig/reportManagement/reportView',
query: { name: val.data.name }
})
break
case 'design':
this.$router.push({
path: '/basicConfig/reportManagement/reportDesign'
path: '/basicConfig/reportManagement/reportDesign',
query: { name: val.data.name }
})
break
case 'edit':
@@ -161,17 +165,17 @@ export default {
type: 'warning'
})
.then(() => {
// maintainManageDelete({ id: val.data.id }).then((res) => {
// console.log(res)
// this.$message({
// message: '工单删除成功',
// type: 'success',
// duration: 1500,
// onClose: () => {}
// })
// this.listQuery.current = 1
// this.getList()
// })
delReportlist({ id: val.data.id }).then((res) => {
console.log(res)
this.$message({
message: '报表删除成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.listQuery.current = 1
this.getList()
})
})
.catch(() => {})
}

View File

@@ -1,8 +1,39 @@
<template>
<div>预览</div>
<div id="reportView" class="reportView">
<iframe :src="url" width="100%" height="100%"></iframe>
</div>
</template>
<script>
export default {
name: 'reportView'
name: 'ReportView',
data() {
return {
url: process.env.VUE_APP_REPORT_VIEW_URL,
aa: '111'
}
},
mounted() {
const vm = this
const { name } = this.$route.query
console.log(name)
this.url += name ? '?_u=db:' + this.$route.query.name : ''
console.log(this.url)
const ifream = document.getElementById('reportView')
ifream.onload = function () {
console.log('加载完成')
vm.loading = false
}
}
}
</script>
<style lang="scss" scoped>
.reportView {
margin: 0px 16px 0 16px;
width: 98.5%;
height: calc(100vh - 205px);
.mainIframe {
width: 100%;
height: 100%;
}
}
</style>

View File

@@ -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,

View File

@@ -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>

View File

@@ -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)

View File

@@ -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
}
})
}
}
}

View File

@@ -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>