Commit 2b0b0d6f72ab780435076face39dc3609e224ce2

Authored by 刘淇
1 parent 730b4930

个人发票 手机号必填

pages/addTitle/addTitle.vue
@@ -23,6 +23,10 @@ @@ -23,6 +23,10 @@
23 <uni-easyinput v-model="baseFormDataPerson.invoicetitle" placeholder="请输入发票抬头"/> 23 <uni-easyinput v-model="baseFormDataPerson.invoicetitle" placeholder="请输入发票抬头"/>
24 </uni-forms-item> 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 <uni-forms-item label="电子邮箱" name="email" required> 30 <uni-forms-item label="电子邮箱" name="email" required>
27 <uni-easyinput v-model="baseFormDataPerson.email" placeholder="请输入电子邮箱"/> 31 <uni-easyinput v-model="baseFormDataPerson.email" placeholder="请输入电子邮箱"/>
28 </uni-forms-item> 32 </uni-forms-item>
@@ -49,8 +53,8 @@ @@ -49,8 +53,8 @@
49 <uni-forms-item label="注册地址"> 53 <uni-forms-item label="注册地址">
50 <uni-easyinput v-model="baseFormData.address" placeholder="请输入注册地址"/> 54 <uni-easyinput v-model="baseFormData.address" placeholder="请输入注册地址"/>
51 </uni-forms-item> 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 </uni-forms-item> 58 </uni-forms-item>
55 <uni-forms-item label="开户行"> 59 <uni-forms-item label="开户行">
56 <uni-easyinput v-model="baseFormData.bank" placeholder="请输入开户行"/> 60 <uni-easyinput v-model="baseFormData.bank" placeholder="请输入开户行"/>
@@ -105,6 +109,7 @@ export default { @@ -105,6 +109,7 @@ export default {
105 current: 0, 109 current: 0,
106 baseFormDataPerson: { 110 baseFormDataPerson: {
107 invoicetitle: '', 111 invoicetitle: '',
  112 + telphone: '',
108 email: '', 113 email: '',
109 remark: '', 114 remark: '',
110 }, 115 },
@@ -130,6 +135,12 @@ export default { @@ -130,6 +135,12 @@ export default {
130 }] 135 }]
131 }, 136 },
132 137
  138 + telphone: {
  139 + rules: [{
  140 + required: true,
  141 + errorMessage: '手机号不能为空'
  142 + },]
  143 + },
