d61359c6 by zhaoqian

表单提交按钮

1 parent 51a2fe9d
......@@ -253,7 +253,7 @@ export default {
default:
break;
}
if(item.type == 'zd' ||item.type == 'dz' ||item.type == 'zrz'){
if(item.type == 'zd' ||item.type == 'dz' ||item.type == 'zrz'||item.type == 'gzw'){
this.$router.push({
path: '/'+item.type,
query:{
......
......@@ -192,8 +192,8 @@
</table>
</el-form>
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" class="saveBtn" @click="onSave" :disabled="disabled">保存</el-button>
<el-button type="primary" @click="onSubmit" :disabled="disabled">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
</div>
</div>
......@@ -535,6 +535,7 @@
if(res.code===200){
this.$message.success("提交完成!");
this.getDzDetailByBsm(this.$route.query.bsm)
this.getTreeByBsm(this.$route.query.bsm,'dz','0,1,2')
}
})
},
......
......@@ -273,6 +273,7 @@
if(res.code===200){
this.$message.success("提交完成!");
this.getGzwDetailInfo(this.bsm)
this.getTreeByBsm(this.bsm,'gzw','0,1,2')
}
})
},
......
......@@ -354,8 +354,8 @@
</tr>
</table>
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="updateZDxx">保存</el-button>
<el-button type="primary" @click="submitZDxx">提交</el-button>
<el-button type="primary" class="saveBtn" @click="updateZDxx" :disabled="disabled">保存</el-button>
<el-button type="primary" @click="submitZDxx" :disabled="disabled">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
</div>
</div>
......
......@@ -9,33 +9,24 @@
</template>
</el-table-column>
<el-table-column prop="zrzmc" label="自然幢" align="center">
<!-- <template slot-scope="scope">
<el-input size="small" v-model="scope.row.ljzbsm"></el-input>
</template> -->
</el-table-column>
<el-table-column prop="ljzmc" label="逻辑幢" align="center">
<!-- <template slot-scope="scope">
<el-input size="small" v-model="scope.row.ljzbsm"></el-input>
</template> -->
</el-table-column>
<el-table-column prop="zdymc" label="幢单元" align="center">
<!-- <template slot-scope="scope">
<el-input size="small" v-model="scope.row.zdybsm"></el-input>
</template> -->
</el-table-column>
<el-table-column prop="qsc" label="起始层" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.qsc"></el-input>
<el-input v-model="scope.row.qsc" type="number"></el-input>
</template>
</el-table-column>
<el-table-column prop="jsc" label="结束层" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.jsc"></el-input>
<el-input v-model="scope.row.jsc" type="number"></el-input>
</template>
</el-table-column>
<el-table-column prop="hs" label="每层户数" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.hs"></el-input>
<el-input v-model="scope.row.hs" type="number"></el-input>
</template>
</el-table-column>
</el-table>
......@@ -87,6 +78,9 @@ export default {
handleRowClick(row, index) {
if (row.cz == "+") {
let temp = JSON.parse(JSON.stringify(this.formData));
temp.qsc = '';
temp.jsc = '';
temp.hs = '';
temp.cz = "-";
this.tableData.push(temp);
} else {
......@@ -94,6 +88,23 @@ export default {
}
},
onSave(bsm) {
console.log(this.tableData)
let totalHs = 0;
for(let k =0;k<this.tableData.length;k++){
if(this.tableData[k].qsc === ""||this.tableData[k].jsc === ""||this.tableData[k].hs === ""){
this.$message.warning("表单不完整,请填写完整")
return false
}
if(this.tableData[k].qsc - this.tableData[k].jsc > 0){
this.$message.warning("存在结束层大于起始层,请重写填写")
return false
}
totalHs = totalHs + (this.tableData[k].jsc-this.tableData[k].qsc+1)*this.tableData[k].hs;
}
if(totalHs >= 5000){
this.$message.warning("单次添加户数累积超过5000户,请分次添加!")
return false
}
insertChInfo(this.tableData).then((res) => {
if (res.code === 200) {
this.$message.success("保存成功");
......
......@@ -393,8 +393,8 @@
</table>
</el-form>
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" class="saveBtn" @click="onSave" :disabled="disableFlag">保存</el-button>
<el-button type="primary" @click="onSubmit" :disabled="disableFlag">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
<!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> -->
</div>
......
......@@ -269,8 +269,8 @@
</table>
<div class="header-button" :style="{width:mainBoxWidth+'px'}">
<el-button type="primary" class="saveBtn" @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit">提交</el-button>
<el-button type="primary" class="saveBtn" @click="onSave" :disabled="disabled">保存</el-button>
<el-button type="primary" @click="onSubmit" :disabled="disabled">提交</el-button>
<el-button type="primary" @click="registerCall">登记调用</el-button>
<!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> -->
</div>
......