|
@@ -76,7 +76,7 @@
|
|
<div style="color: black;">
|
|
<div style="color: black;">
|
|
{{item.codeName}}
|
|
{{item.codeName}}
|
|
</div>
|
|
</div>
|
|
- <i class="el-icon-close" @click.stop="handleDeleteItem(index)"></i>
|
|
|
|
|
|
+ <i class="el-icon-close" @click.stop="handleDeleteItem(item,index)"></i>
|
|
</div>
|
|
</div>
|
|
<div class="code-list">
|
|
<div class="code-list">
|
|
<div v-for="(item1,index) in item.codeValue" :key="index" class="code-item">
|
|
<div v-for="(item1,index) in item.codeValue" :key="index" class="code-item">
|
|
@@ -93,7 +93,7 @@
|
|
</div>
|
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
- <el-button type="primary" @click="handleConfirm" :style="{ background: 'rgb(37, 80, 162)', borderColor: 'rgb(37, 80, 162)' }">确认添加</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="handleConfirm" :style="{ background: 'rgb(37, 80, 162)', borderColor: 'rgb(37, 80, 162)' }">保存</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
@@ -101,6 +101,7 @@
|
|
:visible.sync="addDialogVisible"
|
|
:visible.sync="addDialogVisible"
|
|
width="30%"
|
|
width="30%"
|
|
append-to-body
|
|
append-to-body
|
|
|
|
+ close-on-click-modal="false"
|
|
>
|
|
>
|
|
<div slot="title" class="dialog-title">
|
|
<div slot="title" class="dialog-title">
|
|
<div>
|
|
<div>
|
|
@@ -122,7 +123,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="基础信息">
|
|
<el-form-item label="基础信息">
|
|
- <el-select v-model="addForm.codeValue" placeholder="请选择" multiple style="width: 100%;" @change="handleSelectCode">
|
|
|
|
|
|
+ <el-select v-model="addForm.codeValueList" placeholder="请选择" multiple style="width: 100%;" @change="handleSelectCode">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in basicOptions"
|
|
v-for="item in basicOptions"
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@@ -148,7 +149,7 @@ export default {
|
|
name: 'ConditionsSet',
|
|
name: 'ConditionsSet',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- visible: true,
|
|
|
|
|
|
+ visible: false,
|
|
paramList: [
|
|
paramList: [
|
|
{
|
|
{
|
|
paramName: '<0.75',
|
|
paramName: '<0.75',
|
|
@@ -169,7 +170,7 @@ export default {
|
|
addDialogVisible: false,
|
|
addDialogVisible: false,
|
|
addForm: {
|
|
addForm: {
|
|
codeName: '',
|
|
codeName: '',
|
|
- codeValue: [],
|
|
|
|
|
|
+ codeValueList: [],
|
|
codeValueName: '',
|
|
codeValueName: '',
|
|
codeNameId: ''
|
|
codeNameId: ''
|
|
},
|
|
},
|
|
@@ -180,15 +181,27 @@ export default {
|
|
basicOptions: [
|
|
basicOptions: [
|
|
{ value: '1', label: '矿渣硅酸盐水泥' },
|
|
{ value: '1', label: '矿渣硅酸盐水泥' },
|
|
{ value: '2', label: '普通酸盐水泥' },
|
|
{ value: '2', label: '普通酸盐水泥' },
|
|
- { value: '3', label: '普通酸盐水泥' },
|
|
|
|
|
|
+ { value: '3', label: '普通酸盐水泥' },
|
|
// 添加更多选项...
|
|
// 添加更多选项...
|
|
],
|
|
],
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- show() {
|
|
|
|
|
|
+ show(val) {
|
|
this.visible = true
|
|
this.visible = true
|
|
|
|
+ if(val.length > 0&&val[0].name) {
|
|
|
|
+ console.log(val,'val');
|
|
|
|
+ this.paramList = val.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ paramName: item.select + item.name,
|
|
|
|
+ codeList: []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ this.paramList = []
|
|
|
|
+ }
|
|
},
|
|
},
|
|
hide() {
|
|
hide() {
|
|
this.visible = false
|
|
this.visible = false
|
|
@@ -211,11 +224,7 @@ export default {
|
|
handleSelect(index) {
|
|
handleSelect(index) {
|
|
this.activeIndex = index
|
|
this.activeIndex = index
|
|
},
|
|
},
|
|
- handleSelectCode(value) {
|
|
|
|
- if( !value || value.length === 0) {
|
|
|
|
- this.addForm.codeValueName = '';
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ handleSelectCode(values) {
|
|
if (!values || values.length === 0) {
|
|
if (!values || values.length === 0) {
|
|
this.addForm.codeValueName = '';
|
|
this.addForm.codeValueName = '';
|
|
return;
|
|
return;
|
|
@@ -227,7 +236,8 @@ export default {
|
|
return option ? option.label : '';
|
|
return option ? option.label : '';
|
|
});
|
|
});
|
|
|
|
|
|
- this.addForm.codeValueName = selectedLabels.join(', ');
|
|
|
|
|
|
+ this.addForm.codeValueName = selectedLabels.join('/');
|
|
|
|
+ this.addForm.codeValue = values
|
|
},
|
|
},
|
|
handleSelectCodeName(value) {
|
|
handleSelectCodeName(value) {
|
|
if (!value) {
|
|
if (!value) {
|
|
@@ -235,15 +245,18 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.sampleOptions.forEach(option => {
|
|
this.sampleOptions.forEach(option => {
|
|
- if (option.label === value) {
|
|
|
|
|
|
+ if (option.value === value) {
|
|
this.addForm.codeName = option.label;
|
|
this.addForm.codeName = option.label;
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handleDeleteItem(){
|
|
|
|
-
|
|
|
|
|
|
+ handleDeleteItem(item, index) {
|
|
|
|
+ this.paramList[this.activeIndex].codeList.splice(index, 1)
|
|
|
|
+ this.$message.success('删除成功')
|
|
},
|
|
},
|
|
confirmAdd() {
|
|
confirmAdd() {
|
|
|
|
+ if (!this.addForm.codeName || !this.addForm.codeValue) return this.$message.error('请选择样品信息和基础信息')
|
|
this.paramList[this.activeIndex].codeList.push(
|
|
this.paramList[this.activeIndex].codeList.push(
|
|
{codeName: this.addForm.codeName,
|
|
{codeName: this.addForm.codeName,
|
|
codeValue: [
|
|
codeValue: [
|
|
@@ -256,7 +269,8 @@ export default {
|
|
codeValue: []
|
|
codeValue: []
|
|
}
|
|
}
|
|
this.$message.success('添加成功')
|
|
this.$message.success('添加成功')
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ //保存条件
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|