item_mat_edit.jsp
30.3 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
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<%@ 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">
<!-- <input type="hidden" name="gNo" ms-duplex="@data.gno | 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;">
<table class="kv-table">
<tbody>
<tr>
<td class="kv-label">批次号</td>
<td class="kv-content">
{{@data.batchNo}}
<input type="hidden" name="batchNo" ms-duplex="@data.batchNo | notEmpty" >
</td>
<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">
{{@data.tradeCode}}
<input id="tradeCode" type="hidden" maxlength="10" name="tradeCode" ms-duplex="@data.tradeCode | notEmpty" ></input>
</td>
</tr>
<tr>
<td class="kv-label"><span></span>预录入号</td>
<td class="kv-content">
<input id="copEmsNo" type="text" maxlength="10" name="copEmsNo" ms-duplex="@data.copEmsNo | notEmpty" style="width: 190px"></input>
</td>
<td class="kv-label"><span></span>帐册编号</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;">料件货号</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">成品料件标志</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>
</tr>
<tr>
<td class="kv-label" style="width: 150px;"><span><label>*</label></span>项号</td>
<td class="kv-content">
<input id="gNo" type="text" maxlength="10" name="gNo" ms-duplex="@data.gno | notEmpty" style="width: 190px"></input>
</td>
<td class="kv-label"><span></span>PART#</td>
<td class="kv-content">
<input id="partNo" type="text" maxlength="18" name="partNo" ms-duplex="@data.partNo | notEmpty" style="width: 190px"></input>
</td>
<td class="kv-label"><span><label>*</label></span>商品编码</td>
<td class="kv-content">
<input id="codeTS" type="text" maxlength="18" name="codeTS" onkeydown="if(window.event.keyCode==13){findComplexByCode(this.value)}" ms-duplex="@data.codeTS | notEmpty" style="width: 80%"></input>
</tr>
<tr>
</td>
<td class="kv-label"><span><label>*</label></span>商品名称</td>
<td class="kv-content" >
<input id="gName" type="text" maxlength="10" name="gName" ms-duplex="@data.gname | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label"><span></span>英文品名</td>
<td class="kv-content" >
<input id="gEngName" type="text" name="gEngName" ms-duplex="@data.gengName | notEmpty" style="width: 85%"></input>
</td>
<td class="kv-label"><span></span>品牌</td>
<td class="kv-content" >
<input id="brand" type="text" maxlength="10" name="brand" ms-duplex="@data.brand | notEmpty" style="width: 80%"></input>
</td>
</tr>
<tr>
<td class="kv-label"><span><label>*</label></span>规格型号</td>
<td class="kv-content" colspan="3">
<input id="gModel" type="text" maxlength="100" name="gModel" ms-duplex="@data.gmodel| notEmpty" style="width: 95%"></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-content">
<select id="useType" name="useType" style="width: 85%">
<option></option>
<option ms-for="(k,v) in @useTo"
ms-attr="{id:'sType_'+@useTo[k].useToCod,value:@useTo[k].useToCod}">
{{v.useToNam}}
</option>
</select>
</td>
</tr>
<tr>
<td class="kv-label" style="width: 150px;"><span><label>*</label></span>序号</td>
<td class="kv-content">
<input id="copNo" type="text" maxlength="10" name="copNo" ms-duplex="@data.copNo | 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" style="width: 150px;"><span><label>*</label></span>成交单位</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" 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>
</tr>
<tr>
<td class="kv-label"><span><label>*</label></span>法定第一单位</td>
<td class="kv-content" >
<input type="hidden" id="unit1" name="unit1" ms-duplex="@data.unit1 | notEmpty" >
<input id="unit1Input" type="text" maxlength="10" onkeydown="if(window.event.keyCode==13){findUnit1ByCode(this.value)}" onblur="findUnit1ByCode(this.value)" ms-attr="{value:(''+@data.unit1Name=='undefined'||''+@data.unit1Name=='')?'':@data.unit1Name+'('+@data.unit1+')'}" style="width: 80%"></input>
<!-- input id="unit1Input" type="text" maxlength="10" ms-attr="{value:(''+@data.unit1Name=='undefined'||''+@data.unit1Name=='')?'':@data.unit1Name+'('+@data.unit1+')'}" style="width: 80%"></input> -->
</td>
<td class="kv-label"><span></span>法定第二单位</td>
<td class="kv-content"><!-- disabled="disabled" -->
<input type="hidden" id="unit2" name="unit2" ms-duplex="@data.unit2 | notEmpty" >
<input id="unit2Input" type="text" maxlength="10" ms-attr="{value:(''+@data.unit2Name=='undefined'||''+@data.unit2Name=='')?'':@data.unit2Name+'('+@data.unit2+')'}" style="width: 80%"></input>
</td>
<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">申报单价</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;"><span><label>*</label></span>区域代码</td>
<td class="kv-content">
<!-- <input id="areaCode" type="text" maxlength="10" name="areaCode" ms-duplex="@data.areaCode | notEmpty" style="width: 80%"></input> -->
<select id="areaCode" name="areaCode" style="width: 80%">
<option value="RE04">新郑机场</option>
<option value="ZZ01">郑州综保区</option>
<option value="RE09">郑铁东办</option>
<option value="SQ01">商丘保B</option>
<option value="RE13">南阳海关</option>
<option value="RE17">焦作海关</option>
<option value="ZZHG">郑州海关</option>
<option value="RE18">商丘保仓</option>
<option value="RE19">周口海关</option>
</select>
</td>
<td class="kv-label"><span><label>*</label></span>主管海关</td>
<td class="kv-content" >
<!-- <input id="customsCode" type="text" maxlength="10" name="customsCode" ms-duplex="@data.customsCode | notEmpty" style="width: 80%"></input> -->
<input type="hidden" id="customsCodeHidden" name=customsCode ms-duplex="@data.customsCode | notEmpty" >
<input id="customsCodeInput" type="text" onkeydown="if(window.event.keyCode==13){findCustoms(this.value)}" onblur="findCustoms(this.value)" ms-attr="{value:''+@data.customsCodeName=='undefined'?'':@data.customsCodeName+'('+@data.customsCode+')'}"
style="width: 90%" placeholder="输入关区代码,并按回车"></input>
</td>
<td class="kv-label">征免方式</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>
</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: 90%" ms-attr="{value:(''+@data.currName=='undefined'||''+@data.currName=='')?'':@data.currName+'('+@data.curr+')'}"
placeholder="例如人民币,请输142,并按回车"></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>
<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>
</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">总价</td>
<td class="kv-content">
<input id="apprAmt" type="number" maxlength="18" name="apprAmt" ms-duplex="@data.apprAmt | notEmpty" style="width: 80%"></input>
</td> -->
<!-- <td class="kv-label"><span></span>预录入号</td>企业内部编号
<td class="kv-content" >
<input id="copEmsNo" type="text" maxlength="10" name="copEmsNo" ms-duplex="@data.copEmsNo | 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="apprAmt" type="number" maxlength="18" name="apprAmt" ms-duplex="@data.apprAmt | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;"></td>
<td class="kv-content">
</td>
<td class="kv-label"></td>
<td class="kv-content" >
</td>
</tr> -->
<tr>
<td class="kv-label" style="width: 180px;">备注</td>
<td class="kv-content" colspan="6">
<textarea rows="" cols="" id="note" name="note" ms-duplex="@data.note | notEmpty" ></textarea>
<!-- <input id="note" type="text" name="note" maxlength="255" ms-duplex="@data.note | 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">英文品名</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">
<select id="modifyMark" name="modifyMark" style="width: 85%">
<option value="3">备案</option>
<option value="1">修改</option>
</select>
</td>
<td class="kv-label" style="width: 150px;">辅助处理标志</td>
<td class="kv-content">
<select id="eciModifyMark" name="eciModifyMark" style="width: 85%">
<option value="3">备案</option>
<option value="1">修改</option>
</select>
</td>
<td class="kv-label" style="width: 150px;"><span><label>*</label></span>当前环节</td>
<td class="kv-content">
<!-- <input id="stepId" type="text" maxlength="10" name="stepId" ms-duplex="@data.stepId | notEmpty" style="width: 80%"></input> -->
<select id="stepId" name="stepId" style="width: 80%">
<option value="EMX100100">账册表体流程管理</option>
</select>
</td>
</tr>
<tr>
<!-- <td class="kv-label">征免方式</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" style="width: 150px;"><span><label>*</label></span>当前环节</td>
<td class="kv-content">
<input id="stepId" type="text" maxlength="10" name="stepId" ms-duplex="@data.stepId | notEmpty" style="width: 80%"></input>
</td> -->
<!-- <td class="kv-label" style="width: 150px;"><span><label>*</label></span>企业编码</td>
<td class="kv-content">
<input id="tradesCode" type="text" maxlength="50" name="tradesCode" ms-duplex="@data.tradesCode | notEmpty" style="width: 80%"></input>
</td> -->
</tr>
<tr>
<td class="kv-label" style="width: 150px;"><span><label>*</label></span>创建人</td>
<td class="kv-content" colspan="2">
<input id="createPerson" maxlength="20" type="text" name="createPerson" ms-duplex="@data.createPerson | notEmpty" style="width: 80%"></input>
</td>
<td class="kv-label" style="width: 150px;"><span><label>*</label></span>创建日期</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="createDate" ms-duplex="@data.createDate | dateX('yyyy-MM-dd')"/>
</td>
<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">申报要素</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">
<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 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() %>/itemMat/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 title="料号级料件" style="padding: 20px; display: none;"></div> -->
</div>
</form>
</div>
</div>
<script>
//定义 avalon
var datavm = avalon.define({
$id: "container",
data: ${entity},
bakList: ${bakList},
useTo: []// 用途代码
});
if(datavm.data.gNo != null){
$('#gNo').val(datavm.data.gNo);
}
//保存
function doSave(){
var data = $("#editForm").serializeJson();
if(data.createDate==''){
delete data.createDate;
} else {
data.createDate = data.createDate+" 00:00:00";
}
if(data.declareDate==''){
delete data.declareDate;
} else {
data.declareDate = data.declareDate+" 00:00:00";
}
var url = '';
if (data.id == '') {//新增
data.id = '';
url='<%=request.getContextPath()%>/rest/eptItemMat/insert';
}else{
url='<%=request.getContextPath()%>/rest/eptItemMat/update';
}
$.post(url, data, function(result) {
if(result.status==200){
window.location.href="<%=request.getContextPath()%>/itemMat/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/eptItemMat/findByPK", par, function(result) {
if(result.status==200){
datavm.data = result.data;
if(datavm.data.areaCode != null){
$("#areaCode").val(datavm.data.areaCode);
}
initFormData();
}else{
$.messager.alert("提示", result.msg);
}
});
}
function findCustoms(code){
var par = {};
par.id=code;
$.post("<%=request.getContextPath()%>/rest/customsRel/findByPK", par, function(result) {
if(result.status==200){
$('#customsCodeInput').val(result.data.customsName+'('+result.data.customsCode+')');
$('#customsCodeHidden').val(result.data.customsCode);
}
});
}
//初始化表单关联数据
function initFormData(){
initUseTo();
}
function initUseTo(){
var par ={};
$.post("<%=request.getContextPath()%>/rest/userTo/listAll",par,function(result){
if(result.status==200){
datavm.useTo = result.data;
if(datavm.data.useType != ""){
$("#sType_"+datavm.useTo[datavm.data.useType -1 ].useToCod).attr("selected",true);
}
}
});
}
function findComplexByCode(code){
var par = {};
par.code=code;
$.post("<%=request.getContextPath()%>/rest/complex/findByCodeTS", par, function(result) {
if(result.status==200){
console.log(result);
$('#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);
}
}else {
alert("暂无改商品记录,请填写相关信息");
$('#gName').val("");
$('#unitInput').val("");
$('#unit').val("");
$('#unit1Input').val("");
$('#unit1').val("");
$('#unit2Input').val("");
$('#unit2').val("");
}
});
}
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 findUnit1ByCode(code){
var par = {};
par.id=code;
$.post("<%=request.getContextPath()%>/rest/unit/findByPK", par, function(result) {
if(result.status==200){
$('#unit1').val(result.data.unitCode);
$('#unit1Input').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 + ')');
$('#destinationcountry').val(result.data.countryCo);
}
});
}
$("#codeTS").keyup(function(){
//这就是输入值的个数
var length=this.value.length;
if(length == 4 || length > 4){
var code = $("#codeTS").val();
code = code.substring(0,4);
$.post("<%=request.getContextPath()%>/rest/eptBusinessScope/findByCode",{code:code},function (result) {
if (result.status == 200) {
} else {
alert("未在备案范围,请先备案")
$("#codeTS").val("");
}
});
}
});
$(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==2){
window.location.href='<%=request.getContextPath()%>/mat/list';
}
});
}
<%if(request.getParameter("id")!=null){%>
loadData(<%=request.getParameter("id")%>);
<%}%>
initFormData();
$('#tt').tabs('select',1);
});
</script>
</body>
</html>