Commit dd8cbfe2 authored by 李志鸣's avatar 李志鸣

fea(化验室数据): 化验室数据功能联调

parent 185a78cc
...@@ -14,7 +14,8 @@ module.exports = { ...@@ -14,7 +14,8 @@ module.exports = {
proxyTable: { proxyTable: {
'/host': { '/host': {
// target: 'http://10.100.172.150:9108', //设置你调用的接口域名和端口号 别忘了加http // target: 'http://10.100.172.150:9108', //设置你调用的接口域名和端口号 别忘了加http
target: 'http://192.168.43.244:8888',// 东伟服务器地址 // target: 'http://192.168.43.244:8888', // 东伟服务器地址
target: 'http://192.168.0.126', // 训浩服务器
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/host': ''//这里理解成用‘/host’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可 '^/host': ''//这里理解成用‘/host’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可
......
...@@ -146,3 +146,12 @@ ...@@ -146,3 +146,12 @@
.el-tooltip__popper { .el-tooltip__popper {
max-width: 500px !important; max-width: 500px !important;
} }
// 解决element table 表头错位问题
body .el-table th.gutter{
display: table-cell!important;
}
body .el-table colgroup.gutter{
display: table-cell!important;
}
<template>
<div>
<el-dialog
title="报告详情"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="1200px">
<!-- 点检模板表格 -->
<el-table
style="width: 1058px; margin-bottom: 10px"
:data="checkTemplate"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column
label="版本状态/Rev"
width="200">
<template slot-scope="scope">
{{ scope.row.rev }}
</template>
</el-table-column>
<el-table-column
label="记录编号/Sheet No."
width="200">
<template slot-scope="scope">
{{ scope.row.sheetNo }}
</template>
</el-table-column>
<el-table-column
label="流水码/No."
width="200">
<template slot-scope="scope">
{{ scope.row.no }}
</template>
</el-table-column>
<el-table-column
label="化验员"
width="200">
<template slot-scope="scope">
{{ scope.row.createBy }}
</template>
</el-table-column>
<el-table-column
label="检测日期">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<!-- 点检项表格 -->
<el-table
style="width: 1058px"
:data="checkItem"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.orderNum }}
</template>
</el-table-column>
<el-table-column
label="检测项目"
show-overflow-tooltip
width="145">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column
width="55"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.isNecessary"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
label="检测指标"
show-overflow-tooltip
width="200">
<template slot-scope="scope">
<span
v-if="scope.row.checkResult >= scope.row.rangeLower && scope.row.checkResult <= scope.row.rangeUpper">
{{ scope.row.checkResult }}
</span>
<span
v-else
style="color: red">
{{ scope.row.checkResult }}
</span>
</template>
</el-table-column>
<el-table-column
label="控制范围"
width="200"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.rangeAll }}
</template>
</el-table-column>
<el-table-column
label="频次"
show-overflow-tooltip
width="200">
<template slot-scope="scope">
{{ scope.row.frequency }}
</template>
</el-table-column>
<el-table-column
label="取样时间"
show-overflow-tooltip>
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<el-form
label-width="100px"
label-position="top"
ref="form"
:data="formData">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item
label="槽液调整记录"
prop="recordInfo">
<el-input
readonly
type="textarea"
:rows="4"
v-model="formData.recordInfo"
placeholder="请输入槽液调整记录"
maxlength="255">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<p style="color: red">*各槽液至少搅拌30min后取样测试;标★项为必控项,超出范围必须调整合格后再生产;其他想为观察跟踪项,可偏离控制范围限制一个点,但不允许连续超过3天。</p>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="doExportClick()" icon="el-icon-printer">打印</el-button>
<el-button size="small" type="primary" icon="el-icon-close" @click="doCancelClick()">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import Moment from 'moment'
export default {
props: {
checkRecordId: {}
},
watch: {
dialogToggle (newVal, oldVal) {
// 根据id查询对应的检测报告
this.getCheckRecordById()
}
},
data () {
return {
// 对话框开关标识
dialogToggle: false,
// 模板数据
checkTemplate: [],
// 模板项数据
checkItem: [],
// 槽液调整记录表单
formData: {
recordInfo: ''
}
}
},
methods: {
// 时间日期格式化
formatTime (time, format) {
return Moment(time).format(format)
},
// 点击关闭按钮
doCancelClick () {
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.dialogToggle = false
},
// 点击打印按钮
async doExportClick () {
let queryParams = { recordId: this.checkRecordId }
try {
let response = await request({
url: `${process.env.API_HOST}/api/check/expert`,
data: queryParams,
method: 'get',
responseType: 'blob'
})
let objectUrl = URL.createObjectURL(response.data)
const link = document.createElement('a')
link.download = decodeURI(response.headers.filename)
link.href = objectUrl
link.click()
window.URL.revokeObjectURL(objectUrl)
this.$message.success('操作成功!')
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.dialogToggle = false
} catch (error) {
console.log(error)
}
},
// 根据id查询对应的检测报告
getCheckRecordById () {
let queryParams = { id: this.checkRecordId }
this.$fetch('daily-check-controller/getCheckRecordDetailsByID-get', queryParams).then(response => {
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.checkTemplate.push(_.cloneDeep(response.checkRecord))
this.checkItem = _.cloneDeep(response.itemRecords)
this.formData.recordInfo = _.cloneDeep(response.checkRecord.recordInfo)
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<div class="tool-pack clear-float pl-15 pr-15"> <div class="tool-pack clear-float pl-15 pr-15">
<Search <Search
searchCode="SCADA_EQUIP_INFO" searchCode="DAILY_CHECK_RECORD"
@search="doSearchClick" @search="doSearchClick"
@reset="doResetClick"> @reset="doResetClick">
</Search> </Search>
...@@ -26,30 +26,175 @@ ...@@ -26,30 +26,175 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="general-list-main-pack pl-15 pr-15 pb-15">
<div>
<Table
:tableConfig="tableConfig"
@onPageSizeChange="onPageSizeChange"
@onCurrentPageChange="onCurrentPageChange">
<template slot="createTime">
<el-table-column
label="检测日期"
width="150">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</template>
<template slot="operationColumn">
<el-table-column
fixed="right"
width="100"
label="操作">
<template slot-scope="scope">
<el-button
type="text"
@click="doViewReportClick(scope.row.id)">
查看报告
</el-button>
</template>
</el-table-column>
</template>
</Table>
</div>
</div>
<!-- 新增报告 -->
<AddReport
ref="AddReport"
@doConfirmClick="doAddReportConfirmClick">
</AddReport>
<!-- 查看报告 -->
<ViewReport
ref="ViewReport"
:checkRecordId="checkRecordId">
</ViewReport>
</div> </div>
</template> </template>
<script> <script>
import Table from '@/components/Table/index.vue' import Moment from 'moment'
import Table from '@/components/Table'
import Search from '@/components/Search' import Search from '@/components/Search'
import AddReport from './components/AddReport'
import ViewReport from './components/ViewReport'
export default { export default {
name: 'electrophoresisTank',
components: { components: {
Table, Table,
Search Search,
AddReport,
ViewReport
}, },
data () { data () {
return {} return {
// 检测记录id
checkRecordId: '',
// 搜索组件关键字列表
searchList: {},
// 表格配置项
tableConfig: {
height: 0,
data: [],
fieldList: [
{ label: '序号', value: 'id', width: 55 },
{ label: '版本状态/Rev', value: 'rev' },
{ label: '记录编号/Sheet No.', value: 'sheetNo' },
{ label: '流水码/No.', value: 'no' },
{ label: '化验员', value: 'createBy' },
{ label: '检测日期', value: 'createTime', slot: 'createTime' }
],
paginationToggle: true,
paginationConfig: {
total: 0,
currentPage: 1,
pageSize: 20
}
}
}
}, },
methods: { methods: {
// 时间日期格式化
formatTime (time, format) {
if (time === null) {
return '暂无'
} else {
return Moment(time).format(format)
}
},
// 点击刷新按钮 // 点击刷新按钮
doRefreshClick () {}, doRefreshClick () {
this.getCheckRecordList().then(() => {
this.$message.success('刷新成功!')
})
},
// 点击搜索按钮 // 点击搜索按钮
doSearchClick () {}, doSearchClick (searchValue) {
this.searchList = searchValue
this.tableConfig.paginationConfig.currentPage = 1
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击重置按钮 // 点击重置按钮
doResetClick () {}, doResetClick (searchValue) {
this.searchList = { ...searchValue, filters: [] }
this.tableConfig.paginationConfig.currentPage = 1
this.tableConfig.paginationConfig.pageSize = 20
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 触发列表分页数量改变事件
onPageSizeChange (pageSize) {
this.tableConfig.paginationConfig.currentPage = 1
this.tableConfig.paginationConfig.pageSize = pageSize
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 触发列表分页页数改变事件
onCurrentPageChange (currentPage) {
this.tableConfig.paginationConfig.currentPage = currentPage
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击新增报告按钮 // 点击新增报告按钮
doAddClick () {} doAddClick () {
this.$refs.AddReport.dialogToggle = true
},
// 点击新增报告对话框确认按钮
doAddReportConfirmClick () {
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击查看报告按钮
doViewReportClick (checkId) {
this.checkRecordId = _.cloneDeep(checkId)
this.$refs.ViewReport.dialogToggle = true
},
// 获取设备点检记录列表
getCheckRecordList () {
let queryParams = {
searchCode: 'DAILY_CHECK_RECORD',
filters: this.searchList.filters || [],
pageSize: this.tableConfig.paginationConfig.pageSize,
pageNum: this.tableConfig.paginationConfig.currentPage
}
return new Promise((resolve, reject) => {
this.$fetch('daily-check-controller/electrophoresis-post', queryParams).then(response => {
this.tableConfig.data = _.cloneDeep(response.list)
this.tableConfig.paginationConfig.total = _.cloneDeep(response.total)
resolve()
})
})
}
},
mounted () {
setTimeout(() => {
this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 210
// 获取设备点检记录列表
this.getCheckRecordList()
}, 0)
} }
} }
</script> </script>
......
<template>
<div>
<el-dialog
title="报告详情"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="1200px">
<!-- 点检模板表格 -->
<el-table
style="width: 1058px; margin-bottom: 10px"
:data="checkTemplate"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column
label="版本状态/Rev"
width="200">
<template slot-scope="scope">
{{ scope.row.rev }}
</template>
</el-table-column>
<el-table-column
label="记录编号/Sheet No."
width="200">
<template slot-scope="scope">
{{ scope.row.sheetNo }}
</template>
</el-table-column>
<el-table-column
label="流水码/No."
width="200">
<template slot-scope="scope">
{{ scope.row.no }}
</template>
</el-table-column>
<el-table-column
label="化验员"
width="200">
<template slot-scope="scope">
{{ scope.row.createBy }}
</template>
</el-table-column>
<el-table-column
label="检测日期">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<!-- 点检项表格 -->
<el-table
style="width: 1058px"
:data="checkItem"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.orderNum }}
</template>
</el-table-column>
<el-table-column
label="检测项目"
show-overflow-tooltip
width="145">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column
width="55"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.isNecessary"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
label="检测指标"
show-overflow-tooltip
width="200">
<template slot-scope="scope">
<span
v-if="scope.row.checkResult >= scope.row.rangeLower && scope.row.checkResult <= scope.row.rangeUpper">
{{ scope.row.checkResult }}
</span>
<span
v-else
style="color: red">
{{ scope.row.checkResult }}
</span>
</template>
</el-table-column>
<el-table-column
label="控制范围"
width="200"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.rangeAll }}
</template>
</el-table-column>
<el-table-column
label="频次"
show-overflow-tooltip
width="200">
<template slot-scope="scope">
{{ scope.row.frequency }}
</template>
</el-table-column>
<el-table-column
label="取样时间"
show-overflow-tooltip>
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<el-form
label-width="100px"
label-position="top"
ref="form"
:data="formData">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item
label="槽液调整记录"
prop="recordInfo">
<el-input
readonly
type="textarea"
:rows="4"
v-model="formData.recordInfo"
placeholder="请输入槽液调整记录"
maxlength="255">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<p style="color: red">*各槽液至少搅拌30min后取样测试;标★项为必控项,超出范围必须调整合格后再生产;其他想为观察跟踪项,可偏离控制范围限制一个点,但不允许连续超过3天。</p>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="doExportClick()" icon="el-icon-printer">打印</el-button>
<el-button size="small" type="primary" icon="el-icon-close" @click="doCancelClick()">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import Moment from 'moment'
export default {
props: {
checkRecordId: {}
},
watch: {
dialogToggle (newVal, oldVal) {
// 根据id查询对应的检测报告
this.getCheckRecordById()
}
},
data () {
return {
// 对话框开关标识
dialogToggle: false,
// 模板数据
checkTemplate: [],
// 模板项数据
checkItem: [],
// 槽液调整记录表单
formData: {
recordInfo: ''
}
}
},
methods: {
// 时间日期格式化
formatTime (time, format) {
return Moment(time).format(format)
},
// 点击关闭按钮
doCancelClick () {
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.dialogToggle = false
},
// 点击打印按钮
async doExportClick () {
let queryParams = { recordId: this.checkRecordId }
try {
let response = await request({
url: `${process.env.API_HOST}/api/check/expert`,
data: queryParams,
method: 'get',
responseType: 'blob'
})
let objectUrl = URL.createObjectURL(response.data)
const link = document.createElement('a')
link.download = decodeURI(response.headers.filename)
link.href = objectUrl
link.click()
window.URL.revokeObjectURL(objectUrl)
this.$message.success('操作成功!')
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.dialogToggle = false
} catch (error) {
console.log(error)
}
},
// 根据id查询对应的检测报告
getCheckRecordById () {
let queryParams = { id: this.checkRecordId }
this.$fetch('daily-check-controller/getCheckRecordDetailsByID-get', queryParams).then(response => {
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.checkTemplate.push(_.cloneDeep(response.checkRecord))
this.checkItem = _.cloneDeep(response.itemRecords)
this.formData.recordInfo = _.cloneDeep(response.checkRecord.recordInfo)
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -32,6 +32,15 @@ ...@@ -32,6 +32,15 @@
:tableConfig="tableConfig" :tableConfig="tableConfig"
@onPageSizeChange="onPageSizeChange" @onPageSizeChange="onPageSizeChange"
@onCurrentPageChange="onCurrentPageChange"> @onCurrentPageChange="onCurrentPageChange">
<template slot="createTime">
<el-table-column
label="检测日期"
width="150">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</template>
<template slot="operationColumn"> <template slot="operationColumn">
<el-table-column <el-table-column
fixed="right" fixed="right"
...@@ -39,7 +48,8 @@ ...@@ -39,7 +48,8 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text"> type="text"
@click="doViewReportClick(scope.row.id)">
查看报告 查看报告
</el-button> </el-button>
</template> </template>
...@@ -51,25 +61,37 @@ ...@@ -51,25 +61,37 @@
<!-- 新增报告 --> <!-- 新增报告 -->
<AddReport <AddReport
ref="AddReport"> ref="AddReport"
@doConfirmClick="doAddReportConfirmClick">
</AddReport> </AddReport>
<!-- 查看报告 -->
<ViewReport
ref="ViewReport"
:checkRecordId="checkRecordId">
</ViewReport>
</div> </div>
</template> </template>
<script> <script>
import Moment from 'moment'
import Table from '@/components/Table' import Table from '@/components/Table'
import Search from '@/components/Search' import Search from '@/components/Search'
import AddReport from './components/AddReport' import AddReport from './components/AddReport'
import ViewReport from './components/ViewReport'
export default { export default {
name: 'Pickling', name: 'Pickling',
components: { components: {
Table, Table,
Search, Search,
AddReport AddReport,
ViewReport
}, },
data () { data () {
return { return {
// 检测记录id
checkRecordId: '',
// 搜索组件关键字列表 // 搜索组件关键字列表
searchList: {}, searchList: {},
// 表格配置项 // 表格配置项
...@@ -77,12 +99,12 @@ ...@@ -77,12 +99,12 @@
height: 0, height: 0,
data: [], data: [],
fieldList: [ fieldList: [
{ label: '序号', value: 'id' }, { label: '序号', value: 'id', width: 55 },
{ label: '版本状态/Rev', value: 'rev' }, { label: '版本状态/Rev', value: 'rev' },
{ label: '记录编号/Sheet No.', value: 'sheetNo' }, { label: '记录编号/Sheet No.', value: 'sheetNo' },
{ label: '流水码/No.', value: 'no' }, { label: '流水码/No.', value: 'no' },
{ label: '化验员', value: 'createBy' }, { label: '化验员', value: 'createBy' },
{ label: '检测日期', value: 'createTime' } { label: '检测日期', value: 'createTime', slot: 'createTime' }
], ],
paginationToggle: true, paginationToggle: true,
paginationConfig: { paginationConfig: {
...@@ -94,8 +116,20 @@ ...@@ -94,8 +116,20 @@
} }
}, },
methods: { methods: {
// 时间日期格式化
formatTime (time, format) {
if (time === null) {
return '暂无'
} else {
return Moment(time).format(format)
}
},
// 点击刷新按钮 // 点击刷新按钮
doRefreshClick () {}, doRefreshClick () {
this.getCheckRecordList().then(() => {
this.$message.success('刷新成功!')
})
},
// 点击搜索按钮 // 点击搜索按钮
doSearchClick (searchValue) { doSearchClick (searchValue) {
this.searchList = searchValue this.searchList = searchValue
...@@ -128,6 +162,16 @@ ...@@ -128,6 +162,16 @@
doAddClick () { doAddClick () {
this.$refs.AddReport.dialogToggle = true this.$refs.AddReport.dialogToggle = true
}, },
// 点击新增报告对话框确认按钮
doAddReportConfirmClick () {
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击查看报告按钮
doViewReportClick (checkId) {
this.checkRecordId = _.cloneDeep(checkId)
this.$refs.ViewReport.dialogToggle = true
},
// 获取设备点检记录列表 // 获取设备点检记录列表
getCheckRecordList () { getCheckRecordList () {
let queryParams = { let queryParams = {
......
This diff is collapsed.
This diff is collapsed.
<template>
<div>
<el-dialog
title="报告详情"
:visible.sync="dialogToggle"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
width="1200px">
<!-- 点检模板表格 -->
<el-table
style="width: 1058px; margin-bottom: 10px"
:data="checkTemplate"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column
label="版本状态/Rev"
width="200">
<template slot-scope="scope">
{{ scope.row.rev }}
</template>
</el-table-column>
<el-table-column
label="记录编号/Sheet No."
width="200">
<template slot-scope="scope">
{{ scope.row.sheetNo }}
</template>
</el-table-column>
<el-table-column
label="流水码/No."
width="200">
<template slot-scope="scope">
{{ scope.row.no }}
</template>
</el-table-column>
<el-table-column
label="化验员"
width="200">
<template slot-scope="scope">
{{ scope.row.createBy }}
</template>
</el-table-column>
<el-table-column
label="检测日期">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<!-- 点检项表格 -->
<el-table
style="width: 1058px"
:data="checkItem"
tooltip-effect="dark"
stripe
border>
<el-table-column
label="序号"
width="55"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.orderNum }}
</template>
</el-table-column>
<el-table-column
label="检测项目"
show-overflow-tooltip
width="145">
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column
width="55"
align="center"
show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.isNecessary"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column
label="检测指标"
show-overflow-tooltip
width="200">
<template slot-scope="scope">
<span
v-if="scope.row.checkResult >= scope.row.rangeLower && scope.row.checkResult <= scope.row.rangeUpper">
{{ scope.row.checkResult }}
</span>
<span
v-else
style="color: red">
{{ scope.row.checkResult }}
</span>
</template>
</el-table-column>
<el-table-column
label="控制范围"
width="200"
show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.rangeAll }}
</template>
</el-table-column>
<el-table-column
label="频次"
show-overflow-tooltip
width="200">
<template slot-scope="scope">
{{ scope.row.frequency }}
</template>
</el-table-column>
<el-table-column
label="取样时间"
show-overflow-tooltip>
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</el-table>
<el-form
label-width="100px"
label-position="top"
ref="form"
:data="formData">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item
label="槽液调整记录"
prop="recordInfo">
<el-input
readonly
type="textarea"
:rows="4"
v-model="formData.recordInfo"
placeholder="请输入槽液调整记录"
maxlength="255">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<p style="color: red">*各槽液至少搅拌30min后取样测试;标★项为必控项,超出范围必须调整合格后再生产;其他想为观察跟踪项,可偏离控制范围限制一个点,但不允许连续超过3天。</p>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="doExportClick()" icon="el-icon-printer">打印</el-button>
<el-button size="small" type="primary" icon="el-icon-close" @click="doCancelClick()">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import Moment from 'moment'
export default {
props: {
checkRecordId: {}
},
watch: {
dialogToggle (newVal, oldVal) {
// 根据id查询对应的检测报告
this.getCheckRecordById()
}
},
data () {
return {
// 对话框开关标识
dialogToggle: false,
// 模板数据
checkTemplate: [],
// 模板项数据
checkItem: [],
// 槽液调整记录表单
formData: {
recordInfo: ''
}
}
},
methods: {
// 时间日期格式化
formatTime (time, format) {
return Moment(time).format(format)
},
// 点击关闭按钮
doCancelClick () {
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.dialogToggle = false
},
// 点击打印按钮
async doExportClick () {
let queryParams = { recordId: this.checkRecordId }
try {
let response = await request({
url: `${process.env.API_HOST}/api/check/expert`,
data: queryParams,
method: 'get',
responseType: 'blob'
})
let objectUrl = URL.createObjectURL(response.data)
const link = document.createElement('a')
link.download = decodeURI(response.headers.filename)
link.href = objectUrl
link.click()
window.URL.revokeObjectURL(objectUrl)
this.$message.success('操作成功!')
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.dialogToggle = false
} catch (error) {
console.log(error)
}
},
// 根据id查询对应的检测报告
getCheckRecordById () {
let queryParams = { id: this.checkRecordId }
this.$fetch('daily-check-controller/getCheckRecordDetailsByID-get', queryParams).then(response => {
this.checkTemplate = []
this.checkItem = []
this.formData.recordInfo = ''
this.checkTemplate.push(_.cloneDeep(response.checkRecord))
this.checkItem = _.cloneDeep(response.itemRecords)
this.formData.recordInfo = _.cloneDeep(response.checkRecord.recordInfo)
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</div> </div>
<div class="tool-pack clear-float pl-15 pr-15"> <div class="tool-pack clear-float pl-15 pr-15">
<Search <Search
searchCode="SCADA_EQUIP_INFO" searchCode="DAILY_CHECK_RECORD"
@search="doSearchClick" @search="doSearchClick"
@reset="doResetClick"> @reset="doResetClick">
</Search> </Search>
...@@ -26,30 +26,175 @@ ...@@ -26,30 +26,175 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="general-list-main-pack pl-15 pr-15 pb-15">
<div>
<Table
:tableConfig="tableConfig"
@onPageSizeChange="onPageSizeChange"
@onCurrentPageChange="onCurrentPageChange">
<template slot="createTime">
<el-table-column
label="检测日期"
width="150">
<template slot-scope="scope">
{{ formatTime(scope.row.createTime, 'YYYY-MM-DD') }}
</template>
</el-table-column>
</template>
<template slot="operationColumn">
<el-table-column
fixed="right"
width="100"
label="操作">
<template slot-scope="scope">
<el-button
type="text"
@click="doViewReportClick(scope.row.id)">
查看报告
</el-button>
</template>
</el-table-column>
</template>
</Table>
</div>
</div>
<!-- 新增报告 -->
<AddReport
ref="AddReport"
@doConfirmClick="doAddReportConfirmClick">
</AddReport>
<!-- 查看报告 -->
<ViewReport
ref="ViewReport"
:checkRecordId="checkRecordId">
</ViewReport>
</div> </div>
</template> </template>
<script> <script>
import Table from '@/components/Table/index.vue' import Moment from 'moment'
import Table from '@/components/Table'
import Search from '@/components/Search' import Search from '@/components/Search'
import AddReport from './components/AddReport'
import ViewReport from './components/ViewReport'
export default { export default {
name: 'electrophoresisTank',
components: { components: {
Table, Table,
Search Search,
AddReport,
ViewReport
}, },
data () { data () {
return {} return {
// 检测记录id
checkRecordId: '',
// 搜索组件关键字列表
searchList: {},
// 表格配置项
tableConfig: {
height: 0,
data: [],
fieldList: [
{ label: '序号', value: 'id', width: 55 },
{ label: '版本状态/Rev', value: 'rev' },
{ label: '记录编号/Sheet No.', value: 'sheetNo' },
{ label: '流水码/No.', value: 'no' },
{ label: '化验员', value: 'createBy' },
{ label: '检测日期', value: 'createTime', slot: 'createTime' }
],
paginationToggle: true,
paginationConfig: {
total: 0,
currentPage: 1,
pageSize: 20
}
}
}
}, },
methods: { methods: {
// 时间日期格式化
formatTime (time, format) {
if (time === null) {
return '暂无'
} else {
return Moment(time).format(format)
}
},
// 点击刷新按钮 // 点击刷新按钮
doRefreshClick () {}, doRefreshClick () {
this.getCheckRecordList().then(() => {
this.$message.success('刷新成功!')
})
},
// 点击搜索按钮 // 点击搜索按钮
doSearchClick () {}, doSearchClick (searchValue) {
this.searchList = searchValue
this.tableConfig.paginationConfig.currentPage = 1
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击重置按钮 // 点击重置按钮
doResetClick () {}, doResetClick (searchValue) {
this.searchList = { ...searchValue, filters: [] }
this.tableConfig.paginationConfig.currentPage = 1
this.tableConfig.paginationConfig.pageSize = 20
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 触发列表分页数量改变事件
onPageSizeChange (pageSize) {
this.tableConfig.paginationConfig.currentPage = 1
this.tableConfig.paginationConfig.pageSize = pageSize
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 触发列表分页页数改变事件
onCurrentPageChange (currentPage) {
this.tableConfig.paginationConfig.currentPage = currentPage
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击新增报告按钮 // 点击新增报告按钮
doAddClick () {} doAddClick () {
this.$refs.AddReport.dialogToggle = true
},
// 点击新增报告对话框确认按钮
doAddReportConfirmClick () {
// 获取设备点检记录列表
this.getCheckRecordList()
},
// 点击查看报告按钮
doViewReportClick (checkId) {
this.checkRecordId = _.cloneDeep(checkId)
this.$refs.ViewReport.dialogToggle = true
},
// 获取设备点检记录列表
getCheckRecordList () {
let queryParams = {
searchCode: 'DAILY_CHECK_RECORD',
filters: this.searchList.filters || [],
pageSize: this.tableConfig.paginationConfig.pageSize,
pageNum: this.tableConfig.paginationConfig.currentPage
}
return new Promise((resolve, reject) => {
this.$fetch('daily-check-controller/pretreatment-post', queryParams).then(response => {
this.tableConfig.data = _.cloneDeep(response.list)
this.tableConfig.paginationConfig.total = _.cloneDeep(response.total)
resolve()
})
})
}
},
mounted () {
setTimeout(() => {
this.tableConfig.height = document.querySelector('.page-pack').offsetHeight - 210
// 获取设备点检记录列表
this.getCheckRecordList()
}, 0)
} }
} }
</script> </script>
......
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
}, },
{ {
id: 3, id: 3,
label: '智能扭力钣手', label: '底盘智能扭力钣手',
code: 'INTELLIGENT_TORQUE_WRENCH' code: 'CHASSIS_TORQUE_WRENCH'
}, },
{ {
id: 4, id: 4,
......
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
}, },
{ {
id: 3, id: 3,
label: '智能扭力钣手', label: '总装智能扭力钣手',
code: 'INTELLIGENT_TORQUE_WRENCH' code: 'ASSEMBLY_TORQUE_WRENCH'
}, },
{ {
id: 4, id: 4,
......
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