幢单元表单
Showing
2 changed files
with
125 additions
and
0 deletions
| ... | @@ -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 | ]; | ... | ... |
src/views/systemZRZ/lpb/zdy/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="zdy-content"> | ||
| 3 | <el-form :model="form" :rules="rules" ref="form" label-width="110px" size="small"> | ||
| 4 | <el-row :gutter="24"> | ||
| 5 | <el-col :span="12"> | ||
| 6 | <el-form-item label="幢单元号" prop="zdyh"> | ||
| 7 | <el-input v-model="form.zdyh"></el-input> | ||
| 8 | </el-form-item> | ||
| 9 | </el-col> | ||
| 10 | <el-col :span="12"> | ||
| 11 | <el-form-item label="项目名称" prop="zdymc"> | ||
| 12 | <el-input v-model="form.zdymc"></el-input> | ||
| 13 | </el-form-item> | ||
| 14 | </el-col> | ||
| 15 | </el-row> | ||
| 16 | |||
| 17 | <el-row :gutter="24"> | ||
| 18 | <el-col :span="12"> | ||
| 19 | <el-form-item label="地上层数" prop="dscs"> | ||
| 20 | <el-input v-model.number="form.dscs" type="number"></el-input> | ||
| 21 | </el-form-item> | ||
| 22 | </el-col> | ||
| 23 | <el-col :span="12"> | ||
| 24 | <el-form-item label="地下层数" prop="dxcs"> | ||
| 25 | <el-input v-model.number="form.dxcs" type="number"></el-input> | ||
| 26 | </el-form-item> | ||
| 27 | |||
| 28 | </el-col> | ||
| 29 | </el-row> | ||
| 30 | |||
| 31 | |||
| 32 | <el-row :gutter="24"> | ||
| 33 | <el-col :span="12"> | ||
| 34 | <el-form-item label="总层数" prop="zcs"> | ||
| 35 | <el-input v-model.number="form.zcs" type="number"></el-input> | ||
| 36 | </el-form-item> | ||
| 37 | </el-col> | ||
| 38 | </el-row> | ||
| 39 | |||
| 40 | <el-row :gutter="24"> | ||
| 41 | <el-col :span="24"> | ||
| 42 | <el-form-item label="备注"> | ||
| 43 | <el-input v-model="form.bz"></el-input> | ||
| 44 | </el-form-item> | ||
| 45 | </el-col> | ||
| 46 | </el-row> | ||
| 47 | |||
| 48 | <el-row :gutter="24"> | ||
| 49 | <el-col :span="24"> | ||
| 50 | <el-form-item> | ||
| 51 | <el-button type="primary" @click="submitForm('form')">立即创建</el-button> | ||
| 52 | </el-form-item> | ||
| 53 | </el-col> | ||
| 54 | </el-row> | ||
| 55 | |||
| 56 | |||
| 57 | </el-form> | ||
| 58 | </div> | ||
| 59 | </template> | ||
| 60 | |||
| 61 | <script> | ||
| 62 | export default { | ||
| 63 | name: "index", | ||
| 64 | components: {}, | ||
| 65 | |||
| 66 | data(){ | ||
| 67 | return{ | ||
| 68 | form:{ | ||
| 69 | zdyh:'', | ||
| 70 | zdymc:'', | ||
| 71 | dscs:'', | ||
| 72 | dxcs:'', | ||
| 73 | zcs:'', | ||
| 74 | bz:'', | ||
| 75 | }, | ||
| 76 | rules:{ | ||
| 77 | zdyh: [ | ||
| 78 | { required: true, message: '幢单元号不能为空', trigger: 'blur' }, | ||
| 79 | { min: 5, max: 50, message: '长度最少 5 个字符', trigger: 'blur' } | ||
| 80 | ], | ||
| 81 | zdymc: [ | ||
| 82 | { required: true, message: '名称不能为空', trigger: 'change' } | ||
| 83 | ], | ||
| 84 | dscs: [ | ||
| 85 | { required: true, message: '地上层数不能为空', trigger: 'blur' }, | ||
| 86 | {type: 'number' , message: '必须是数字',trigger:'blur'} | ||
| 87 | ], | ||
| 88 | dxcs: [ | ||
| 89 | { required: true, message: '地下层数不能为空', trigger: 'blur' }, | ||
| 90 | {type: 'number' , message: '必须是数字'} | ||
| 91 | ], | ||
| 92 | zcs: [ | ||
| 93 | { required: true, message: '名称不能为空', trigger: 'change' } | ||
| 94 | ] | ||
| 95 | } | ||
| 96 | } | ||
| 97 | }, | ||
| 98 | methods:{ | ||
| 99 | submitForm(formName) { | ||
| 100 | this.$refs[formName].validate((valid) => { | ||
| 101 | if (valid) { | ||
| 102 | alert('submit!'); | ||
| 103 | } else { | ||
| 104 | console.log('error submit!!'); | ||
| 105 | return false; | ||
| 106 | } | ||
| 107 | }); | ||
| 108 | }, | ||
| 109 | } | ||
| 110 | } | ||
| 111 | </script> | ||
| 112 | |||
| 113 | <style scoped> | ||
| 114 | |||
| 115 | /deep/.el-input__inner{ | ||
| 116 | width: 100%; | ||
| 117 | } | ||
| 118 | |||
| 119 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment