feat(base): 添加质量管理(首末检验、检验报表、检验标准等等)和工艺参数模块
- 新增首末检验功能模块,包含检验单号、检验类型、产品信息、工位等字段管理 - 新增检验报表功能模块,支持报表编号、名称、检验统计信息等数据管理 - 新增检验标准功能模块,包含标准编号、名称、检验项目、方法等配置管理 - 新增工序预警功能模块,支持预警类型、级别、设备信息、处理状态等管理 - 集成检验标准和抽样方案下拉选择功能 - 实现预警状态处理和详情查看功能 - 添加数据列表、新增、修改、删除、导出等基础操作功能master
parent
65841c227e
commit
6eb0be6b12
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listFirstLastInspection(query) {
|
||||
return request({
|
||||
url: '/base/firstLastInspection/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getFirstLastInspection(objId) {
|
||||
return request({
|
||||
url: '/base/firstLastInspection/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addFirstLastInspection(data) {
|
||||
return request({
|
||||
url: '/base/firstLastInspection',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateFirstLastInspection(data) {
|
||||
return request({
|
||||
url: '/base/firstLastInspection',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delFirstLastInspection(objId) {
|
||||
return request({
|
||||
url: '/base/firstLastInspection/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getFirstLastInspectionList(query) {
|
||||
return request({
|
||||
url: '/base/firstLastInspection/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listInspectionReport(query) {
|
||||
return request({
|
||||
url: '/base/inspectionReport/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionReport(objId) {
|
||||
return request({
|
||||
url: '/base/inspectionReport/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addInspectionReport(data) {
|
||||
return request({
|
||||
url: '/base/inspectionReport',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateInspectionReport(data) {
|
||||
return request({
|
||||
url: '/base/inspectionReport',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delInspectionReport(objId) {
|
||||
return request({
|
||||
url: '/base/inspectionReport/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionReportList(query) {
|
||||
return request({
|
||||
url: '/base/inspectionReport/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listInspectionStandard(query) {
|
||||
return request({
|
||||
url: '/base/inspectionStandard/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionStandard(objId) {
|
||||
return request({
|
||||
url: '/base/inspectionStandard/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addInspectionStandard(data) {
|
||||
return request({
|
||||
url: '/base/inspectionStandard',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateInspectionStandard(data) {
|
||||
return request({
|
||||
url: '/base/inspectionStandard',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delInspectionStandard(objId) {
|
||||
return request({
|
||||
url: '/base/inspectionStandard/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionStandardList(query) {
|
||||
return request({
|
||||
url: '/base/inspectionStandard/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询工艺预警列表
|
||||
export function listProcessAlert(query) {
|
||||
return request({
|
||||
url: '/base/processAlert/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询工艺预警详细
|
||||
export function getProcessAlert(alertId) {
|
||||
return request({
|
||||
url: '/base/processAlert/' + alertId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增工艺预警
|
||||
export function addProcessAlert(data) {
|
||||
return request({
|
||||
url: '/base/processAlert',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改工艺预警
|
||||
export function updateProcessAlert(data) {
|
||||
return request({
|
||||
url: '/base/processAlert',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工艺预警
|
||||
export function delProcessAlert(alertId) {
|
||||
return request({
|
||||
url: '/base/processAlert/' + alertId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 处理工艺预警
|
||||
export function handleProcessAlert(data) {
|
||||
return request({
|
||||
url: '/base/processAlert/handle',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询调试备份列表
|
||||
export function listProcessDebugBackup(query) {
|
||||
return request({
|
||||
url: '/base/processDebugBackup/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询调试备份详细
|
||||
export function getProcessDebugBackup(backupId) {
|
||||
return request({
|
||||
url: '/base/processDebugBackup/' + backupId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增调试备份
|
||||
export function addProcessDebugBackup(data) {
|
||||
return request({
|
||||
url: '/base/processDebugBackup',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改调试备份
|
||||
export function updateProcessDebugBackup(data) {
|
||||
return request({
|
||||
url: '/base/processDebugBackup',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除调试备份
|
||||
export function delProcessDebugBackup(backupId) {
|
||||
return request({
|
||||
url: '/base/processDebugBackup/' + backupId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取调试备份列表(不分页)
|
||||
export function getProcessDebugBackupList(query) {
|
||||
return request({
|
||||
url: '/base/processDebugBackup/getProcessDebugBackupList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询工艺文档列表
|
||||
export function listProcessDocument(query) {
|
||||
return request({
|
||||
url: '/base/processDocument/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询工艺文档详细
|
||||
export function getProcessDocument(docId) {
|
||||
return request({
|
||||
url: '/base/processDocument/' + docId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增工艺文档
|
||||
export function addProcessDocument(data) {
|
||||
return request({
|
||||
url: '/base/processDocument',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改工艺文档
|
||||
export function updateProcessDocument(data) {
|
||||
return request({
|
||||
url: '/base/processDocument',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工艺文档
|
||||
export function delProcessDocument(docId) {
|
||||
return request({
|
||||
url: '/base/processDocument/' + docId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取工艺文档列表(不分页)
|
||||
export function getProcessDocumentList(query) {
|
||||
return request({
|
||||
url: '/base/processDocument/getProcessDocumentList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询工艺参数变更记录列表
|
||||
export function listProcessParamChange(query) {
|
||||
return request({
|
||||
url: '/base/processParamChange/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询工艺参数变更记录详细
|
||||
export function getProcessParamChange(changeId) {
|
||||
return request({
|
||||
url: '/base/processParamChange/' + changeId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增工艺参数变更记录
|
||||
export function addProcessParamChange(data) {
|
||||
return request({
|
||||
url: '/base/processParamChange',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改工艺参数变更记录
|
||||
export function updateProcessParamChange(data) {
|
||||
return request({
|
||||
url: '/base/processParamChange',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工艺参数变更记录
|
||||
export function delProcessParamChange(changeId) {
|
||||
return request({
|
||||
url: '/base/processParamChange/' + changeId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询工艺参数监控列表
|
||||
export function listProcessParamMonitor(query) {
|
||||
return request({
|
||||
url: '/base/processParamMonitor/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询工艺参数监控详细
|
||||
export function getProcessParamMonitor(monitorId) {
|
||||
return request({
|
||||
url: '/base/processParamMonitor/' + monitorId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增工艺参数监控
|
||||
export function addProcessParamMonitor(data) {
|
||||
return request({
|
||||
url: '/base/processParamMonitor',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改工艺参数监控
|
||||
export function updateProcessParamMonitor(data) {
|
||||
return request({
|
||||
url: '/base/processParamMonitor',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工艺参数监控
|
||||
export function delProcessParamMonitor(monitorId) {
|
||||
return request({
|
||||
url: '/base/processParamMonitor/' + monitorId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询参数追溯列表
|
||||
export function listProcessParamTrace(query) {
|
||||
return request({
|
||||
url: '/base/processParamTrace/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询参数追溯详细
|
||||
export function getProcessParamTrace(traceId) {
|
||||
return request({
|
||||
url: '/base/processParamTrace/' + traceId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增参数追溯
|
||||
export function addProcessParamTrace(data) {
|
||||
return request({
|
||||
url: '/base/processParamTrace',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改参数追溯
|
||||
export function updateProcessParamTrace(data) {
|
||||
return request({
|
||||
url: '/base/processParamTrace',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除参数追溯
|
||||
export function delProcessParamTrace(traceId) {
|
||||
return request({
|
||||
url: '/base/processParamTrace/' + traceId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询工艺快照列表
|
||||
export function listProcessSnapshot(query) {
|
||||
return request({
|
||||
url: '/base/processSnapshot/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询工艺快照详细
|
||||
export function getProcessSnapshot(snapshotId) {
|
||||
return request({
|
||||
url: '/base/processSnapshot/' + snapshotId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增工艺快照
|
||||
export function addProcessSnapshot(data) {
|
||||
return request({
|
||||
url: '/base/processSnapshot',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改工艺快照
|
||||
export function updateProcessSnapshot(data) {
|
||||
return request({
|
||||
url: '/base/processSnapshot',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工艺快照
|
||||
export function delProcessSnapshot(snapshotId) {
|
||||
return request({
|
||||
url: '/base/processSnapshot/' + snapshotId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listQualityTrace(query) {
|
||||
return request({
|
||||
url: '/base/qualityTrace/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityTrace(objId) {
|
||||
return request({
|
||||
url: '/base/qualityTrace/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addQualityTrace(data) {
|
||||
return request({
|
||||
url: '/base/qualityTrace',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateQualityTrace(data) {
|
||||
return request({
|
||||
url: '/base/qualityTrace',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delQualityTrace(objId) {
|
||||
return request({
|
||||
url: '/base/qualityTrace/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityTraceList(query) {
|
||||
return request({
|
||||
url: '/base/qualityTrace/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listSamplingInspection(query) {
|
||||
return request({
|
||||
url: '/base/samplingInspection/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getSamplingInspection(objId) {
|
||||
return request({
|
||||
url: '/base/samplingInspection/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addSamplingInspection(data) {
|
||||
return request({
|
||||
url: '/base/samplingInspection',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateSamplingInspection(data) {
|
||||
return request({
|
||||
url: '/base/samplingInspection',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delSamplingInspection(objId) {
|
||||
return request({
|
||||
url: '/base/samplingInspection/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getSamplingInspectionList(query) {
|
||||
return request({
|
||||
url: '/base/samplingInspection/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listSamplingPlan(query) {
|
||||
return request({
|
||||
url: '/base/samplingPlan/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getSamplingPlan(objId) {
|
||||
return request({
|
||||
url: '/base/samplingPlan/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addSamplingPlan(data) {
|
||||
return request({
|
||||
url: '/base/samplingPlan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateSamplingPlan(data) {
|
||||
return request({
|
||||
url: '/base/samplingPlan',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delSamplingPlan(objId) {
|
||||
return request({
|
||||
url: '/base/samplingPlan/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getSamplingPlanList(query) {
|
||||
return request({
|
||||
url: '/base/samplingPlan/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listStandardDocument(query) {
|
||||
return request({
|
||||
url: '/base/standardDocument/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getStandardDocument(objId) {
|
||||
return request({
|
||||
url: '/base/standardDocument/' + objId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addStandardDocument(data) {
|
||||
return request({
|
||||
url: '/base/standardDocument',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateStandardDocument(data) {
|
||||
return request({
|
||||
url: '/base/standardDocument',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delStandardDocument(objId) {
|
||||
return request({
|
||||
url: '/base/standardDocument/' + objId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getStandardDocumentList(query) {
|
||||
return request({
|
||||
url: '/base/standardDocument/getList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="检验单号" prop="inspectionNo">
|
||||
<el-input v-model="queryParams.inspectionNo" placeholder="请输入检验单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验类型" prop="inspectionType">
|
||||
<el-input v-model="queryParams.inspectionType" placeholder="请输入检验类型" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:firstLastInspection:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:firstLastInspection:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:firstLastInspection:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:firstLastInspection:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="firstLastInspectionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="检验单号" align="center" prop="inspectionNo" />
|
||||
<el-table-column label="检验类型" align="center" prop="inspectionType" />
|
||||
<el-table-column label="产品编号" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="工单编号" align="center" prop="workOrderNo" />
|
||||
<el-table-column label="工位编号" align="center" prop="stationCode" />
|
||||
<el-table-column label="检验员" align="center" prop="inspector" />
|
||||
<el-table-column label="检验结果" align="center" prop="inspectionResult" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:firstLastInspection:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:firstLastInspection:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="检验单号" prop="inspectionNo">
|
||||
<el-input v-model="form.inspectionNo" placeholder="请输入检验单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验类型" prop="inspectionType">
|
||||
<el-input v-model="form.inspectionType" placeholder="请输入检验类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编号" prop="workOrderNo">
|
||||
<el-input v-model="form.workOrderNo" placeholder="请输入工单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工位" prop="stationCode">
|
||||
<el-select v-model="form.stationCode" placeholder="请选择工位" clearable filterable @change="handleStationChange">
|
||||
<el-option
|
||||
v-for="item in processStationList"
|
||||
:key="item.processCode"
|
||||
:label="item.processCode + ' - ' + item.processName"
|
||||
:value="item.processCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验标准" prop="standardCode">
|
||||
<el-select v-model="form.standardCode" placeholder="请选择检验标准" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in inspectionStandardList"
|
||||
:key="item.standardCode"
|
||||
:label="item.standardCode + ' - ' + item.standardName"
|
||||
:value="item.standardCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验员" prop="inspector">
|
||||
<el-input v-model="form.inspector" placeholder="请输入检验员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验时间" prop="inspectionTime">
|
||||
<el-date-picker clearable v-model="form.inspectionTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择检验时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-input v-model="form.inspectionResult" placeholder="请输入检验结果" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合格数量" prop="qualifiedQty">
|
||||
<el-input-number v-model="form.qualifiedQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="不合格数量" prop="unqualifiedQty">
|
||||
<el-input-number v-model="form.unqualifiedQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷描述" prop="defectDescription">
|
||||
<el-input v-model="form.defectDescription" type="textarea" placeholder="请输入缺陷描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFirstLastInspection, getFirstLastInspection, delFirstLastInspection, addFirstLastInspection, updateFirstLastInspection } from "@/api/base/firstLastInspection";
|
||||
import { getInspectionStandardList } from "@/api/base/inspectionStandard";
|
||||
import { listProcessStation } from "@/api/base/processStation";
|
||||
|
||||
export default {
|
||||
name: "FirstLastInspection",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
firstLastInspectionList: [],
|
||||
inspectionStandardList: [],
|
||||
processStationList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inspectionNo: null,
|
||||
inspectionType: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
stationCode: null,
|
||||
inspector: null,
|
||||
inspectionResult: null,
|
||||
status: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
inspectionNo: [{ required: true, message: "检验单号不能为空", trigger: "blur" }],
|
||||
inspectionType: [{ required: true, message: "检验类型不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadInspectionStandardList();
|
||||
this.loadProcessStationList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFirstLastInspection(this.queryParams).then(response => {
|
||||
this.firstLastInspectionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
inspectionNo: null,
|
||||
inspectionType: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
stationCode: null,
|
||||
stationName: null,
|
||||
standardCode: null,
|
||||
inspector: null,
|
||||
inspectionTime: null,
|
||||
inspectionResult: null,
|
||||
qualifiedQty: null,
|
||||
unqualifiedQty: null,
|
||||
defectDescription: null,
|
||||
status: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加首末检验";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getFirstLastInspection(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.syncStationNameFromCode(this.form.stationCode);
|
||||
this.open = true;
|
||||
this.title = "修改首末检验";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateFirstLastInspection(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFirstLastInspection(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除首末检验编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delFirstLastInspection(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/firstLastInspection/export', { ...this.queryParams }, `firstLastInspection_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
loadInspectionStandardList() {
|
||||
getInspectionStandardList().then(response => {
|
||||
this.inspectionStandardList = response.rows || [];
|
||||
});
|
||||
},
|
||||
loadProcessStationList() {
|
||||
listProcessStation().then(response => {
|
||||
this.processStationList = response.rows || [];
|
||||
this.syncStationNameFromCode(this.form.stationCode);
|
||||
});
|
||||
},
|
||||
handleStationChange(val) {
|
||||
const station = this.processStationList.find(item => item.processCode === val);
|
||||
this.form.stationName = station ? station.processName : '';
|
||||
},
|
||||
syncStationNameFromCode(code) {
|
||||
if (!code) {
|
||||
this.form.stationName = '';
|
||||
return;
|
||||
}
|
||||
const station = this.processStationList.find(item => item.processCode === code);
|
||||
this.form.stationName = station ? station.processName : '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="报表编号" prop="reportNo">
|
||||
<el-input v-model="queryParams.reportNo" placeholder="请输入报表编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="报表名称" prop="reportName">
|
||||
<el-input v-model="queryParams.reportName" placeholder="请输入报表名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:inspectionReport:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:inspectionReport:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:inspectionReport:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:inspectionReport:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="inspectionReportList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="报表编号" align="center" prop="reportNo" />
|
||||
<el-table-column label="报表名称" align="center" prop="reportName" />
|
||||
<el-table-column label="产品编号" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="工单编号" align="center" prop="workOrderNo" />
|
||||
<el-table-column label="检验类型" align="center" prop="inspectionType" />
|
||||
<el-table-column label="检验工单总数" align="center" prop="totalInspections" />
|
||||
<el-table-column label="通过数量" align="center" prop="passedQty" />
|
||||
<el-table-column label="不通过数量" align="center" prop="failedQty" />
|
||||
<el-table-column label="未检验数量" align="center" prop="pendingQty" />
|
||||
<el-table-column label="合格率" align="center" prop="passRate" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:inspectionReport:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:inspectionReport:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="报表编号" prop="reportNo">
|
||||
<el-input v-model="form.reportNo" placeholder="请输入报表编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报表名称" prop="reportName">
|
||||
<el-input v-model="form.reportName" placeholder="请输入报表名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编号" prop="workOrderNo">
|
||||
<el-input v-model="form.workOrderNo" placeholder="请输入工单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验类型" prop="inspectionType">
|
||||
<el-input v-model="form.inspectionType" placeholder="请输入检验类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验工单总数" prop="totalInspections">
|
||||
<el-input-number v-model="form.totalInspections" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通过数量" prop="passedQty">
|
||||
<el-input-number v-model="form.passedQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="不通过数量" prop="failedQty">
|
||||
<el-input-number v-model="form.failedQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="未检验数量" prop="pendingQty">
|
||||
<el-input-number v-model="form.pendingQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合格率" prop="passRate">
|
||||
<el-input v-model="form.passRate" placeholder="请输入合格率" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable v-model="form.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开始时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker clearable v-model="form.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择结束时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInspectionReport, getInspectionReport, delInspectionReport, addInspectionReport, updateInspectionReport } from "@/api/base/inspectionReport";
|
||||
|
||||
export default {
|
||||
name: "InspectionReport",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
inspectionReportList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
reportNo: null,
|
||||
reportName: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
inspectionType: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
reportNo: [{ required: true, message: "报表编号不能为空", trigger: "blur" }],
|
||||
reportName: [{ required: true, message: "报表名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInspectionReport(this.queryParams).then(response => {
|
||||
this.inspectionReportList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
reportNo: null,
|
||||
reportName: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
inspectionType: null,
|
||||
totalInspections: null,
|
||||
passedQty: null,
|
||||
failedQty: null,
|
||||
pendingQty: null,
|
||||
passRate: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
createdBy: null,
|
||||
createdTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加检验报表";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getInspectionReport(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改检验报表";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateInspectionReport(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInspectionReport(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除检验报表编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delInspectionReport(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/inspectionReport/export', { ...this.queryParams }, `inspectionReport_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="标准编号" prop="standardCode">
|
||||
<el-input v-model="queryParams.standardCode" placeholder="请输入标准编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准名称" prop="standardName">
|
||||
<el-input v-model="queryParams.standardName" placeholder="请输入标准名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:inspectionStandard:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:inspectionStandard:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:inspectionStandard:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:inspectionStandard:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="inspectionStandardList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="标准编号" align="center" prop="standardCode" />
|
||||
<el-table-column label="标准名称" align="center" prop="standardName" />
|
||||
<el-table-column label="产品编号" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="检验类型" align="center" prop="inspectionType" />
|
||||
<el-table-column label="检验项目" align="center" prop="inspectionItems" />
|
||||
<el-table-column label="检验方法" align="center" prop="inspectionMethod" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:inspectionStandard:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:inspectionStandard:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="标准编号" prop="standardCode">
|
||||
<el-input v-model="form.standardCode" placeholder="请输入标准编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准名称" prop="standardName">
|
||||
<el-input v-model="form.standardName" placeholder="请输入标准名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验类型" prop="inspectionType">
|
||||
<el-input v-model="form.inspectionType" placeholder="请输入检验类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验项目" prop="inspectionItems">
|
||||
<el-input v-model="form.inspectionItems" placeholder="请输入检验项目" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验方法" prop="inspectionMethod">
|
||||
<el-input v-model="form.inspectionMethod" placeholder="请输入检验方法" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准值" prop="standardValue">
|
||||
<el-input v-model="form.standardValue" placeholder="请输入标准值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="公差范围" prop="toleranceRange">
|
||||
<el-input v-model="form.toleranceRange" placeholder="请输入公差范围" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抽样方案" prop="samplingPlanCode">
|
||||
<el-select v-model="form.samplingPlanCode" placeholder="请选择抽样方案" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in samplingPlanList"
|
||||
:key="item.planCode"
|
||||
:label="item.planCode + ' - ' + item.planName"
|
||||
:value="item.planCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInspectionStandard, getInspectionStandard, delInspectionStandard, addInspectionStandard, updateInspectionStandard, getInspectionStandardList } from "@/api/base/inspectionStandard";
|
||||
import { getSamplingPlanList } from "@/api/base/samplingPlan";
|
||||
|
||||
export default {
|
||||
name: "InspectionStandard",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
inspectionStandardList: [],
|
||||
samplingPlanList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
standardCode: null,
|
||||
standardName: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
inspectionType: null,
|
||||
isFlag: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
standardCode: [{ required: true, message: "标准编号不能为空", trigger: "blur" }],
|
||||
standardName: [{ required: true, message: "标准名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadSamplingPlanList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInspectionStandard(this.queryParams).then(response => {
|
||||
this.inspectionStandardList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
standardCode: null,
|
||||
standardName: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
inspectionType: null,
|
||||
inspectionItems: null,
|
||||
inspectionMethod: null,
|
||||
standardValue: null,
|
||||
toleranceRange: null,
|
||||
samplingPlanCode: null,
|
||||
remark: null,
|
||||
isFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加检验标准";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getInspectionStandard(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改检验标准";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateInspectionStandard(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInspectionStandard(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除检验标准编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delInspectionStandard(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/inspectionStandard/export', { ...this.queryParams }, `inspectionStandard_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
loadSamplingPlanList() {
|
||||
getSamplingPlanList().then(response => {
|
||||
this.samplingPlanList = response.rows || [];
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="预警编号" prop="alertCode">
|
||||
<el-input v-model="queryParams.alertCode" placeholder="请输入预警编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="queryParams.deviceCode" placeholder="请输入设备编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警类型" prop="alertType">
|
||||
<el-select v-model="queryParams.alertType" placeholder="请选择类型" clearable>
|
||||
<el-option label="参数超限" value="参数超限"/>
|
||||
<el-option label="设备异常" value="设备异常"/>
|
||||
<el-option label="质量异常" value="质量异常"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警状态" prop="alertStatus">
|
||||
<el-select v-model="queryParams.alertStatus" placeholder="请选择状态" clearable>
|
||||
<el-option label="未处理" value="0"/>
|
||||
<el-option label="处理中" value="1"/>
|
||||
<el-option label="已处理" value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警时间">
|
||||
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:processAlert:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="alertList" :row-class-name="tableRowClassName">
|
||||
<el-table-column label="预警编号" align="center" prop="alertCode" width="120"/>
|
||||
<el-table-column label="预警类型" align="center" prop="alertType" width="100"/>
|
||||
<el-table-column label="预警级别" align="center" prop="alertLevel" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.alertLevel === '3' ? 'danger' : scope.row.alertLevel === '2' ? 'warning' : 'info'">
|
||||
{{ scope.row.alertLevel === '3' ? '紧急' : scope.row.alertLevel === '2' ? '重要' : '一般' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName"/>
|
||||
<el-table-column label="参数名称" align="center" prop="paramName"/>
|
||||
<el-table-column label="预警内容" align="center" prop="alertContent" show-overflow-tooltip/>
|
||||
<el-table-column label="预警值" align="center" prop="alertValue" width="80"/>
|
||||
<el-table-column label="阈值" align="center" prop="thresholdValue" width="80"/>
|
||||
<el-table-column label="预警时间" align="center" prop="alertTime" width="160"/>
|
||||
<el-table-column label="状态" align="center" prop="alertStatus" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.alertStatus === '2' ? 'success' : scope.row.alertStatus === '1' ? 'warning' : 'danger'">
|
||||
{{ scope.row.alertStatus === '2' ? '已处理' : scope.row.alertStatus === '1' ? '处理中' : '未处理' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.alertStatus !== '2'" size="mini" type="text" icon="el-icon-check" @click="handleProcess(scope.row)" v-hasPermi="['base:processAlert:edit']">处理</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<el-dialog title="处理预警" :visible.sync="processOpen" width="500px" append-to-body>
|
||||
<el-form ref="processForm" :model="processForm" :rules="processRules" label-width="100px">
|
||||
<el-form-item label="预警编号">
|
||||
<el-input v-model="processForm.alertCode" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警内容">
|
||||
<el-input v-model="processForm.alertContent" type="textarea" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理状态" prop="alertStatus">
|
||||
<el-radio-group v-model="processForm.alertStatus">
|
||||
<el-radio label="1">处理中</el-radio>
|
||||
<el-radio label="2">已处理</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理结果" prop="handleResult">
|
||||
<el-input v-model="processForm.handleResult" type="textarea" placeholder="请输入处理结果"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitProcess">确 定</el-button>
|
||||
<el-button @click="processOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="预警详情" :visible.sync="viewOpen" width="600px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="预警编号">{{ currentRow.alertCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警类型">{{ currentRow.alertType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警级别">{{ currentRow.alertLevel === '3' ? '紧急' : currentRow.alertLevel === '2' ? '重要' : '一般' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警状态">{{ currentRow.alertStatus === '2' ? '已处理' : currentRow.alertStatus === '1' ? '处理中' : '未处理' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编码">{{ currentRow.deviceCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备名称">{{ currentRow.deviceName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="参数编码">{{ currentRow.paramCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="参数名称">{{ currentRow.paramName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警值">{{ currentRow.alertValue }}</el-descriptions-item>
|
||||
<el-descriptions-item label="阈值">{{ currentRow.thresholdValue }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警内容" :span="2">{{ currentRow.alertContent }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预警时间" :span="2">{{ currentRow.alertTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="处理人">{{ currentRow.handleUser }}</el-descriptions-item>
|
||||
<el-descriptions-item label="处理时间">{{ currentRow.handleTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="处理结果" :span="2">{{ currentRow.handleResult }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="viewOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProcessAlert, getProcessAlert, handleProcessAlert } from "@/api/base/processAlert";
|
||||
|
||||
export default {
|
||||
name: "ProcessAlert",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
alertList: [],
|
||||
dateRange: [],
|
||||
processOpen: false,
|
||||
viewOpen: false,
|
||||
currentRow: {},
|
||||
processForm: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
alertCode: null,
|
||||
deviceCode: null,
|
||||
alertType: null,
|
||||
alertStatus: null,
|
||||
},
|
||||
processRules: {
|
||||
alertStatus: [{ required: true, message: "请选择处理状态", trigger: "change" }],
|
||||
handleResult: [{ required: true, message: "请输入处理结果", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let params = { ...this.queryParams };
|
||||
if (this.dateRange && this.dateRange.length === 2) {
|
||||
params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
|
||||
}
|
||||
listProcessAlert(params).then(response => {
|
||||
this.alertList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
tableRowClassName({ row }) {
|
||||
if (row.alertStatus === '0' && row.alertLevel === '3') {
|
||||
return 'danger-row';
|
||||
} else if (row.alertStatus === '0') {
|
||||
return 'warning-row';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
handleProcess(row) {
|
||||
this.processForm = {
|
||||
alertId: row.alertId,
|
||||
alertCode: row.alertCode,
|
||||
alertContent: row.alertContent,
|
||||
alertStatus: row.alertStatus === '0' ? '1' : row.alertStatus,
|
||||
handleResult: row.handleResult,
|
||||
};
|
||||
this.processOpen = true;
|
||||
},
|
||||
handleView(row) {
|
||||
this.currentRow = row;
|
||||
this.viewOpen = true;
|
||||
},
|
||||
submitProcess() {
|
||||
this.$refs["processForm"].validate(valid => {
|
||||
if (valid) {
|
||||
handleProcessAlert(this.processForm).then(response => {
|
||||
this.$modal.msgSuccess("处理成功");
|
||||
this.processOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/processAlert/export', { ...this.queryParams }, `processAlert_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .warning-row {
|
||||
background-color: #FDF6EC !important;
|
||||
}
|
||||
::v-deep .danger-row {
|
||||
background-color: #FEF0F0 !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="备份编号" prop="backupCode">
|
||||
<el-input v-model="queryParams.backupCode" placeholder="请输入备份编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="queryParams.deviceCode" placeholder="请输入设备编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="productCode">
|
||||
<el-input v-model="queryParams.productCode" placeholder="请输入产品编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:processDebugBackup:add']">新增备份</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:processDebugBackup:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:processDebugBackup:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="backupList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="备份编号" align="center" prop="backupCode"/>
|
||||
<el-table-column label="备份名称" align="center" prop="backupName" show-overflow-tooltip/>
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName"/>
|
||||
<el-table-column label="模具编码" align="center" prop="moldCode"/>
|
||||
<el-table-column label="产品编码" align="center" prop="productCode"/>
|
||||
<el-table-column label="备份人" align="center" prop="backupUser"/>
|
||||
<el-table-column label="备份时间" align="center" prop="backupTime" width="160"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看参数</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-download" @click="handleApply(scope.row)">应用</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:processDebugBackup:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="备份编号" prop="backupCode">
|
||||
<el-input v-model="form.backupCode" placeholder="请输入备份编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备份名称" prop="backupName">
|
||||
<el-input v-model="form.backupName" placeholder="请输入备份名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="请输入设备编码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模具编码" prop="moldCode">
|
||||
<el-input v-model="form.moldCode" placeholder="请输入模具编码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数数据" prop="paramData">
|
||||
<el-input v-model="form.paramData" type="textarea" :rows="6" placeholder="请输入参数数据(JSON格式)"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="参数数据" :visible.sync="viewOpen" width="700px" append-to-body>
|
||||
<pre style="max-height: 400px; overflow: auto; background: #f5f5f5; padding: 15px; border-radius: 4px;">{{ viewParamData }}</pre>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="viewOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProcessDebugBackup, getProcessDebugBackup, delProcessDebugBackup, addProcessDebugBackup } from "@/api/base/processDebugBackup";
|
||||
|
||||
export default {
|
||||
name: "ProcessDebugBackup",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
backupList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
viewOpen: false,
|
||||
viewParamData: "",
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
backupCode: null,
|
||||
deviceCode: null,
|
||||
productCode: null,
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
backupCode: [{ required: true, message: "备份编号不能为空", trigger: "blur" }],
|
||||
deviceCode: [{ required: true, message: "设备编码不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listProcessDebugBackup(this.queryParams).then(response => {
|
||||
this.backupList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
backupId: null,
|
||||
backupCode: null,
|
||||
backupName: null,
|
||||
deviceCode: null,
|
||||
deviceName: null,
|
||||
moldCode: null,
|
||||
moldName: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
paramData: null,
|
||||
isFlag: "1",
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.backupId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加调试备份";
|
||||
},
|
||||
handleView(row) {
|
||||
try {
|
||||
this.viewParamData = row.paramData ? JSON.stringify(JSON.parse(row.paramData), null, 2) : "暂无参数数据";
|
||||
} catch (e) {
|
||||
this.viewParamData = row.paramData || "暂无参数数据";
|
||||
}
|
||||
this.viewOpen = true;
|
||||
},
|
||||
handleApply(row) {
|
||||
this.$modal.confirm('是否确认应用备份编号为"' + row.backupCode + '"的参数数据?').then(() => {
|
||||
this.$modal.msgSuccess("参数应用成功(此功能需要与设备通信模块对接)");
|
||||
}).catch(() => {});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
addProcessDebugBackup(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const backupIds = row.backupId || this.ids;
|
||||
this.$modal.confirm('是否确认删除调试备份编号为"' + backupIds + '"的数据项?').then(function() {
|
||||
return delProcessDebugBackup(backupIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/processDebugBackup/export', { ...this.queryParams }, `processDebugBackup_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="文档编号" prop="docCode">
|
||||
<el-input v-model="queryParams.docCode" placeholder="请输入文档编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文档名称" prop="docName">
|
||||
<el-input v-model="queryParams.docName" placeholder="请输入文档名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文档类型" prop="docType">
|
||||
<el-select v-model="queryParams.docType" placeholder="请选择文档类型" clearable>
|
||||
<el-option label="SOP" value="SOP"/>
|
||||
<el-option label="参数要求" value="参数要求"/>
|
||||
<el-option label="作业指导书" value="作业指导书"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:processDocument:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:processDocument:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:processDocument:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:processDocument:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="documentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="文档编号" align="center" prop="docCode"/>
|
||||
<el-table-column label="文档名称" align="center" prop="docName" show-overflow-tooltip/>
|
||||
<el-table-column label="文档类型" align="center" prop="docType"/>
|
||||
<el-table-column label="产品编码" align="center" prop="productCode"/>
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
|
||||
<el-table-column label="版本" align="center" prop="docVersion" width="80"/>
|
||||
<el-table-column label="文件名称" align="center" prop="fileName" show-overflow-tooltip/>
|
||||
<el-table-column label="状态" align="center" prop="docStatus" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.docStatus === '1' ? 'success' : scope.row.docStatus === '2' ? 'danger' : 'info'">
|
||||
{{ scope.row.docStatus === '1' ? '发布' : scope.row.docStatus === '2' ? '作废' : '草稿' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:processDocument:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:processDocument:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="文档编号" prop="docCode">
|
||||
<el-input v-model="form.docCode" placeholder="请输入文档编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文档名称" prop="docName">
|
||||
<el-input v-model="form.docName" placeholder="请输入文档名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文档类型" prop="docType">
|
||||
<el-select v-model="form.docType" placeholder="请选择文档类型" style="width: 100%">
|
||||
<el-option label="SOP" value="SOP"/>
|
||||
<el-option label="参数要求" value="参数要求"/>
|
||||
<el-option label="作业指导书" value="作业指导书"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="请输入设备编码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文档版本" prop="docVersion">
|
||||
<el-input v-model="form.docVersion" placeholder="请输入文档版本"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件上传" prop="filePath">
|
||||
<file-upload v-model="form.filePath"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文档状态" prop="docStatus">
|
||||
<el-radio-group v-model="form.docStatus">
|
||||
<el-radio label="0">草稿</el-radio>
|
||||
<el-radio label="1">发布</el-radio>
|
||||
<el-radio label="2">作废</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProcessDocument, getProcessDocument, delProcessDocument, addProcessDocument, updateProcessDocument } from "@/api/base/processDocument";
|
||||
|
||||
export default {
|
||||
name: "ProcessDocument",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
documentList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
docCode: null,
|
||||
docName: null,
|
||||
docType: null,
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
docCode: [{ required: true, message: "文档编号不能为空", trigger: "blur" }],
|
||||
docName: [{ required: true, message: "文档名称不能为空", trigger: "blur" }],
|
||||
docType: [{ required: true, message: "文档类型不能为空", trigger: "change" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listProcessDocument(this.queryParams).then(response => {
|
||||
this.documentList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
docId: null,
|
||||
docCode: null,
|
||||
docName: null,
|
||||
docType: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
deviceCode: null,
|
||||
deviceName: null,
|
||||
moldCode: null,
|
||||
moldName: null,
|
||||
docVersion: null,
|
||||
filePath: null,
|
||||
fileName: null,
|
||||
fileSize: null,
|
||||
docStatus: "0",
|
||||
isFlag: "1",
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.docId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加工艺文档";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const docId = row.docId || this.ids;
|
||||
getProcessDocument(docId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改工艺文档";
|
||||
});
|
||||
},
|
||||
handleView(row) {
|
||||
if (row.filePath) {
|
||||
window.open(process.env.VUE_APP_BASE_API + row.filePath, '_blank');
|
||||
} else {
|
||||
this.$modal.msgWarning("暂无文件可查看");
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.docId != null) {
|
||||
updateProcessDocument(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addProcessDocument(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const docIds = row.docId || this.ids;
|
||||
this.$modal.confirm('是否确认删除工艺文档编号为"' + docIds + '"的数据项?').then(function() {
|
||||
return delProcessDocument(docIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/processDocument/export', { ...this.queryParams }, `processDocument_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="queryParams.deviceCode" placeholder="请输入设备编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数名称" prop="paramName">
|
||||
<el-input v-model="queryParams.paramName" placeholder="请输入参数名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数状态" prop="paramStatus">
|
||||
<el-select v-model="queryParams.paramStatus" placeholder="请选择状态" clearable>
|
||||
<el-option label="正常" value="0"/>
|
||||
<el-option label="异常" value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:processParamMonitor:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="getList">刷新数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="monitorList" :row-class-name="tableRowClassName">
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName"/>
|
||||
<el-table-column label="参数编码" align="center" prop="paramCode"/>
|
||||
<el-table-column label="参数名称" align="center" prop="paramName"/>
|
||||
<el-table-column label="参数值" align="center" prop="paramValue">
|
||||
<template slot-scope="scope">
|
||||
<span :class="{'text-danger': scope.row.paramStatus === '1'}">{{ scope.row.paramValue }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="paramUnit" width="80"/>
|
||||
<el-table-column label="标准值" align="center" prop="standardValue"/>
|
||||
<el-table-column label="上限" align="center" prop="upperLimit" width="80"/>
|
||||
<el-table-column label="下限" align="center" prop="lowerLimit" width="80"/>
|
||||
<el-table-column label="状态" align="center" prop="paramStatus" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.paramStatus === '0' ? 'success' : 'danger'">
|
||||
{{ scope.row.paramStatus === '0' ? '正常' : '异常' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采集时间" align="center" prop="collectTime" width="160"/>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProcessParamMonitor } from "@/api/base/processParamMonitor";
|
||||
|
||||
export default {
|
||||
name: "ProcessParamMonitor",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
monitorList: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceCode: null,
|
||||
paramName: null,
|
||||
paramStatus: null,
|
||||
},
|
||||
refreshTimer: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.refreshTimer) {
|
||||
clearInterval(this.refreshTimer);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listProcessParamMonitor(this.queryParams).then(response => {
|
||||
this.monitorList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
tableRowClassName({ row }) {
|
||||
if (row.paramStatus === '1') {
|
||||
return 'warning-row';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/processParamMonitor/export', { ...this.queryParams }, `processParamMonitor_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.text-danger {
|
||||
color: #F56C6C;
|
||||
font-weight: bold;
|
||||
}
|
||||
::v-deep .warning-row {
|
||||
background-color: #FEF0F0 !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="queryParams.deviceCode" placeholder="请输入设备编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模具编码" prop="moldCode">
|
||||
<el-input v-model="queryParams.moldCode" placeholder="请输入模具编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="productCode">
|
||||
<el-input v-model="queryParams.productCode" placeholder="请输入产品编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次编码" prop="batchCode">
|
||||
<el-input v-model="queryParams.batchCode" placeholder="请输入批次编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="追溯时间">
|
||||
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:processParamTrace:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="traceList">
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName"/>
|
||||
<el-table-column label="模具编码" align="center" prop="moldCode"/>
|
||||
<el-table-column label="产品编码" align="center" prop="productCode"/>
|
||||
<el-table-column label="批次编码" align="center" prop="batchCode"/>
|
||||
<el-table-column label="模次" align="center" prop="moldCount" width="80"/>
|
||||
<el-table-column label="参数编码" align="center" prop="paramCode"/>
|
||||
<el-table-column label="参数名称" align="center" prop="paramName"/>
|
||||
<el-table-column label="参数值" align="center" prop="paramValue"/>
|
||||
<el-table-column label="单位" align="center" prop="paramUnit" width="80"/>
|
||||
<el-table-column label="追溯时间" align="center" prop="traceTime" width="160"/>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProcessParamTrace } from "@/api/base/processParamTrace";
|
||||
|
||||
export default {
|
||||
name: "ProcessParamTrace",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
traceList: [],
|
||||
dateRange: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceCode: null,
|
||||
moldCode: null,
|
||||
productCode: null,
|
||||
batchCode: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let params = { ...this.queryParams };
|
||||
if (this.dateRange && this.dateRange.length === 2) {
|
||||
params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
|
||||
}
|
||||
listProcessParamTrace(params).then(response => {
|
||||
this.traceList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/processParamTrace/export', { ...this.queryParams }, `processParamTrace_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="产品编码" prop="productCode">
|
||||
<el-input v-model="queryParams.productCode" placeholder="请输入产品编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编码" prop="orderCode">
|
||||
<el-input v-model="queryParams.orderCode" placeholder="请输入工单编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次编码" prop="batchCode">
|
||||
<el-input v-model="queryParams.batchCode" placeholder="请输入批次编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="deviceCode">
|
||||
<el-input v-model="queryParams.deviceCode" placeholder="请输入设备编码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="快照时间">
|
||||
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:processSnapshot:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="snapshotList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="快照编号" align="center" prop="snapshotCode" width="120"/>
|
||||
<el-table-column label="产品编码" align="center" prop="productCode"/>
|
||||
<el-table-column label="产品名称" align="center" prop="productName" show-overflow-tooltip/>
|
||||
<el-table-column label="工单编码" align="center" prop="orderCode"/>
|
||||
<el-table-column label="批次编码" align="center" prop="batchCode"/>
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode"/>
|
||||
<el-table-column label="工位编码" align="center" prop="stationCode"/>
|
||||
<el-table-column label="工序步骤" align="center" prop="processStep" width="80"/>
|
||||
<el-table-column label="工序名称" align="center" prop="processName"/>
|
||||
<el-table-column label="快照时间" align="center" prop="snapshotTime" width="160"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看参数</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<el-dialog title="工艺参数快照" :visible.sync="viewOpen" width="700px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="产品编码">{{ currentRow.productCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="产品名称">{{ currentRow.productName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工单编码">{{ currentRow.orderCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="批次编码">{{ currentRow.batchCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编码">{{ currentRow.deviceCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工位编码">{{ currentRow.stationCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工序步骤">{{ currentRow.processStep }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工序名称">{{ currentRow.processName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="快照时间" :span="2">{{ currentRow.snapshotTime }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="margin-top: 15px;">
|
||||
<h4>参数数据</h4>
|
||||
<pre style="max-height: 300px; overflow: auto; background: #f5f5f5; padding: 15px; border-radius: 4px;">{{ viewParamData }}</pre>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="viewOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProcessSnapshot, getProcessSnapshot } from "@/api/base/processSnapshot";
|
||||
|
||||
export default {
|
||||
name: "ProcessSnapshot",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
snapshotList: [],
|
||||
viewOpen: false,
|
||||
viewParamData: "",
|
||||
currentRow: {},
|
||||
dateRange: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
productCode: null,
|
||||
orderCode: null,
|
||||
batchCode: null,
|
||||
deviceCode: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let params = { ...this.queryParams };
|
||||
if (this.dateRange && this.dateRange.length === 2) {
|
||||
params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
|
||||
}
|
||||
listProcessSnapshot(params).then(response => {
|
||||
this.snapshotList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.snapshotId);
|
||||
},
|
||||
handleView(row) {
|
||||
this.currentRow = row;
|
||||
try {
|
||||
this.viewParamData = row.paramData ? JSON.stringify(JSON.parse(row.paramData), null, 2) : "暂无参数数据";
|
||||
} catch (e) {
|
||||
this.viewParamData = row.paramData || "暂无参数数据";
|
||||
}
|
||||
this.viewOpen = true;
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/processSnapshot/export', { ...this.queryParams }, `processSnapshot_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,297 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="追溯编号" prop="traceNo">
|
||||
<el-input v-model="queryParams.traceNo" placeholder="请输入追溯编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="queryParams.productCode" placeholder="请输入产品编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:qualityTrace:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:qualityTrace:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:qualityTrace:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:qualityTrace:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="qualityTraceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="追溯编号" align="center" prop="traceNo" />
|
||||
<el-table-column label="产品编号" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="工单编号" align="center" prop="workOrderNo" />
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="生产线" align="center" prop="productionLine" />
|
||||
<el-table-column label="工位编号" align="center" prop="stationCode" />
|
||||
<el-table-column label="检验单号" align="center" prop="inspectionNo" />
|
||||
<el-table-column label="检验类型" align="center" prop="inspectionType" />
|
||||
<el-table-column label="检验结果" align="center" prop="inspectionResult" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:qualityTrace:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:qualityTrace:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="追溯编号" prop="traceNo">
|
||||
<el-input v-model="form.traceNo" placeholder="请输入追溯编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编号" prop="workOrderNo">
|
||||
<el-input v-model="form.workOrderNo" placeholder="请输入工单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="batchNo">
|
||||
<el-input v-model="form.batchNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="productionDate">
|
||||
<el-date-picker clearable v-model="form.productionDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择生产日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产线" prop="productionLine">
|
||||
<el-select v-model="form.productionLine" placeholder="请选择生产线" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.productLineCode"
|
||||
:label="item.productLineName"
|
||||
:value="item.productLineCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工位" prop="stationCode">
|
||||
<el-select v-model="form.stationCode" placeholder="请选择工位" clearable filterable @change="handleStationChange">
|
||||
<el-option
|
||||
v-for="item in processStationList"
|
||||
:key="item.processCode"
|
||||
:label="item.processCode + ' - ' + item.processName"
|
||||
:value="item.processCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检验单号" prop="inspectionNo">
|
||||
<el-input v-model="form.inspectionNo" placeholder="请输入检验单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验类型" prop="inspectionType">
|
||||
<el-input v-model="form.inspectionType" placeholder="请输入检验类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-input v-model="form.inspectionResult" placeholder="请输入检验结果" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷编号" prop="defectCode">
|
||||
<el-input v-model="form.defectCode" placeholder="请输入缺陷编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷名称" prop="defectName">
|
||||
<el-input v-model="form.defectName" placeholder="请输入缺陷名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷数量" prop="defectQty">
|
||||
<el-input-number v-model="form.defectQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处理措施" prop="handlingMeasure">
|
||||
<el-input v-model="form.handlingMeasure" type="textarea" placeholder="请输入处理措施" />
|
||||
</el-form-item>
|
||||
<el-form-item label="责任人" prop="responsiblePerson">
|
||||
<el-input v-model="form.responsiblePerson" placeholder="请输入责任人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listQualityTrace, getQualityTrace, delQualityTrace, addQualityTrace, updateQualityTrace } from "@/api/base/qualityTrace";
|
||||
import { findProductLineList } from "@/api/base/productLine";
|
||||
import { listProcessStation } from "@/api/base/processStation";
|
||||
|
||||
export default {
|
||||
name: "QualityTrace",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
qualityTraceList: [],
|
||||
productLineList: [],
|
||||
processStationList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
traceNo: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
batchNo: null,
|
||||
productionLine: null,
|
||||
stationCode: null,
|
||||
inspectionNo: null,
|
||||
inspectionType: null,
|
||||
inspectionResult: null,
|
||||
defectCode: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
traceNo: [{ required: true, message: "追溯编号不能为空", trigger: "blur" }],
|
||||
productCode: [{ required: true, message: "产品编号不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadProductLineList();
|
||||
this.loadProcessStationList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listQualityTrace(this.queryParams).then(response => {
|
||||
this.qualityTraceList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
traceNo: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
batchNo: null,
|
||||
productionDate: null,
|
||||
productionLine: null,
|
||||
stationCode: null,
|
||||
stationName: null,
|
||||
inspectionNo: null,
|
||||
inspectionType: null,
|
||||
inspectionResult: null,
|
||||
defectCode: null,
|
||||
defectName: null,
|
||||
defectQty: null,
|
||||
handlingMeasure: null,
|
||||
responsiblePerson: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加品质质量追溯";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getQualityTrace(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.syncStationNameFromCode(this.form.stationCode);
|
||||
this.open = true;
|
||||
this.title = "修改品质质量追溯";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateQualityTrace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addQualityTrace(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除品质质量追溯编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delQualityTrace(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/qualityTrace/export', { ...this.queryParams }, `qualityTrace_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
loadProductLineList() {
|
||||
findProductLineList().then(response => {
|
||||
this.productLineList = response.data || [];
|
||||
});
|
||||
},
|
||||
loadProcessStationList() {
|
||||
listProcessStation().then(response => {
|
||||
this.processStationList = response.rows || [];
|
||||
this.syncStationNameFromCode(this.form.stationCode);
|
||||
});
|
||||
},
|
||||
handleStationChange(val) {
|
||||
const station = this.processStationList.find(item => item.processCode === val);
|
||||
this.form.stationName = station ? station.processName : '';
|
||||
},
|
||||
syncStationNameFromCode(code) {
|
||||
if (!code) {
|
||||
this.form.stationName = '';
|
||||
return;
|
||||
}
|
||||
const station = this.processStationList.find(item => item.processCode === code);
|
||||
this.form.stationName = station ? station.processName : '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="检验单号" prop="inspectionNo">
|
||||
<el-input v-model="queryParams.inspectionNo" placeholder="请输入检验单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="queryParams.productCode" placeholder="请输入产品编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:samplingInspection:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:samplingInspection:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:samplingInspection:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:samplingInspection:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="samplingInspectionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="检验单号" align="center" prop="inspectionNo" />
|
||||
<el-table-column label="产品编号" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="工单编号" align="center" prop="workOrderNo" />
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="批次数量" align="center" prop="batchQty" />
|
||||
<el-table-column label="样本数量" align="center" prop="sampleSize" />
|
||||
<el-table-column label="检验员" align="center" prop="inspector" />
|
||||
<el-table-column label="检验结果" align="center" prop="inspectionResult" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:samplingInspection:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:samplingInspection:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="检验单号" prop="inspectionNo">
|
||||
<el-input v-model="form.inspectionNo" placeholder="请输入检验单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编号" prop="workOrderNo">
|
||||
<el-input v-model="form.workOrderNo" placeholder="请输入工单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="batchNo">
|
||||
<el-input v-model="form.batchNo" placeholder="请输入批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次数量" prop="batchQty">
|
||||
<el-input-number v-model="form.batchQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抽样方案" prop="samplingPlanCode">
|
||||
<el-select v-model="form.samplingPlanCode" placeholder="请选择抽样方案" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in samplingPlanList"
|
||||
:key="item.planCode"
|
||||
:label="item.planCode + ' - ' + item.planName"
|
||||
:value="item.planCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="样本数量" prop="sampleSize">
|
||||
<el-input-number v-model="form.sampleSize" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验员" prop="inspector">
|
||||
<el-input v-model="form.inspector" placeholder="请输入检验员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验时间" prop="inspectionTime">
|
||||
<el-date-picker clearable v-model="form.inspectionTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择检验时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验结果" prop="inspectionResult">
|
||||
<el-input v-model="form.inspectionResult" placeholder="请输入检验结果" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合格数量" prop="qualifiedQty">
|
||||
<el-input-number v-model="form.qualifiedQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="不合格数量" prop="unqualifiedQty">
|
||||
<el-input-number v-model="form.unqualifiedQty" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接收数" prop="acceptNumber">
|
||||
<el-input-number v-model="form.acceptNumber" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="拒收数" prop="rejectNumber">
|
||||
<el-input-number v-model="form.rejectNumber" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷描述" prop="defectDescription">
|
||||
<el-input v-model="form.defectDescription" type="textarea" placeholder="请输入缺陷描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSamplingInspection, getSamplingInspection, delSamplingInspection, addSamplingInspection, updateSamplingInspection } from "@/api/base/samplingInspection";
|
||||
import { getSamplingPlanList } from "@/api/base/samplingPlan";
|
||||
|
||||
export default {
|
||||
name: "SamplingInspection",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
samplingInspectionList: [],
|
||||
samplingPlanList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inspectionNo: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
batchNo: null,
|
||||
inspector: null,
|
||||
inspectionResult: null,
|
||||
status: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
inspectionNo: [{ required: true, message: "检验单号不能为空", trigger: "blur" }],
|
||||
productCode: [{ required: true, message: "产品编号不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadSamplingPlanList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSamplingInspection(this.queryParams).then(response => {
|
||||
this.samplingInspectionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
inspectionNo: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
workOrderNo: null,
|
||||
batchNo: null,
|
||||
batchQty: null,
|
||||
samplingPlanCode: null,
|
||||
sampleSize: null,
|
||||
inspector: null,
|
||||
inspectionTime: null,
|
||||
inspectionResult: null,
|
||||
qualifiedQty: null,
|
||||
unqualifiedQty: null,
|
||||
acceptNumber: null,
|
||||
rejectNumber: null,
|
||||
defectDescription: null,
|
||||
status: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加抽样检验";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getSamplingInspection(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改抽样检验";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateSamplingInspection(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addSamplingInspection(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除抽样检验编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delSamplingInspection(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/samplingInspection/export', { ...this.queryParams }, `samplingInspection_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
loadSamplingPlanList() {
|
||||
getSamplingPlanList().then(response => {
|
||||
this.samplingPlanList = response.rows || [];
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="方案编号" prop="planCode">
|
||||
<el-input v-model="queryParams.planCode" placeholder="请输入方案编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称" prop="planName">
|
||||
<el-input v-model="queryParams.planName" placeholder="请输入方案名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:samplingPlan:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:samplingPlan:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:samplingPlan:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:samplingPlan:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="samplingPlanList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="方案编号" align="center" prop="planCode" />
|
||||
<el-table-column label="方案名称" align="center" prop="planName" />
|
||||
<el-table-column label="AQL标准" align="center" prop="aqlStandard" />
|
||||
<el-table-column label="检验水平" align="center" prop="inspectionLevel" />
|
||||
<el-table-column label="抽样类型" align="center" prop="samplingType" />
|
||||
<el-table-column label="批次范围" align="center" prop="batchRange" />
|
||||
<el-table-column label="样本数量" align="center" prop="sampleSize" />
|
||||
<el-table-column label="接收数" align="center" prop="acceptNumber" />
|
||||
<el-table-column label="拒收数" align="center" prop="rejectNumber" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:samplingPlan:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:samplingPlan:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="方案编号" prop="planCode">
|
||||
<el-input v-model="form.planCode" placeholder="请输入方案编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称" prop="planName">
|
||||
<el-input v-model="form.planName" placeholder="请输入方案名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="AQL标准" prop="aqlStandard">
|
||||
<el-input v-model="form.aqlStandard" placeholder="请输入AQL标准" />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验水平" prop="inspectionLevel">
|
||||
<el-input v-model="form.inspectionLevel" placeholder="请输入检验水平" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抽样类型" prop="samplingType">
|
||||
<el-input v-model="form.samplingType" placeholder="请输入抽样类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次范围" prop="batchRange">
|
||||
<el-input v-model="form.batchRange" placeholder="请输入批次范围" />
|
||||
</el-form-item>
|
||||
<el-form-item label="样本数量" prop="sampleSize">
|
||||
<el-input-number v-model="form.sampleSize" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接收数" prop="acceptNumber">
|
||||
<el-input-number v-model="form.acceptNumber" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="拒收数" prop="rejectNumber">
|
||||
<el-input-number v-model="form.rejectNumber" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSamplingPlan, getSamplingPlan, delSamplingPlan, addSamplingPlan, updateSamplingPlan } from "@/api/base/samplingPlan";
|
||||
|
||||
export default {
|
||||
name: "SamplingPlan",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
samplingPlanList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
planCode: null,
|
||||
planName: null,
|
||||
aqlStandard: null,
|
||||
inspectionLevel: null,
|
||||
samplingType: null,
|
||||
isFlag: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
planCode: [{ required: true, message: "方案编号不能为空", trigger: "blur" }],
|
||||
planName: [{ required: true, message: "方案名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSamplingPlan(this.queryParams).then(response => {
|
||||
this.samplingPlanList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
planCode: null,
|
||||
planName: null,
|
||||
aqlStandard: null,
|
||||
inspectionLevel: null,
|
||||
samplingType: null,
|
||||
batchRange: null,
|
||||
sampleSize: null,
|
||||
acceptNumber: null,
|
||||
rejectNumber: null,
|
||||
remark: null,
|
||||
isFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加抽样方案";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getSamplingPlan(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改抽样方案";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateSamplingPlan(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addSamplingPlan(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除抽样方案编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delSamplingPlan(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/samplingPlan/export', { ...this.queryParams }, `samplingPlan_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80">
|
||||
<el-form-item label="文档编号" prop="documentCode">
|
||||
<el-input v-model="queryParams.documentCode" placeholder="请输入文档编号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="文档名称" prop="documentName">
|
||||
<el-input v-model="queryParams.documentName" placeholder="请输入文档名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:standardDocument:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['base:standardDocument:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:standardDocument:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['base:standardDocument:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="standardDocumentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="文档编号" align="center" prop="documentCode" />
|
||||
<el-table-column label="文档名称" align="center" prop="documentName" />
|
||||
<el-table-column label="文档类型" align="center" prop="documentType" />
|
||||
<el-table-column label="产品编号" align="center" prop="productCode" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="版本号" align="center" prop="versionNo" />
|
||||
<el-table-column label="文档大小" align="center" prop="documentSize" />
|
||||
<el-table-column label="上传人" align="center" prop="uploader" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:standardDocument:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['base:standardDocument:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="文档编号" prop="documentCode">
|
||||
<el-input v-model="form.documentCode" placeholder="请输入文档编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文档名称" prop="documentName">
|
||||
<el-input v-model="form.documentName" placeholder="请输入文档名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文档类型" prop="documentType">
|
||||
<el-input v-model="form.documentType" placeholder="请输入文档类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input v-model="form.productCode" placeholder="请输入产品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="versionNo">
|
||||
<el-input v-model="form.versionNo" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文档路径" prop="documentPath">
|
||||
<el-input v-model="form.documentPath" placeholder="请输入文档路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文档大小" prop="documentSize">
|
||||
<el-input-number v-model="form.documentSize" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生效日期" prop="effectiveDate">
|
||||
<el-date-picker clearable v-model="form.effectiveDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择生效日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="失效日期" prop="expiryDate">
|
||||
<el-date-picker clearable v-model="form.expiryDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择失效日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStandardDocument, getStandardDocument, delStandardDocument, addStandardDocument, updateStandardDocument } from "@/api/base/standardDocument";
|
||||
|
||||
export default {
|
||||
name: "StandardDocument",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
standardDocumentList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
documentCode: null,
|
||||
documentName: null,
|
||||
documentType: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
status: null
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
documentCode: [{ required: true, message: "文档编号不能为空", trigger: "blur" }],
|
||||
documentName: [{ required: true, message: "文档名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStandardDocument(this.queryParams).then(response => {
|
||||
this.standardDocumentList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
objId: null,
|
||||
documentCode: null,
|
||||
documentName: null,
|
||||
documentType: null,
|
||||
productCode: null,
|
||||
productName: null,
|
||||
versionNo: null,
|
||||
documentPath: null,
|
||||
documentSize: null,
|
||||
uploader: null,
|
||||
uploadTime: null,
|
||||
effectiveDate: null,
|
||||
expiryDate: null,
|
||||
status: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.objId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加标准文档";
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const objId = row.objId || this.ids;
|
||||
getStandardDocument(objId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改标准文档";
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.objId != null) {
|
||||
updateStandardDocument(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addStandardDocument(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const objIds = row.objId || this.ids;
|
||||
this.$modal.confirm('是否确认删除标准文档编号为"' + objIds + '"的数据项?').then(function() {
|
||||
return delStandardDocument(objIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('base/standardDocument/export', { ...this.queryParams }, `standardDocument_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue