c6f5f4df by weimo934

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

1 parent 0b8deb0e
...@@ -43,20 +43,20 @@ ...@@ -43,20 +43,20 @@
43 > 43 >
44 </td> 44 </td>
45 <td class="dzwdm"> 45 <td class="dzwdm">
46 <el-input v-model="item.dzwdm" > 46 <el-input v-model="item.dzwdm" placeholder="请输入定着物代码">
47 </el-input> 47 </el-input>
48 </td> 48 </td>
49 <td class="syqmj"> 49 <td class="syqmj">
50 <el-input placeholder="请输入数字" style="ime-mode:inactive" 50 <el-input placeholder="请输入使用所有权面积" style="ime-mode:inactive"
51 oninput="if(isNaN(value)) { value = value.substr(0, value.length - 1) } if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+4)}" 51 oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"
52 v-model="item.tdsyqsyqmj" 52 v-model="item.tdsyqsyqmj"
53 ></el-input> 53 ></el-input>
54 </td> 54 </td>
55 <td class="dytdmj"> 55 <td class="dytdmj">
56 <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> 56 <el-input v-model="item.dydytdmj" style="ime-mode:inactive" placeholder="请输入独有独用土地面积" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input>
57 </td> 57 </td>
58 <td class="fttjmj"> 58 <td class="fttjmj">
59 <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> 59 <el-input v-model="item.fttdmj" style="ime-mode:inactive" placeholder="请输入分摊土地面积" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null"></el-input>
60 </td> 60 </td>
61 </tr> 61 </tr>
62 <tr> 62 <tr>
...@@ -131,17 +131,6 @@ ...@@ -131,17 +131,6 @@
131 console.log(error) 131 console.log(error)
132 }) 132 })
133 }, 133 },
134 oninput(e) {
135 /* e.target.value = (e.target.value.match(/^(1|2|3|4|5|6|7|8|9|0)*(\.?\d{0,2})/g)[0]) || null*/
136 let value = e.target.value
137 if (isNaN(value)) {
138 console.log(value,'value');
139 value = value.slice()
140 }
141 if (value.indexOf('.') > 0) {
142 value = value.slice(0, value.indexOf('.') + 4)
143 }
144 },
145 addRow() { 134 addRow() {
146 this.mjftData.list.push({ 135 this.mjftData.list.push({
147 dydytdmj: '', 136 dydytdmj: '',
......
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
37 >-</el-button 37 >-</el-button
38 > 38 >
39 </td> 39 </td>
40 <td><input type="text" class="formInput" v-model="item.jgzwbh"/></td> 40 <td><el-input v-model="item.jgzwbh" placeholder="请输入建(构)筑物编号"></el-input></td>
41 <td><input type="number" class="formInput" v-model="item.jgzsl" @keydown="oninput"/></td> 41 <td><el-input v-model="item.jgzsl" oninput="value = (value.match(/^\d*/g)) || null" placeholder="请输入建(构)筑物数量"></el-input></td>
42 <td><input type="number" class="formInput" v-model.number="item.jgzmj" @keydown="oninput"/></td> 42 <td><el-input v-model="item.jgzmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="请输入建(构)筑物面积(㎡)"></el-input></td>
43 <td><input type="number" class="formInput" v-model.number="item.zdmj" @keydown="oninput"/></td> 43 <td><el-input v-model="item.zdmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="请输入占地面积(㎡)"></el-input></td>
44 <td><input type="number" class="formInput" v-model.number="item.fttdmj" @keydown="oninput"/></td> 44 <td><el-input v-model="item.fttdmj" oninput="value = (value.match(/^\d*(\.?\d{0,3})/g)[0]) || null" placeholder="请输入分摊土地面积(㎡)"></el-input></td>
45 <td><input type="text" class="formInput" v-model="item.fj"/></td> 45 <td><el-input v-model="item.fj" placeholder="请输入附记"></el-input></td>
46 </tr> 46 </tr>
47 <!-- <tr> 47 <!-- <tr>
48 <td>统计</td> 48 <td>统计</td>
...@@ -108,9 +108,6 @@ ...@@ -108,9 +108,6 @@
108 } 108 }
109 }) 109 })
110 }, 110 },
111 oninput(e) {
112 e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
113 },
114 addRow() { 111 addRow() {
115 this.Data.list.push({ 112 this.Data.list.push({
116 jgzwbh: '', // 建(构)筑物编号 113 jgzwbh: '', // 建(构)筑物编号
......