683f3209 by yangwei

个人信息表单校验及部分样式修改

1 parent 30176885
...@@ -20,16 +20,17 @@ ...@@ -20,16 +20,17 @@
20 v-for="(item, index) in sexList" 20 v-for="(item, index) in sexList"
21 :key="index" 21 :key="index"
22 :label="item.value" 22 :label="item.value"
23 >{{ item.name }}</el-radio> 23 >{{ item.name }}</el-radio
24 >
24 </el-radio-group> 25 </el-radio-group>
25 </el-form-item> 26 </el-form-item>
26 <el-form-item label="身份证号:" prop="idCard"> 27 <el-form-item label="身份证号:" prop="idCard">
27 <el-input v-model="form.idCard" clearable /> 28 <el-input v-model="form.idCard" clearable />
28 </el-form-item> 29 </el-form-item>
29 <el-form-item label="手机号码:" prop="mobilePhone"> 30 <el-form-item label="手机号码:" prop="mobilePhone">
30 <el-input v-model="form.mobilePhone" clearable type="number" /> 31 <el-input v-model="form.mobilePhone" clearable />
31 </el-form-item> 32 </el-form-item>
32 <el-form-item label="办公电话:"> 33 <el-form-item label="办公电话:" prop="telephone">
33 <el-input v-model="form.telephone" clearable /> 34 <el-input v-model="form.telephone" clearable />
34 </el-form-item> 35 </el-form-item>
35 <el-form-item label="办公地址:"> 36 <el-form-item label="办公地址:">
...@@ -55,46 +56,53 @@ export default { ...@@ -55,46 +56,53 @@ export default {
55 data() { 56 data() {
56 return { 57 return {
57 form: { 58 form: {
58 "id": "3127e455-43ba-45ff-9326-0e02ef89485e", 59 id: "3127e455-43ba-45ff-9326-0e02ef89485e",
59 "name": "超级管理员", 60 name: "超级管理员",
60 "sort": 1, 61 sort: 1,
61 "loginName": "admin", 62 loginName: "admin",
62 "email": null, 63 email: null,
63 "lastLoginTime": null, 64 lastLoginTime: null,
64 "mobilePhone": "18291003568", 65 mobilePhone: "18291003568",
65 "isLocked": false, 66 isLocked: false,
66 "status": "ACTIVE", 67 status: "ACTIVE",
67 "passwordChangeTime": "2021-12-10T08:01:01.569+0000", 68 passwordChangeTime: "2021-12-10T08:01:01.569+0000",
68 "idCard": "612725202111021521", 69 idCard: "612725202111021521",
69 "departmentId": "2eae5304-544f-4f5b-b354-8f5d47433c9b", 70 departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b",
70 "departmentName": null, 71 departmentName: null,
71 "organizationId": "0bca67ae-1d9e-4b41-b057-f165586d24aa", 72 organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa",
72 "sex": "0", 73 sex: "0",
73 "isDuty": true, 74 isDuty: true,
74 "code": "123324", 75 code: "123324",
75 "jobLevel": null, 76 jobLevel: null,
76 "telephone": "028-87720898", 77 telephone: "028-87720898",
77 "address": "办公地点修改测试" 78 address: "办公地点修改测试",
78 }, 79 },
79 sexList: [], 80 sexList: [],
80 rules: { 81 rules: {
81 mobilePhone: [ 82 mobilePhone: [
82 { 83 {
83 pattern: 84 pattern:
84 /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, 85 /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
85 message: '手机号码格式有误', 86 message: "手机号码格式有误",
86 trigger: 'blur' 87 trigger: "blur",
87 } 88 },
88 ], 89 ],
89 idCard: [ 90 idCard: [
90 { 91 {
91 pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, 92 pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
92 message: '身份证号格式有误', 93 message: "身份证号格式有误",
93 trigger: 'blur' 94 trigger: "blur",
94 } 95 },
95 ] 96 ],
96 } 97 telephone: [
97 } 98 {
99 pattern: /^((d{3,4})|d{3,4}-|s)?d{7,14}$/,
100 message: "办公电话格式有误",
101 trigger: "blur",
102 },
103 ],
104 },
105 };
98 }, 106 },
99 watch: { 107 watch: {
100 // userInfo: { 108 // userInfo: {
...@@ -108,71 +116,71 @@ export default { ...@@ -108,71 +116,71 @@ export default {
108 mounted() { 116 mounted() {
109 // getDictItems('XB').then((res) => { 117 // getDictItems('XB').then((res) => {
110 // if (res.status === 1) { 118 // if (res.status === 1) {
111 this.sexList = [ 119 this.sexList = [
112 { 120 {
113 "id": "079c72b2-f3de-4a4f-b2a1-e5c8f085cc5f", 121 id: "079c72b2-f3de-4a4f-b2a1-e5c8f085cc5f",
114 "createdAt": "2021-06-11T02:42:02.000+0000", 122 createdAt: "2021-06-11T02:42:02.000+0000",
115 "updatedAt": "2021-09-03T09:21:46.000+0000", 123 updatedAt: "2021-09-03T09:21:46.000+0000",
116 "createdBy": "3127e455-43ba-45ff-9326-0e02ef89485e", 124 createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
117 "updatedBy": "3127e455-43ba-45ff-9326-0e02ef89485e", 125 updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
118 "sort": 2, 126 sort: 2,
119 "name": "男", 127 name: "男",
120 "description": "", 128 description: "",
121 "code": "N362", 129 code: "N362",
122 "value": "0", 130 value: "0",
123 "parentId": null, 131 parentId: null,
124 "baseDataCategoryId": "11441374-5e2a-4635-bfa5-d1a430222019", 132 baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019",
125 "version": 1, 133 version: 1,
126 "valid": true, 134 valid: true,
127 "standard": false, 135 standard: false,
128 "standardName": null, 136 standardName: null,
129 "standardValue": null, 137 standardValue: null,
130 "children": [], 138 children: [],
131 "commonName": "男(N362)" 139 commonName: "男(N362)",
132 }, 140 },
133 { 141 {
134 "id": "4d6f845d-6f6a-4848-8fc2-a3760764c196", 142 id: "4d6f845d-6f6a-4848-8fc2-a3760764c196",
135 "createdAt": "2021-06-11T02:42:12.000+0000", 143 createdAt: "2021-06-11T02:42:12.000+0000",
136 "updatedAt": "2021-09-03T09:21:46.000+0000", 144 updatedAt: "2021-09-03T09:21:46.000+0000",
137 "createdBy": "3127e455-43ba-45ff-9326-0e02ef89485e", 145 createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
138 "updatedBy": "3127e455-43ba-45ff-9326-0e02ef89485e", 146 updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
139 "sort": 1, 147 sort: 1,
140 "name": "女", 148 name: "女",
141 "description": "", 149 description: "",
142 "code": "N922", 150 code: "N922",
143 "value": "1", 151 value: "1",
144 "parentId": null, 152 parentId: null,
145 "baseDataCategoryId": "11441374-5e2a-4635-bfa5-d1a430222019", 153 baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019",
146 "version": 1, 154 version: 1,
147 "valid": true, 155 valid: true,
148 "standard": false, 156 standard: false,
149 "standardName": null, 157 standardName: null,
150 "standardValue": null, 158 standardValue: null,
151 "children": [], 159 children: [],
152 "commonName": "女(N922)" 160 commonName: "女(N922)",
153 }, 161 },
154 { 162 {
155 "id": "637c360b-d4e2-4afb-aa18-33624cf3abcb", 163 id: "637c360b-d4e2-4afb-aa18-33624cf3abcb",
156 "createdAt": "2021-06-11T02:42:29.000+0000", 164 createdAt: "2021-06-11T02:42:29.000+0000",
157 "updatedAt": "2021-09-03T09:21:43.000+0000", 165 updatedAt: "2021-09-03T09:21:43.000+0000",
158 "createdBy": "3127e455-43ba-45ff-9326-0e02ef89485e", 166 createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
159 "updatedBy": "3127e455-43ba-45ff-9326-0e02ef89485e", 167 updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
160 "sort": 0, 168 sort: 0,
161 "name": "保密", 169 name: "保密",
162 "description": "", 170 description: "",
163 "code": "BM816", 171 code: "BM816",
164 "value": "2", 172 value: "2",
165 "parentId": null, 173 parentId: null,
166 "baseDataCategoryId": "11441374-5e2a-4635-bfa5-d1a430222019", 174 baseDataCategoryId: "11441374-5e2a-4635-bfa5-d1a430222019",
167 "version": 1, 175 version: 1,
168 "valid": true, 176 valid: true,
169 "standard": false, 177 standard: false,
170 "standardName": null, 178 standardName: null,
171 "standardValue": null, 179 standardValue: null,
172 "children": [], 180 children: [],
173 "commonName": "保密(BM816)" 181 commonName: "保密(BM816)",
174 } 182 },
175 ] 183 ];
176 // } else { 184 // } else {
177 // this.$message.error({ message: res.message, showClose: true }) 185 // this.$message.error({ message: res.message, showClose: true })
178 // } 186 // }
...@@ -202,14 +210,14 @@ export default { ...@@ -202,14 +210,14 @@ export default {
202 // }) 210 // })
203 // } 211 // }
204 // }) 212 // })
205 } 213 },
206 } 214 },
207 } 215 };
208 </script> 216 </script>
209 217
210 <style scoped lang="scss"> 218 <style scoped lang="scss">
211 .user-info { 219 .user-info {
212 margin: .1875rem 1.0417rem; 220 margin: 0.1875rem 1.0417rem;
213 background: #ffffff; 221 background: #ffffff;
214 max-height: 90%; 222 max-height: 90%;
215 overflow-y: auto; 223 overflow-y: auto;
...@@ -224,7 +232,7 @@ export default { ...@@ -224,7 +232,7 @@ export default {
224 padding: 0 8px; 232 padding: 0 8px;
225 height: 40px; 233 height: 40px;
226 line-height: 40px; 234 line-height: 40px;
227 border: 1px solid #dfe7f3; 235 border: 1px solid #6BC1FC;
228 } 236 }
229 } 237 }
230 } 238 }
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
124 padding: 0 8px; 124 padding: 0 8px;
125 height: 40px; 125 height: 40px;
126 line-height: 40px; 126 line-height: 40px;
127 border: 1px solid #dfe7f3; 127 border: 1px solid #6BC1FC;
128 } 128 }
129 } 129 }
130 } 130 }
......