多次新建自然幢,每次重置表单信息
Showing
2 changed files
with
17 additions
and
8 deletions
... | @@ -177,6 +177,9 @@ export default { | ... | @@ -177,6 +177,9 @@ export default { |
177 | "$store.state.zdbsm": function(bsm) { | 177 | "$store.state.zdbsm": function(bsm) { |
178 | this.getRightTree(bsm); | 178 | this.getRightTree(bsm); |
179 | }, | 179 | }, |
180 | "$store.state.zrzbsm": function(bsm) { | ||
181 | this.getRightTreeByZrzbsm(this.$store.state.zrzbsm); | ||
182 | }, | ||
180 | 183 | ||
181 | "$store.state.treeData":function (val) { | 184 | "$store.state.treeData":function (val) { |
182 | console.log(val,'val'); | 185 | console.log(val,'val'); |
... | @@ -430,6 +433,8 @@ export default { | ... | @@ -430,6 +433,8 @@ export default { |
430 | width: 100%; | 433 | width: 100%; |
431 | height: 100vh; | 434 | height: 100vh; |
432 | position: relative; | 435 | position: relative; |
436 | min-width: 1500px; | ||
437 | overflow-x: auto; | ||
433 | .calcWidth{ | 438 | .calcWidth{ |
434 | width: calc(100% - 300px); | 439 | width: calc(100% - 300px); |
435 | } | 440 | } | ... | ... |
... | @@ -98,11 +98,10 @@ | ... | @@ -98,11 +98,10 @@ |
98 | </el-tab-pane> | 98 | </el-tab-pane> |
99 | <el-tab-pane class="eltabspane" label="自然幢" name="zrz"> | 99 | <el-tab-pane class="eltabspane" label="自然幢" name="zrz"> |
100 | <el-form :inline="true" :rules="rules1" :model="ruleForm1" ref="ruleForm1" class="demo-form-inline"> | 100 | <el-form :inline="true" :rules="rules1" :model="ruleForm1" ref="ruleForm1" class="demo-form-inline"> |
101 | <el-form-item label="项目名称" prop="xmmc"> | 101 | <el-form-item label="项目名称" class="w100" prop="xmmc"> |
102 | <el-input | 102 | <el-input |
103 | v-model="ruleForm1.xmmc" | 103 | v-model="ruleForm1.xmmc" |
104 | placeholder="项目名称" | 104 | placeholder="项目名称" |
105 | style="width:400px;" | ||
106 | ></el-input> | 105 | ></el-input> |
107 | </el-form-item> | 106 | </el-form-item> |
108 | </el-form> | 107 | </el-form> |
... | @@ -114,11 +113,10 @@ | ... | @@ -114,11 +113,10 @@ |
114 | </el-tab-pane> | 113 | </el-tab-pane> |
115 | <el-tab-pane class="eltabspane" label="多幢" name="dz"> | 114 | <el-tab-pane class="eltabspane" label="多幢" name="dz"> |
116 | <el-form :inline="true" :rules="rules2" :model="ruleForm2" ref="ruleForm2" class="demo-form-inline"> | 115 | <el-form :inline="true" :rules="rules2" :model="ruleForm2" ref="ruleForm2" class="demo-form-inline"> |
117 | <el-form-item label="项目名称" prop="xmmc"> | 116 | <el-form-item label="项目名称" class="w100" prop="xmmc"> |
118 | <el-input | 117 | <el-input |
119 | v-model="ruleForm2.xmmc" | 118 | v-model="ruleForm2.xmmc" |
120 | placeholder="项目名称" | 119 | placeholder="项目名称" |
121 | style="width:400px;" | ||
122 | ></el-input> | 120 | ></el-input> |
123 | </el-form-item> | 121 | </el-form-item> |
124 | </el-form> | 122 | </el-form> |
... | @@ -243,9 +241,16 @@ export default { | ... | @@ -243,9 +241,16 @@ export default { |
243 | methods: { | 241 | methods: { |
244 | // 重置 | 242 | // 重置 |
245 | reset(){ | 243 | reset(){ |
244 | debugger | ||
245 | if(this.$refs['ruleForm']){ | ||
246 | this.$refs['ruleForm'].resetFields(); | 246 | this.$refs['ruleForm'].resetFields(); |
247 | } | ||
248 | if(this.$refs["ruleForm1"]){ | ||
247 | this.$refs["ruleForm1"].resetFields(); | 249 | this.$refs["ruleForm1"].resetFields(); |
250 | } | ||
251 | if (this.$refs["ruleForm2"]) { | ||
248 | this.$refs["ruleForm2"].resetFields(); | 252 | this.$refs["ruleForm2"].resetFields(); |
253 | } | ||
249 | }, | 254 | }, |
250 | handleClick(tab, event) { | 255 | handleClick(tab, event) { |
251 | console.log(tab, event); | 256 | console.log(tab, event); |
... | @@ -290,7 +295,6 @@ export default { | ... | @@ -290,7 +295,6 @@ export default { |
290 | this.ruleForm1.dzbsm = this.$store.state.dzbsm != '' ? this.$store.state.dzbsm : ''; | 295 | this.ruleForm1.dzbsm = this.$store.state.dzbsm != '' ? this.$store.state.dzbsm : ''; |
291 | insertZrzjbxx(this.ruleForm1) | 296 | insertZrzjbxx(this.ruleForm1) |
292 | .then((res) => { | 297 | .then((res) => { |
293 | debugger | ||
294 | if (res.code == "200") { | 298 | if (res.code == "200") { |
295 | this.$message({ | 299 | this.$message({ |
296 | message: "创建成功!", | 300 | message: "创建成功!", |
... | @@ -300,13 +304,13 @@ export default { | ... | @@ -300,13 +304,13 @@ export default { |
300 | this.$store.state.zdbsm=res.result.zdbsm; | 304 | this.$store.state.zdbsm=res.result.zdbsm; |
301 | this.$store.state.zrzbsm=res.result.bsm; | 305 | this.$store.state.zrzbsm=res.result.bsm; |
302 | this.$store.state.xmmc=res.result.xmmc; | 306 | this.$store.state.xmmc=res.result.xmmc; |
307 | this.close(); | ||
303 | this.$router.push({ | 308 | this.$router.push({ |
304 | path: '/zrz', query:{ | 309 | path: '/zrz', query:{ |
305 | source: 1, | 310 | source: 1, |
306 | bsm:res.result.bsm | 311 | bsm:res.result.bsm |
307 | } | 312 | } |
308 | }); | 313 | }); |
309 | this.close(); | ||
310 | } else { | 314 | } else { |
311 | this.$message.error("创建失败!"); | 315 | this.$message.error("创建失败!"); |
312 | } | 316 | } |
... | @@ -334,13 +338,13 @@ export default { | ... | @@ -334,13 +338,13 @@ export default { |
334 | this.$store.state.zdbsm=res.result.zdbsm; | 338 | this.$store.state.zdbsm=res.result.zdbsm; |
335 | this.$store.state.dzbsm=res.result.bsm; | 339 | this.$store.state.dzbsm=res.result.bsm; |
336 | this.$store.state.xmmc=res.result.xmmc; | 340 | this.$store.state.xmmc=res.result.xmmc; |
341 | this.close(); | ||
337 | this.$router.push({ | 342 | this.$router.push({ |
338 | path: '/dz', query:{ | 343 | path: '/dz', query:{ |
339 | source: 1, | 344 | source: 1, |
340 | bsm:res.result.bsm | 345 | bsm:res.result.bsm |
341 | } | 346 | } |
342 | }); | 347 | }); |
343 | this.close(); | ||
344 | } else { | 348 | } else { |
345 | this.$message.error("创建失败!"); | 349 | this.$message.error("创建失败!"); |
346 | } | 350 | } |
... | @@ -405,8 +409,8 @@ export default { | ... | @@ -405,8 +409,8 @@ export default { |
405 | } | 409 | } |
406 | }, | 410 | }, |
407 | close() { | 411 | close() { |
408 | this.$emit("closeDialog"); | ||
409 | this.reset(); | 412 | this.reset(); |
413 | this.$emit("closeDialog"); | ||
410 | }, | 414 | }, |
411 | }, | 415 | }, |
412 | computed: {}, | 416 | computed: {}, | ... | ... |
-
Please register or sign in to post a comment