fix:检测项目更新
This commit is contained in:
parent
766b3d0704
commit
a7d02670d9
|
@ -13,7 +13,7 @@
|
||||||
:model="form"
|
:model="form"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
label-width="80px"
|
label-width="100px"
|
||||||
style="padding: 0 10px"
|
style="padding: 0 10px"
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
@ -25,6 +25,93 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="字段类型">
|
||||||
|
<el-select
|
||||||
|
v-model="form.field_type"
|
||||||
|
placeholder="字段类型"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="检验类型">
|
||||||
|
<el-select
|
||||||
|
v-model="form.tags"
|
||||||
|
placeholder="检验类型"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in tagsOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item label="物料系列标签">
|
||||||
|
<el-select
|
||||||
|
v-model="form.mcate_tags"
|
||||||
|
placeholder="物料系列标签"
|
||||||
|
clearable
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in mcateTagsOptions"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="选项">
|
||||||
|
<el-button icon="el-icon-circle-plus" text @click="addComponent('choices')">
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template
|
||||||
|
v-for="(item, $index) in form.choices"
|
||||||
|
:key="$index"
|
||||||
|
>
|
||||||
|
<el-col :md="7" :sm="10">
|
||||||
|
<el-form-item label-width="80px">
|
||||||
|
<el-input
|
||||||
|
v-model="form.choices[$index]"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="1" :sm="2">
|
||||||
|
<div style="text-align: center">
|
||||||
|
<el-button type="danger" icon="el-icon-remove" text @click="delComponent($index,'choices')">
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="描述">
|
<el-form-item label="描述">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -42,38 +129,6 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="标签">
|
|
||||||
<el-button type="primary" @click="addComponent">
|
|
||||||
添加
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<template
|
|
||||||
v-for="(item, $index) in form.tags"
|
|
||||||
:key="$index"
|
|
||||||
>
|
|
||||||
<el-col :md="11" :sm="20">
|
|
||||||
<el-form-item>
|
|
||||||
<el-input
|
|
||||||
v-model="form.tags[$index]"
|
|
||||||
clearable
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :md="1" :sm="2">
|
|
||||||
<div style="text-align: center">
|
|
||||||
<el-icon
|
|
||||||
color="red"
|
|
||||||
@click="delComponent($index)"
|
|
||||||
>
|
|
||||||
<CircleCloseFilled />
|
|
||||||
</el-icon>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer>
|
<el-footer>
|
||||||
|
@ -91,7 +146,9 @@ const defaultForm = {
|
||||||
name: "",
|
name: "",
|
||||||
description: "",
|
description: "",
|
||||||
sort: 1,
|
sort: 1,
|
||||||
tags: [""],
|
tags: [],
|
||||||
|
mcate_tags: [],
|
||||||
|
choices: [""],
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
emits: ["success", "closed"],
|
emits: ["success", "closed"],
|
||||||
|
@ -114,19 +171,36 @@ export default {
|
||||||
},
|
},
|
||||||
visible: false,
|
visible: false,
|
||||||
isSaveing: false,
|
isSaveing: false,
|
||||||
options: [],
|
options: [
|
||||||
|
{value:"input-number",name:"数字"},
|
||||||
|
{value:"input-text",name:"文字"},
|
||||||
|
{value:"select",name:"单选"},
|
||||||
|
{value:"selects",name:"多选"},
|
||||||
|
],
|
||||||
|
tagsOptions: [
|
||||||
|
{value:"first",name:"首件检验"},
|
||||||
|
{value:"prod",name:"成品检验"},
|
||||||
|
{value:"performance",name:"性能检验"},
|
||||||
|
],
|
||||||
|
mcateTagsOptions: [],
|
||||||
processOptions: [],
|
processOptions: [],
|
||||||
setFiltersVisible: false,
|
setFiltersVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {
|
||||||
|
this.getmcateTagsOptions();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addComponent() {
|
getmcateTagsOptions() {
|
||||||
this.form.tags.push("");
|
this.$API.mtm.material.cates.req().then((res) => {
|
||||||
|
this.mcateTagsOptions = res;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
delComponent(index) {
|
addComponent(type) {
|
||||||
this.form.tags.splice(index, 1);
|
this.form[type].push("");
|
||||||
console.log("this.form.tags:", this.form.tags);
|
},
|
||||||
|
delComponent(index,type) {
|
||||||
|
this.form[type].splice(index, 1);
|
||||||
},
|
},
|
||||||
//显示
|
//显示
|
||||||
open(mode = "add") {
|
open(mode = "add") {
|
||||||
|
|
Loading…
Reference in New Issue