index.js
2.88 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
export default {
computed: {
// 获取路由参数
getRouter() {
if (this.$route.query.dataStatus == "view") {
return true;
} else if (this.$route.query.dataStatus == "edit") {
return false;
} else {
return false;
}
},
},
methods: {
// 获取所有数据字典
getAllDictData() {
allDictData()
.then((res) => {
if (res.code != 200) {
this.msgError(res.msg);
return;
}
// 给checkBox表单赋值做展示信息
const { data } = res;
this.cargoType = data.cargoType; // 申报类别
this.cargoStatus = data.cargoStatus; // 货物类型
this.puporpux = data.puporpux; // 取件扫描号
this.serviceCode = data.serviceCode; // Service Code
this.handlingCode = data.handlingCode; // Handling Code
this.subCategory = data.subCategory; // Sub Category
})
.catch(() => {});
},
// 判断对象是否存在某个属性,并且把这个属性值使用分号分隔
hasOwnProperty(item, key) {
if (item.hasOwnProperty(key)) {
if (item[key]) {
item[key] = item[key].split(";");
} else {
item[key] = [];
}
}
},
// 设置属性值
setattrVal(item) {
if (item.location) {
// 始发站
item.isLocation = "1";
}
if (item.notLocation) {
item.isLocation = "2";
}
if (item.location == null && item.notLocation == null) {
item.isLocation = "1";
}
if (item.destinationSite) {
// 目的站
item.isDestinationSite = "1";
}
if (item.notDestinationSite) {
item.isDestinationSite = "2";
}
if (item.destinationSite == null && item.notDestinationSite == null) {
item.isDestinationSite = "1";
}
},
// 失焦事件
blurEvent({ originOfFlightNo }) {
this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
},
// 当前激活面板改变时触发
collapseChange(name) {
// console.log(name);
},
// 始发站
changeLocation(val) {
console.log("始发站:", val);
},
// 目的站
changeDestinationSite(val) {
console.log("目的站:", val);
},
// 申报类别
changeCargoType(arr) {
console.log("申报类别:", arr);
},
// 货物类型
changeCargoStatus(arr) {
console.log("货物类型:", arr);
},
// 取件扫描号
changePuporpux(arr) {
console.log("取件扫描号:", arr);
},
// Service Code
changeServiceCode(arr) {
console.log("Service Code:", arr);
},
// Handling Code
changeHandlingCode(arr) {
console.log("Handling Code:", arr);
},
// Sub Category
changeSubCategory(arr) {
console.log("Sub Category:", arr);
},
},
};