|
@@ -64,7 +64,7 @@
|
|
|
|
|
|
|
|
|
<view class="btn-area submitBottomBtn padding-lr-sm">
|
|
|
- <button class="bg-blue round margin-top" @click="addSubmit">提 交 </button>
|
|
|
+ <button class="bg-blue round margin-top" @click="$noMultipleClicks(addSubmit)">提 交 </button>
|
|
|
</view>
|
|
|
</form>
|
|
|
<!-- 站点新增end -->
|
|
@@ -130,7 +130,7 @@
|
|
|
<input name="input" v-model="siteMessage.rheological_change"></input>
|
|
|
</view>
|
|
|
<view class="btn-area submitBottomBtn padding-lr-sm">
|
|
|
- <button class="bg-blue round margin-top" @click="editSubmit">提 交 </button>
|
|
|
+ <button class="bg-blue round margin-top" @click="$noMultipleClicks(editSubmit)">提 交 </button>
|
|
|
</view>
|
|
|
</form>
|
|
|
<!-- 站点修改end -->
|
|
@@ -144,6 +144,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ noClick:true,
|
|
|
|
|
|
id: 0,
|
|
|
latitude: "",
|
|
@@ -226,14 +227,14 @@
|
|
|
|
|
|
//新增验证并提交
|
|
|
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"
|
|
@@ -254,14 +255,14 @@
|
|
|
});
|
|
|
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 +285,21 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.installed_capacity) {
|
|
|
+ if (!this.region) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请选择所属区域...",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 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"
|
|
@@ -314,14 +322,14 @@
|
|
|
|
|
|
//编辑验证并提交
|
|
|
editSubmit() {
|
|
|
- if (!this.siteMessage.siteName) {
|
|
|
+ if (!this.siteMessage.siteName.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请填写站点名称...",
|
|
|
icon: "none"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if (!this.siteMessage.address) {
|
|
|
+ if (!this.siteMessage.address.replace(/^\s*/g,'')) {
|
|
|
uni.showToast({
|
|
|
title: "请输入地址...",
|
|
|
icon: "none"
|
|
@@ -342,14 +350,14 @@
|
|
|
});
|
|
|
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,6 +378,13 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
+ if (!this.siteMessage.region) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请选择所属区域...",
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!this.siteMessage.installed_capacity) {
|
|
|
uni.showToast({
|
|
|
title: "请输入装机容量...",
|