Commit 2e07c396 authored by 秦嘉's avatar 秦嘉

测试结果页面与接口对接

parent 08c30023
// 测试结果-API
import request from '@/utils/request'
// 查询测试列表
export function listQuaTest(query) {
return request({
url: '/nltscan/queryNltScanTestByPagination',
method: 'get',
params: query
})
}
// 查询测试结果列表
export function listDetailQuaTest(query) {
return request({
url: '/nltscan/queryNltScanTestDetailByPagination',
method: 'get',
params: query
})
}
// 查询测试列表
export function listDetailQuaTestResult(query) {
return request({
url: '/NltTestInfo/queryNltTestInfoDetail',
method: 'get',
params: query
})
}
<template>
<div>质量检验</div>
<div class="app-container">
<div class="testSearch" style="margin-left: 10px">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="开工时间" prop="revisedStartDate">
<div slot="label" class="labelClass">
<div>开工时间</div>
<div>Start Time</div>
</div>
<el-date-picker
v-model="queryParams.revisedStartDate"
type="date"
placeholder="选择日期"
:editable="false"
:clearable="false"
format="yyyy/MM/DD">
</el-date-picker>
</el-form-item>
<el-form-item label="主板SN编号" prop="materSn">
<div slot="label" class="labelClass">
<div>主板SN编号</div>
<div>SN No.</div>
</div>
<el-input
v-model="queryParams.materSn"
:maxlength="30"
placeholder="请输入主板SN编号"
clearable
size="small"
/>
</el-form-item>
<el-form-item label="工单编号" prop="orderNo">
<div slot="label" class="labelClass">
<div>工单编号</div>
<div>Order No.</div>
</div>
<el-input
v-model="queryParams.orderNo"
:maxlength="30"
placeholder="请输入工单编号"
clearable
size="small"
/>
</el-form-item>
<el-form-item>
<el-button
class="redBtn"
type="danger"
size="small"
style="margin-left: 30px"
@click="handleQuery"
>查询 Query</el-button>
<el-button class="resetBtn" size="small" @click="resetQuery">重置 Reset</el-button>
</el-form-item>
</el-form>
</div>
<div class="placeholder" />
<div style="padding:10px">
<div class="mb12 font-small-bold">测试结果列表</div>
<el-table
v-loading="Loading"
:data="testList"
border
>
<el-table-column
type="index"
width="50">
<template slot="header">
<div>序号</div>
<div>No.</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="productionLine">
<template slot="header">
<div>线体号</div>
<div>Line No.</div>
</template>
<template slot-scope="scope">
<span>{{ scope.row.productionLine || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="materSn">
<template slot="header">
<div>主板SN编号</div>
<div>Main SN</div>
</template>
<template slot-scope="scope">
<span>{{ scope.row.materSn || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="materCode">
<template slot="header">
<div>成品料号</div>
<!-- <div>Main SN</div>-->
</template>
<template slot-scope="scope">
<span>{{ scope.row.materCode || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="orderNo">
<template slot="header">
<div>工单编号</div>
<!-- <div>Main SN</div>-->
</template>
<template slot-scope="scope">
<span>{{ scope.row.orderNo || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot="header">
<div>操作</div>
<div>Operate</div>
</template>
<template slot-scope="scope">
<el-link
size="mini"
type="success"
style="margin-left: 10px"
@click="handleDetail(scope.row)"
>测试结果</el-link>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getTestData"
/>
<el-dialog v-loading="Loading1" :close-on-click-modal="false" title="测试结果" class="testDialog" :visible.sync="open" width="80%" append-to-body>
<el-form ref="form" :model="form" size="small" label-width="120px" :inline="true">
<el-form-item class="labelHeight" label="主板SN编号" prop="materSn">
<div slot="label" class="labelClass">
<div class="labelName">主板SN编号</div>
<div class="labelName">Main SN</div>
</div>
<span>{{ form.materSn }}</span>
</el-form-item>
<el-form-item class="labelHeight" label="软件版本" prop="version" style="margin-left: 100px">
<div slot="label" class="labelClass">
<div class="labelName">软件版本</div>
<div class="labelName">Software version</div>
</div>
<span>{{ form.version }}</span>
</el-form-item>
</el-form>
<div>
<el-table
v-loading="Loading2"
:data="testResultList"
border
>
<el-table-column
type="index"
width="60">
<template slot="header">
<div>排序</div>
<div>Sort</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="staName">
<template slot="header">
<div>测试工站名称</div>
<!-- <div>Line Beach No.</div>-->
</template>
<template slot-scope="scope">
<span>{{ scope.row.staName || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="testDate">
<template slot="header">
<div>测试时间</div>
<div>Test Time</div>
</template>
<template slot-scope="scope">
<span>{{ scope.row.testDate || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="testResult">
<template slot="header">
<div>测试结果</div>
<div>Test Result</div>
</template>
<template slot-scope="scope">
<span v-if="scope.row.testResult === '0'">失败</span>
<span v-else-if="scope.row.testResult === '1'">通过</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="测试参数" align="center" class-name="small-padding fixed-width">
<template slot="header">
<div>测试参数</div>
<!-- <div>Operate</div>-->
</template>
<template slot-scope="scope">
<el-link
size="mini"
type="success"
style="margin-left: 10px"
@click="handleDetailNew(scope.row)"
>详情</el-link>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total1>0"
:total="total1"
:page.sync="detailForm.page"
:limit.sync="detailForm.rows"
@pagination="getDetailTestData"
/>
<div slot="footer" class="dialog-footer">
<el-button class="canleBtn" @click="cancel">关闭 Close</el-button>
</div>
</el-dialog>
<el-dialog v-loading="Loading3" :close-on-click-modal="false" title="参数详情" class="testDialog" :visible.sync="open1" width="80%" append-to-body>
<el-form ref="form" :model="form1" size="small" label-width="120px" :inline="true">
<el-form-item class="labelHeight" label="主板SN编号" prop="materSn">
<div slot="label" class="labelClass">
<div class="labelName">主板SN编号</div>
<div class="labelName">Main SN</div>
</div>
<span>{{ form1.materSn }}</span>
</el-form-item>
</el-form>
<div>
<el-table
v-loading="Loading4"
:data="testResultDetailList"
border
>
<el-table-column
type="index"
width="60">
<template slot="header">
<div>测试序号</div>
<div>Test Sort</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="key">
<template slot="header">
<div>参数</div>
<!-- <div>Line Beach No.</div>-->
</template>
<template slot-scope="scope">
<span>{{ scope.row.key || '-' }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" prop="value">
<template slot="header">
<div>结果</div>
<!-- <div>Test Time</div>-->
</template>
<template slot-scope="scope">
<span>{{ scope.row.value || '-' }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button class="canleBtn" @click="cancel1">关闭 Close</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import moment from 'moment'
import { listDetailQuaTest, listDetailQuaTestResult, listQuaTest } from '@/api/qualityTest'
export default {
name: 'QualityTest'
name: 'QualityTest',
data() {
return {
// 搜索栏表单
queryParams: {
page: 1,
rows: 10,
revisedStartDate: moment(new Date().getTime()).format('YYYY/MM/DD'),
materSn: undefined,
orderNo: undefined
},
// 表格遮罩标志
Loading: true,
Loading2: true,
Loading4: true,
//对话框遮罩标志
Loading1: true,
Loading3: true,
// 测试表格数据
testList: [],
// 对话框表格数据
testResultList: [],
testResultDetailList: [],
// 表格总数
total: 0,
total1: 0,
// 对话框标志
open: false,
open1: false,
// 结果表单
form: {},
// 详情表单
form1: {},
// 测试结果查询表单
detailForm: {
page: 1,
rows: 10,
materSn: undefined
},
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next()
},
created() {
if (this.$store.getters.searchParams[this.$route.path]) {
const { searchParams } = this.$store.getters; const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.queryParams = { ...param }
}
this.getTestData()
},
methods: {
/**
* 查询方法
*/
handleQuery() {
this.queryParams.page = 1
this.getTestData()
},
/**
* 重置方法
*/
resetQuery() {
this.queryParams.revisedStartDate = moment(new Date().getTime()).format('YYYY/MM/DD')
this.queryParams.materSn = undefined
this.queryParams.orderNo = undefined
this.getTestData()
},
/**
*查看测试结果方法
*/
handleDetail(row) {
this.Loading1 = true
this.Loading2 = true
this.open = true
console.log(row,'row数据')
const temp = JSON.parse(JSON.stringify(row))
this.form = temp
console.log(temp,'temp数据')
this.detailForm.materSn = this.form.materSn
this.form1.materSn = this.form.materSn
this.getDetailTestData()
},
/**
* 获取表格数据
*/
getTestData() {
this.Loading = true
listQuaTest(this.queryParams).then(response => {
this.testList = response.rows
this.total = response.total
this.Loading = false
})
},
/**
* 查看详情方法
*/
handleDetailNew(row) {
this.Loading3 = true
this.Loading4 = true
this.open1 = true
this.getTestResultDetail(row)
},
/**
* 获取测试结果表格数据
*/
getDetailTestData() {
listDetailQuaTest(this.detailForm).then(response => {
this.testResultList = response.rows
this.total1 = response.total
this.Loading1 = false
this.Loading2 = false
})
},
/**
* 关闭对话框
*/
cancel(){
this.open = false
},
cancel1() {
this.open1 = false
},
/**
* 获取测试结果详情数据
*/
getTestResultDetail(row) {
listDetailQuaTestResult({businessId: row.testId}).then(response => {
console.log(response)
this.testResultDetailList = response.data
this.Loading3 = false
this.Loading4 = false
})
}
}
}
</script>
<style scoped>
<style lang="scss">
.app-container{
font-size: 18px;
padding: 0;
.testSearch {
.el-form-item--small .el-form-item__label{
line-height: 17px;
}
.labelClass{
text-align: center;
}
}
.placeholder{
height:1.3vh;
background-color: #F4F4F4;
margin-bottom:10px
}
.el-table th .cell{
display: inline-block!important;
}
.table-drop{
vertical-align: 2px;
line-height: 20px;
margin-left: 15px
}
.el-switch{
margin-left: 15px;
}
}
.testDialog{
.el-table th .cell{
display: inline-block!important;
}
.table-drop{
vertical-align: 2px;
line-height: 20px;
margin-left: 15px
}
.labelHeight{
.el-form-item__label{
height: 60px;
}
.el-form-item__error{
top: 73%;
line-height: 0;
}
}
.el-form-item--small .el-form-item__label{
line-height: 17px;
}
.labelName{
display: flex;
justify-content: end;
white-space: nowrap;
}
.labelClass{
position: relative;
right: 13px;
bottom: -5px;
text-align: center;
}
.labelClassRequired{
text-align: center;
position: relative;
bottom: 17px;
right: 13px;
}
}
</style>
......@@ -155,14 +155,14 @@
@click="handleDetail(scope.row)"
>详情</el-link>
<el-link
v-if="scope.row.status === '1'"
v-if="scope.row.status === 1"
size="mini"
type="primary"
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>编辑生产模型</el-link>
<el-link
v-if="scope.row.status === '0'"
v-if="scope.row.status === 0"
size="mini"
type="danger"
style="margin-left: 10px"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment