Commit 08dbd69e authored by zhuli's avatar zhuli

# ipqc模板配置更新

parent 8a66b8a5
...@@ -195,9 +195,9 @@ ...@@ -195,9 +195,9 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-tabs type="border-card" v-if="form.templateId != null"> <el-tabs type="border-card" v-if="form.id != null">
<el-tab-pane label="检测项"> <el-tab-pane label="检测项">
<TemplateIndex ref="indexTab" :templateId="form.templateId" :optType="optType"></TemplateIndex> <TemplateIndex ref="indexTab" :templateId="form.id" :optType="optType"></TemplateIndex>
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane label="物料产品"> <!-- <el-tab-pane label="物料产品">
<TemplateProduct ref="productTab" :templateId="form.templateId" :optType="optType"></TemplateProduct> <TemplateProduct ref="productTab" :templateId="form.templateId" :optType="optType"></TemplateProduct>
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
templateId: null, id: null,
templateCode: null, templateCode: null,
templateName: null, templateName: null,
qcTypesParam: [], qcTypesParam: [],
...@@ -320,7 +320,7 @@ export default { ...@@ -320,7 +320,7 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.templateId) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
...@@ -334,7 +334,7 @@ export default { ...@@ -334,7 +334,7 @@ export default {
// 查询明细按钮操作 // 查询明细按钮操作
handleView(row){ handleView(row){
this.reset(); this.reset();
const templateId = row.templateId || this.ids; const templateId = row.id || this.ids;
getQctemplate(templateId).then(response => { getQctemplate(templateId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
...@@ -345,7 +345,7 @@ export default { ...@@ -345,7 +345,7 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const templateId = row.templateId || this.ids const templateId = row.id || this.ids
getQctemplate(templateId).then(response => { getQctemplate(templateId).then(response => {
debugger; debugger;
this.form = response.data; this.form = response.data;
...@@ -358,7 +358,7 @@ export default { ...@@ -358,7 +358,7 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.templateId != null) { if (this.form.id != null) {
updateQctemplate(this.form).then(response => { updateQctemplate(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
...@@ -376,7 +376,7 @@ export default { ...@@ -376,7 +376,7 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const templateIds = row.templateId || this.ids; const templateIds = row.id || this.ids;
this.$modal.confirm('是否确认删除检测模板编号为"' + templateIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除检测模板编号为"' + templateIds + '"的数据项?').then(function() {
return delQctemplate(templateIds); return delQctemplate(templateIds);
}).then(() => { }).then(() => {
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:qc:qctemplate:add']" v-hasPermi="['mes:qc:qctemplate:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:qc:qctemplate:edit']" v-hasPermi="['mes:qc:qctemplate:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -31,15 +33,16 @@ ...@@ -31,15 +33,16 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:qc:qctemplate:remove']" v-hasPermi="['mes:qc:qctemplate:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="templateindexList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="templateindexList" @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="indexName" /> <el-table-column label="检测项名称" align="center" prop="indexName"/>
<el-table-column label="检测项类型" align="center" prop="indexType" > <el-table-column label="检测项类型" align="center" prop="indexType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/> <dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/>
</template> </template>
...@@ -50,13 +53,14 @@ ...@@ -50,13 +53,14 @@
<span v-if="scope.row.inputType==2">选择框</span> <span v-if="scope.row.inputType==2">选择框</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检测工具" align="center" prop="qcTool" /> <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="checkMethod" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="标准值" align="center" prop="standerVal" /> <!-- <el-table-column label="标准值" align="center" prop="standerVal" />
<el-table-column label="单位" align="center" prop="unitOfMeasure" /> <el-table-column label="单位" align="center" prop="unitOfMeasure" />
<el-table-column label="误差上限" align="center" prop="thresholdMax" /> <el-table-column label="误差上限" align="center" prop="thresholdMax" />
<el-table-column label="误差下限" align="center" prop="thresholdMin" /> --> <el-table-column label="误差下限" align="center" prop="thresholdMin" /> -->
<el-table-column label="操作" v-if="optType != 'view'" align="center" width="150px" class-name="small-padding fixed-width"> <el-table-column label="操作" v-if="optType != 'view'" align="center" width="150px"
class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -64,14 +68,16 @@ ...@@ -64,14 +68,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:qc:qctemplate:edit']" v-hasPermi="['mes:qc:qctemplate:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:qc:qctemplate:remove']" v-hasPermi="['mes:qc:qctemplate:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -90,51 +96,53 @@ ...@@ -90,51 +96,53 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检测项" prop="indexId"> <el-form-item label="检测项" prop="indexId">
<el-input v-model="form.indexName" placeholder="请选择检测项" > <el-input v-model="form.indexName" placeholder="请选择检测项">
<el-button slot="append" @click="handleSelectIndex" icon="el-icon-search"></el-button> <el-button slot="append" @click="handleSelectIndex" icon="el-icon-search"></el-button>
</el-input> </el-input>
<IndexSelect ref="indexSelect" @onSelected="onIndexSelected" ></IndexSelect> <IndexSelect ref="indexSelect" @onSelected="onIndexSelected"></IndexSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检测工具" prop="qcTool"> <el-form-item label="检测工具" prop="qcTool">
<el-input v-model="form.qcTool" placeholder="请输入检测工具" /> <el-input v-model="form.qcTool" placeholder="请输入检测工具"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="检测要求" prop="checkMethod"> <el-form-item label="检测要求" prop="checkMethod">
<el-input v-model="form.checkMethod" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.checkMethod" type="textarea" placeholder="请输入内容"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="form.inputType == 2"> <el-row v-if="form.inputType == 2" align="center">
<el-col :span="24"> <el-col :span="20">
<!-- <el-form-item label="选择框值" prop="selectValues"> <!-- <el-form-item label="选择框值" prop="selectValues">
<el-input v-model="form.selectValues" type="textarea" placeholder="请输入下拉选择框内容,格式为:[{&quot;label&quot;:&quot;显式值&quot;,&quot;value&quot;:&quot;存储值&quot;}]" /> <el-input v-model="form.selectValues" type="textarea" placeholder="请输入下拉选择框内容,格式为:[{&quot;label&quot;:&quot;显式值&quot;,&quot;value&quot;:&quot;存储值&quot;}]" />
</el-form-item> --> </el-form-item> -->
<el-table :data="form.selectValues" style="margin-bottom:20px;"> <el-table :data="form.selectValues" align="right" style="width: 100%">
<el-table-column label="参数值" align="center"> <el-table-column label="参数值" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.name" placeholder=""></el-input> <el-input v-model="scope.row.name" placeholder=""></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" align="left" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="form.selectValues.splice(scope.$index, 1)" @click="form.selectValues.splice(scope.$index, 1)"
>删除</el-button> >删除
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-plus" icon="el-icon-plus"
v-if="scope.$index === form.selectValues.length -1" v-if="scope.$index === form.selectValues.length -1"
@click="form.selectValues.push({name: ''})" @click="form.selectValues.push({name: ''})"
>新增</el-button> >新增
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -175,14 +183,14 @@ ...@@ -175,14 +183,14 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="说明图" prop="docUrl"> <el-form-item label="说明图" prop="docUrl">
<el-input v-model="form.docUrl" placeholder="请输入说明图" /> <el-input v-model="form.docUrl" placeholder="请输入说明图"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -197,17 +205,24 @@ ...@@ -197,17 +205,24 @@
</template> </template>
<script> <script>
import { listTemplateindex, getTemplateindex, delTemplateindex, addTemplateindex, updateTemplateindex } from "@/api/mes/qc/templateindex"; import {
listTemplateindex,
getTemplateindex,
delTemplateindex,
addTemplateindex,
updateTemplateindex
} from "@/api/mes/qc/templateindex";
import IndexSelect from "@/components/qcindexSelect/single.vue"; import IndexSelect from "@/components/qcindexSelect/single.vue";
import { listAllUnitmeasure} from "@/api/mes/md/unitmeasure"; import {listAllUnitmeasure} from "@/api/mes/md/unitmeasure";
export default { export default {
name: "Templateindex", name: "Templateindex",
dicts: ['mes_index_type'], dicts: ['mes_index_type'],
props:{ props: {
optType: null, optType: null,
templateId: null templateId: null
}, },
components:{IndexSelect}, components: {IndexSelect},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -225,12 +240,12 @@ export default { ...@@ -225,12 +240,12 @@ export default {
// 检测模板-检测项表格数据 // 检测模板-检测项表格数据
templateindexList: [], templateindexList: [],
//单位选择 //单位选择
measureOptions:[], measureOptions: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
inputTypeOptions: [{"label":"输入框","value":1},{"label":"选择框","value":2}], inputTypeOptions: [{"label": "输入框", "value": 1}, {"label": "选择框", "value": 2}],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -254,10 +269,10 @@ export default { ...@@ -254,10 +269,10 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
templateId: [ templateId: [
{ required: true, message: "检测模板ID不能为空", trigger: "blur" } {required: true, message: "检测模板ID不能为空", trigger: "blur"}
], ],
indexId: [ indexId: [
{ required: true, message: "检测项不能为空", trigger: "blur" } {required: true, message: "检测项不能为空", trigger: "blur"}
], ],
} }
}; };
...@@ -276,8 +291,8 @@ export default { ...@@ -276,8 +291,8 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getUnits(){ getUnits() {
listAllUnitmeasure().then(response =>{ listAllUnitmeasure().then(response => {
this.measureOptions = response.data; this.measureOptions = response.data;
}); });
}, },
...@@ -323,7 +338,7 @@ export default { ...@@ -323,7 +338,7 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
...@@ -349,7 +364,9 @@ export default { ...@@ -349,7 +364,9 @@ export default {
if (valid) { if (valid) {
const params = Object.assign({}, this.form) const params = Object.assign({}, this.form)
params.selectValues = JSON.stringify(this.form.selectValues) params.selectValues = JSON.stringify(this.form.selectValues)
if (this.form.recordId != null) { // this.form.templateId = this.templateId;
console.log(this.form)
if (this.form.id != null) {
updateTemplateindex(params).then(response => { updateTemplateindex(params).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
...@@ -368,20 +385,21 @@ export default { ...@@ -368,20 +385,21 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const recordIds = row.id || this.ids; const recordIds = row.id || this.ids;
this.$modal.confirm('是否确认删除检测模板-检测项编号为"' + recordIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除检测模板-检测项编号为"' + recordIds + '"的数据项?').then(function () {
return delTemplateindex(recordIds); return delTemplateindex(recordIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
//选择检测项弹出框 //选择检测项弹出框
handleSelectIndex(){ handleSelectIndex() {
this.$refs.indexSelect.showFlag = true; this.$refs.indexSelect.showFlag = true;
}, },
//弹框返回值 //弹框返回值
onIndexSelected(obj){ onIndexSelected(obj) {
if(obj != undefined && obj != null){ if (obj != undefined && obj != null) {
this.form.indexId = obj.indexId; this.form.indexId = obj.indexId;
this.form.indexCode = obj.indexCode; this.form.indexCode = obj.indexCode;
this.form.indexName = obj.indexName; this.form.indexName = obj.indexName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment