From cd84a28754fc1b3fadb7027245333d6d3ff330a3 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Mon, 19 Aug 2024 17:22:53 +0800
Subject: [PATCH] bug修改
---
src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue | 85 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 83 insertions(+), 2 deletions(-)
diff --git a/src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue b/src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue
index 4536556..d91469c 100644
--- a/src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue
+++ b/src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue
@@ -34,10 +34,35 @@
<el-input v-model.trim="state.form.cas" placeholder="请输入CAS"></el-input>
</el-form-item>
<el-form-item label="试剂类型:" prop="productType">
- <el-input v-model.trim="state.form.productType" placeholder="请输入试剂类型"></el-input>
+ <el-select
+ v-model="state.form.productType"
+ placeholder="请选择试剂类型"
+ clearable
+ style="width: 100%"
+ >
+ <el-option
+ v-for="dict in state.hazmatTypeList"
+ :key="dict.id"
+ :label="dict.name"
+ :value="dict.name"
+ />
+ </el-select>
</el-form-item>
<el-form-item label="危险性质:" prop="productCharacter">
- <el-input v-model.trim="state.form.productCharacter" placeholder="请输入危险性质"></el-input>
+ <el-select
+ v-model="state.characterList"
+ placeholder="请选择危险性质"
+ clearable
+ multiple
+ style="width: 100%"
+ >
+ <el-option
+ v-for="dict in state.hazmatCharacterList"
+ :key="dict.id"
+ :label="dict.name"
+ :value="dict.name"
+ />
+ </el-select>
</el-form-item>
<el-form-item label="供应商:" prop="supplier">
<el-input v-model.trim="state.form.supplier" placeholder="请输入供应商"></el-input>
@@ -167,6 +192,7 @@
threshold: null,
kind: ''
},
+ characterList: [],
formRules:{
name: [{ required: true, trigger: "blur", message: '请输入危化品名称', }],
cas: [{ required: true, message: '请输入cas', trigger: 'blur' }],
@@ -234,14 +260,66 @@
name: '其他'
},
],
+ hazmatTypeList: [
+ {
+ id: 0,
+ name: '耗材'
+ },
+ {
+ id: 1,
+ name: '液态'
+ },
+ {
+ id: 2,
+ name: '液体'
+ },
+ {
+ id: 3,
+ name: '气态'
+ },
+ {
+ id: 4,
+ name: '固态'
+ },
+ ],
+ hazmatCharacterList: [
+ {
+ id: 0,
+ name: '腐蚀品'
+ },
+ {
+ id: 1,
+ name: '氧化品'
+ },
+ {
+ id: 2,
+ name: '有毒品'
+ },
+ {
+ id: 3,
+ name: '易燃品'
+ },
+ {
+ id: 4,
+ name: '非易燃品'
+ },
+ ],
unitOptions: [
{
value: 'g',
label: 'g',
},
{
+ value: 'mg',
+ label: 'mg',
+ },
+ {
value: 'ml',
label: 'ml',
+ },
+ {
+ value: 'l',
+ label: 'l',
},
]
})
@@ -252,12 +330,14 @@
title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '' ;
if(type === 'edit' || type === 'distribute') {
state.form = value;
+ state.characterList = state.form.productCharacter.split(',')
startUsername.value = value.productSn
}
dialogVisible.value = true;
}
const onSubmit = async () => {
+ state.form.productCharacter = state.characterList.join(",")
const valid = await busRef.value.validate();
if(valid){
if(title.value === '新增'){
@@ -319,6 +399,7 @@
threshold: null,
kind: ''
}
+ state.characterList = []
}
defineExpose({
openDialog
--
Gitblit v1.9.2