1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import Utils from "~/utils";
export default {
methods: {
// 表单提交
async handleSubmit() {
let result = await this.save();
if (result.respCode == SUCCESS) {
this.$notify({
title: "成功",
message: "保存成功",
type: "success",
});
this.$router.history.push("/business/trnrel");
} else {
this.$notify({
title: "失败",
message: "保存失败",
type: "error",
});
}
},
// 表单暂存
async handleStash() {
let result = await this.pedding();
if (result.respCode == SUCCESS) {
this.$notify({
title: "成功",
message: "暂存成功",
type: "success",
});
this.$router.history.push("/business/sptsel");
} else {
this.$notify({
title: "失败",
message: "暂存失败",
type: "error",
});
}
},
// 表单校验
async handleCheck() {
let result = await this.checkAll();
if (result.respCode != SUCCESS) {
this.$notify.error({ title: "错误", message: result.respMsg });
} else {
// 清除之前的校验状态
this.$refs.modelForm.clearValidate();
const fields = this.$refs.modelForm.fields;
const fieldErrors = result.fieldErrors;
this.updateModel(result.data);
Utils.positioningErrorMsg(fieldErrors, fields);
const tab = Utils.positioningErrorMsg(fieldErrors, fields);
if (tab) {
// tab切换之后,需出发tab-click的事件
this.tabClick(tab);
}
}
},
},
};