7f1950dc by weimo934

fix(mjft):修改面积验证

1 parent 3024659f
1 <template> 1 <template>
2 <div class="main"> 2 <div class="main">
3 <table border="1"> 3 <table border="1">
4 <tr> 4 <tr>
5 <td colspan="2">土地坐落</td> 5 <td colspan="2">土地坐落</td>
6 <td colspan="3"><input type="number" class="formInput" v-model.number="mjftData.tdzl" disabled/></td> 6 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.tdzl" disabled/></td>
7 </tr> 7 </tr>
8 <tr> 8 <tr>
9 <td colspan="2">宗地代码</td> 9 <td colspan="2">宗地代码</td>
10 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm " disabled/></td> 10 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.zdbsm " disabled/></td>
11 </tr> 11 </tr>
12 <tr> 12 <tr>
13 <td colspan="2">宗地面积(㎡)</td> 13 <td colspan="2">宗地面积(㎡)</td>
14 <td><input type="number" class="formInput" v-model.number="mjftData.zjmj" disabled/></td> 14 <td><input type="number" class="formInput" v-model.number="mjftData.zdmj" disabled/></td>
15 <td>定着物数量</td> 15 <td>定着物数量</td>
16 <td>{{dzwdsl}}</td> 16 <td>{{dzwdsl}}</td>
17 </tr> 17 </tr>
18 <tr> 18 <tr>
19 <td colspan="2">备注</td> 19 <td colspan="2">备注</td>
20 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.bz"/></td> 20 <td colspan="3"><input type="text" class="formInput" v-model="mjftData.bz"/></td>
21 </tr> 21 </tr>
22 </table> 22 </table>
23 <table border="1"> 23 <table border="1">
24 <tr> 24 <tr>
25 <td @click="addRow">+</td> 25 <td @click="addRow">+</td>
26 <td>定着物代码</td> 26 <td>定着物代码</td>
27 <td>土地所有权/使用权面积(㎡)</td> 27 <td>土地所有权/使用权面积(㎡)</td>
28 <td>独有独用土地面积(㎡)</td> 28 <td>独有独用土地面积(㎡)</td>
29 <td>分摊土地面积(㎡)</td> 29 <td>分摊土地面积(㎡)</td>
30 </tr> 30 </tr>
31 <tr v-for="(item,i) in mjftData.addQjZdftdzwRequestList" :key="i"> 31 <tr v-for="(item,i) in mjftData.addQjZdftdzwRequestList" :key="i">
32 <td @click="delRow(i)">-</td> 32 <td @click="delRow(i)">-</td>
33 <td><input type="text" class="formInput" v-model="item.dzwdm"/></td> 33 <td><input type="text" class="formInput" v-model="item.dzwdm"/></td>
34 <td><input type="number" class="formInput" v-model.number="item.tdsyqsyqmj"/></td> 34 <td><input type="number" class="formInput" v-model="item.tdsyqsyqmj" @keydown="oninput"/></td>
35 <td><input type="number" class="formInput" v-model.number="item.dydytdmj"/></td> 35 <td><input type="number" class="formInput" v-model="item.dydytdmj" @keydown="oninput"/></td>
36 <td><input type="number" class="formInput" v-model.number="item.fttdmj"/></td> 36 <td><input type="number" class="formInput" v-model="item.fttdmj" @keydown="oninput"/></td>
37 </tr> 37 </tr>
38 <tr> 38 <tr>
39 <td></td> 39 <td></td>
40 <td>统计</td> 40 <td>统计</td>
41 <td>{{sumTdsyqsyqmj}}</td> 41 <td>{{sumTdsyqsyqmj}}</td>
42 <td>{{sumDydytdmj}}</td> 42 <td>{{sumDydytdmj}}</td>
43 <td>{{sumFttdmj}}</td> 43 <td>{{sumFttdmj}}</td>
44 </tr> 44 </tr>
45 </table> 45 </table>
46 <div class="pers"> 46 <div class="pers">
47 <el-button @click="save" type="primary">保存</el-button> 47 <el-button @click="save" type="primary">保存</el-button>
48 </div>
48 </div> 49 </div>
49 </div>
50 </template> 50 </template>
51 51
52 <script> 52 <script>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
57 data() { 57 data() {
58 return { 58 return {
59 mjftData: { 59 mjftData: {
60 zdbsm: '123', // 宗地标识码 继承获取 60 zdbsm: '', // 宗地标识码 继承获取
61 tdsyqsyqmjhj: '',// 土地所有权/使用权面积合计 61 tdsyqsyqmjhj: '',// 土地所有权/使用权面积合计
62 fttdmjhj: '', // 分摊土地面积合计 62 fttdmjhj: '', // 分摊土地面积合计
63 dzwdys: '', // 表示同一宗地内所有的定着物单元数 63 dzwdys: '', // 表示同一宗地内所有的定着物单元数
...@@ -87,6 +87,9 @@ ...@@ -87,6 +87,9 @@
87 console.log(error) 87 console.log(error)
88 }) 88 })
89 }, 89 },
90 oninput(e) {
91 e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
92 },
90 addRow() { 93 addRow() {
91 this.mjftData.addQjZdftdzwRequestList.push({ 94 this.mjftData.addQjZdftdzwRequestList.push({
92 dydytdmj: '', 95 dydytdmj: '',
...@@ -111,7 +114,7 @@ ...@@ -111,7 +114,7 @@
111 } 114 }
112 sum += parseFloat(data[i].tdsyqsyqmj) 115 sum += parseFloat(data[i].tdsyqsyqmj)
113 } 116 }
114 let num = isNaN(sum) ? '' : sum; 117 let num = isNaN(sum) ? '' : sum.toFixed(3);
115 self.mjftData.tdsyqsyqmjhj = num; 118 self.mjftData.tdsyqsyqmjhj = num;
116 return num; 119 return num;
117 }, 120 },
...@@ -125,7 +128,7 @@ ...@@ -125,7 +128,7 @@
125 } 128 }
126 sum += parseFloat(data[i].dydytdmj) 129 sum += parseFloat(data[i].dydytdmj)
127 } 130 }
128 let num = isNaN(sum) ? '' : sum; 131 let num = isNaN(sum) ? '' : sum.toFixed(3);
129 self.mjftData.dydytdmjhj = num; 132 self.mjftData.dydytdmjhj = num;
130 return num; 133 return num;
131 }, 134 },
...@@ -139,7 +142,7 @@ ...@@ -139,7 +142,7 @@
139 } 142 }
140 sum += parseFloat(data[i].fttdmj) 143 sum += parseFloat(data[i].fttdmj)
141 } 144 }
142 let num = isNaN(sum) ? '' : sum; 145 let num = isNaN(sum) ? '' : sum.toFixed(3);
143 self.mjftData.fttdmjhj = num; 146 self.mjftData.fttdmjhj = num;
144 return num; 147 return num;
145 }, 148 },
...@@ -154,49 +157,55 @@ ...@@ -154,49 +157,55 @@
154 console.log("create init...") 157 console.log("create init...")
155 }, 158 },
156 mounted() { 159 mounted() {
160 // 暂时随机生成 后续从调查表继承过来
161 this.mjftData.zdbsm='ZDDM'+parseInt(Math.random()*100)
162 this.mjftData.zdmj=(Math.random()*100).toFixed(3)
163 let zl=['西安','咸阳','雁塔区','高新区','未央区','莲湖区','临潼区']
164 let i=parseInt(Math.random()*7,10);
165 this.mjftData.tdzl=zl[i]
157 console.log("mounted init...") 166 console.log("mounted init...")
158 } 167 }
159 } 168 }
160 </script> 169 </script>
161 170
162 <style scoped> 171 <style scoped>
163 .main { 172 .main {
164 box-sizing: border-box; 173 box-sizing: border-box;
165 padding: 18px; 174 padding: 18px;
166 height: auto; 175 height: auto;
167 width: 80%; 176 width: 80%;
168 } 177 }
169 178
170 table { 179 table {
171 margin-top: 10px; 180 margin-top: 10px;
172 background-color: #fff; 181 background-color: #fff;
173 font-size: 14px; 182 font-size: 14px;
174 width: 100%; 183 width: 100%;
175 } 184 }
176 185
177 td { 186 td {
178 text-align: center; 187 text-align: center;
179 height: 36px; 188 height: 36px;
180 } 189 }
181 190
182 table .formInput { 191 table .formInput {
183 margin: 0; 192 margin: 0;
184 height: 36px; 193 height: 36px;
185 outline: none; 194 outline: none;
186 border: none; 195 border: none;
187 color: #606764; 196 color: #606764;
188 overflow: visible; 197 overflow: visible;
189 text-align: center; 198 text-align: center;
190 cursor: text; 199 cursor: text;
191 } 200 }
192 201
193 .pers { 202 .pers {
194 text-align: center; 203 text-align: center;
195 margin-top: 10px; 204 margin-top: 10px;
196 } 205 }
197 206
198 .pers .el-button { 207 .pers .el-button {
199 width: 150px; 208 width: 150px;
200 } 209 }
201 210
202 </style> 211 </style>
......