e3520832 by weimo934

fix(mjft):修改保存验证

1 parent 7f1950dc
......@@ -13,7 +13,7 @@
<td colspan="2">宗地面积(㎡)</td>
<td><input type="number" class="formInput" v-model.number="mjftData.zdmj" disabled/></td>
<td>定着物数量</td>
<td>{{dzwdsl}}</td>
<td class="dzwsl">{{dzwdsl}}</td>
</tr>
<tr>
<td colspan="2">备注</td>
......@@ -51,7 +51,7 @@
<script>
import {savemjft} from '../../../api/basic'
import {Message} from 'element-ui'
export default {
name: "index",
data() {
......@@ -80,7 +80,14 @@
methods: {
save() {
console.log(this.mjftData)
console.log(this.mjftData);
for (let val of this.mjftData.addQjZdftdzwRequestList){
if (val.dzwdm == '') {
Message.error("定着物代码不能为空")
return
}
}
savemjft(this.mjftData).then(res => {
console.log(res)
}).catch(error => {
......@@ -158,11 +165,11 @@
},
mounted() {
// 暂时随机生成 后续从调查表继承过来
this.mjftData.zdbsm='ZDDM'+parseInt(Math.random()*100)
this.mjftData.zdmj=(Math.random()*100).toFixed(3)
let zl=['西安','咸阳','雁塔区','高新区','未央区','莲湖区','临潼区']
let i=parseInt(Math.random()*7,10);
this.mjftData.tdzl=zl[i]
this.mjftData.zdbsm = 'ZDDM' + parseInt(Math.random() * 100)
this.mjftData.zdmj = (Math.random() * 1000).toFixed(3)
let zl = ['西安', '咸阳', '雁塔区', '高新区', '未央区', '莲湖区', '临潼区']
let i = parseInt(Math.random() * 7, 10);
this.mjftData.tdzl = zl[i]
console.log("mounted init...")
}
}
......@@ -208,4 +215,8 @@
width: 150px;
}
.dzwsl {
width: 200px;
}
</style>
......