mat_edit.jsp
22.0 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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
<%@ 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">
</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 | notEmpty">
<input type="hidden" name="bookId" ms-duplex="@data.bookId | notEmpty">
<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="overflow: auto; padding: 20px; display: none;">
</div>
<!-- <div title="料号级料件" style="padding: 20px; display: none;"> -->
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label">回执编号</td>
<td class="kv-content">
{{@data.seqNo}}
<input type="hidden" name="seqNo" ms-duplex="@data.seqNo | notEmpty" >
</td>
<td class="kv-label" style="width: 150px;">经营单位代码</td>
<td class="kv-content">
<input id="tradeCode" type="text" maxlength="10" name="tradeCode" ms-duplex="@data.tradeCode | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label"><span><label>*</label>企业内部编号/预录入号</td>
<td class="kv-content" >
<input id="copEmsNo" type="text" maxlength="10" name="copEmsNo" ms-duplex="@data.copEmsNo | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">序号</td>
<td class="kv-content">
{{@data.copNo}}
<input type="hidden" name="copNo" ms-duplex="@data.copNo | notEmpty" >
</td>
<td class="kv-label" style="width: 150px;">总价</td>
<td class="kv-content">
<input id="apprAmt" type="text" maxlength="10" name="apprAmt" ms-duplex="@data.apprAmt | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label"><span><label>*</label>企业编码</td>
<td class="kv-content" >
<input id="tradesCode" type="text" maxlength="10" name="tradesCode" ms-duplex="@data.tradesCode | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label"><span><label>*</label>帐册编号</td>
<td class="kv-content">
{{@data.emsNo}}
<input type="hidden" name="emsNo" ms-duplex="@data.emsNo | notEmpty" >
</td>
<td class="kv-label" style="width: 150px;"><span><label>*</label>料件货号</td>
<td class="kv-content">
<input id="copGNo" type="text" maxlength="10" name="copGNo" ms-duplex="@data.copGNo | notEmpty" style="width: 190px"></input>
</td>
<td class="kv-label" style="width: 150px;"><span><label>*</label>项号</td>
<td class="kv-content">
<input id="gNo" type="number" maxlength="10" name="gNo" ms-duplex="@data.gno | notEmpty" style="width: 190px"></input>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">征免性质</td>
<td class="kv-content">
<input type="hidden" id="dutyMode" name="dutyMode" ms-duplex="@data.dutyMode | notEmpty" >
<input id="dutyModeInput" type="text" onkeydown="if(window.event.keyCode==13){findDutyModeByCode(this.value)}" onblur="findDutyModeByCode(this.value)" ms-attr="{value:(''+@data.dutyModeName=='undefined'||''+@data.dutyModeName=='')?'':@data.dutyModeName+'('+@data.dutyMode+')'}" style="width: 80%"></input>
</td>
<td class="kv-label">成品料件标志</td>
<td class="kv-content" >
<span ms-for="(k, v) in @bakList" >
<input type="radio" name="eciGoodsFlag" ms-duplex="@data.eciGoodsFlag | notEmpty" ms-attr="{id:'status_'+@bakList[k].parCode,value:@bakList[k].parCode}"/>{{v.parName}}
</span>
</td>
<td class="kv-label" style="width: 150px;">当前环节</td>
<td class="kv-content" colspan="3">
<input id="stepId" type="text" maxlength="10" name="stepId" ms-duplex="@data.stepId | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label"><span><label>*</label>商品编码</td>
<td class="kv-content">
<input id="codeTS" type="text" maxlength="18" name="codeTS" onkeydown="if(window.event.keyCode==13){findComplexByCode(this.value)}" onblur="findComplexByCode(this.value)" ms-duplex="@data.codeTS | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">归类标志</td>
<td class="kv-content">
<input id="classMark" type="text" maxlength="10" name="classMark" ms-duplex="@data.classMark | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label"><span><label>*</label>商品名称</td>
<td class="kv-content" >
<input id="gName" type="text" maxlength="10" name="gName" ms-duplex="@data.gname | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label"><span><label>*</label>商品规格型号</td>
<td class="kv-content">
<input id="gModel" type="text" maxlength="18" name="gModel" ms-duplex="@data.gmodel | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">计量单位</td>
<td class="kv-content">
<input type="hidden" id="unit" name="unit" ms-duplex="@data.unit | notEmpty" >
<input id="unitInput" type="text" maxlength="10" onkeydown="if(window.event.keyCode==13){findUnitByCode(this.value)}" onblur="findUnitByCode(this.value)" ms-attr="{value:(''+@data.unitName=='undefined'||''+@data.unitName=='')?'':@data.unitName+'('+@data.unit+')'}" style="width: 80%"></input>
</td>
<td class="kv-label">法定计量单位</td>
<td class="kv-content" >
<input type="hidden" id="unit1" name="unit1" ms-duplex="@data.unit1 | notEmpty" >
<input id="unit1Input" type="text" maxlength="10" disabled="disabled" ms-attr="{value:(''+@data.unit1Name=='undefined'||''+@data.unit1Name=='')?'':@data.unit1Name+'('+@data.unit1+')'}" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">第二单位</td>
<td class="kv-content">
<input type="hidden" id="unit2" name="unit2" ms-duplex="@data.unit2 | notEmpty" >
<input id="unit2Input" type="text" maxlength="10" disabled="disabled" ms-attr="{value:(''+@data.unit2Name=='undefined'||''+@data.unit2Name=='')?'':@data.unit2Name+'('+@data.unit2+')'}" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">产销国</td>
<td class="kv-content">
<input type="hidden" id="countryCode" name="countryCode" ms-duplex="@data.countryCode | notEmpty" >
<input id="countryCodeInput" type="text" maxlength="10" onkeydown="if(window.event.keyCode==13){findCountryByCode(this.value)}" onblur="findCountryByCode(this.value)" ms-attr="{value:(''+@data.countryCodeName=='undefined'||''+@data.countryCodeName=='')?'':@data.countryCodeName+'('+@data.countryCode+')'}" style="width: 80%"></input>
</td>
<td class="kv-label">申报单价</td>
<td class="kv-content" >
<input id="decPrice" type="number" maxlength="10" name="decPrice" ms-duplex="@data.decPrice | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">最终目的国(地区)</td>
<td class="kv-content">
<input type="hidden" id="destinationcountry" name="destinationcountry" ms-duplex="@data.destinationcountry | notEmpty" >
<input id="destinationcountryInput" type="text" onkeydown="if(window.event.keyCode==13){findDestinationcountryByCode(this.value)}" onblur="findDestinationcountryByCode(this.value)" ms-attr="{value:(''+@data.destinationcountryName=='undefined'||''+@data.destinationcountryName=='')?'':@data.destinationcountryName+'('+@data.destinationcountry+')'}" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">区域代码</td>
<td class="kv-content">
<input id="areaCode" type="text" maxlength="10" name="areaCode" ms-duplex="@data.areaCode | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label">主管海关</td>
<td class="kv-content" >
<input id="customsCode" type="text" maxlength="10" name="customsCode" ms-duplex="@data.customsCode | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">币制</td>
<td class="kv-content">
<input type="hidden" id="curr" name="curr" ms-duplex="@data.curr | notEmpty" >
<input id="currInput" type="text" maxlength="18" onkeydown="if(window.event.keyCode==13){findCurrByCode(this.value)}" onblur="findCurrByCode(this.value)" style="width: 80%" ms-attr="{value:(''+@data.currName=='undefined'||''+@data.currName=='')?'':@data.currName+'('+@data.curr+')'}" ></input>
</td>
<td class="kv-label" style="width: 150px;">申报单价人民币</td>
<td class="kv-content">
<input id="decPriceRmb" type="number" maxlength="10" name="decPriceRmb" ms-duplex="@data.decPriceRmb | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label">法定申报计量单位比例因子</td>
<td class="kv-content" >
<input id="factor1" type="number" maxlength="10" name="factor1" ms-duplex="@data.factor1 | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">第二法定申报计量单位比例因子</td>
<td class="kv-content">
<input id="factor2" type="number" maxlength="18" name="factor2" ms-duplex="@data.factor2 | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">重量比例因子</td>
<td class="kv-content">
<input id="factorWt" type="number" maxlength="10" name="factorWt" ms-duplex="@data.factorWt | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label">比例因子浮动比率</td>
<td class="kv-content" >
<input id="factorRate" type="number" maxlength="10" name="factorRate" ms-duplex="@data.factorRate | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">申报数量</td>
<td class="kv-content">
<input id="qty" type="number" maxlength="18" name="qty" ms-duplex="@data.qty | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">最大余量</td>
<td class="kv-content">
<input id="maxQty" type="number" maxlength="10" name="maxQty" ms-duplex="@data.maxQty | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label">初始数量</td>
<td class="kv-content" >
<input id="firstQty" type="number" maxlength="10" name="firstQty" ms-duplex="@data.firstQty | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">进/出口方式</td>
<td class="kv-content">
<input id="iEType" type="text" name="iEType" ms-duplex="@data.ietype | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">用途代码</td>
<td class="kv-content">
<input type="hidden" id="useType" name="useType" ms-duplex="@data.useType | notEmpty" >
<input id="useTypeInput" type="text" onkeydown="if(window.event.keyCode==13){findUseToByCode(this.value)}" onblur="findUseToByCode(this.value)" ms-attr="{value:(''+@data.useTypeName=='undefined'||''+@data.useTypeName=='')?'':@data.useTypeName+'('+@data.useType+')'}" style="width: 80%"></input>
</td>
<td class="kv-label">备用标志1</td>
<td class="kv-content" >
<input id="note1" type="text" maxlength="1" name="note1" ms-duplex="@data.note1 | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">备用标志2</td>
<td class="kv-content">
<input id="note2" type="text" maxlength="1" name="note2" ms-duplex="@data.note2 | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">备注</td>
<td class="kv-content">
<input id="note" type="text" maxlength="100" name="note" ms-duplex="@data.note | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label">英文品名</td>
<td class="kv-content" >
<input id="gEngName" type="text" maxlength="50" name="gEngName" ms-duplex="@data.gEngName | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label">英文描述</td>
<td class="kv-content">
<input id="gEngModel" type="text" maxlength="50" name="gEngModel" ms-duplex="@data.gEngModel | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">处理标志</td>
<td class="kv-content">
{{@data.modifyMark}}
</td>
<td class="kv-label">辅助处理标志</td>
<td class="kv-content" >
{{@data.eciModifyMark}}
</td>
</tr>
<tr>
<td class="kv-label">申报要素</td>
<td class="kv-content" colspan="5">
<textarea rows="" cols="" id="classNote" name="classNote" ms-duplex="@data.classNote | notEmpty" ></textarea>
</td>
</tr>
<tr>
<td class="kv-label">征税比率</td>
<td class="kv-content">
<input id="dutyRate" type="number" name="dutyRate" ms-duplex="@data.dutyRate | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">海关审核单价</td>
<td class="kv-content">
<input id="chkPrice" type="number" name="chkPrice" ms-duplex="@data.chkPrice | notEmpty" style="width: 180px"></input>
</td>
<td class="kv-label" >是否有效</td>
<td class="kv-content" colspan="3">
<input type="radio" value="1" name="isEffect" ms-duplex="@data.isEffect | notEmpty" >有效
<input type="radio" value="0" name="isEffect" ms-duplex="@data.isEffect | notEmpty" >无效
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">申报人</td>
<td class="kv-content" colspan="2">
<input id="name" maxlength="20" type="text" name="declarePerson" ms-duplex="@data.declarePerson | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">申报日期</td>
<td class="kv-content" colspan="2">
<input type="text" style="width: 85%" value="" class=" laydate-icon navContentText " onclick="laydate({istime: false, format: 'YYYY-MM-DD',start: laydate.now(), istoday: false})" name="declareDate" ms-duplex="@data.declareDate | dateX('yyyy-MM-dd')"/>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">审批人</td>
<td class="kv-content" colspan="2">
<input id="name" maxlength="20" type="text" name="approvePerson" ms-duplex="@data.approvePerson | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;">审批时间</td>
<td class="kv-content" colspan="2">
<input type="text" style="width: 85%" value="" class=" laydate-icon navContentText " onclick="laydate({istime: false, format: 'YYYY-MM-DD',start: laydate.now(), istoday: false})" name="approveDate" ms-duplex="@data.approveDate | dateX('yyyy-MM-dd')"/>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;">外部审批意见</td>
<td class="kv-content" colspan="3">
<textarea rows="" cols="" id="outerComment" name="outerComment" ms-duplex="@data.outerComment | notEmpty" ></textarea>
</td>
<td class="kv-label" style="width: 150px;">内部审批意见</td>
<td class="kv-content" colspan="3">
<textarea rows="" cols="" id="innerComment" name="innerComment" ms-duplex="@data.innerComment | notEmpty" ></textarea>
</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() %>/mat/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},
bakList:${bakList}
});
//保存
function doSave(){
var data = $("#editForm").serializeJson();
if(data.declareDate==''){
delete data.declareDate;
}else{
data.declareDate = data.declareDate+" 00:00:00";
}
if(data.approveDate==''){
delete data.approveDate;
}else{
data.approveDate = data.approveDate+" 00:00:00";
}
var url = '';
if(data.id==''){//新增
url='<%=request.getContextPath()%>/rest/eptMat/insert';
}else{
url='<%=request.getContextPath()%>/rest/eptMat/update';
}
$.post(url, data, function(result) {
if(result.status==200){
window.location.href="<%=request.getContextPath()%>/mat/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/eptMat/findByPK", par, function(result) {
if(result.status==200){
datavm.data = result.data;
initFormData();
}else{
$.messager.alert("提示", result.msg);
}
});
}
//初始化表单关联数据
function initFormData(){
}
function findComplexByCode(code){
var par = {};
par.code=code;
$.post("<%=request.getContextPath()%>/rest/complex/findByCodeTS", par, function(result) {
if(result.status==200){
$('#gName').val(result.data.gName);
$('#unitInput').val(result.data.unit1Name+'('+result.data.unit1+')');
$('#unit').val(result.data.unit1);
$('#unit1Input').val(result.data.unit1Name+'('+result.data.unit1+')');
$('#unit1').val(result.data.unit1);
if(result.data.unit2 !=null && result.data.unit2 != "" ){
$('#unit2Input').val(result.data.unit2Name+'('+result.data.unit2+')');
$('#unit2').val(result.data.unit2);
}
}
});
}
function findUnitByCode(code){
var par = {};
par.id=code;
$.post("<%=request.getContextPath()%>/rest/unit/findByPK", par, function(result) {
if(result.status==200){
$('#unit').val(result.data.unitCode);
$('#unitInput').val(result.data.unitName+'('+result.data.unitCode+')');
}
});
}
function findCurrByCode(code) {
var par = {};
par.id = code;
$.post("<%=request.getContextPath()%>/rest/curr/findByPK", par, function (result) {
if (result.status == 200) {
$('#currInput').val(result.data.currName + '(' + result.data.currCode + ')');
$('#curr').val(result.data.currCode);
}
});
}
function findUseToByCode(code) {
var par = {};
par.id = code;
$.post("<%=request.getContextPath()%>/rest/userTo/findByPK", par, function (result) {
if (result.status == 200) {
$('#useTypeInput').val(result.data.useToNam + '(' + result.data.useToCod + ')');
$('#useType').val(result.data.useToCod);
}
});
}
function findDutyModeByCode(code) {
var par = {};
par.id = code;
$.post("<%=request.getContextPath()%>/rest/levymode/findByPK", par, function (result) {
if (result.status == 200) {
datavm.data.dutyModeName=result.data.dutySpec;
$('#dutyModeInput').val(result.data.dutySpec + '(' + result.data.dutyMode + ')');
$('#dutyMode').val(result.data.dutyMode);
}
});
}
function findCountryByCode(code) {
var par = {};
par.id = code;
$.post("<%=request.getContextPath()%>/rest/country/findByPK", par, function (result) {
if (result.status == 200) {
$('#countryCodeInput').val(result.data.countryNa + '(' + result.data.countryCo + ')');
$('#countryCode').val(result.data.countryCo);
}
});
}
function findDestinationcountryByCode(code) {
var par = {};
par.id = code;
$.post("<%=request.getContextPath()%>/rest/country/findByPK", par, function (result) {
if (result.status == 200) {
$('#destinationcountryInput').val(result.data.countryNa + '(' + result.data.countryCo + ')');
$('#destinationcountryCode').val(result.data.countryCo);
}
});
}
$(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()%>/bookAdmin/headInfo';
}else if(e.data.index==1){
window.location.href='<%=request.getContextPath()%>/itemMat/list';
}
});
}
<%if(request.getParameter("id")!=null){%>
loadData(<%=request.getParameter("id")%>);
<%}%>
$('#tt').tabs('select',2);
});
</script>
</body>
</html>