检测模板添加检测项
This commit is contained in:
parent
4a022a1efe
commit
21f5d04eb7
44
src/api/mes/qc/templateindex.js
Normal file
44
src/api/mes/qc/templateindex.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询检测模板-检测项列表
|
||||||
|
export function listTemplateindex(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/qc/templateindex/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询检测模板-检测项详细
|
||||||
|
export function getTemplateindex(recordId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/qc/templateindex/' + recordId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增检测模板-检测项
|
||||||
|
export function addTemplateindex(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/qc/templateindex',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改检测模板-检测项
|
||||||
|
export function updateTemplateindex(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/qc/templateindex',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除检测模板-检测项
|
||||||
|
export function delTemplateindex(recordId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/qc/templateindex/' + recordId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
187
src/components/qcindexSelect/single.vue
Normal file
187
src/components/qcindexSelect/single.vue
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog title="物料产品选择"
|
||||||
|
v-if="showFlag"
|
||||||
|
:visible.sync="showFlag"
|
||||||
|
:modal= false
|
||||||
|
width="60%"
|
||||||
|
center
|
||||||
|
>
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||||
|
<el-form-item label="检测项类型" prop="indexType">
|
||||||
|
<el-radio-group v-model="queryParams.indexType" @change="handleQuery">
|
||||||
|
<el-radio-button v-for="dict in dict.type.mes_index_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
:value="dict.value"
|
||||||
|
>{{dict.label}}</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检测项名称" prop="indexName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.indexName"
|
||||||
|
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-table v-loading="loading" :data="qcindexList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
|
||||||
|
<el-table-column width="50" align="center" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio v-model="selectedIndexId" :label="scope.row.indexId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检测项编码" align="center" prop="indexCode" />
|
||||||
|
<el-table-column label="检测项名称" align="center" prop="indexName" />
|
||||||
|
<el-table-column label="检测项类型" align="center" prop="indexType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检测工具" align="center" prop="qcTool" />
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||||
|
<el-button @click="showFlag=false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listQcindex, getQcindex, delQcindex, addQcindex, updateQcindex } from "@/api/mes/qc/qcindex";
|
||||||
|
export default {
|
||||||
|
name: "QcindexSelect",
|
||||||
|
dicts: ['mes_index_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showFlag:false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
selectedIndexId: null,
|
||||||
|
selectedRows: undefined,
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 检测项表格数据
|
||||||
|
qcindexList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
indexCode: null,
|
||||||
|
indexName: null,
|
||||||
|
indexType: null,
|
||||||
|
qcTool: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询检测项列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listQcindex(this.queryParams).then(response => {
|
||||||
|
this.qcindexList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
indexId: null,
|
||||||
|
indexCode: null,
|
||||||
|
indexName: null,
|
||||||
|
indexType: null,
|
||||||
|
qcTool: null,
|
||||||
|
remark: null,
|
||||||
|
attr1: null,
|
||||||
|
attr2: null,
|
||||||
|
attr3: null,
|
||||||
|
attr4: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.autoGenFlag = false;
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.indexId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
handleCurrent(row){
|
||||||
|
if(row){
|
||||||
|
this.selectedRows = row;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRowDbClick(row){
|
||||||
|
if(row){
|
||||||
|
this.selectedRows = row;
|
||||||
|
this.$emit('onSelected',this.selectedRows);
|
||||||
|
this.showFlag = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 单选选中数据
|
||||||
|
handleRowChange(row) {
|
||||||
|
debugger;
|
||||||
|
if(row){
|
||||||
|
this.selectedRows = row;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//选中确认
|
||||||
|
confirmSelect(){
|
||||||
|
if(this.selectedIndexId ==null || this.selectedIndexId==0){
|
||||||
|
this.$notify({
|
||||||
|
title:'提示',
|
||||||
|
type:'warning',
|
||||||
|
message: '请至少选择一条数据!'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$emit('onSelected',this.selectedRows);
|
||||||
|
this.showFlag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -122,7 +122,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="物料名称" min-width="120" align="left" key="itemName" prop="itemName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
<el-table-column label="物料名称" min-width="120" align="left" key="itemName" prop="itemName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="规格型号" align="left" key="specification" prop="specification" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
<el-table-column label="规格型号" align="left" key="specification" prop="specification" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="单位" align="center" key="unitOfMeasure" prop="unitOfMeasure" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
<el-table-column label="单位" align="center" key="unitOfMeasure" prop="unitOfMeasure" v-if="columns[3].visible" :show-overflow-tooltip="true" >
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="物料/产品" align="center" key="itemOrProduct" prop="itemOrProduct" v-if="columns[4].visible" :show-overflow-tooltip="true" >
|
<el-table-column label="物料/产品" align="center" key="itemOrProduct" prop="itemOrProduct" v-if="columns[4].visible" :show-overflow-tooltip="true" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.mes_item_product" :value="scope.row.itemOrProduct"/>
|
<dict-tag :options="dict.type.mes_item_product" :value="scope.row.itemOrProduct"/>
|
||||||
@ -470,6 +471,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
|
this.getUnits();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询物料编码列表 */
|
/** 查询物料编码列表 */
|
||||||
@ -482,6 +484,11 @@ export default {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
getUnits(){
|
||||||
|
listAllUnitmeasure().then(response =>{
|
||||||
|
this.measureOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 查询分类下拉树结构 */
|
/** 查询分类下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
treeselect().then(response => {
|
treeselect().then(response => {
|
||||||
@ -555,9 +562,6 @@ export default {
|
|||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
listAllUnitmeasure().then(response =>{
|
|
||||||
this.measureOptions = response.data;
|
|
||||||
});
|
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
if(this.queryParams.itemTypeId != 0){
|
if(this.queryParams.itemTypeId != 0){
|
||||||
this.form.itemTypeId = this.queryParams.itemTypeId;
|
this.form.itemTypeId = this.queryParams.itemTypeId;
|
||||||
|
@ -85,7 +85,15 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="qctemplateList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="qctemplateList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="检测模板编号" align="center" prop="templateCode" />
|
<el-table-column label="检测模板编号" align="center" prop="templateCode" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="handleView(scope.row)"
|
||||||
|
v-hasPermi="['mes:qc:template:query']"
|
||||||
|
>{{scope.row.templateCode}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="检测模板名称" align="center" prop="templateName" />
|
<el-table-column label="检测模板名称" align="center" prop="templateName" />
|
||||||
<el-table-column label="检测种类" align="center" prop="qcTypesParam" >
|
<el-table-column label="检测种类" align="center" prop="qcTypesParam" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -187,6 +195,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-tabs type="border-card" v-if="form.templateId != null">
|
||||||
|
<el-tab-pane label="检测项">
|
||||||
|
<TemplateIndex ref="indexTab" :templateId="form.templateId" :optType="optType"></TemplateIndex>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
||||||
<el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
<el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
||||||
@ -199,9 +213,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listQctemplate, getQctemplate, delQctemplate, addQctemplate, updateQctemplate } from "@/api/mes/qc/qctemplate";
|
import { listQctemplate, getQctemplate, delQctemplate, addQctemplate, updateQctemplate } from "@/api/mes/qc/qctemplate";
|
||||||
import {genCode} from "@/api/system/autocode/rule"
|
import {genCode} from "@/api/system/autocode/rule"
|
||||||
|
import TemplateIndex from "./templateindex.vue"
|
||||||
export default {
|
export default {
|
||||||
name: "Qctemplate",
|
name: "Qctemplate",
|
||||||
dicts: ['sys_yes_no','mes_qc_type'],
|
dicts: ['sys_yes_no','mes_qc_type'],
|
||||||
|
components: {TemplateIndex},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//自动生成编码
|
//自动生成编码
|
||||||
|
352
src/views/mes/qc/qctemplate/templateindex.vue
Normal file
352
src/views/mes/qc/qctemplate/templateindex.vue
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="10" v-if="optType !='view'" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['mes:qc:templateindex: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="['mes:qc:templateindex: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="['mes:qc:templateindex:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="templateindexList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="检测项名称" align="center" prop="indexName" />
|
||||||
|
<el-table-column label="检测项类型" align="center" prop="indexType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="检测工具" align="center" prop="qcTool" />
|
||||||
|
<el-table-column label="检测方法" align="center" prop="checkMethod" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="标准值" align="center" prop="standerVal" />
|
||||||
|
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
|
||||||
|
<el-table-column label="误差上限" align="center" prop="thresholdMax" />
|
||||||
|
<el-table-column label="误差下限" align="center" prop="thresholdMin" />
|
||||||
|
<el-table-column label="操作" v-if="optType != 'view'" align="center" width="100px" 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="['mes:qc:templateindex:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mes:qc:templateindex: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="960px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="检测项" prop="indexId">
|
||||||
|
<el-input v-model="form.indexName" placeholder="请选择检测项" >
|
||||||
|
<el-button slot="append" @click="handleSelectIndex" icon="el-icon-search"></el-button>
|
||||||
|
</el-input>
|
||||||
|
<IndexSelect ref="indexSelect" @onSelected="onIndexSelected" ></IndexSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="检测工具" prop="qcTool">
|
||||||
|
<el-input v-model="form.qcTool" placeholder="请输入检测工具" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检测方法" prop="checkMethod">
|
||||||
|
<el-input v-model="form.checkMethod" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="标准值" prop="standerVal">
|
||||||
|
<el-input v-model="form.standerVal" placeholder="请输入标准值" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="单位" prop="unitOfMeasure">
|
||||||
|
<el-select v-model="form.unitOfMeasure" placeholder="请选择单位">
|
||||||
|
<el-option
|
||||||
|
v-for="item in measureOptions"
|
||||||
|
:key="item.measureCode"
|
||||||
|
:label="item.measureName"
|
||||||
|
:value="item.measureCode"
|
||||||
|
:disabled="item.enableFlag == 'N'"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="误差上限" prop="thresholdMax">
|
||||||
|
<el-input-number :min="0" v-model="form.thresholdMax" placeholder="请输入误差上限" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="误差下限" prop="thresholdMin">
|
||||||
|
<el-input-number :max="0" v-model="form.thresholdMin" placeholder="请输入误差下限" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="说明图" prop="docUrl">
|
||||||
|
<el-input v-model="form.docUrl" placeholder="请输入说明图" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm" v-else>确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listTemplateindex, getTemplateindex, delTemplateindex, addTemplateindex, updateTemplateindex } from "@/api/mes/qc/templateindex";
|
||||||
|
import IndexSelect from "@/components/qcindexSelect/single.vue";
|
||||||
|
import { listAllUnitmeasure} from "@/api/mes/md/unitmeasure";
|
||||||
|
export default {
|
||||||
|
name: "Templateindex",
|
||||||
|
dicts: ['mes_index_type'],
|
||||||
|
props:{
|
||||||
|
optType: null,
|
||||||
|
templateId: null
|
||||||
|
},
|
||||||
|
components:{IndexSelect},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 检测模板-检测项表格数据
|
||||||
|
templateindexList: [],
|
||||||
|
//单位选择
|
||||||
|
measureOptions:[],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
templateId: this.templateId,
|
||||||
|
indexId: null,
|
||||||
|
indexCode: null,
|
||||||
|
indexName: null,
|
||||||
|
indexType: null,
|
||||||
|
qcTool: null,
|
||||||
|
checkMethod: null,
|
||||||
|
standerVal: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
thresholdMax: null,
|
||||||
|
thresholdMin: null,
|
||||||
|
docUrl: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
templateId: [
|
||||||
|
{ required: true, message: "检测模板ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
indexId: [
|
||||||
|
{ required: true, message: "检测项不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getUnits();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询检测模板-检测项列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listTemplateindex(this.queryParams).then(response => {
|
||||||
|
this.templateindexList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getUnits(){
|
||||||
|
listAllUnitmeasure().then(response =>{
|
||||||
|
this.measureOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
recordId: null,
|
||||||
|
templateId: this.templateId,
|
||||||
|
indexId: null,
|
||||||
|
indexCode: null,
|
||||||
|
indexName: null,
|
||||||
|
indexType: null,
|
||||||
|
qcTool: null,
|
||||||
|
checkMethod: null,
|
||||||
|
standerVal: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
thresholdMax: null,
|
||||||
|
thresholdMin: null,
|
||||||
|
docUrl: null,
|
||||||
|
remark: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: 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.recordId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加检测模板-检测项";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const recordId = row.recordId || this.ids
|
||||||
|
getTemplateindex(recordId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改检测模板-检测项";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.recordId != null) {
|
||||||
|
updateTemplateindex(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addTemplateindex(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const recordIds = row.recordId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除检测模板-检测项编号为"' + recordIds + '"的数据项?').then(function() {
|
||||||
|
return delTemplateindex(recordIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
//选择检测项弹出框
|
||||||
|
handleSelectIndex(){
|
||||||
|
this.$refs.indexSelect.showFlag = true;
|
||||||
|
},
|
||||||
|
//弹框返回值
|
||||||
|
onIndexSelected(obj){
|
||||||
|
if(obj != undefined && obj != null){
|
||||||
|
this.form.indexId = obj.indexId;
|
||||||
|
this.form.indexCode = obj.indexCode;
|
||||||
|
this.form.indexName = obj.indexName;
|
||||||
|
this.form.indexType = obj.indexType;
|
||||||
|
this.form.qcTool = obj.qcTool;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user