wasteUpdateInfo.vue
5.58 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<template>
<div class="app-body">
<div class="content">
<table>
<tr>
<th colspan="4" style="margin:0 auto;text-align: center">危险废物</th>
</tr>
<tr>
<td colspan="2">废物名称:{{ wasteData.wasteName }}</td>
<td rowspan="6">
<div style="display: flex;flex-direction: column;align-items: center;height: 100%;">
<div style="font-size: 1rem;">危险特性</div>
<img style="width: 15vw;" src="../../assets/waste2.png" alt=""/>
<img style="width: 15vw;margin: 5px 0;" src="../../assets/waste3.png" alt=""/>
<img v-if="type=='1'" style="width: 15vw;" src="../../assets/waste1.png" alt=""/>
</div>
</td>
</tr>
<tr>
<td>废物类别: {{ wasteData.wasteType }}</td>
</tr>
<tr>
<td>废物代码: {{ wasteData.wasteCode }}</td>
</tr>
<tr>
<td>废物形态: {{ wasteData.wasteForm }}</td>
</tr>
<tr style="word-break:break-all;overflow:hidden;">
<td>主要成分: <br/>{{ wasteData.mainComponent }}</td>
</tr>
<tr style="word-break:break-all;overflow:hidden;">
<td>有害成分: <br/>{{ wasteData.harmfulIngredient }}</td>
</tr>
<tr style="word-break:break-all;overflow:hidden;">
<td colspan="4">注意事项: <br/>{{ wasteData.announcements }}</td>
</tr>
<tr>
<td colspan="4">数字识别码: {{ wasteData.numericIdentificationCode }}</td>
</tr>
<tr style="word-break:break-all;overflow:hidden;">
<td colspan="4">产生/收集单位 : {{ wasteData.produceUnit }}</td>
</tr>
<tr style="word-break:break-all;overflow:hidden;">
<td colspan="4" style="color: white">废物总重量: {{ wasteData.wasteWeight }}/kg</td>
</tr>
<tr style="height: 80px;">
<td colspan="4">
<div style="width: 100%;height: 100%;">
<label style="font-weight: 800;">操作:</label>
<select v-model="opp_type"
style="width: 61vw;
height: 3.8vh;
margin-left: 5vw;"
>
<option value="1">转入</option>
<option value="2">转出</option>
</select>
</div>
</td>
</tr>
<tr height="50px" v-if="opp_type=='2'">
<td colspan="4"><label style="font-weight: 800;">转出单位:</label> <input v-model="receivingUnitr"
style="height: 30px;width: 60vw"
type="text"/></td>
</tr>
<tr>
<td colspan="4"><label style="font-weight: 800;">转出重量:</label> <input v-model.number="weight"
style="height: 30px;width: 60vw"
type="text"/>/kg
</td>
</tr>
<tr>
<td colspan="4">
<div style="display: flex;">
<label style="font-weight: 800;margin-top: 2rem">操作备注:</label>
<textarea v-model="opp_remark" maxlength="120"
style="height: 80px;width: 60vw;word-break:break-all;overflow:hidden;"
type="text"/>
</div>
</td>
</tr>
<tr style="height: 80px;">
<td colspan="4" style="text-align: center;">
<button style="width: 20rem;height: 3rem;" @click="submit">提交</button>
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import {getWasteInfo, updateWaste} from '@/api/api';
export default {
name: "wasteUpdateInfo",
data() {
return {
id: '',
type: '',
wasteData: [],
weight: '',
opp_type: '1',
receivingUnitr: '',
opp_remark: '',
}
},
created() {
this.getWasteInfo();
},
methods: {
getWasteInfo() {
var params = {};
location.search.substr(1).split('&').forEach(function (item) {
var s = item.split('=');
params[s[0]] = s[1];
params[s[1]] = s[2];
});
this.id = params.id
this.type = params.type
let params2 = {
'id': this.id
}
getWasteInfo(params2).then(res => {
this.wasteData = res.result;
})
},
submit() {
if (typeof this.weight !== 'number') {
alert('请输入正确的重量')
return
}
let params3 = {
'headId': this.wasteData.id,
'wasteWeight': this.weight,
'type': this.opp_type,
'receivingUnitr': this.receivingUnitr,
'remark': this.opp_remark
}
updateWaste(params3).then(res => {
this.getWasteInfo();
this.clearInput();
alert(res.result);
})
},
clearInput() {
this.weight = '';
this.opp_type = '1';
this.receivingUnitr = '';
this.opp_remark = '';
}
},
}
</script>
<style scoped>
.app-body {
width: 100%;
height: 100%;
}
.content {
width: 99.1%;
height: 100%;
border: 1px solid yellowgreen;
margin: 0 auto;
background-color: #ec9627;
}
body {
font-size: 1rem;
}
table,
td,
th {
border-collapse: collapse;
border-spacing: 0;
}
table {
width: 100%;
margin-top: 10px;
}
td,
th {
border: 2px solid #000000;
padding: 5px 10px;
}
.form-group {
margin: 10px;
}
</style>