master
shaoyong 1 year ago
parent fa27045f50
commit b359a38763

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询检验节点维护列表
export function listCheckType(query) {
return request({
url: '/quality/checkType/list',
method: 'get',
params: query
});
}
// 查询检验节点维护详细
export function getCheckType(id) {
return request({
url: '/quality/checkType/' + id,
method: 'get'
});
}
// 新增检验节点维护
export function addCheckType(data) {
return request({
url: '/quality/checkType',
method: 'post',
data: data
});
}
// 修改检验节点维护
export function updateCheckType(data) {
return request({
url: '/quality/checkType',
method: 'put',
data: data
});
}
// 删除检验节点维护
export function delCheckType(id) {
return request({
url: '/quality/checkType/' + id,
method: 'delete'
});
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询人员列表
export function listMaterial(query) {
return request({
url: '/quality/material/userList',
method: 'get',
params: query
});
}
// 查询人员物料绑定详细
export function getMaterial(userCode) {
return request({
url: '/quality/material/' + userCode,
method: 'get'
});
}
// 新增人员物料绑定
export function addMaterial(data) {
return request({
url: '/quality/material',
method: 'post',
data: data
});
}
// 修改人员物料绑定
export function updateMaterial(data) {
return request({
url: '/quality/material',
method: 'put',
data: data
});
}
// 删除人员物料绑定
export function delMaterial(id) {
return request({
url: '/quality/material/' + id,
method: 'delete'
});
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询检验项目维护列表
export function listProject(query) {
return request({
url: '/quality/project/list',
method: 'get',
params: query
});
}
// 查询检验项目维护详细
export function getProject(id) {
return request({
url: '/quality/project/' + id,
method: 'get'
});
}
// 新增检验项目维护
export function addProject(data) {
return request({
url: '/quality/project',
method: 'post',
data: data
});
}
// 修改检验项目维护
export function updateProject(data) {
return request({
url: '/quality/project',
method: 'put',
data: data
});
}
// 删除检验项目维护
export function delProject(id) {
return request({
url: '/quality/project/' + id,
method: 'delete'
});
}

@ -0,0 +1,62 @@
import request from '@/utils/request'
// 查询用户物料关联列表
export function listProduct(query) {
return request({
url: '/quality/material/list',
method: 'get',
params: query
});
}
// 查询用户物料关联详细
export function getProduct(userCode) {
return request({
url: '/quality/material/' + userCode,
method: 'get'
});
}
// 新增用户物料关联
export function addProduct(data) {
return request({
url: '/quality/material',
method: 'post',
data: data
});
}
// 修改用户物料关联
export function updateProduct(data) {
return request({
url: '/quality/material',
method: 'put',
data: data
});
}
// 删除用户物料关联
export function delProduct(userCode) {
return request({
url: '/quality/material/' + userCode,
method: 'delete'
});
}
// 查询用户物料未关联列表
export function getListProduct(query) {
return request({
url: '/quality/material/getList',
method: 'get',
params: query
});
}
// 查询用户物料已关联列表
export function getRightList(query) {
return request({
url: '/quality/material/getRightList',
method: 'get',
params: query
});
}

@ -0,0 +1,300 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="流程编号" prop="order">
<el-input
v-model="queryParams.order"
placeholder="请输入流程编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="名称" prop="checkName">
<el-input
v-model="queryParams.checkName"
placeholder="请输入名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类型名称" prop="typeName">
<el-select v-model="form.typeName" placeholder="请输入类型名称" >
<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>
<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:checkType: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:checkType: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:checkType:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="checkTypeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="流程编号" align="center" type="index" width="100"/>
<el-table-column label="名称" align="center" prop="checkName" />
<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" 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:checkType:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['quality:checkType: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-row>
<el-col :span="15">
<el-form-item label="名称" prop="checkName">
<el-input v-model="form.checkName" placeholder="请输入名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item label="类型名称" prop="typeName">
<el-select v-model="form.typeCode" placeholder="请输入类型名称" >
<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-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>
</template>
<script>
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType";
export default {
name: "CheckType",
dicts: ["check_type"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
checkTypeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
order: null,
checkName: null,
typeCode: null,
typeName: null,
attr1: null,
factoryCode: null,
},
//
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询检验节点维护列表 */
getList() {
this.loading = true;
listCheckType(this.queryParams).then(response => {
this.checkTypeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
order: null,
checkName: null,
typeCode: null,
typeName: 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
getCheckType(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) {
updateCheckType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCheckType(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 delCheckType(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/checkType/export', {
...this.queryParams
}, `checkType_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,270 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="员工名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入员工名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
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="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="multiple"
@click="handleUpdate"
v-hasPermi="['quality:material:edit']"
>绑定</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表数据 -->
<el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="员工编号" align="center" prop="userId" />
<el-table-column label="姓名" align="center" prop="userName" />
<el-table-column label="联系方式" align="center" prop="phonenumber" />
<el-table-column label="邮箱" align="center" prop="email" />
<el-table-column label="绑定的检验物料" align="center" prop="materialNames" width="400" />
<el-table-column label="状态" align="center" prop="status" >
<template slot-scope="scope">
<span
v-if="scope.row.status === '0'"
>正常</span>
<span
v-if="scope.row.status === '1'"
>停用</span>
</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:material:edit']"
>绑定</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="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="员工编码" prop="userCodes">
<el-input v-model="form.userCodes" placeholder="请输入员工编码" />
</el-form-item>
<el-form-item label="员工名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入员工名称" />
</el-form-item>
</el-form>
<el-tabs type="border-card" v-if="form.userCodes != null">
<el-tab-pane label="关联物料">
<Userbind v-if="form.userCodes !=null" :optType="optType" :userCodes="form.userCodes"></Userbind>
</el-tab-pane>
</el-tabs>
<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 { listMaterial, getMaterial, delMaterial, addMaterial, updateMaterial } from "@/api/quality/material";
import Userbind from "./userbind.vue";
export default {
name: "Material",
components: {Userbind},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
materialList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userCode: null,
userName: null,
userCodes: null,
materialCode: null,
materialName: null,
materialNames: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
factoryCode: null,
},
//
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询人员物料绑定列表 */
getList() {
this.loading = true;
listMaterial(this.queryParams).then(response => {
this.materialList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
userCode: null,
userName: null,
userCodes: null,
materialCode: null,
materialName: null,
materialNames: null,
attr1: null,
attr2: null,
attr3: null,
attr4: 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.userCode)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加人员物料绑定";
},
/** 绑定按钮操作 */
handleUpdate(row) {
this.reset();
const userCodes = row.userCode || this.ids
this.form.userCodes = userCodes;
this.open = true;
this.title = "修改人员物料绑定";
this.optType = "edit";
// getMaterial(userCode).then(response => {
// });
},
/** 提交按钮 */
submitForm() {
this.open = false;
this.getList();
/* this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMaterial(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMaterial(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
}); */
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.userCode || this.ids;
this.$modal.confirm('是否确认删除人员物料绑定编号为"' + ids + '"的数据项?').then(function() {
return delMaterial(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/material/export', {
...this.queryParams
}, `material_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,269 @@
<template>
<div>
<el-input placeholder="请输入内容" clearable > </el-input>
<el-transfer v-model="rightList" :data="leftList" :titles="titles"
:filterable=false
@change="handleChange"
>
<!-- 左侧栏分页 -->
<el-button
type="text"
style="color:#606266"
v-if="leftLength != 0"
class="transfer-footer"
slot="left-footer"
size="small"
>{{ Ltotal }}</el-button>
<el-button
v-if="leftLength != 0"
class="transfer-footer"
slot="left-footer"
size="small"
@click="leftPageNumChange"
:disabled="LPageNum - 1 < 1"
>上一页</el-button>
<el-input
v-if="leftLength != 0"
v-model="LPageNum"
size="mini"
class="transfer-footer"
slot="left-footer"
:placeholder="LPageNum"
style="width: 67px;padding: 1px 3px"
disabled
></el-input>
<el-button
class="transfer-footer"
slot="left-footer"
size="small"
@click="leftAddPageNumChange"
v-if="leftLength != 0"
:disabled="LNextPage>LPages"
>下一页</el-button>
<!-- 右侧栏分页 -->
<el-button
type="text"
style="color:#606266"
v-if="rightLength != 0"
class="transfer-footer"
slot="right-footer"
size="small"
>{{ Rtotal }}</el-button>
<el-button
v-if="rightLength != 0"
class="transfer-footer"
slot="right-footer"
size="small"
@click="rightPageNumChange"
:disabled="RPageNum - 1 < 1"
>上一页</el-button>
<el-input
v-if="rightLength != 0"
v-model="RPageNum"
size="mini"
class="transfer-footer"
slot="right-footer"
:placeholder="RPageNum"
style="width: 43px"
></el-input>
<el-button
class="transfer-footer"
slot="right-footer"
size="small"
@click="rightAddPageNumChange"
v-if="rightLength != 0"
:disabled="RNextPage>RPages"
>下一页</el-button>
</el-transfer>
</div>
</template>
<script>
import { getListProduct,getRightList ,addProduct, updateProduct, getProduct, delProduct} from "@/api/quality/userbind";
export default {
name: "Userbind",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 线
routeproductList: [],
//
processList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userCodes: this.userCodes,
materialId: null,
materialCode: null,
materialName: null,
specification: null,
unitOfMeasure: null,
quantity: null,
productionTime: null,
timeUnitType: null,
},
//
form: {},
//--------------------->
leftList: [],
rightList: [],
titles:['未关联物料','已关联物料'],
//
Ltotal: "",
LPageNum: "1",
LPageSize: "20",
LNextPage: null,
LPages: null,
leftLength: null,
leftQueryParams: {
userCodes: this.userCodes,
pageNum: 1,
pageSize: 20
},
//
Rtotal: "",
RPageNum: "1",
RPageSize: "20",
RPages: null,
rightLength: null,
RNextPage: null,
rightQueryParams: {
userCodes: this.userCodes,
pageNum: 1,
pageSize: 20
},
};
},
props :{
userCodes: undefined,
optType: undefined
},
created() {
this.getList();
this.getRightListFun();
},
methods: {
/** 查询未分配产品列表 */
getList() {
this.loading = true;
getListProduct(this.leftQueryParams).then(response => {
this.LPages = Math.ceil(response.total/this.LPageSize)
this.leftList = response.rows;
this.Ltotal = response.total;
this.LPageNum = this.leftQueryParams.pageNum;
this.LNextPage = this.leftQueryParams.pageNum+1;
this.loading = false;
});
},
/**左边上一页**/
leftPageNumChange(){
this.leftQueryParams.pageNum = this.LPageNum-1;
this.loading = true;
this.getList();
this.getRightListFun();
},
/**左边下一页**/
leftAddPageNumChange(){
this.leftQueryParams.pageNum = this.LNextPage;
this.loading = true;
this.getList();
this.getRightListFun();
},
/** 查询已分配产品列表 -------------------------------*/
getRightListFun() {
this.loading = true;
getRightList(this.rightQueryParams).then(response => {
this.RPages = Math.ceil(response.total/this.RPageSize);
const dataright = [];
for(let i in response.rows){
// 穿
dataright.push(response.rows[i].key)
}
this.rightList = dataright;
this.Rtotal = response.total;
this.RPageNum = this.rightQueryParams.pageNum;
this.RNextPage = this.rightQueryParams.pageNum+1;
this.loading = false;
});
},
/**右边上一页**/
rightPageNumChange(){
this.rightQueryParams.pageNum = this.RPageNum-1;
this.loading = true;
this.getRightListFun();
},
/**右边下一页**/
rightAddPageNumChange(){
this.rightQueryParams.pageNum = this.RNextPage;
this.loading = true;
this.getRightListFun();
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
recordId: null,
userCodes: this.userCodes,
materialId: null,
materialCode: null,
materialName: null,
specification: null,
unitOfMeasure: null,
quantity: null,
productionTime: null,
timeUnitType: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
},
/** 提交按钮 */
handleChange(value, direction, movedKeys) {
if (this.queryParams.userCodes != null) {
this.queryParams.selectedValues = value;
addProduct(this.queryParams).then(response => {
this.$modal.msgSuccess("关联成功");
});
}
}
}
};
</script>
<style>
.el-transfer-panel {
width: 350px;
};
</style>

@ -0,0 +1,377 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<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="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" type="index" width="100"/>
<el-table-column label="检验规则名称" align="center" prop="ruleName" />
<el-table-column label="检验规则属性" align="center" prop="propertyCode" >
<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" />
<el-table-column label="检验工具" align="center" prop="checkTool" />
<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="checkStandard" />
<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: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 :span="15">
<el-form-item label="检验规则名称" prop="ruleName">
<el-input v-model="form.ruleName" placeholder="请输入检验规则名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item label="检验规则属性" prop="propertyCode">
<el-select v-model="form.propertyCode" placeholder="请选择检验规则属性" >
<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>
<template v-if="form.propertyCode === '0'">
<el-row>
<el-col :span="15">
<el-form-item label="检验标准" prop="checkStandard">
<el-input v-model="form.checkStandard" placeholder="请输入检验标准" />
</el-form-item>
</el-col>
</el-row>
</template>
<template v-if="form.propertyCode === '1'">
<el-row>
<el-col :span="15">
<el-form-item label="检验方式" prop="checkMode">
<el-input v-model="form.checkMode" placeholder="请输入检验方式" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<el-form-item label="检验工具" prop="checkTool">
<el-input v-model="form.checkTool" placeholder="请输入检验工具" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="15">
<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-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 { listProject, getProject, delProject, addProject, updateProject } from "@/api/quality/project";
export default {
name: "Project",
dicts: ["qc_rule_prop","unit"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
projectList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
orderNum: null,
ruleName: null,
propertyCode: null,
checkMode: null,
checkTool: null,
unitCode: null,
checkStandard: null,
attr1: null,
factoryCode: null,
},
//
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询检验项目维护列表 */
getList() {
this.loading = true;
listProject(this.queryParams).then(response => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
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
};
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
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`)
}
}
};
</script>
Loading…
Cancel
Save