133 email: { 144 email: {
134 rules: [{ 145 rules: [{
135 required: true, 146 required: true,
@@ -146,6 +157,12 @@ export default { @@ -146,6 +157,12 @@ export default {
146 errorMessage: '发票抬头不能为空' 157 errorMessage: '发票抬头不能为空'
147 }] 158 }]
148 }, 159 },
  160 + telphone: {
  161 + rules: [{
  162 + required: true,
  163 + errorMessage: '手机号不能为空'
  164 + },]
  165 + },
149 userId: { 166 userId: {
150 rules: [{ 167 rules: [{
151 required: true, 168 required: true,
@@ -187,6 +204,18 @@ export default { @@ -187,6 +204,18 @@ export default {
187 submit() { 204 submit() {
188 console.log() 205 console.log()
189 if(this.current==0){ 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 this.$refs['baseFormPerson'].validate().then(res => { 219 this.$refs['baseFormPerson'].validate().then(res => {
191 console.log('success', res); 220 console.log('success', res);
192 221
@@ -197,6 +226,7 @@ export default { @@ -197,6 +226,7 @@ export default {
197 remark: this.baseFormDataPerson.remark, 226 remark: this.baseFormDataPerson.remark,
198 isDefault: '1',// 是否默认客户抬头信息,1表示是默认抬头信息,0不是默认抬头信息(默认0) 227 isDefault: '1',// 是否默认客户抬头信息,1表示是默认抬头信息,0不是默认抬头信息(默认0)
199 invoiceType: '0', // 发票类型(个人、公司),0 表示个人,1表示公司 228 invoiceType: '0', // 发票类型(个人、公司),0 表示个人,1表示公司
  229 + phone: this.baseFormDataPerson.phone,
200 }; 230 };
201 uni.request({ 231 uni.request({
202 url: insertCustInvoiceInfo, 232 url: insertCustInvoiceInfo,
@@ -232,6 +262,18 @@ export default { @@ -232,6 +262,18 @@ export default {
232 }) 262 })
233 } 263 }
234 if(this.current==1){ 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 this.$refs['baseForm'].validate().then(res => { 277 this.$refs['baseForm'].validate().then(res => {
236 console.log('success', res); 278 console.log('success', res);
237 let insertCustInvoiceInfo = this.$common.insertCustInvoiceInfo; 279 let insertCustInvoiceInfo = this.$common.insertCustInvoiceInfo;
pages/companyMsg/companyMsg.vue
@@ -58,6 +58,15 @@ @@ -58,6 +58,15 @@
58 {{titleIfo.taxid}} 58 {{titleIfo.taxid}}
59 </view> 59 </view>
60 </view> 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 <view class="uni-list-cell jy-fix-height34" > 70 <view class="uni-list-cell jy-fix-height34" >
62 <view class="uni-list-cell-left"> 71 <view class="uni-list-cell-left">
63 <text class="is-required">*</text> 72 <text class="is-required">*</text>
pages/editTitle/editTitle.vue
@@ -22,6 +22,10 @@ @@ -22,6 +22,10 @@
22 <uni-easyinput v-model="baseFormDataPerson.invoicetitle" placeholder="请输入发票抬头"/> 22 <uni-easyinput v-model="baseFormDataPerson.invoicetitle" placeholder="请输入发票抬头"/>
23 </uni-forms-item> 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 <uni-forms-item label="电子邮箱" name="email" required> 29 <uni-forms-item label="电子邮箱" name="email" required>
26 <uni-easyinput v-model="baseFormDataPerson.email" placeholder="请输入电子邮箱"/> 30 <uni-easyinput v-model="baseFormDataPerson.email" placeholder="请输入电子邮箱"/>
27 </uni-forms-item> 31 </uni-forms-item>
@@ -48,7 +52,7 @@ @@ -48,7 +52,7 @@
48 <uni-forms-item label="注册地址"> 52 <uni-forms-item label="注册地址">
49 <uni-easyinput v-model="baseFormData.address" placeholder="请输入注册地址"/> 53 <uni-easyinput v-model="baseFormData.address" placeholder="请输入注册地址"/>
50 </uni-forms-item> 54 </uni-forms-item>
51 - <uni-forms-item label="注册电话"> 55 + <uni-forms-item label="注册电话" name="phone" required>
52 <uni-easyinput v-model="baseFormData.phone" placeholder="请输入注册电话"/> 56 <uni-easyinput v-model="baseFormData.phone" placeholder="请输入注册电话"/>
53 </uni-forms-item> 57 </uni-forms-item>
54 <uni-forms-item label="开户行"> 58 <uni-forms-item label="开户行">
@@ -108,6 +112,7 @@ export default { @@ -108,6 +112,7 @@ export default {
108 invoicetitle: '', 112 invoicetitle: '',
109 email: '', 113 email: '',
110 remark: '', 114 remark: '',
  115 + phone:''
111 }, 116 },
112 baseFormData: { 117 baseFormData: {
113 invoicetitle: '', 118 invoicetitle: '',
@@ -138,6 +143,15 @@ export default { @@ -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 rules: { 157 rules: {
@@ -165,6 +179,12 @@ export default { @@ -165,6 +179,12 @@ export default {
165 errorMessage: '邮寄地址不能为空' 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,6 +197,7 @@ export default {
177 this.baseFormDataPerson.invoicetitle = this.titleIfo.name 197 this.baseFormDataPerson.invoicetitle = this.titleIfo.name
178 this.baseFormDataPerson.email = this.titleIfo.email 198 this.baseFormDataPerson.email = this.titleIfo.email
179 this.baseFormDataPerson.remark = this.titleIfo.remark 199 this.baseFormDataPerson.remark = this.titleIfo.remark
  200 + this.baseFormDataPerson.phone = this.titleIfo.phone
180 201
181 }else{ 202 }else{
182 this.current = 1 203 this.current = 1
@@ -219,8 +240,8 @@ export default { @@ -219,8 +240,8 @@ export default {
219 email: this.baseFormDataPerson.email, 240 email: this.baseFormDataPerson.email,
220 remark: this.baseFormDataPerson.remark, 241 remark: this.baseFormDataPerson.remark,
221 invoiceType:'0', 242 invoiceType:'0',
222 - isDefault:this.titleIfo.isDefault  
223 - 243 + isDefault:this.titleIfo.isDefault,
  244 + phone:this.baseFormDataPerson.phone
224 }; 245 };
225 uni.request({ 246 uni.request({
226 url: updateCustInvoiceInfo, 247 url: updateCustInvoiceInfo,
pages/invoiceTitle/invoiceTitle.vue
@@ -182,7 +182,7 @@ export default { @@ -182,7 +182,7 @@ export default {
182 uni.setStorageSync('useTitleIfo',val) 182 uni.setStorageSync('useTitleIfo',val)
183 let i = JSON.parse(val) 183 let i = JSON.parse(val)
184 uni.navigateTo({ 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 },