style:材料信息
Showing
1 changed file
with
22 additions
and
7 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-05-09 09:20:10 | 4 | * @LastEditTime: 2023-07-18 08:55:31 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <dialogBox title="新建材料信息" width="20%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit" | 7 | <dialogBox title="新建材料信息" width="20%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit" |
8 | :isFullscreen="false"> | 8 | :isFullscreen="false"> |
9 | <el-form :model="ruleForm" ref="ruleForm" label-width="70px"> | 9 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px"> |
10 | <el-row> | 10 | <el-row> |
11 | <el-col :span="24"> | 11 | <el-col :span="24"> |
12 | <el-form-item label="材料类型"> | 12 | <el-form-item label="材料类型" prop="cllx"> |
13 | <el-select v-model="ruleForm.cllx" class="width100" placeholder="请选择"> | 13 | <el-select v-model="ruleForm.cllx" class="width100" placeholder="请选择"> |
14 | <el-option v-for="item in dictData['A40']" :key="item.dcode" :label="item.dname" :value="item.dcode"> | 14 | <el-option v-for="item in dictData['A40']" :key="item.dcode" :label="item.dname" :value="item.dcode"> |
15 | </el-option> | 15 | </el-option> |
... | @@ -19,7 +19,7 @@ | ... | @@ -19,7 +19,7 @@ |
19 | </el-row> | 19 | </el-row> |
20 | <el-row :gutter="20"> | 20 | <el-row :gutter="20"> |
21 | <el-col :span="24"> | 21 | <el-col :span="24"> |
22 | <el-form-item label="材料名称"> | 22 | <el-form-item label="材料名称" prop="clmc"> |
23 | <el-input v-model="ruleForm.clmc"></el-input> | 23 | <el-input v-model="ruleForm.clmc"></el-input> |
24 | </el-form-item> | 24 | </el-form-item> |
25 | </el-col> | 25 | </el-col> |
... | @@ -41,7 +41,15 @@ | ... | @@ -41,7 +41,15 @@ |
41 | cllx: "", | 41 | cllx: "", |
42 | clmc: "", | 42 | clmc: "", |
43 | }, | 43 | }, |
44 | }; | 44 | rules: { |
45 | cllx: [ | ||
46 | { required: true, message: '请选择材料类型', trigger: 'change' } | ||
47 | ], | ||
48 | clmc: [ | ||
49 | { required: true, message: '请输入材料名称', trigger: 'blur' } | ||
50 | ] | ||
51 | } | ||
52 | } | ||
45 | }, | 53 | }, |
46 | computed: { | 54 | computed: { |
47 | ...mapGetters(["dictData"]), | 55 | ...mapGetters(["dictData"]), |
... | @@ -60,14 +68,21 @@ | ... | @@ -60,14 +68,21 @@ |
60 | } | 68 | } |
61 | }, | 69 | }, |
62 | handleSubmit () { | 70 | handleSubmit () { |
71 | debugger | ||
72 | this.$refs['ruleForm'].validate((valid) => { | ||
73 | if (valid) { | ||
63 | this.$parent.addSave(this.ruleForm); | 74 | this.$parent.addSave(this.ruleForm); |
64 | this.ruleForm = { | 75 | this.ruleForm = { |
65 | cllx: "", | 76 | cllx: "", |
66 | clmc: "", | 77 | clmc: "", |
67 | } | 78 | } |
68 | this.$emit("input", false); | 79 | this.$emit("input", false); |
69 | }, | 80 | } else { |
70 | }, | 81 | return false; |
82 | } | ||
83 | }) | ||
84 | } | ||
85 | } | ||
71 | }; | 86 | }; |
72 | </script> | 87 | </script> |
73 | <style scoped lang="scss"> | 88 | <style scoped lang="scss"> | ... | ... |
-
Please register or sign in to post a comment