Merge remote-tracking branch 'origin/master'
Showing
2 changed files
with
181 additions
and
29 deletions
... | @@ -8,20 +8,20 @@ | ... | @@ -8,20 +8,20 @@ |
8 | <th colspan="12"><font size="4"></font>多幢基本信息</th> | 8 | <th colspan="12"><font size="4"></font>多幢基本信息</th> |
9 | </tr> | 9 | </tr> |
10 | <tr height="30"> | 10 | <tr height="30"> |
11 | <td colspan="2" align="center" >宗地代码</td> | 11 | <td colspan="2" align="center">宗地代码</td> |
12 | <td colspan="4" > | 12 | <td colspan="4" > |
13 | <input class="formInput" :disabled="disabled" maxlength="19" v-model="form.zddm"> | 13 | <input class="formInput" disabled maxlength="19" v-model="form.zddm"> |
14 | </td> | 14 | </td> |
15 | <td colspan="2" align="center" >不动产单元号</td> | 15 | <td colspan="2" align="center" ><i class="requisite">*</i>不动产单元号</td> |
16 | <td colspan="4" class="psr"> | 16 | <td colspan="4" class="psr"> |
17 | <input class="formInput percent80" :disabled="disabled" maxlength="28" v-model="form.bdcdyh"> | 17 | <input class="formInput percent80" :disabled="disabled" maxlength="28" v-model="form.bdcdyh" @blur="inputBlur($event)" ref="bdcdyh"> |
18 | <el-button @click.prevent="generatorCode" :disabled="disabled" size="mini" class="createBtn" type="warning">生成</el-button> | 18 | <el-button @click.prevent="generatorCode" :disabled="disabled" size="mini" class="createBtn" type="warning">生成</el-button> |
19 | </td> | 19 | </td> |
20 | </tr> | 20 | </tr> |
21 | <tr height="30"> | 21 | <tr height="30"> |
22 | <td colspan="2" align="center" >项目名称</td> | 22 | <td colspan="2" align="center" ><i class="requisite">*</i>项目名称</td> |
23 | <td colspan="4" > | 23 | <td colspan="4" > |
24 | <input class="formInput" :disabled="disabled" v-model="form.xmmc"> | 24 | <input class="formInput" :disabled="disabled" v-model="form.xmmc" @blur="inputBlur($event)" ref="xmmc"> |
25 | </td> | 25 | </td> |
26 | <td colspan="2" align="center" >房屋性质</td> | 26 | <td colspan="2" align="center" >房屋性质</td> |
27 | <td colspan="4" > | 27 | <td colspan="4" > |
... | @@ -142,10 +142,10 @@ | ... | @@ -142,10 +142,10 @@ |
142 | 142 | ||
143 | <tr height="30"> | 143 | <tr height="30"> |
144 | <td colspan="2" align="center" > | 144 | <td colspan="2" align="center" > |
145 | <span>坐落</span> | 145 | <span><i class="requisite">*</i>坐落</span> |
146 | </td> | 146 | </td> |
147 | <td colspan="10" > | 147 | <td colspan="10" > |
148 | <input class="formInput" v-model="form.zl" :disabled="disabled"> | 148 | <input class="formInput" v-model="form.zl" :disabled="disabled" @blur="inputBlur($event)" ref="zl"> |
149 | </td> | 149 | </td> |
150 | </tr> | 150 | </tr> |
151 | 151 | ||
... | @@ -284,6 +284,8 @@ | ... | @@ -284,6 +284,8 @@ |
284 | value: '', | 284 | value: '', |
285 | ytTitleRowspan:1, //用途的单元格垂直合并数量 | 285 | ytTitleRowspan:1, //用途的单元格垂直合并数量 |
286 | mainBoxWidth: 0, | 286 | mainBoxWidth: 0, |
287 | |||
288 | rules:[], | ||
287 | } | 289 | } |
288 | }, | 290 | }, |
289 | created() { | 291 | created() { |
... | @@ -382,6 +384,15 @@ | ... | @@ -382,6 +384,15 @@ |
382 | this.form.qlxzList | 384 | this.form.qlxzList |
383 | }, | 385 | }, |
384 | 386 | ||
387 | inputBlur(e) { | ||
388 | if (e.target.value != '') { | ||
389 | e.target.style.border = "" | ||
390 | } else { | ||
391 | e.target.style.border = "1px solid red"; | ||
392 | e.target.style.boxSizing = 'border-box'; | ||
393 | } | ||
394 | }, | ||
395 | |||
385 | deleteQlxzItem(index){ | 396 | deleteQlxzItem(index){ |
386 | 397 | ||
387 | }, | 398 | }, |
... | @@ -434,21 +445,84 @@ | ... | @@ -434,21 +445,84 @@ |
434 | 445 | ||
435 | 446 | ||
436 | onSave(){ | 447 | onSave(){ |
448 | |||
449 | this.rules=[ | ||
450 | { | ||
451 | data:this.form.bdcdyh, | ||
452 | name:'不动产单元号', | ||
453 | dom:this.$refs.bdcdyh, | ||
454 | rule: /^\s*$/g, //非空 | ||
455 | }, | ||
456 | { | ||
457 | data:this.form.xmmc, | ||
458 | name:'项目名称', | ||
459 | dom:this.$refs.xmmc, | ||
460 | rule: /^\s*$/g, //非空 | ||
461 | }, | ||
462 | { | ||
463 | data:this.form.zl, | ||
464 | name:'坐落', | ||
465 | dom:this.$refs.zl, | ||
466 | rule: /^\s*$/g, //非空 | ||
467 | }, | ||
468 | ] | ||
469 | |||
470 | this.form.fwytList.forEach((item,index)=>{ | ||
471 | this.rules.push( | ||
472 | { | ||
473 | data:item.fwytzdbsm, | ||
474 | name:'规划用途', | ||
475 | dom:this.$refs.ghyt[index], | ||
476 | rule: /^\s*$/g, //非空 | ||
477 | }, | ||
478 | { | ||
479 | data:item.fwytzdbsm, | ||
480 | name:'用途', | ||
481 | dom:this.$refs.yt[index], | ||
482 | rule: /^\s*$/g, //非空 | ||
483 | }, | ||
484 | ) | ||
485 | }) | ||
486 | |||
437 | console.log(this.form) | 487 | console.log(this.form) |
438 | this.form.dzbsm=this.bsm; | 488 | this.form.dzbsm=this.bsm; |
489 | let flag = true; | ||
439 | this.form.qlxzList= this.$refs.qlxzModule.getQlxzDataList(); | 490 | this.form.qlxzList= this.$refs.qlxzModule.getQlxzDataList(); |
440 | if(1>0){ | 491 | this.$refs.qlxzModule.getRules(); |
441 | saveDzInfo(this.form).then((res)=>{ | 492 | this.rules.forEach(item=>{ |
442 | if(res.code===200){ | 493 | if(item.rule.test(item.data) || item.data == null){ |
443 | this.$message.success("保存完成!") | 494 | if(item.dom.$el){ |
444 | }else { | 495 | item.dom.$el.style.border = '1px solid red'; |
445 | this.$message({ | 496 | item.dom.$el.style.boxSizing = 'border-box'; |
446 | message: res.message, | 497 | }else{ |
447 | type: "warning", | 498 | item.dom.style.border = '1px solid red'; |
448 | }); | 499 | item.dom.style.boxSizing = 'border-box'; |
449 | } | 500 | } |
450 | }) | 501 | flag = false; |
451 | } | 502 | return false |
503 | } | ||
504 | }) | ||
505 | |||
506 | this.$nextTick(()=> { | ||
507 | if (flag && this.$refs.qlxzModule.getRulesResult()) { | ||
508 | saveDzInfo(this.form).then((res)=>{ | ||
509 | if(res.code===200){ | ||
510 | this.$message.success("保存完成!") | ||
511 | }else { | ||
512 | this.$message({ | ||
513 | message: res.message, | ||
514 | type: "warning", | ||
515 | }); | ||
516 | } | ||
517 | }) | ||
518 | }else { | ||
519 | this.$message({ | ||
520 | // message: item.name+'不能为空', | ||
521 | message: '请完善表单后再继续操作', | ||
522 | type: "warning", | ||
523 | }); | ||
524 | } | ||
525 | }) | ||
452 | }, | 526 | }, |
453 | onSubmit(){ | 527 | onSubmit(){ |
454 | console.log(this.form) | 528 | console.log(this.form) |
... | @@ -519,6 +593,24 @@ | ... | @@ -519,6 +593,24 @@ |
519 | this.getDzDetailByBsm(val) | 593 | this.getDzDetailByBsm(val) |
520 | }, | 594 | }, |
521 | 595 | ||
596 | "form.fwytList": { | ||
597 | handler : function (newVal, oldVal) { | ||
598 | newVal.forEach((item,ind)=>{ | ||
599 | if(item.fwytzdbsm != ''){ | ||
600 | this.$refs.ghyt[ind].$el.style.border="" | ||
601 | this.$refs.yt[ind].$el.style.border="" | ||
602 | } | ||
603 | }) | ||
604 | }, | ||
605 | deep:true | ||
606 | }, | ||
607 | |||
608 | "form.bdcdyh":function (val) { | ||
609 | if (val != '') { | ||
610 | this.$refs.bdcdyh.style.border = ''; | ||
611 | } | ||
612 | }, | ||
613 | |||
522 | "$store.state.sxdrType": { | 614 | "$store.state.sxdrType": { |
523 | handler(n) { | 615 | handler(n) { |
524 | this.$nextTick(()=>{ | 616 | this.$nextTick(()=>{ | ... | ... |
... | @@ -13,17 +13,17 @@ | ... | @@ -13,17 +13,17 @@ |
13 | </td> | 13 | </td> |
14 | <td colspan="2" align="center" >项目名称</td> | 14 | <td colspan="2" align="center" >项目名称</td> |
15 | <td colspan="4" > | 15 | <td colspan="4" > |
16 | <input class="formInput" v-model="form.xmmc" :disabled="form.qszt!=='0'"> | 16 | <input class="formInput" v-model="form.xmmc" :disabled="form.qszt!=='0'" @blur="inputBlur($event)" ref="xmmc"> |
17 | </td> | 17 | </td> |
18 | </tr> | 18 | </tr> |
19 | <tr height="30"> | 19 | <tr height="30"> |
20 | <td colspan="2" align="center" >坐落</td> | 20 | <td colspan="2" align="center" >坐落</td> |
21 | <td colspan="4" > | 21 | <td colspan="4" > |
22 | <input class="formInput" v-model="form.zl" :disabled="form.qszt!=='0'"> | 22 | <input class="formInput" v-model="form.zl" :disabled="form.qszt!=='0'" @blur="inputBlur($event)" ref="zl"> |
23 | </td> | 23 | </td> |
24 | <td colspan="2" align="center" >不动产单元号</td> | 24 | <td colspan="2" align="center" >不动产单元号</td> |
25 | <td colspan="4" class="psr"> | 25 | <td colspan="4" class="psr"> |
26 | <input class="formInput percent80" maxlength="28" v-model="form.bdcdyh" :disabled="form.qszt!=='0'"> | 26 | <input class="formInput percent80" maxlength="28" v-model="form.bdcdyh" :disabled="form.qszt!=='0'" @blur="inputBlur($event)" ref="bdcdyh"> |
27 | <el-button @click.prevent="generatorCode" size="mini" class="createBtn" type="warning" :disabled="form.qszt!=='0'">生成</el-button> | 27 | <el-button @click.prevent="generatorCode" size="mini" class="createBtn" type="warning" :disabled="form.qszt!=='0'">生成</el-button> |
28 | </td> | 28 | </td> |
29 | </tr> | 29 | </tr> |
... | @@ -129,6 +129,7 @@ | ... | @@ -129,6 +129,7 @@ |
129 | bsm:'', | 129 | bsm:'', |
130 | }, | 130 | }, |
131 | zdbsm:'', | 131 | zdbsm:'', |
132 | rules:[], | ||
132 | } | 133 | } |
133 | }, | 134 | }, |
134 | methods:{ | 135 | methods:{ |
... | @@ -140,6 +141,16 @@ | ... | @@ -140,6 +141,16 @@ |
140 | } | 141 | } |
141 | }) | 142 | }) |
142 | }, | 143 | }, |
144 | |||
145 | inputBlur(e) { | ||
146 | if (e.target.value != '') { | ||
147 | e.target.style.border = "" | ||
148 | } else { | ||
149 | e.target.style.border = "1px solid red"; | ||
150 | e.target.style.boxSizing = 'border-box'; | ||
151 | } | ||
152 | }, | ||
153 | |||
143 | generatorCode(){ | 154 | generatorCode(){ |
144 | if(this.form.bdcdyh!=null&&this.form.bdcdyh!==''){ | 155 | if(this.form.bdcdyh!=null&&this.form.bdcdyh!==''){ |
145 | this.open(); | 156 | this.open(); |
... | @@ -182,15 +193,58 @@ | ... | @@ -182,15 +193,58 @@ |
182 | }); | 193 | }); |
183 | }, | 194 | }, |
184 | onSave(){ | 195 | onSave(){ |
185 | console.log(this.form,'this.form'); | 196 | |
186 | this.bsm=this.$route.query.bsm; | 197 | this.rules=[ |
187 | this.form.bsm=this.bsm; | 198 | { |
188 | this.form.jgsj=this.form.jgrq; | 199 | data:this.form.bdcdyh, |
189 | updateGzwjbxx(this.form).then((res)=>{ | 200 | name:'不动产单元号', |
190 | if(res.code === 200){ | 201 | dom:this.$refs.bdcdyh, |
191 | this.$message.success("保存完成!"); | 202 | rule: /^\s*$/g, //非空 |
203 | }, | ||
204 | { | ||
205 | data:this.form.xmmc, | ||
206 | name:'项目名称', | ||
207 | dom:this.$refs.xmmc, | ||
208 | rule: /^\s*$/g, //非空 | ||
209 | }, | ||
210 | { | ||
211 | data:this.form.zl, | ||
212 | name:'坐落', | ||
213 | dom:this.$refs.zl, | ||
214 | rule: /^\s*$/g, //非空 | ||
215 | }, | ||
216 | ] | ||
217 | |||
218 | let flag = true; | ||
219 | this.rules.forEach(item=>{ | ||
220 | if(item.rule.test(item.data) || item.data == null){ | ||
221 | if(item.dom.$el){ | ||
222 | item.dom.$el.style.border = '1px solid red'; | ||
223 | item.dom.$el.style.boxSizing = 'border-box'; | ||
224 | }else{ | ||
225 | item.dom.style.border = '1px solid red'; | ||
226 | item.dom.style.boxSizing = 'border-box'; | ||
227 | } | ||
228 | flag = false; | ||
229 | return false | ||
192 | } | 230 | } |
193 | }) | 231 | }) |
232 | |||
233 | this.$nextTick(()=> { | ||
234 | if (flag) { | ||
235 | console.log(this.form,'this.form'); | ||
236 | this.bsm=this.$route.query.bsm; | ||
237 | this.form.bsm=this.bsm; | ||
238 | this.form.jgsj=this.form.jgrq; | ||
239 | updateGzwjbxx(this.form).then((res)=>{ | ||
240 | if(res.code === 200){ | ||
241 | this.$message.success("保存完成!"); | ||
242 | } | ||
243 | }) | ||
244 | } | ||
245 | }) | ||
246 | |||
247 | |||
194 | }, | 248 | }, |
195 | getGzwDetailInfo(data){ | 249 | getGzwDetailInfo(data){ |
196 | getQjGzwDetailInfo(data).then((res)=>{ | 250 | getQjGzwDetailInfo(data).then((res)=>{ |
... | @@ -252,6 +306,12 @@ | ... | @@ -252,6 +306,12 @@ |
252 | this.getGzwDetailInfo(val) | 306 | this.getGzwDetailInfo(val) |
253 | this.reload() | 307 | this.reload() |
254 | }, | 308 | }, |
309 | |||
310 | "form.bdcdyh":function (val) { | ||
311 | if (val != '') { | ||
312 | this.$refs.bdcdyh.style.border = ''; | ||
313 | } | ||
314 | }, | ||
255 | } | 315 | } |
256 | } | 316 | } |
257 | </script> | 317 | </script> | ... | ... |
-
Please register or sign in to post a comment