|
@@ -745,7 +745,6 @@ class CustomerProfile extends Component {
|
|
|
// 新建联系人
|
|
|
add() {
|
|
|
let data = this.state.obj
|
|
|
- console.log(data)
|
|
|
for (let i in data) {
|
|
|
if (!data[i] && data[i] !== 0) {
|
|
|
Taro.showToast({
|
|
@@ -753,6 +752,19 @@ class CustomerProfile extends Component {
|
|
|
icon: "none",
|
|
|
});
|
|
|
return
|
|
|
+ } else if ('name,position,department'.indexOf(i) > -1) {
|
|
|
+ if (!data[i].match(/^[\D].*[\u4e00-\u9fff]+$/)) {
|
|
|
+ let keyObjName = {
|
|
|
+ name: "姓名",
|
|
|
+ position: "职位",
|
|
|
+ department: "部门"
|
|
|
+ };
|
|
|
+ Taro.showToast({
|
|
|
+ title: `请输入正确的${keyObjName[i]},不能以数字开头,且至少包含一个汉字`,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
} else if (i == "mobile") {
|
|
|
if (!(/^1[3-9]\d{9}$/.test(data[i]))) {
|
|
|
Taro.showToast({
|