Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         isCPF(){
  2.             if (this.cpfOrCnpjField.length > 11)    {
  3.                 return false
  4.             }  
  5.             return true
  6.         },
  7.         hasErrorOnCPF() {
  8.             if (this.isCPF) {
  9.                 let cpf = this.cpfOrCnpjField.replace(/\D/g, '');
  10.                 let isValidCpf = clientUtils.isValidCpf(cpf)
  11.                 if (isValidCpf) return false
  12.                 else return true
  13.             } else {
  14.                 return false //retornar falso sempre que for um CNPJ
  15.             }
  16.         },
  17.         hasErrorOnCNPJ() {
  18.             if (!this.isCPF) {
  19.                 let cnpj = this.cnpjField.replace(/\D/g, '');
  20.                 let isValidCNPJ = clientUtils.isValidCnpj(cnpj)
  21.                 if (isValidCnpj) return false
  22.                 return true
  23.             } else {
  24.                 return false //retornar falso sempre que for um CPF
  25.             }
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement