expenses_edit.jsp
14.5 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>费用统计编辑</title>
<jsp:include page="../../template/head.jsp"></jsp:include>
<link href="<%=request.getContextPath()%>/resource/library/css/form.css" rel="stylesheet">
<%--非空必填--%>
<style>
.kv-table label {
color: #FF0000;
margin-right: 5px;
}
</style>
</head>
<body>
<div class="container" style="width: 100%; height: 100%">
<div class="content" ms-controller="container" style="width: 100%; height: 100%">
<form class="from-control" id="editForm">
<input type="hidden" name="id" ms-duplex="@data.id">
<div id="tt" class="easyui-tabs" style="width: 100%;">
<div title="费用统计列表" style="padding: 20px; width: 100%; height: 100%; overflow: auto;" ms-controller="container"></div>
<div title="费用统计编辑" style="padding: 20px; width: 100%; height: 100%; overflow: auto;" ms-controller="container">
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label" style="width: 180px;"><label>*</label>月份</td>
<td class="kv-content">
<input id="month" maxlength="20" type="text" name="month" placeholder="例如:201710" ms-duplex="@data.month | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;"><label>*</label>申报日期</td>
<td class="kv-content" >
<input id="declareDate" name="declareDate" maxlength="20" type="text" class="laydate-icon navContentText" onclick="laydate({istime: false, format: 'YYYY-MM-DD',start: laydate.now(), istoday: false})" ms-duplex="@data.declareDate | dateX('yyyy-MM-dd')"/>
</td>
<td class="kv-label" style="width: 180px;"><label>*</label>报关单号</td>
<td class="kv-content" >
<input id="entryId" maxlength="20" type="text" name="entryId" ms-duplex="@data.entryId | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 180px;"><label>*</label>件数</td>
<td class="kv-content" >
<input id="num" maxlength="20" type="number" name="num" ms-duplex="@data.num | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">重量</td>
<td class="kv-content" >
<input id="weight" maxlength="20" type="number" name="weight" ms-duplex="@data.weight | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">运单号</td>
<td class="kv-content" >
<input id="waybillNo" maxlength="20" type="text" name="waybillNo" ms-duplex="@data.waybillNo | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 180px;">保税仓库使用费</td>
<td class="kv-content" >
<input id="warehouseRoyalty" maxlength="20" type="number" name="warehouseRoyalty" onblur="calcTotal()" ms-duplex="@data.warehouseRoyalty | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">电子账册使用费</td>
<td class="kv-content" >
<input id="emsRoyalty" maxlength="20" type="number" name="emsRoyalty" onblur="calcTotal()" ms-duplex="@data.emsRoyalty | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 180px;">代理报关费</td>
<td class="kv-content" >
<input id="customsCharge" maxlength="20" type="number" name="customsCharge" onblur="calcTotal()" ms-duplex="@data.customsCharge | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">代理转关费</td>
<td class="kv-content" >
<input id="customsTransmitCharge" maxlength="20" type="number" name="customsTransmitCharge" onblur="calcTotal()" ms-duplex="@data.customsTransmitCharge | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 180px;">检验放行费</td>
<td class="kv-content" >
<input id="inspectionReleaseFee" maxlength="20" type="number" name="inspectionReleaseFee" onblur="calcTotal()" ms-duplex="@data.inspectionReleaseFee | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">删/改单费</td>
<td class="kv-content" >
<input id="amendmentCharge" maxlength="20" type="number" name="amendmentCharge" onblur="calcTotal()" ms-duplex="@data.amendmentCharge | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 180px;">删/改单被移交缉私</td>
<td class="kv-content" >
<input id="seizeSmugglers" maxlength="20" type="number" name="seizeSmugglers" onblur="calcTotal()" ms-duplex="@data.seizeSmugglers | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">审批费</td>
<td class="kv-content" >
<input id="approvalFee" maxlength="20" type="number" name="approvalFee" onblur="calcTotal()" ms-duplex="@data.approvalFee | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 180px;">叉车费</td>
<td class="kv-content" >
<input id="forkliftCharge" maxlength="20" type="number" name="forkliftCharge" onblur="calcTotal()" ms-duplex="@data.forkliftCharge | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">出/入库运输费</td>
<td class="kv-content" >
<input id="freightFee" maxlength="20" type="number" name="freightFee" onblur="calcTotal()" ms-duplex="@data.freightFee | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 180px;">重新包装费</td>
<td class="kv-content" >
<input id="reparkingCharge" maxlength="20" type="number" name="reparkingCharge" onblur="calcTotal()" ms-duplex="@data.reparkingCharge | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">海关查验费</td>
<td class="kv-content" >
<input id="customsInspectionFee" maxlength="20" type="number" name="customsInspectionFee" onblur="calcTotal()" ms-duplex="@data.customsInspectionFee | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 180px;">卡口核放单绑定费</td>
<td class="kv-content" >
<input id="bayonetBindingFee" maxlength="20" type="number" name="bayonetBindingFee" onblur="calcTotal()" ms-duplex="@data.bayonetBindingFee | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 150px;">出/入库理货费</td>
<td class="kv-content" >
<input id="tallyingFee" maxlength="20" type="number" name="tallyingFee" onblur="calcTotal()" ms-duplex="@data.tallyingFee | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 180px;">报关单据制单费</td>
<td class="kv-content" >
<input id="documentFee" maxlength="20" type="number" name="documentFee" onblur="calcTotal()" ms-duplex="@data.documentFee | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">通关电子账册备案变更费</td>
<td class="kv-content" >
<input id="filingChangeFee" maxlength="20" type="number" name="filingChangeFee" onblur="calcTotal()" ms-duplex="@data.filingChangeFee | notEmpty" style="width: 80%;" ></input>
</td>
<td class="kv-label" style="width: 180px;"><label>*</label>合计</td>
<td class="kv-content" >
<input id="total" maxlength="20" type="number" name="total" ms-duplex="@data.total | notEmpty" style="width: 80%;"></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 180px;"><label>*</label>进出类别</td>
<td class="kv-content" >
<select id="type" name="type" style="width: 80%">
<option value="0">进库</option>
<option value="1">出库</option>
</select>
</td>
<td class="kv-label" style="width: 180px;"><label>*</label>报关单位</td>
<td class="kv-content" colspan="4">
<input id="customsDeclarationEntity" maxlength="20" type="text" name="customsDeclarationEntity" ms-duplex="@data.customsDeclarationEntity | notEmpty" style="width: 80%;" ></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 180px;">备注</td>
<td class="kv-content" colspan="6">
<textarea rows="" cols="" id="remark" name="remark" ms-duplex="@data.remark | notEmpty" style="width: 80%"></textarea>
<!-- <input id="remark" type="text" name="remark" maxlength="255" ms-duplex="@data.remark | notEmpty" style="width: 80%"></input> -->
</td>
</tr>
<tr>
<td colspan="8">
<div class="opt-buttons" style="padding-top:20px;">
<a href="javascript:doSave();" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true" group="" id=""><span class="l-btn-left"><span class="l-btn-text">保存</span></span></a>
<a href="javascript:window.location.href='<%=request.getContextPath() %>/expenses/list'" class="easyui-linkbutton l-btn l-btn-small" group="" id=""><span class="l-btn-left"><span class="l-btn-text">取消</span></span></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</form>
</div>
</div>
<script>
//定义 avalon
var datavm = avalon.define({
$id: "container",
data: ${entity}
});
//保存
function doSave(){
var data = $("#editForm").serializeJson();
//处理时间,要不然会提交失败
if(data.declareDate==''){
delete data.declareDate;
}else{
data.declareDate = data.declareDate+" 00:00:00";
}
var url = '';
if(data.id=='null'){//新增
data.id = '';
url='<%=request.getContextPath()%>/rest/eptExpenses/insert';
}else{
url='<%=request.getContextPath()%>/rest/eptExpenses/update';
}
$.post(url, data, function(result) {
if(result.status==200){
window.location.href="<%=request.getContextPath()%>/expenses/list";
}else{
var html = result.msg+"<br/>"
if(result.data){
for(var i=0;i<result.data.length;i++){
html+=result.data[i].message+"<br/>";
}
}
$.messager.alert("提示", html);
}
});
}
//读取编辑资料(编辑时使用)
function loadData(id){
var par = {};
par.id=id;
$.post("<%=request.getContextPath()%>/rest/eptExpenses/findByPK", par, function(result) {
if(result.status==200){
datavm.data = result.data;
initFormData();
}else{
$.messager.alert("提示", result.msg);
}
});
}
//初始化表单关联数据
function initFormData(){
// 进出库类别赋值
if (datavm.data.type != "") {
$("#type").val(datavm.data.type);
}
}
$(document).ready(function(){
var tabs = $('#tt').tabs().tabs('tabs');
for(var i=0; i<tabs.length; i++){
tabs[i].panel('options').tab.unbind().bind('click',{index:i},function(e){
if(e.data.index==0){
window.location.href='<%=request.getContextPath()%>/expenses/list';
}
});
}
<%if(request.getParameter("id")!=null){%>
loadData(<%=request.getParameter("id")%>);
<%}%>
$('#tt').tabs('select',1);
});
function calcTotal(){
var warehouseRoyalty = $("#warehouseRoyalty").val();
var emsRoyalty = $("#emsRoyalty").val();
var customsCharge = $("#customsCharge").val();
var customsTransmitCharge = $("#customsTransmitCharge").val();
var inspectionReleaseFee = $("#inspectionReleaseFee").val();
var amendmentCharge = $("#amendmentCharge").val();
var seizeSmugglers = $("#seizeSmugglers").val();
var approvalFee = $("#approvalFee").val();
var forkliftCharge = $("#forkliftCharge").val();
var freightFee = $("#freightFee").val();
var repackingCharge = $("#repackingCharge").val();
var customsInspectionFee = $("#customsInspectionFee").val();
var bayonetBindingFee = $("#bayonetBindingFee").val();
var tallyingFee = $("#tallyingFee").val();
var documentFee = $("#documentFee").val();
var filingChangeFee = $("#filingChangeFee").val();
var total = 0;
if(warehouseRoyalty != null && warehouseRoyalty != ''){
total = total + warehouseRoyalty*1;
}
if(emsRoyalty != null && emsRoyalty != ''){
total = total + emsRoyalty*1;
}
if(customsCharge != null && customsCharge != ''){
total = total + customsCharge*1;
}
if(customsTransmitCharge != null && customsTransmitCharge != ''){
total = total + customsTransmitCharge*1;
}
if(inspectionReleaseFee != null && inspectionReleaseFee != ''){
total = total + inspectionReleaseFee*1;
}
if(amendmentCharge != null && amendmentCharge != ''){
total = total + amendmentCharge*1;
}
if(seizeSmugglers != null && seizeSmugglers != ''){
total = total + seizeSmugglers*1;
}
if(approvalFee != null && approvalFee != ''){
total = total + approvalFee*1;
}
if(forkliftCharge != null && forkliftCharge != ''){
total = total + forkliftCharge*1;
}
if(freightFee != null && freightFee != ''){
total = total + freightFee*1;
}
if(repackingCharge != null && repackingCharge != ''){
total = total + repackingCharge*1;
}
if(customsInspectionFee != null && customsInspectionFee != ''){
total = total + customsInspectionFee*1;
}
if(bayonetBindingFee != null && bayonetBindingFee != ''){
total = total + bayonetBindingFee*1;
}
if(tallyingFee != null && tallyingFee != ''){
total = total + tallyingFee*1;
}
if(documentFee != null && documentFee != ''){
total = total + documentFee*1;
}
if(filingChangeFee != null && filingChangeFee != ''){
total = total + filingChangeFee*1;
}
$("#total").val(total.toFixed(2));
}
</script>
</body>
</html>