Merge remote-tracking branch 'origin/master'

yangwl
wws 10 months ago
commit 1b6b8f6032

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询检验方案维护列表
export function listQcProjectType(query) {
return request({
url: '/quality/qcProjectType/list',
method: 'get',
params: query
});
}
// 查询检验方案维护详细
export function getQcProjectType(id) {
return request({
url: '/quality/qcProjectType/' + id,
method: 'get'
});
}
// 新增检验方案维护
export function addQcProjectType(data) {
return request({
url: '/quality/qcProjectType',
method: 'post',
data: data
});
}
// 修改检验方案维护
export function updateQcProjectType(data) {
return request({
url: '/quality/qcProjectType',
method: 'put',
data: data
});
}
// 删除检验方案维护
export function delQcProjectType(id) {
return request({
url: '/quality/qcProjectType/' + id,
method: 'delete'
});
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询来料抽样规则列表
export function listQcSampleRule(query) {
return request({
url: '/quality/qcSampleRule/list',
method: 'get',
params: query
});
}
// 查询来料抽样规则详细
export function getQcSampleRule(id) {
return request({
url: '/quality/qcSampleRule/' + id,
method: 'get'
});
}
// 新增来料抽样规则
export function addQcSampleRule(data) {
return request({
url: '/quality/qcSampleRule',
method: 'post',
data: data
});
}
// 修改来料抽样规则
export function updateQcSampleRule(data) {
return request({
url: '/quality/qcSampleRule',
method: 'put',
data: data
});
}
// 删除来料抽样规则
export function delQcSampleRule(id) {
return request({
url: '/quality/qcSampleRule/' + id,
method: 'delete'
});
}

@ -174,6 +174,20 @@ export const dynamicRoutes = [
}
]
},
{
path: '/qua/quality/qcProject-data',
component: Layout,
hidden: true,
permissions: ['quality:qcProjectType:edit'],
children: [
{
path: 'index/:projectType(\\w+)',
component: () => import('@/views/quality/qcProjectType/data'),
name: 'ProjectData',
meta: { title: '检验方案详情', activeMenu: '/quality/qcProjectType' }
}
]
},
{
path: '/monitor/job-log',
component: Layout,

@ -38,6 +38,19 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验方案" prop="projectType">
<el-select
v-model="queryParams.projectType"
placeholder="请选择检验方案"
clearable >
<el-option
v-for="item in ProjectTypeList"
:key="item.projectTypeCode"
:label="item.projectTypeName"
:value="item.projectTypeCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -87,6 +100,15 @@
v-hasPermi="['quality:project:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-document-copy"
size="mini"
@click="handleProjectType"
>检验方案</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -141,6 +163,20 @@
<!-- 添加或修改检验项目维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px" >
<el-row>
<el-col>
<el-form-item label="检验方案" prop="projectType">
<el-select v-model="form.projectType" placeholder="请选择检验方案" style="width:100%">
<el-option
v-for="item in ProjectTypeList"
:key="item.projectTypeCode"
:label="item.projectTypeName"
:value="item.projectTypeCode"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="检验规则名称" prop="ruleName">
@ -227,14 +263,19 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--检验方案维护弹窗-->
<ItemProjectType ref="itemProjectType" @get-projectType-list = "getProjectTypeList"></ItemProjectType>
</div>
</template>
<script>
import { listProject, getProject, delProject, addProject, updateProject } from "@/api/quality/project";
import ItemProjectType from "./projectType.vue";
import { listQcProjectType} from "@/api/quality/qcProjectType.js"
export default {
name: "Project",
components: {ItemProjectType},
dicts: ["qc_rule_prop","unit"],
data() {
return {
@ -256,6 +297,8 @@ export default {
title: "",
//
open: false,
//
ProjectTypeList: {},
//
queryParams: {
pageNum: 1,
@ -282,6 +325,7 @@ export default {
},
created() {
this.getList();
this.getProjectTypeList();
},
methods: {
/** 查询检验项目维护列表 */
@ -293,6 +337,11 @@ export default {
this.loading = false;
});
},
getProjectTypeList() {
listQcProjectType().then(response => {
this.ProjectTypeList = response.rows;
});
},
//
cancel() {
this.open = false;
@ -315,7 +364,8 @@ export default {
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null
delFlag: null,
projectType: null
};
this.resetForm("form");
},
@ -386,6 +436,9 @@ export default {
this.download('quality/project/export', {
...this.queryParams
}, `project_${new Date().getTime()}.xlsx`)
},
handleProjectType() {
this.$refs.itemProjectType.showFlag = true;
}
}
};

@ -0,0 +1,346 @@
<template>
<el-dialog
title="检验方案维护"
v-if="showFlag"
:visible.sync="showFlag"
:modal="false"
width="1000px"
>
<el-row :gutter="10">
<el-col :span="24" :xs="24">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
align="left"
>
<el-form-item label="检验方案编码">
<el-input
v-model="queryParams.projectTypeCode"
placeholder="检验方案编码"
clearable
style="width: 180px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检测项方案名称">
<el-input
v-model="queryParams.projectTypeName"
placeholder="检测项方案名称"
clearable
style="width: 180px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['quality:qcProjectType:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="multiple"
@click="handleUpdate"
v-hasPermi="['quality:qcProjectType: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="['quality:qcProjectType:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="itemList"
@selection-change="handleSelectionChange"
ref="myTable"
>
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column label="序号" align="left" type="index" width="100" />
<el-table-column
label="检测项方案编码"
align="left"
key="projectTypeCode"
prop="projectTypeCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="检测项方案名称"
align="left"
key="projectTypeName"
prop="projectTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['quality:project:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['quality:project: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-col>
</el-row>
<!-- 添加或修改检验方案对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="20">
<el-form-item label="检验方案编码" prop="projectTypeCode" >
<el-input
v-model="form.projectTypeCode"
placeholder="请输入检验方案编码"
:disabled = "editFlag"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
<el-form-item label="检验方案名称" prop="projectTypeName" >
<el-input
v-model="form.projectTypeName"
placeholder="请输入检验方案名称"
/>
</el-form-item>
</el-col>
</el-row>
</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 slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleDone"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
listQcProjectType,
getQcProjectType,
addQcProjectType,
updateQcProjectType,
delQcProjectType,
} from "@/api/quality/qcProjectType.js";
export default {
name: "itemProjectType",
data() {
return {
showFlag: false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
itemList: [],
open: false,
title: "",
editFlag: false,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label",
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
projectTypeCode: "",
projectTypeName: "",
},
//
form: {},
//
rules: {
projectTypeCode: [
{ required: true, message: "检验方案编码不能为空", trigger: "blur" }
],
projectTypeName: [
{ required: true, message: "检验方案名称不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询表格列表*/
getList() {
this.loading = true;
listQcProjectType(this.queryParams).then((response) => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
projectTypeCode: null,
projectTypeName: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
};
this.resetForm("form");
this.editFlag = false;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检验方案维护";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getQcProjectType(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改检验方案维护";
this.editFlag = true;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateQcProjectType(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addQcProjectType(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除检验方案维护编号为"' + ids + '"的数据项?')
.then(function () {
return delQcProjectType(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
handleDone() {
this.showFlag = false;
this.$emit('get-projectType-list');
}
},
};
</script>

@ -142,8 +142,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['quality:qcProduce:remove']"
>删除</el-button>-->
</el-col>
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"

@ -0,0 +1,507 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="检验规则名称" prop="ruleName">
<el-input
v-model="queryParams.ruleName"
placeholder="请输入检验规则名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验规则属性" prop="propertyCode">
<el-select
v-model="queryParams.propertyCode"
placeholder="请选择检验规则属性"
clearable >
<el-option
v-for="dict in dict.type.qc_rule_prop"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检验方式" prop="checkMode">
<el-input
v-model="queryParams.checkMode"
placeholder="请输入检验方式"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验工具" prop="checkTool">
<el-input
v-model="queryParams.checkTool"
placeholder="请输入检验工具"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['quality:project: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="['quality:project: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="['quality:project:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['quality:project:import']"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['quality:project:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检验规则编号" align="center" prop="orderNum" width="110"/>
<el-table-column label="检验规则名称" align="center" prop="ruleName" width="200" :show-overflow-tooltip="true"/>
<el-table-column label="检验规则属性" align="center" prop="propertyCode" width="100">
<template slot-scope="scope">
<dict-tag
:options="dict.type.qc_rule_prop"
:value="scope.row.propertyCode"
/>
</template>
</el-table-column>
<el-table-column label="检验方式" align="center" prop="checkMode" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="检验工具" align="center" prop="checkTool" />
<el-table-column label="检验标准" align="center" prop="checkStandard" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="单位" align="center" prop="unitCode" >
<template slot-scope="scope"><dict-tag :options="dict.type.unit" :value="scope.row.unitCode"/></template>
</el-table-column>
<el-table-column label="抽样方案" align="center" prop="samplePlan" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="合格判定" align="center" prop="judge" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['quality:project:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['quality:project: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px" >
<el-row>
<el-col>
<el-form-item label="检验方案" prop="projectType">
<el-select v-model="form.projectType" placeholder="请选择检验方案" style="width:100%" disabled>
<el-option
v-for="item in ProjectTypeList"
:key="item.projectTypeCode"
:label="item.projectTypeName"
:value="item.projectTypeCode"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="检验规则名称" prop="ruleName">
<el-input v-model="form.ruleName" placeholder="请输入检验规则名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="检验规则属性" prop="propertyCode">
<el-select v-model="form.propertyCode" placeholder="请选择检验规则属性" style="width:100%">
<el-option
v-for="dict in dict.type.qc_rule_prop"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="检验标准" prop="checkStandard">
<el-input type='textarea' v-model="form.checkStandard" placeholder="请输入检验标准" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="检验方式" prop="checkMode">
<el-input type='textarea' v-model="form.checkMode" placeholder="请输入检验方式" />
</el-form-item>
</el-col>
</el-row>
<template v-if="form.propertyCode === '1'">
<el-row>
<el-col>
<el-form-item label="检验工具" prop="checkTool">
<el-input type='textarea' v-model="form.checkTool" placeholder="请输入检验工具" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="单位" prop="unitCode">
<el-select v-model="form.unitCode" placeholder="请选择单位" >
<el-option
v-for="dict in dict.type.unit"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</template>
<el-row>
<el-col>
<el-form-item label="抽样方案" prop="samplePlan">
<el-input type='textarea' v-model="form.samplePlan" placeholder="抽样方案" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="缺陷等级" prop="defectLevel">
<el-input type='textarea' v-model="form.defectLevel" placeholder="请输入检验标准" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="合格判定" prop="judge">
<el-input type='textarea' v-model="form.judge" placeholder="合格判定" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 检测项目导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProject, getProject, delProject, addProject, updateProject } from "@/api/quality/project";
import { getToken } from "@/utils/auth";
import { listQcProjectType} from "@/api/quality/qcProjectType.js"
export default {
name: "ProjectData",
dicts: ["qc_rule_prop","unit"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
projectList: [],
//
title: "",
//
open: false,
projectType: null,
//
ProjectTypeList: {},
//
queryParams: {
pageNum: 1,
pageSize: 10,
orderNum: null,
ruleName: null,
propertyCode: null,
checkMode: null,
checkTool: null,
unitCode: null,
checkStandard: null,
attr1: null,
factoryCode: null,
projectType: null,
},
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: {
Authorization: "Bearer " + getToken(),
poolName: localStorage.getItem('USER_POOL_NAME_CURRENT'),
},
//
url: process.env.VUE_APP_BASE_API + "/quality/project/importData"
},
//
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
],
}
};
},
created() {
const projectType = this.$route.params && this.$route.params.projectType;
this.queryParams.projectType = projectType;
this.projectType = projectType;
this.getList();
this.getProjectTypeList();
},
methods: {
/** 查询检验项目维护列表 */
getList() {
this.loading = true;
listProject(this.queryParams).then(response => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getProjectTypeList() {
listQcProjectType().then(response => {
this.ProjectTypeList = response.rows;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
orderNum: null,
ruleName: null,
propertyCode: null,
checkMode: null,
checkTool: null,
unitCode: null,
checkStandard: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
projectType: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.form.projectType = this.projectType
this.open = true;
this.title = "添加检验项目维护";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getProject(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改检验项目维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateProject(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProject(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除检验项目维护编号为"' + ids + '"的数据项?').then(function() {
return delProject(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/project/export', {
...this.queryParams
}, `project_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "检测项目导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('quality/project/importTemplate', {
}, `user_template_${new Date().getTime()}.xlsx`)
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
}
}
};
</script>

@ -0,0 +1,277 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="检测项方案编号" prop="projectTypeCode">
<el-input
v-model="queryParams.projectTypeCode"
placeholder="请输入检测项方案编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检测项方案名称" prop="projectTypeName">
<el-input
v-model="queryParams.projectTypeName"
placeholder="请输入检测项方案名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['quality:qcProjectType: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="['quality:qcProjectType: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="['quality:qcProjectType: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="['quality:qcProjectType:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="qcProjectTypeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="检测项方案编号" align="center" prop="projectTypeCode" />
<el-table-column label="检测项方案名称" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<router-link :to="'/qua/quality/qcProject-data/index/' + scope.row.projectTypeCode" class="link-type">
<span>{{ scope.row.projectTypeName }}</span>
</router-link>
</template>
</el-table-column>
<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="['quality:qcProjectType:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['quality:qcProjectType: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="检测项方案编号" prop="projectTypeCode">
<el-input v-model="form.projectTypeCode" placeholder="请输入检测项方案编号" />
</el-form-item>
<el-form-item label="检测项方案名称" prop="projectTypeName">
<el-input v-model="form.projectTypeName" 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 { listQcProjectType, getQcProjectType, delQcProjectType, addQcProjectType, updateQcProjectType } from "@/api/quality/qcProjectType";
export default {
name: "QcProjectType",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
qcProjectTypeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
projectTypeCode: null,
projectTypeName: null,
attr1: null,
factoryCode: null,
},
//
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询检验方案维护列表 */
getList() {
this.loading = true;
listQcProjectType(this.queryParams).then(response => {
this.qcProjectTypeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
projectTypeCode: null,
projectTypeName: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加检验方案维护";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getQcProjectType(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改检验方案维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateQcProjectType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addQcProjectType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除检验方案维护编号为"' + ids + '"的数据项?').then(function() {
return delQcProjectType(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/qcProjectType/export', {
...this.queryParams
}, `qcProjectType_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,360 @@
<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="startValue">
<el-input
v-model="queryParams.startValue"
placeholder="请输入开始值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="结束值" prop="endValue">
<el-input
v-model="queryParams.endValue"
placeholder="请输入结束值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="抽样数量" prop="sampleQuality">
<el-input
v-model="queryParams.sampleQuality"
placeholder="请输入抽样数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验类型" prop="typeCode">
<el-select v-model="form.typeCode" placeholder="请选择检验类型" clearable style="width:100%">
<el-option
v-for="dict in dict.type.check_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检验类型子项目" prop="checkType">
<el-select v-model="form.checkType" placeholder="请选择检验类型子项目" clearable style="width:100%">
<el-option
v-for="item in checkTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['quality:qcSampleRule: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="['quality:qcSampleRule: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="['quality:qcSampleRule: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="['quality:qcSampleRule:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="qcSampleRuleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="开始值" align="center" prop="startValue" />
<el-table-column label="结束值" align="center" prop="endValue" />
<el-table-column label="抽样数量" align="center" prop="sampleQuality" />
<el-table-column label="检验类型" align="center" prop="typeCode" >
<template slot-scope="scope"><dict-tag :options="dict.type.check_type" :value="scope.row.typeCode"/></template>
</el-table-column>
<el-table-column label="检验类型子项目" align="center" prop="checkType">
<template slot-scope="scope">
{{ formatCheckType(scope.row.checkType) }}
</template>
</el-table-column>
<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="['quality:qcSampleRule:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['quality:qcSampleRule: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="开始值" prop="startValue">
<el-input v-model="form.startValue" placeholder="请输入开始值" />
</el-form-item>
<el-form-item label="结束值" prop="endValue">
<el-input v-model="form.endValue" placeholder="请输入检测项方案名称" />
</el-form-item>
<el-form-item label="抽样数量" prop="sampleQuality">
<el-input v-model="form.sampleQuality" placeholder="请输入抽样数量" />
</el-form-item>
<el-form-item label="检验类型" prop="typeCode">
<el-select v-model="form.typeCode" placeholder="请选择检验类型" style="width:100%">
<el-option
v-for="dict in dict.type.check_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检验类型子项目" prop="checkType">
<el-select v-model="form.checkType" placeholder="请选择检验类型子项目" style="width:100%">
<el-option
v-for="item in checkTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</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 { listQcSampleRule, getQcSampleRule, delQcSampleRule, addQcSampleRule, updateQcSampleRule } from "@/api/quality/qcSampleRule";
export default {
name: "QcSampleRule",
dicts: ["check_type"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
qcSampleRuleList: [],
//
title: "",
//
open: false,
checkTypeList: [
{
value: 'checkTypeCP',
label: '成品入库检验',
},
{
value: 'checkTypeLL',
label: '来料检验',
},
{
value: 'checkTypeSC',
label: '首件检验',
},
{
value: 'checkTypeSCXJ',
label: '过程巡检',
},
],
//
queryParams: {
pageNum: 1,
pageSize: 10,
startValue: null,
endValue: null,
attr1: null,
factoryCode: null,
sampleQuality: null,
checkType: null,
typeCode: null
},
//
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询来料抽样规则列表 */
getList() {
this.loading = true;
listQcSampleRule(this.queryParams).then(response => {
this.qcSampleRuleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
startValue: null,
endValue: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
sampleQuality: null,
checkType: null,
typeCode: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加来料抽样规则";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getQcSampleRule(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改来料抽样规则";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateQcSampleRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addQcSampleRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除来料抽样规则编号为"' + ids + '"的数据项?').then(function() {
return delQcSampleRule(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/qcSampleRule/export', {
...this.queryParams
}, `qcSampleRule_${new Date().getTime()}.xlsx`)
},
formatCheckType(checkType) {
const checkTypeBody = this.checkTypeList.find((item) => item.value === checkType);
return checkTypeBody ? checkTypeBody.label : '——';
}
}
};
</script>
Loading…
Cancel
Save