|
@@ -574,26 +574,33 @@ export default {
|
|
|
this.form.provinceName = this.startArea.provinceName
|
|
|
this.form.cityName = this.startArea.cityName
|
|
|
this.form.districtName = this.startArea.districtName
|
|
|
+
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: 'Loading',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
|
|
|
// 不允许重复提交
|
|
|
this.subLoading = true
|
|
|
if (this.form.id != null) {
|
|
|
updateAgent(this.form).then(response => {
|
|
|
+ loading.close();
|
|
|
this.msgSuccess("修改成功");
|
|
|
- this.subLoading = false
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
}).catch((error) => {
|
|
|
- this.subLoading = true
|
|
|
+ loading.close();
|
|
|
});
|
|
|
} else {
|
|
|
addAgent(this.form).then(response => {
|
|
|
+ loading.close();
|
|
|
this.msgSuccess("新增成功");
|
|
|
- this.subLoading = false
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
}).catch((error) => {
|
|
|
- this.subLoading = true
|
|
|
+ loading.close();
|
|
|
});
|
|
|
}
|
|
|
}
|