e3520832 by weimo934

fix(mjft):修改保存验证

1 parent 7f1950dc
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 <td colspan="2">宗地面积(㎡)</td> 13 <td colspan="2">宗地面积(㎡)</td>
14 <td><input type="number" class="formInput" v-model.number="mjftData.zdmj" 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 class="dzwsl">{{dzwdsl}}</td>
17 </tr> 17 </tr>
18 <tr> 18 <tr>
19 <td colspan="2">备注</td> 19 <td colspan="2">备注</td>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
51 51
52 <script> 52 <script>
53 import {savemjft} from '../../../api/basic' 53 import {savemjft} from '../../../api/basic'
54 54 import {Message} from 'element-ui'
55 export default { 55 export default {
56 name: "index", 56 name: "index",
57 data() { 57 data() {
...@@ -80,7 +80,14 @@ ...@@ -80,7 +80,14 @@
80 80
81 methods: { 81 methods: {
82 save() { 82 save() {
83 console.log(this.mjftData) 83 console.log(this.mjftData);
84 for (let val of this.mjftData.addQjZdftdzwRequestList){
85 if (val.dzwdm == '') {
86 Message.error("定着物代码不能为空")
87 return
88 }
89 }
90
84 savemjft(this.mjftData).then(res => { 91 savemjft(this.mjftData).then(res => {
85 console.log(res) 92 console.log(res)
86 }).catch(error => { 93 }).catch(error => {
...@@ -158,11 +165,11 @@ ...@@ -158,11 +165,11 @@
158 }, 165 },
159 mounted() { 166 mounted() {
160 // 暂时随机生成 后续从调查表继承过来 167 // 暂时随机生成 后续从调查表继承过来
161 this.mjftData.zdbsm='ZDDM'+parseInt(Math.random()*100) 168 this.mjftData.zdbsm = 'ZDDM' + parseInt(Math.random() * 100)
162 this.mjftData.zdmj=(Math.random()*100).toFixed(3) 169 this.mjftData.zdmj = (Math.random() * 1000).toFixed(3)
163 let zl=['西安','咸阳','雁塔区','高新区','未央区','莲湖区','临潼区'] 170 let zl = ['西安', '咸阳', '雁塔区', '高新区', '未央区', '莲湖区', '临潼区']
164 let i=parseInt(Math.random()*7,10); 171 let i = parseInt(Math.random() * 7, 10);
165 this.mjftData.tdzl=zl[i] 172 this.mjftData.tdzl = zl[i]
166 console.log("mounted init...") 173 console.log("mounted init...")
167 } 174 }
168 } 175 }
...@@ -208,4 +215,8 @@ ...@@ -208,4 +215,8 @@
208 width: 150px; 215 width: 150px;
209 } 216 }
210 217
218 .dzwsl {
219 width: 200px;
220 }
221
211 </style> 222 </style>
......