c6f5f4df by weimo934

style(yzgy,mjftb):修改表格样式,添加输入验证

1 parent 0b8deb0e
......@@ -43,20 +43,20 @@
>
</td>
<td class="dzwdm">
<el-input v-model="item.dzwdm" >
<el-input v-model="item.dzwdm" placeholder="请输入定着物代码">
</el-input>
</td>
<td class="syqmj">
<el-input placeholder="请输入数字" style="ime-mode:inactive"
oninput="if(isNaN(value)) { value = value.substr(0, value.length - 1) } if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+4)}"
<el-input placeholder="请输入使用所有权面积" style="ime-mode:inactive"
oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"
v-model="item.tdsyqsyqmj"
></el-input>
</td>
<td class="dytdmj">
<el-input v-model="item.dydytdmj" style="ime-mode:inactive" placeholder="请输入数字" oninput="if(isNaN(value)) { value = value.substr(0, value.length - 1)} if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+4)}"></el-input>
<el-input v-model="item.dydytdmj" style="ime-mode:inactive" placeholder="请输入独有独用土地面积" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input>
</td>
<td class="fttjmj">
<el-input v-model="item.fttdmj" style="ime-mode:inactive" placeholder="请输入数字" oninput="if(isNaN(value)) { value = value.substr(0, value.length - 1) } if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+4)}"></el-input>
<el-input v-model="item.fttdmj" style="ime-mode:inactive" placeholder="请输入分摊土地面积" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input>
</td>
</tr>
<tr>
......@@ -131,17 +131,6 @@
console.log(error)
})
},
oninput(e) {
/* e.target.value = (e.target.value.match(/^(1|2|3|4|5|6|7|8|9|0)*(\.?\d{0,2})/g)[0]) || null*/
let value = e.target.value
if (isNaN(value)) {
console.log(value,'value');
value = value.slice()
}
if (value.indexOf('.') > 0) {
value = value.slice(0, value.indexOf('.') + 4)
}
},
addRow() {
this.mjftData.list.push({
dydytdmj: '',
......
......@@ -37,12 +37,12 @@
>-</el-button
>
</td>
<td><input type="text" class="formInput" v-model="item.jgzwbh"/></td>
<td><input type="number" class="formInput" v-model="item.jgzsl" @keydown="oninput"/></td>
<td><input type="number" class="formInput" v-model.number="item.jgzmj" @keydown="oninput"/></td>
<td><input type="number" class="formInput" v-model.number="item.zdmj" @keydown="oninput"/></td>
<td><input type="number" class="formInput" v-model.number="item.fttdmj" @keydown="oninput"/></td>
<td><input type="text" class="formInput" v-model="item.fj"/></td>
<td><el-input v-model="item.jgzwbh" placeholder="请输入建(构)筑物编号"></el-input></td>
<td><el-input v-model="item.jgzsl" oninput="value = (value.match(/^\d*/g)) || null" placeholder="请输入建(构)筑物数量"></el-input></td>
<td><el-input v-model="item.jgzmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="请输入建(构)筑物面积(㎡)"></el-input></td>
<td><el-input v-model="item.zdmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="请输入占地面积(㎡)"></el-input></td>
<td><el-input v-model="item.fttdmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="请输入分摊土地面积(㎡)"></el-input></td>
<td><el-input v-model="item.fj" placeholder="请输入附记"></el-input></td>
</tr>
<!-- <tr>
<td>统计</td>
......@@ -108,9 +108,6 @@
}
})
},
oninput(e) {
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
},
addRow() {
this.Data.list.push({
jgzwbh: '', // 建(构)筑物编号
......