|
@@ -429,6 +429,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
+ const validatePhone2 = (rule, value, callback) => {
|
|
|
+ if(value && !(/^1[3456789]\d{9}$/.test(value))) {
|
|
|
+ callback('请输入正确的手机号')
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const validatePhone = (rule, value, callback) => {
|
|
|
+ if(!value) {
|
|
|
+ callback('请输入手机号')
|
|
|
+ } else if(!(/^1[3456789]\d{9}$/.test(value))) {
|
|
|
+ callback('请输入正确的手机号')
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
baseURL: process.env.VUE_APP_BASE_API,
|
|
|
myHeaders: { 'x-token': getToken() },
|
|
@@ -472,7 +488,8 @@ export default {
|
|
|
formRules: {
|
|
|
orderSmallType: [{ required: true, message: '请选择工单类型', trigger: 'change' }],
|
|
|
receUserName: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
|
|
|
- recePhone: [{ required: true, message: '请输入客户电话', trigger: 'blur' }],
|
|
|
+ recePhone: [{ required: true, validator: validatePhone, trigger: 'blur' }],
|
|
|
+ saleMobile: [{ validator: validatePhone2, trigger: 'blur' }],
|
|
|
payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
|
|
|
},
|
|
|
formType: 'add',
|