d61359c6 by zhaoqian

表单提交按钮

1 parent 51a2fe9d
...@@ -253,7 +253,7 @@ export default { ...@@ -253,7 +253,7 @@ export default {
253 default: 253 default:
254 break; 254 break;
255 } 255 }
256 if(item.type == 'zd' ||item.type == 'dz' ||item.type == 'zrz'){ 256 if(item.type == 'zd' ||item.type == 'dz' ||item.type == 'zrz'||item.type == 'gzw'){
257 this.$router.push({ 257 this.$router.push({
258 path: '/'+item.type, 258 path: '/'+item.type,
259 query:{ 259 query:{
......
...@@ -192,8 +192,8 @@ ...@@ -192,8 +192,8 @@
192 </table> 192 </table>
193 </el-form> 193 </el-form>
194 <div class="header-button" :style="{width:mainBoxWidth+'px'}"> 194 <div class="header-button" :style="{width:mainBoxWidth+'px'}">
195 <el-button type="primary" class="saveBtn" @click="onSave">保存</el-button> 195 <el-button type="primary" class="saveBtn" @click="onSave" :disabled="disabled">保存</el-button>
196 <el-button type="primary" @click="onSubmit">提交</el-button> 196 <el-button type="primary" @click="onSubmit" :disabled="disabled">提交</el-button>
197 <el-button type="primary" @click="registerCall">登记调用</el-button> 197 <el-button type="primary" @click="registerCall">登记调用</el-button>
198 </div> 198 </div>
199 </div> 199 </div>
...@@ -535,6 +535,7 @@ ...@@ -535,6 +535,7 @@
535 if(res.code===200){ 535 if(res.code===200){
536 this.$message.success("提交完成!"); 536 this.$message.success("提交完成!");
537 this.getDzDetailByBsm(this.$route.query.bsm) 537 this.getDzDetailByBsm(this.$route.query.bsm)
538 this.getTreeByBsm(this.$route.query.bsm,'dz','0,1,2')
538 } 539 }
539 }) 540 })
540 }, 541 },
......
...@@ -273,6 +273,7 @@ ...@@ -273,6 +273,7 @@
273 if(res.code===200){ 273 if(res.code===200){
274 this.$message.success("提交完成!"); 274 this.$message.success("提交完成!");
275 this.getGzwDetailInfo(this.bsm) 275 this.getGzwDetailInfo(this.bsm)
276 this.getTreeByBsm(this.bsm,'gzw','0,1,2')
276 } 277 }
277 }) 278 })
278 }, 279 },
......
...@@ -354,8 +354,8 @@ ...@@ -354,8 +354,8 @@
354 </tr> 354 </tr>
355 </table> 355 </table>
356 <div class="header-button" :style="{width:mainBoxWidth+'px'}"> 356 <div class="header-button" :style="{width:mainBoxWidth+'px'}">
357 <el-button type="primary" class="saveBtn" @click="updateZDxx">保存</el-button> 357 <el-button type="primary" class="saveBtn" @click="updateZDxx" :disabled="disabled">保存</el-button>
358 <el-button type="primary" @click="submitZDxx">提交</el-button> 358 <el-button type="primary" @click="submitZDxx" :disabled="disabled">提交</el-button>
359 <el-button type="primary" @click="registerCall">登记调用</el-button> 359 <el-button type="primary" @click="registerCall">登记调用</el-button>
360 </div> 360 </div>
361 </div> 361 </div>
......
...@@ -9,33 +9,24 @@ ...@@ -9,33 +9,24 @@
9 </template> 9 </template>
10 </el-table-column> 10 </el-table-column>
11 <el-table-column prop="zrzmc" label="自然幢" align="center"> 11 <el-table-column prop="zrzmc" label="自然幢" align="center">
12 <!-- <template slot-scope="scope">
13 <el-input size="small" v-model="scope.row.ljzbsm"></el-input>
14 </template> -->
15 </el-table-column> 12 </el-table-column>
16 <el-table-column prop="ljzmc" label="逻辑幢" align="center"> 13 <el-table-column prop="ljzmc" label="逻辑幢" align="center">
17 <!-- <template slot-scope="scope">
18 <el-input size="small" v-model="scope.row.ljzbsm"></el-input>
19 </template> -->
20 </el-table-column> 14 </el-table-column>
21 <el-table-column prop="zdymc" label="幢单元" align="center"> 15 <el-table-column prop="zdymc" label="幢单元" align="center">
22 <!-- <template slot-scope="scope">
23 <el-input size="small" v-model="scope.row.zdybsm"></el-input>
24 </template> -->
25 </el-table-column> 16 </el-table-column>
26 <el-table-column prop="qsc" label="起始层" align="center"> 17 <el-table-column prop="qsc" label="起始层" align="center">
27 <template slot-scope="scope"> 18 <template slot-scope="scope">
28 <el-input size="small" v-model="scope.row.qsc"></el-input> 19 <el-input v-model="scope.row.qsc" type="number"></el-input>
29 </template> 20 </template>
30 </el-table-column> 21 </el-table-column>
31 <el-table-column prop="jsc" label="结束层" align="center"> 22 <el-table-column prop="jsc" label="结束层" align="center">
32 <template slot-scope="scope"> 23 <template slot-scope="scope">
33 <el-input size="small" v-model="scope.row.jsc"></el-input> 24 <el-input v-model="scope.row.jsc" type="number"></el-input>
34 </template> 25 </template>
35 </el-table-column> 26 </el-table-column>
36 <el-table-column prop="hs" label="每层户数" align="center"> 27 <el-table-column prop="hs" label="每层户数" align="center">
37 <template slot-scope="scope"> 28 <template slot-scope="scope">
38 <el-input size="small" v-model="scope.row.hs"></el-input> 29 <el-input v-model="scope.row.hs" type="number"></el-input>
39 </template> 30 </template>
40 </el-table-column> 31 </el-table-column>
41 </el-table> 32 </el-table>
...@@ -87,6 +78,9 @@ export default { ...@@ -87,6 +78,9 @@ export default {
87 handleRowClick(row, index) { 78 handleRowClick(row, index) {
88 if (row.cz == "+") { 79 if (row.cz == "+") {
89 let temp = JSON.parse(JSON.stringify(this.formData)); 80 let temp = JSON.parse(JSON.stringify(this.formData));
81 temp.qsc = '';
82 temp.jsc = '';
83 temp.hs = '';
90 temp.cz = "-"; 84 temp.cz = "-";
91 this.tableData.push(temp); 85 this.tableData.push(temp);
92 } else { 86 } else {
...@@ -94,6 +88,23 @@ export default { ...@@ -94,6 +88,23 @@ export default {
94 } 88 }
95 }, 89 },
96 onSave(bsm) { 90 onSave(bsm) {
91 console.log(this.tableData)
92 let totalHs = 0;
93 for(let k =0;k<this.tableData.length;k++){
94 if(this.tableData[k].qsc === ""||this.tableData[k].jsc === ""||this.tableData[k].hs === ""){
95 this.$message.warning("表单不完整,请填写完整")
96 return false
97 }
98 if(this.tableData[k].qsc - this.tableData[k].jsc > 0){
99 this.$message.warning("存在结束层大于起始层,请重写填写")
100 return false
101 }
102 totalHs = totalHs + (this.tableData[k].jsc-this.tableData[k].qsc+1)*this.tableData[k].hs;
103 }
104 if(totalHs >= 5000){
105 this.$message.warning("单次添加户数累积超过5000户,请分次添加!")
106 return false
107 }
97 insertChInfo(this.tableData).then((res) => { 108 insertChInfo(this.tableData).then((res) => {
98 if (res.code === 200) { 109 if (res.code === 200) {
99 this.$message.success("保存成功"); 110 this.$message.success("保存成功");
......
...@@ -393,8 +393,8 @@ ...@@ -393,8 +393,8 @@
393 </table> 393 </table>
394 </el-form> 394 </el-form>
395 <div class="header-button" :style="{width:mainBoxWidth+'px'}"> 395 <div class="header-button" :style="{width:mainBoxWidth+'px'}">
396 <el-button type="primary" class="saveBtn" @click="onSave">保存</el-button> 396 <el-button type="primary" class="saveBtn" @click="onSave" :disabled="disableFlag">保存</el-button>
397 <el-button type="primary" @click="onSubmit">提交</el-button> 397 <el-button type="primary" @click="onSubmit" :disabled="disableFlag">提交</el-button>
398 <el-button type="primary" @click="registerCall">登记调用</el-button> 398 <el-button type="primary" @click="registerCall">登记调用</el-button>
399 <!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> --> 399 <!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> -->
400 </div> 400 </div>
......
...@@ -269,8 +269,8 @@ ...@@ -269,8 +269,8 @@
269 269
270 </table> 270 </table>
271 <div class="header-button" :style="{width:mainBoxWidth+'px'}"> 271 <div class="header-button" :style="{width:mainBoxWidth+'px'}">
272 <el-button type="primary" class="saveBtn" @click="onSave">保存</el-button> 272 <el-button type="primary" class="saveBtn" @click="onSave" :disabled="disabled">保存</el-button>
273 <el-button type="primary" @click="onSubmit">提交</el-button> 273 <el-button type="primary" @click="onSubmit" :disabled="disabled">提交</el-button>
274 <el-button type="primary" @click="registerCall">登记调用</el-button> 274 <el-button type="primary" @click="registerCall">登记调用</el-button>
275 <!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> --> 275 <!-- <el-button type="primary" class="saveBtn" @click="save">保存</el-button> -->
276 </div> 276 </div>
......