|
@@ -226,42 +226,42 @@
|
|
|
|
|
|
//新增验证并提交
|
|
|
addSubmit() {
|
|
|
- if (!this.siteName) {
|
|
|
+ if (!this.siteName.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入站点名称...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.address) {
|
|
|
+ if (!this.address.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入地址...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.longitude) {
|
|
|
+ if (!this.longitude.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入经度...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.latitude) {
|
|
|
+ if (!this.latitude.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入纬度...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.userName) {
|
|
|
+ if (!this.userName.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入联系人...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.phone) {
|
|
|
+ if (!this.phone.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入手机号码...",
|
|
|
icon: "none"
|
|
@@ -284,14 +284,14 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.installed_capacity) {
|
|
|
+ if (!this.installed_capacity.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入装机容量...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.rheological_change) {
|
|
|
+ if (!this.rheological_change.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入流变变化...",
|
|
|
icon: "none"
|
|
@@ -321,35 +321,35 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.address) {
|
|
|
+ if (!this.siteMessage.address.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入地址...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.longitude) {
|
|
|
+ if (!this.siteMessage.longitude.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入经度...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.latitude) {
|
|
|
+ if (!this.siteMessage.latitude.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入纬度...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.userName) {
|
|
|
+ if (!this.siteMessage.userName.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入联系人...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.phone) {
|
|
|
+ if (!this.siteMessage.phone.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入手机号码...",
|
|
|
icon: "none"
|
|
@@ -370,14 +370,14 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.installed_capacity) {
|
|
|
+ if (!this.siteMessage.installed_capacity.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入装机容量...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.rheological_change) {
|
|
|
+ if (!this.siteMessage.rheological_change.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入流变变化...",
|
|
|
icon: "none"
|