fix(mjft):修改面积验证
Showing
1 changed file
with
18 additions
and
9 deletions
... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
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> |
... | @@ -11,7 +11,7 @@ | ... | @@ -11,7 +11,7 @@ |
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> |
... | @@ -31,9 +31,9 @@ | ... | @@ -31,9 +31,9 @@ |
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> |
... | @@ -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,6 +157,12 @@ | ... | @@ -154,6 +157,12 @@ |
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 | } | ... | ... |
-
Please register or sign in to post a comment