Commit 2b0b0d6f72ab780435076face39dc3609e224ce2
1 parent
730b4930
个人发票 手机号必填
Showing
4 changed files
with
78 additions
and
6 deletions
pages/addTitle/addTitle.vue
... | ... | @@ -23,6 +23,10 @@ |
23 | 23 | <uni-easyinput v-model="baseFormDataPerson.invoicetitle" placeholder="请输入发票抬头"/> |
24 | 24 | </uni-forms-item> |
25 | 25 | |
26 | + <uni-forms-item label="手机号" name="telphone" required> | |
27 | + <uni-easyinput v-model="baseFormDataPerson.telphone" placeholder="请输入手机号"/> | |
28 | + </uni-forms-item> | |
29 | + | |
26 | 30 | <uni-forms-item label="电子邮箱" name="email" required> |
27 | 31 | <uni-easyinput v-model="baseFormDataPerson.email" placeholder="请输入电子邮箱"/> |
28 | 32 | </uni-forms-item> |
... | ... | @@ -49,8 +53,8 @@ |
49 | 53 | <uni-forms-item label="注册地址"> |
50 | 54 | <uni-easyinput v-model="baseFormData.address" placeholder="请输入注册地址"/> |
51 | 55 | </uni-forms-item> |
52 | - <uni-forms-item label="注册电话"> | |
53 | - <uni-easyinput v-model="baseFormData.telphone" placeholder="请输入注册电话"/> | |
56 | + <uni-forms-item label="手机号" name="telphone" required> | |
57 | + <uni-easyinput v-model="baseFormData.telphone" placeholder="请输入手机号"/> | |
54 | 58 | </uni-forms-item> |
55 | 59 | <uni-forms-item label="开户行"> |
56 | 60 | <uni-easyinput v-model="baseFormData.bank" placeholder="请输入开户行"/> |
... | ... | @@ -105,6 +109,7 @@ export default { |
105 | 109 | current: 0, |
106 | 110 | baseFormDataPerson: { |
107 | 111 | invoicetitle: '', |
112 | + telphone: '', | |
108 | 113 | email: '', |
109 | 114 | remark: '', |
110 | 115 | }, |
... | ... | @@ -130,6 +135,12 @@ export default { |
130 | 135 | }] |
131 | 136 | }, |
132 | 137 | |
138 | + telphone: { | |
139 | + rules: [{ | |
140 | + required: true, | |
141 | + errorMessage: '手机号不能为空' | |
142 | + },] | |
143 | + }, | |
133 | 144 | email: { |
134 | 145 | rules: [{ |
135 | 146 | required: true, |
... | ... | @@ -146,6 +157,12 @@ export default { |
146 | 157 | errorMessage: '发票抬头不能为空' |
147 | 158 | }] |
148 | 159 | }, |
160 | + telphone: { | |
161 | + rules: [{ | |
162 | + required: true, | |
163 | + errorMessage: '手机号不能为空' | |
164 | + },] | |
165 | + }, | |
149 | 166 | userId: { |
150 | 167 | rules: [{ |
151 | 168 | required: true, |
... | ... | @@ -187,6 +204,18 @@ export default { |
187 | 204 | submit() { |
188 | 205 | console.log() |
189 | 206 | if(this.current==0){ |
207 | + | |
208 | + if (this.baseFormDataPerson.phone) { | |
209 | + const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; | |
210 | + if (!reg.test(this.baseFormDataPerson.phone)) { | |
211 | + uni.showToast({ | |
212 | + icon: 'none', | |
213 | + title: `手机号输入不正确` | |
214 | + }) | |
215 | + return | |
216 | + } | |
217 | + } | |
218 | + | |
190 | 219 | this.$refs['baseFormPerson'].validate().then(res => { |
191 | 220 | console.log('success', res); |
192 | 221 | |
... | ... | @@ -197,6 +226,7 @@ export default { |
197 | 226 | remark: this.baseFormDataPerson.remark, |
198 | 227 | isDefault: '1',// 是否默认客户抬头信息,1表示是默认抬头信息,0不是默认抬头信息(默认0) |
199 | 228 | invoiceType: '0', // 发票类型(个人、公司),0 表示个人,1表示公司 |
229 | + phone: this.baseFormDataPerson.phone, | |
200 | 230 | }; |
201 | 231 | uni.request({ |
202 | 232 | url: insertCustInvoiceInfo, |
... | ... | @@ -232,6 +262,18 @@ export default { |
232 | 262 | }) |
233 | 263 | } |
234 | 264 | if(this.current==1){ |
265 | + | |
266 | + if (this.baseFormData.telphone) { | |
267 | + const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; | |
268 | + if (!reg.test(this.baseFormData.telphone)) { | |
269 | + uni.showToast({ | |
270 | + icon: 'none', | |
271 | + title: `手机号输入不正确` | |
272 | + }) | |
273 | + return | |
274 | + } | |
275 | + } | |
276 | + | |
235 | 277 | this.$refs['baseForm'].validate().then(res => { |
236 | 278 | console.log('success', res); |
237 | 279 | let insertCustInvoiceInfo = this.$common.insertCustInvoiceInfo; | ... | ... |
pages/companyMsg/companyMsg.vue
... | ... | @@ -58,6 +58,15 @@ |
58 | 58 | {{titleIfo.taxid}} |
59 | 59 | </view> |
60 | 60 | </view> |
61 | + <view class="uni-list-cell jy-fix-height34"> | |
62 | + <view class="uni-list-cell-left"> | |
63 | + <text class="is-required">*</text> | |
64 | + 手机号: | |
65 | + </view> | |
66 | + <view class="uni-list-cell-db"> | |
67 | + {{titleIfo.phone}} | |
68 | + </view> | |
69 | + </view> | |
61 | 70 | <view class="uni-list-cell jy-fix-height34" > |
62 | 71 | <view class="uni-list-cell-left"> |
63 | 72 | <text class="is-required">*</text> | ... | ... |
pages/editTitle/editTitle.vue
... | ... | @@ -22,6 +22,10 @@ |
22 | 22 | <uni-easyinput v-model="baseFormDataPerson.invoicetitle" placeholder="请输入发票抬头"/> |
23 | 23 | </uni-forms-item> |
24 | 24 | |
25 | + <uni-forms-item label="手机号" name="phone" required> | |
26 | + <uni-easyinput v-model="baseFormDataPerson.phone" placeholder="请输入手机号"/> | |
27 | + </uni-forms-item> | |
28 | + | |
25 | 29 | <uni-forms-item label="电子邮箱" name="email" required> |
26 | 30 | <uni-easyinput v-model="baseFormDataPerson.email" placeholder="请输入电子邮箱"/> |
27 | 31 | </uni-forms-item> |
... | ... | @@ -48,7 +52,7 @@ |
48 | 52 | <uni-forms-item label="注册地址"> |
49 | 53 | <uni-easyinput v-model="baseFormData.address" placeholder="请输入注册地址"/> |
50 | 54 | </uni-forms-item> |
51 | - <uni-forms-item label="注册电话"> | |
55 | + <uni-forms-item label="注册电话" name="phone" required> | |
52 | 56 | <uni-easyinput v-model="baseFormData.phone" placeholder="请输入注册电话"/> |
53 | 57 | </uni-forms-item> |
54 | 58 | <uni-forms-item label="开户行"> |
... | ... | @@ -108,6 +112,7 @@ export default { |
108 | 112 | invoicetitle: '', |
109 | 113 | email: '', |
110 | 114 | remark: '', |
115 | + phone:'' | |
111 | 116 | }, |
112 | 117 | baseFormData: { |
113 | 118 | invoicetitle: '', |
... | ... | @@ -138,6 +143,15 @@ export default { |
138 | 143 | },] |
139 | 144 | }, |
140 | 145 | |
146 | + phone: { | |
147 | + rules: [{ | |
148 | + required: true, | |
149 | + errorMessage: '手机号不能为空' | |
150 | + },] | |
151 | + }, | |
152 | + | |
153 | + | |
154 | + | |
141 | 155 | }, |
142 | 156 | // 校验规则 |
143 | 157 | rules: { |
... | ... | @@ -165,6 +179,12 @@ export default { |
165 | 179 | errorMessage: '邮寄地址不能为空' |
166 | 180 | },] |
167 | 181 | }, |
182 | + phone: { | |
183 | + rules: [{ | |
184 | + required: true, | |
185 | + errorMessage: '手机号不能为空' | |
186 | + },] | |
187 | + }, | |
168 | 188 | }, |
169 | 189 | }; |
170 | 190 | }, |
... | ... | @@ -177,6 +197,7 @@ export default { |
177 | 197 | this.baseFormDataPerson.invoicetitle = this.titleIfo.name |
178 | 198 | this.baseFormDataPerson.email = this.titleIfo.email |
179 | 199 | this.baseFormDataPerson.remark = this.titleIfo.remark |
200 | + this.baseFormDataPerson.phone = this.titleIfo.phone | |
180 | 201 | |
181 | 202 | }else{ |
182 | 203 | this.current = 1 |
... | ... | @@ -219,8 +240,8 @@ export default { |
219 | 240 | email: this.baseFormDataPerson.email, |
220 | 241 | remark: this.baseFormDataPerson.remark, |
221 | 242 | invoiceType:'0', |
222 | - isDefault:this.titleIfo.isDefault | |
223 | - | |
243 | + isDefault:this.titleIfo.isDefault, | |
244 | + phone:this.baseFormDataPerson.phone | |
224 | 245 | }; |
225 | 246 | uni.request({ |
226 | 247 | url: updateCustInvoiceInfo, | ... | ... |
pages/invoiceTitle/invoiceTitle.vue
... | ... | @@ -182,7 +182,7 @@ export default { |
182 | 182 | uni.setStorageSync('useTitleIfo',val) |
183 | 183 | let i = JSON.parse(val) |
184 | 184 | uni.navigateTo({ |
185 | - url: '../billing/billing?invoiceType='+i.invoiceType+'&email='+i.email+'&name='+i.name+'&remark='+i.remark | |
185 | + url: '../billing/billing?invoiceType='+i.invoiceType+'&email='+i.email+'&name='+i.name+'&remark='+i.remark+'&phone='+i.phone | |
186 | 186 | }); |
187 | 187 | } |
188 | 188 | }, | ... | ... |