fd4021e8 by 杨威
2 parents 27087e06 bb7bdccd
......@@ -25,7 +25,7 @@
<td colspan="2">其他建筑面积(㎡)</td>
<td colspan="4"><input type="text" v-model="form.qtjzmj" class="inputtitle"/></td>
<td colspan="2">分摊系数</td>
<td colspan="4"><input type="text" v-model="form.ftxs" class="inputtitle"/></td>
<td colspan="4"><input type="number" @blur="inputBlur($event)" ref="ftxs" v-model="form.ftxs" class="inputtitle"/></td>
</tr>
<tr>
<td colspan="2">户型</td>
......@@ -315,6 +315,16 @@
}
},
methods: {
inputBlur(e){
if(e.target.value!==''&&e.target.value>0&&e.target.value<10){
e.target.style.border=""
}else{
e.target.style.border="1px solid red";
e.target.style.boxSizing = 'border-box';
}
},
lodding:function(){
this.$emit('lodding')
},
......@@ -411,6 +421,30 @@
this.fwjgTitleRowspan=1; //房屋结构的单元格垂直合并数量
},
save: function () {
this.rules=[
{
data:this.form.ftxs,
name:'分摊系数',
dom:this.$refs.ftxs,
rule: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/, //非空
},
];
let flag = true;
this.rules.forEach(item=>{
if(item.rule.test(item.data) || item.data == null){
if(item.dom.$el){
item.dom.$el.style.border = '1px solid red';
item.dom.$el.style.boxSizing = 'border-box';
}else{
item.dom.style.border = '1px solid red';
item.dom.style.boxSizing = 'border-box';
}
flag = false;
return false
}
})
this.form['hbsms'] = this.bsms
this.form.qlxzList= this.$refs.qlxzModule.getQlxzDataList();
for(let i=0;i< this.form.fwjgList.length;i++){
......