Merge remote-tracking branch 'origin/master'
commit
a12efc2814
@ -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,70 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
// 检查阈值预警
|
||||
export function checkThresholdAlert() {
|
||||
return request({
|
||||
url: '/base/processAlert/checkThreshold',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量标记预警为已处理
|
||||
export function batchMarkAsProcessed(data) {
|
||||
return request({
|
||||
url: '/base/processAlert/batchMarkProcessed',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -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,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,64 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取完整的看板数据
|
||||
export function getDashboardData(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/all',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取设备状态统计
|
||||
export function getDeviceStatusSummary(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/device-status',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取任务完成情况
|
||||
export function getTaskCompletionSummary(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/task-completion',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取OEE数据
|
||||
export function getOeeSummary(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/oee',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取利用率统计
|
||||
export function getUtilizationSummary(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/utilization',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取品质数据
|
||||
export function getQualitySummary(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/quality',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取安灯事件统计
|
||||
export function getAndonEventSummary(productLineCode) {
|
||||
return request({
|
||||
url: '/production/andon/dashboard/andon-events',
|
||||
method: 'get',
|
||||
params: { productLineCode }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询周排产计划列表
|
||||
export function listPlan(query) {
|
||||
return request({
|
||||
url: '/production/plan/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询周排产计划详细
|
||||
export function getPlan(id) {
|
||||
return request({
|
||||
url: '/production/plan/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增周排产计划
|
||||
export function addPlan(data) {
|
||||
return request({
|
||||
url: '/production/plan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改周排产计划
|
||||
export function updatePlan(data) {
|
||||
return request({
|
||||
url: '/production/plan',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除周排产计划
|
||||
export function delPlan(id) {
|
||||
return request({
|
||||
url: '/production/plan/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量更新周排产计划
|
||||
export function batchUpdatePlan(data) {
|
||||
return request({
|
||||
url: '/production/plan/batchUpdate',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询子件物料周需求列表
|
||||
export function listReq(query) {
|
||||
return request({
|
||||
url: '/production/req/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询子件物料周需求详细
|
||||
export function getReq(id) {
|
||||
return request({
|
||||
url: '/production/req/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增子件物料周需求
|
||||
export function addReq(data) {
|
||||
return request({
|
||||
url: '/production/req',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改子件物料周需求
|
||||
export function updateReq(data) {
|
||||
return request({
|
||||
url: '/production/req',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除子件物料周需求
|
||||
export function delReq(id) {
|
||||
return request({
|
||||
url: '/production/req/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量更新子件物料周需求
|
||||
export function batchUpdateReq(data) {
|
||||
return request({
|
||||
url: '/production/req/batchUpdate',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -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,258 @@
|
||||
<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="primary" plain icon="el-icon-refresh" size="mini" @click="handleCheckThreshold" v-hasPermi="['base:processAlert:add']">检查预警</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-check" size="mini" :disabled="multiple" @click="handleBatchMarkProcessed" v-hasPermi="['base:processAlert:edit']">批量标记已处理</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: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" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<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, checkThresholdAlert, batchMarkAsProcessed } from "@/api/base/processAlert";
|
||||
|
||||
export default {
|
||||
name: "ProcessAlert",
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
alertList: [],
|
||||
ids: [],
|
||||
multiple: true,
|
||||
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();
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.alertId);
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
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`);
|
||||
},
|
||||
handleCheckThreshold() {
|
||||
this.$modal.confirm('是否检查参数阈值并生成预警?').then(() => {
|
||||
checkThresholdAlert().then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList();
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
handleBatchMarkProcessed() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgWarning("请选择要处理的预警");
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm('确认将选中的 ' + this.ids.length + ' 条预警标记为已处理?').then(() => {
|
||||
batchMarkAsProcessed(this.ids).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList();
|
||||
});
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .warning-row {
|
||||
background-color: #FDF6EC !important;
|
||||
}
|
||||
::v-deep .danger-row {
|
||||
background-color: #FEF0F0 !important;
|
||||
}
|
||||
</style>
|
||||
@ -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