06f8233f by 杨威
2 parents 7564f797 25c0002b
...@@ -10,4 +10,15 @@ export function getLpbMenuTree (data) { ...@@ -10,4 +10,15 @@ export function getLpbMenuTree (data) {
10 zrzbsm:data 10 zrzbsm:data
11 }, 11 },
12 }) 12 })
13 }
14
15 /**
16 * 新增幢单元接口信息
17 */
18 export function insertZdyInfo (data) {
19 return request({
20 url: 'system/qjZdy/insertQjZdy',
21 method: 'post',
22 data:data
23 })
13 } 24 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -95,6 +95,12 @@ const constantRoutes = [ ...@@ -95,6 +95,12 @@ const constantRoutes = [
95 code: "1-7", 95 code: "1-7",
96 component: () => import("@/views/systemZRZ/c/index"), 96 component: () => import("@/views/systemZRZ/c/index"),
97 }, 97 },
98 {
99 path: "/zdy",
100 name: "幢单元",
101 code: "1-8",
102 component: () => import("@/views/systemZRZ/lpb/zdy/index"),
103 },
98 ], 104 ],
99 }, 105 },
100 ]; 106 ];
......
1 <template>
2 <div class="zdy-content">
3 <el-form :model="form" :rules="rules" ref="form" label-width="110px" size="small">
4
5 <table border="1" width="100%" cellspacing="0" cellpadding="0" class="hTable">
6 <tbody>
7 <tr height="30">
8 <td colspan="12" align="center" ><font size="4">幢单元基本信息</font></td>
9 </tr>
10 <tr height="30">
11 <td colspan="2" align="center" >幢单元号</td>
12 <td colspan="4" >
13 <el-input v-model="form.zdyh"></el-input>
14 </td>
15 <td colspan="2" align="center" >幢单元名称</td>
16 <td colspan="4" >
17 <el-input v-model="form.zdymc"></el-input>
18 </td>
19 </tr>
20 <tr height="30">
21 <td colspan="2" align="center" >地上层数</td>
22 <td colspan="4" >
23 <el-input v-model="form.dscs"></el-input>
24 </td>
25 <td colspan="2" align="center" >地下层数</td>
26 <td colspan="4" >
27 <el-input v-model="form.dxcs"></el-input>
28 </td>
29 </tr>
30 <tr height="30">
31 <td colspan="2" align="center" >总层数</td>
32 <td colspan="4" >
33 <el-input v-model="form.zcs"></el-input>
34 </td>
35 <td colspan="2" align="center" >备注</td>
36 <td colspan="4" >
37 <el-input v-model="form.bz"></el-input>
38 </td>
39 </tr>
40 </tbody>
41 </table>
42
43 <el-row :gutter="24">
44 <el-col :span="24">
45 <el-button type="primary" @click="submitForm('form')">立即创建</el-button>
46 </el-col>
47 </el-row>
48
49
50 </el-form>
51 </div>
52 </template>
53
54 <script>
55
56 import {insertZdyInfo} from "../../../../api/lpb"
57 export default {
58 name: "index",
59 components: {},
60
61 data(){
62 return{
63 form:{
64 zdyh:'',
65 zdymc:'',
66 dscs:'',
67 dxcs:'',
68 zcs:'',
69 bz:'',
70 },
71 rules:{
72 zdyh: [
73 { required: true, message: '幢单元号不能为空', trigger: 'blur' },
74 { min: 5, max: 50, message: '长度最少 5 个字符', trigger: 'blur' }
75 ],
76 zdymc: [
77 { required: true, message: '名称不能为空', trigger: 'change' }
78 ],
79 dscs: [
80 { required: true, message: '地上层数不能为空', trigger: 'blur' },
81 {type: 'number' , message: '必须是数字',trigger:'blur'}
82 ],
83 dxcs: [
84 { required: true, message: '地下层数不能为空', trigger: 'blur' },
85 {type: 'number' , message: '必须是数字'}
86 ],
87 zcs: [
88 { required: true, message: '名称不能为空', trigger: 'change' }
89 ]
90 }
91 }
92 },
93 methods:{
94 submitForm(formName,zrzbsm,ljzbsm) {
95 this.form.zrzbsm=zrzbsm;
96 this.form.ljzbsm=ljzbsm;
97 this.$refs[formName].validate((valid) => {
98 if (valid) {
99 insertZdyInfo(this.form).then((res)=>{
100 if(res.code===200){
101 this.$message.success("保存成功!")
102 //更新树结构数据
103 this.$parent.$parent.getLpbMenuTree(zrzbsm);
104 //关闭弹框
105 this.$parent.$parent.closeDaialog()
106 }
107 return true;
108 })
109 } else {
110 console.log('error submit!!');
111 return false;
112 }
113 });
114 },
115 }
116 }
117 </script>
118
119 <style scoped>
120
121 /deep/.el-input__inner{
122 width: 100%;
123 border:0;
124 }
125
126 table{
127 background: #fff;
128 table-layout: fixed;
129 }
130
131 </style>
...\ No newline at end of file ...\ No newline at end of file