引导页新建自然幢表单验证
Showing
1 changed file
with
26 additions
and
21 deletions
... | @@ -95,26 +95,19 @@ | ... | @@ -95,26 +95,19 @@ |
95 | </el-tab-pane> | 95 | </el-tab-pane> |
96 | <el-tab-pane class="eltabspane" label="宗海" name="zh">宗海</el-tab-pane> | 96 | <el-tab-pane class="eltabspane" label="宗海" name="zh">宗海</el-tab-pane> |
97 | <el-tab-pane class="eltabspane" label="自然幢" name="zrz"> | 97 | <el-tab-pane class="eltabspane" label="自然幢" name="zrz"> |
98 | <el-form :inline="true" class="zrzProject"> | 98 | <el-form :inline="true" :rules="rules1" :model="ruleForm1" ref="ruleForm1" class="zrzProject"> |
99 | <el-form-item label="项目名称"> | 99 | <el-form-item label="项目名称" prop="xmmc"> |
100 | <el-input | 100 | <el-input |
101 | v-model="zrzProjectName" | 101 | v-model="ruleForm1.xmmc" |
102 | placeholder="项目名称" | 102 | placeholder="项目名称" |
103 | style="width:400px;" | 103 | style="width:400px;" |
104 | ></el-input> | 104 | ></el-input> |
105 | </el-form-item> | 105 | </el-form-item> |
106 | 106 | <el-form-item class="handleBtn"> | |
107 | <div> | ||
108 | <el-form-item style="margin-left:300px;"> | ||
109 | <el-button type="primary">导入图形</el-button> | 107 | <el-button type="primary">导入图形</el-button> |
110 | </el-form-item> | ||
111 | <el-form-item> | ||
112 | <el-button type="primary" @click="newZrz">创建</el-button> | 108 | <el-button type="primary" @click="newZrz">创建</el-button> |
113 | </el-form-item> | ||
114 | <el-form-item> | ||
115 | <el-button type="primary" @click="close">取消</el-button> | 109 | <el-button type="primary" @click="close">取消</el-button> |
116 | </el-form-item> | 110 | </el-form-item> |
117 | </div> | ||
118 | </el-form> | 111 | </el-form> |
119 | </el-tab-pane> | 112 | </el-tab-pane> |
120 | <el-tab-pane class="eltabspane" label="多幢" name="dz">多幢</el-tab-pane> | 113 | <el-tab-pane class="eltabspane" label="多幢" name="dz">多幢</el-tab-pane> |
... | @@ -154,6 +147,11 @@ export default { | ... | @@ -154,6 +147,11 @@ export default { |
154 | "xzqbsm": "", | 147 | "xzqbsm": "", |
155 | "zdtzmbsm": "" | 148 | "zdtzmbsm": "" |
156 | }, | 149 | }, |
150 | ruleForm1:{ | ||
151 | zdbsm:'', | ||
152 | xmmc:'', | ||
153 | userbsm:'' | ||
154 | }, | ||
157 | rules: { | 155 | rules: { |
158 | xzqbsm: [ | 156 | xzqbsm: [ |
159 | { required: true, message: '请选择行政区', trigger: 'change' } | 157 | { required: true, message: '请选择行政区', trigger: 'change' } |
... | @@ -174,6 +172,11 @@ export default { | ... | @@ -174,6 +172,11 @@ export default { |
174 | { required: true, message: '请选择宗地特征码', trigger: 'change' } | 172 | { required: true, message: '请选择宗地特征码', trigger: 'change' } |
175 | ] | 173 | ] |
176 | }, | 174 | }, |
175 | rules1: { | ||
176 | xmmc: [ | ||
177 | { required: true, message: '请输入项目名称', trigger: 'blur' }, | ||
178 | ], | ||
179 | }, | ||
177 | syqlx: [ | 180 | syqlx: [ |
178 | { | 181 | { |
179 | label: "国家所有", | 182 | label: "国家所有", |
... | @@ -227,13 +230,9 @@ export default { | ... | @@ -227,13 +230,9 @@ export default { |
227 | }, | 230 | }, |
228 | newZrz() { | 231 | newZrz() { |
229 | //todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm | 232 | //todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm |
230 | var data = { | 233 | this.$refs['ruleForm1'].validate((valid) => { |
231 | userbsm: "", | 234 | if (valid) { |
232 | xmmc: this.zrzProjectName, | 235 | insertZrzjbxx(this.ruleForm1) |
233 | zdbsm: "", | ||
234 | }; | ||
235 | console.log(data); | ||
236 | insertZrzjbxx(data) | ||
237 | .then((res) => { | 236 | .then((res) => { |
238 | if (res.code == "200") { | 237 | if (res.code == "200") { |
239 | this.$message({ | 238 | this.$message({ |
... | @@ -256,6 +255,12 @@ export default { | ... | @@ -256,6 +255,12 @@ export default { |
256 | } | 255 | } |
257 | }) | 256 | }) |
258 | .catch((error) => {}); | 257 | .catch((error) => {}); |
258 | } else { | ||
259 | console.log('error submit!!'); | ||
260 | return false; | ||
261 | } | ||
262 | }); | ||
263 | |||
259 | }, | 264 | }, |
260 | getXzqList() { | 265 | getXzqList() { |
261 | getAllList() | 266 | getAllList() |
... | @@ -319,6 +324,9 @@ export default { | ... | @@ -319,6 +324,9 @@ export default { |
319 | height: 100%; | 324 | height: 100%; |
320 | width: 100%; | 325 | width: 100%; |
321 | padding: 20px; | 326 | padding: 20px; |
327 | .el-form--inline .el-form-item__label{ | ||
328 | width: 100px; | ||
329 | } | ||
322 | .el-form-item{ | 330 | .el-form-item{ |
323 | margin-bottom: 20px; | 331 | margin-bottom: 20px; |
324 | } | 332 | } |
... | @@ -340,7 +348,4 @@ export default { | ... | @@ -340,7 +348,4 @@ export default { |
340 | .zrzProject { | 348 | .zrzProject { |
341 | margin-top: 80px; | 349 | margin-top: 80px; |
342 | } | 350 | } |
343 | .el-form--inline .el-form-item__label{ | ||
344 | width: 100px; | ||
345 | } | ||
346 | </style> | 351 | </style> | ... | ... |
-
Please register or sign in to post a comment