threestepInfo.js
2.36 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
109
110
111
112
113
import {
getThreestep,
getBase64,
} from "@/api/business/threestep";
import {getToken} from "@/utils/auth";
import {
getArea,
truckList,
} from "@/api/dict";
export default {
name: "ThreestepInfo",
props: {
businessKey: {
type: String
}
},
data() {
return {
areas: [],
labelName: "工地名称",
labelName2: "绑定消纳场",
infoData: {type: 0},
loading: null,
showPic: false,
picImage: null,
slide1:[]
}
},
created() {
this.loading = true;
this.getInfo();
},
methods: {
slides1(img){
console.log(img)
let slide = [{
src: process.env.VUE_APP_BASE_API + img,
msrc: process.env.VUE_APP_BASE_API + img,
w: 1920,
h: 1080
}]
return slide
},
downloadFile(path) {
window.location.href = process.env.VUE_APP_BASE_API + "/business/threestep/download?path=" + encodeURI(path);
},
getInfo() {
let id;
if (this.businessKey.split(":").length == 2) {
id = this.businessKey.split(":")[1];
} else {
id = this.businessKey;
}
getThreestep(id).then(response => {
this.infoData = response.data;
this.selectType(this.infoData.type);
this.infoData.type = this.infoData.type + "";
getArea().then(res => {
this.areas = res.result;
this.loading = false;
for (let i = 0; i < this.areas.length; i++) {
if (Number(this.infoData.place) == this.areas[i].code) {
this.infoData.place = this.areas[i].name;
}
}
});
let query = {
'page': 1,
'size': 9999,
'valid': 0
}
truckList(query).then(res => {
this.truckList = res.result.list;
let trucks = "";
for (let i in this.truckList) {
if (this.infoData.companyTrucks.split(",").indexOf(this.truckList[i].id) > -1) {
trucks += this.truckList[i].licenseplateNo + ",";
}
}
this.infoData.companyTrucks = trucks;
});
});
},
selectType(value) {
if (value == "0") {
this.labelName = "工地名称";
this.labelName2 = "绑定消纳场";
} else {
this.labelName = "消纳场名称";
this.labelName2 = "绑定工地";
}
},
}
}