FnaSubmitRequestJsChange_e9.jsp
44.6 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
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
<%@page import="weaver.general.BaseBean"%>
<%@page import="weaver.fna.maintenance.FnaSystemSetComInfo"%>
<%@page import="org.json.JSONObject"%>
<%@page import="java.util.UUID"%>
<%@page import="weaver.hrm.HrmUserVarify"%>
<%@page import="weaver.hrm.User"%>
<%@page import="weaver.systeminfo.SystemEnv"%>
<%@page import="weaver.conn.RecordSet"%>
<%@page import="weaver.general.Util"%>
<%@page import="weaver.workflow.field.BrowserComInfo"%>
<%@page import="weaver.fna.maintenance.FnaCostCenter"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
String guid1 = UUID.randomUUID().toString();
User user = HrmUserVarify.getUser (request , response) ;
if(user==null){
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
RecordSet rs = new RecordSet();
FnaSystemSetComInfo fnaSystemSetComInfo = new FnaSystemSetComInfo();
boolean subjectFilter = 1==Util.getIntValue(fnaSystemSetComInfo.get_subjectFilter(), 0);
int costControlCycle = Util.getIntValue(fnaSystemSetComInfo.get_costControlCycle(), 0);//费用控制周期
//request.getSession().setAttribute("FnaSubmitRequestJsBorrow.jsp_____"+guid1+"_____"+user.getUID(), guid1);
int requestid = Util.getIntValue(request.getParameter("requestid"),0);
int workflowid = Util.getIntValue(request.getParameter("workflowid"),0);
int formid = 0;
int currentnodetype = 0;
boolean isNeverSubmit = false;//流程从未提交下去标志位
if(workflowid <= 0){
rs.executeSql("select workflowid, currentnodetype from workflow_requestbase where requestid = "+requestid);
if(rs.next()){
workflowid = Util.getIntValue(rs.getString("workflowid"), 0);
currentnodetype = Util.getIntValue(rs.getString("currentnodetype"), 0);
}
}
if(requestid > 0 && currentnodetype==0){
rs.executeSql("select count(*) cnt from workflow_requestLog a where a.logtype <> '1' and a.requestid = "+requestid);
if(rs.next() && rs.getInt("cnt") == 0){
isNeverSubmit = true;
}
}else{
isNeverSubmit = true;
}
Map<String, String> dataMap = new HashMap<String, String>();
FnaCommon.getFnaWfFieldInfo4Expense(workflowid, dataMap);
String fieldIdSubject = Util.null2String(dataMap.get("fieldIdSubject_fieldId"));
String fieldIdOrgType = Util.null2String(dataMap.get("fieldIdOrgType_fieldId"));
String fieldIdOrgId = Util.null2String(dataMap.get("fieldIdOrgId_fieldId"));
String fieldIdOccurdate = Util.null2String(dataMap.get("fieldIdOccurdate_fieldId"));
String fieldIdAmount = Util.null2String(dataMap.get("fieldIdAmount_fieldId"));
String fieldIdHrmInfo = Util.null2String(dataMap.get("fieldIdHrmInfo_fieldId"));
String fieldIdDepInfo = Util.null2String(dataMap.get("fieldIdDepInfo_fieldId"));
String fieldIdSubInfo = Util.null2String(dataMap.get("fieldIdSubInfo_fieldId"));
String fieldIdFccInfo = Util.null2String(dataMap.get("fieldIdFccInfo_fieldId"));
String fieldIdSubject2 = Util.null2String(dataMap.get("fieldIdSubject2_fieldId"));
String fieldIdOrgType2 = Util.null2String(dataMap.get("fieldIdOrgType2_fieldId"));
String fieldIdOrgId2 = Util.null2String(dataMap.get("fieldIdOrgId2_fieldId"));
String fieldIdOccurdate2 = Util.null2String(dataMap.get("fieldIdOccurdate2_fieldId"));
String fieldIdHrmInfo2 = Util.null2String(dataMap.get("fieldIdHrmInfo2_fieldId"));
String fieldIdDepInfo2 = Util.null2String(dataMap.get("fieldIdDepInfo2_fieldId"));
String fieldIdSubInfo2 = Util.null2String(dataMap.get("fieldIdSubInfo2_fieldId"));
String fieldIdFccInfo2 = Util.null2String(dataMap.get("fieldIdFccInfo2_fieldId"));
String fieldIdSubject_isDtl = Util.null2String(dataMap.get("fieldIdSubject_fieldId_isDtl"));
String fieldIdOrgType_isDtl = Util.null2String(dataMap.get("fieldIdOrgType_fieldId_isDtl"));
String fieldIdOrgId_isDtl = Util.null2String(dataMap.get("fieldIdOrgId_fieldId_isDtl"));
String fieldIdOccurdate_isDtl = Util.null2String(dataMap.get("fieldIdOccurdate_fieldId_isDtl"));
String fieldIdAmount_isDtl = Util.null2String(dataMap.get("fieldIdAmount_fieldId_isDtl"));
String fieldIdHrmInfo_isDtl = Util.null2String(dataMap.get("fieldIdHrmInfo_fieldId_isDtl"));
String fieldIdDepInfo_isDtl = Util.null2String(dataMap.get("fieldIdDepInfo_fieldId_isDtl"));
String fieldIdSubInfo_isDtl = Util.null2String(dataMap.get("fieldIdSubInfo_fieldId_isDtl"));
String fieldIdFccInfo_isDtl = Util.null2String(dataMap.get("fieldIdFccInfo_fieldId_isDtl"));
String fieldIdSubject2_isDtl = Util.null2String(dataMap.get("fieldIdSubject2_fieldId_isDtl"));
String fieldIdOrgType2_isDtl = Util.null2String(dataMap.get("fieldIdOrgType2_fieldId_isDtl"));
String fieldIdOrgId2_isDtl = Util.null2String(dataMap.get("fieldIdOrgId2_fieldId_isDtl"));
String fieldIdOccurdate2_isDtl = Util.null2String(dataMap.get("fieldIdOccurdate2_fieldId_isDtl"));
String fieldIdHrmInfo2_isDtl = Util.null2String(dataMap.get("fieldIdHrmInfo2_fieldId_isDtl"));
String fieldIdDepInfo2_isDtl = Util.null2String(dataMap.get("fieldIdDepInfo2_fieldId_isDtl"));
String fieldIdSubInfo2_isDtl = Util.null2String(dataMap.get("fieldIdSubInfo2_fieldId_isDtl"));
String fieldIdFccInfo2_isDtl = Util.null2String(dataMap.get("fieldIdFccInfo2_fieldId_isDtl"));
String fieldIdOrgId_automaticTake = Util.null2String(dataMap.get("fieldIdOrgId_automaticTake"));
String fieldIdOrgId2_automaticTake = Util.null2String(dataMap.get("fieldIdOrgId2_automaticTake"));
if(Util.getIntValue(fieldIdSubject2) <= 0){
fieldIdSubject2 = fieldIdSubject;
fieldIdSubject2_isDtl = fieldIdSubject_isDtl;
}
if(Util.getIntValue(fieldIdOrgType2) <= 0){
fieldIdOrgType2 = fieldIdOrgType;
fieldIdOrgType2_isDtl = fieldIdOrgType_isDtl;
}
if(Util.getIntValue(fieldIdOrgId2) <= 0){
fieldIdOrgId2 = fieldIdOrgId;
fieldIdOrgId2_isDtl = fieldIdOrgId_isDtl;
}
if(Util.getIntValue(fieldIdOccurdate2) <= 0){
fieldIdOccurdate2 = fieldIdOccurdate;
fieldIdOccurdate2_isDtl = fieldIdOccurdate_isDtl;
}
if(Util.getIntValue(fieldIdHrmInfo2) <= 0){
fieldIdHrmInfo2 = fieldIdHrmInfo;
fieldIdHrmInfo2_isDtl = fieldIdHrmInfo_isDtl;
}
if(Util.getIntValue(fieldIdDepInfo2) <= 0){
fieldIdDepInfo2 = fieldIdDepInfo;
fieldIdDepInfo2_isDtl = fieldIdDepInfo_isDtl;
}
if(Util.getIntValue(fieldIdSubInfo2) <= 0){
fieldIdSubInfo2 = fieldIdSubInfo;
fieldIdSubInfo2_isDtl = fieldIdSubInfo_isDtl;
}
if(Util.getIntValue(fieldIdFccInfo2) <= 0){
fieldIdFccInfo2 = fieldIdFccInfo;
fieldIdFccInfo2_isDtl = fieldIdFccInfo_isDtl;
}
%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="weaver.fna.general.FnaCommon"%>
<script language="javascript" src="/fna/js/e8Common_wev8.js?r=20"></script>
<script language="javascript" src="/fna/js/fna_e9Common.js?r=v3"></script>
<script type="text/javascript">
var __fna_haveNotTopDialogAlertVal = __fna_haveNotTopDialogAlert();
var _FnaSubmitRequestJsFlag = 1;
var _FnaCostCenterStaticIdx = <%=FnaCostCenter.ORGANIZATION_TYPE%>;
var _____guid1 = "<%=guid1 %>";
var _____currentnodetype = "<%=currentnodetype %>";
var dt1_subject = "<%=fieldIdSubject %>";
var dt1_organizationtype = "<%=fieldIdOrgType %>";
var dt1_organizationid = "<%=fieldIdOrgId %>";
var dt1_budgetperiod = "<%=fieldIdOccurdate %>";
var dt1_applyamount = "<%=fieldIdAmount %>";
var dt1_hrmremain = "<%=fieldIdHrmInfo %>";
var dt1_deptremain = "<%=fieldIdDepInfo %>";
var dt1_subcomremain = "<%=fieldIdSubInfo %>";
var dt1_fccremain = "<%=fieldIdFccInfo %>";
var dt1_fieldId_array = [dt1_subject, dt1_organizationtype, dt1_organizationid, dt1_budgetperiod, dt1_applyamount,
dt1_hrmremain, dt1_deptremain, dt1_subcomremain, dt1_fccremain];
var dt1_subject2 = "<%=fieldIdSubject2 %>";
var dt1_organizationtype2 = "<%=fieldIdOrgType2 %>";
var dt1_organizationid2 = "<%=fieldIdOrgId2 %>";
var dt1_budgetperiod2 = "<%=fieldIdOccurdate2 %>";
var dt1_hrmremain2 = "<%=fieldIdHrmInfo2 %>";
var dt1_deptremain2 = "<%=fieldIdDepInfo2 %>";
var dt1_subcomremain2 = "<%=fieldIdSubInfo2 %>";
var dt1_fccremain2 = "<%=fieldIdFccInfo2 %>";
var dt1_fieldId_array2 = [dt1_subject2, dt1_organizationtype2, dt1_organizationid2, dt1_budgetperiod2,
dt1_hrmremain2, dt1_deptremain2, dt1_subcomremain2, dt1_fccremain2];
//是否是明细表字段;1:是明细表;0:是主表;-1:未配置字段;
var dt1_subject_isDtl = "<%=fieldIdSubject_isDtl %>";
var dt1_organizationtype_isDtl = "<%=fieldIdOrgType_isDtl %>";
var dt1_organizationid_isDtl = "<%=fieldIdOrgId_isDtl %>";
var dt1_budgetperiod_isDtl = "<%=fieldIdOccurdate_isDtl %>";
var dt1_applyamount_isDtl = "<%=fieldIdAmount_isDtl %>";
var dt1_hrmremain_isDtl = "<%=fieldIdHrmInfo_isDtl %>";
var dt1_deptremain_isDtl = "<%=fieldIdDepInfo_isDtl %>";
var dt1_subcomremain_isDtl = "<%=fieldIdSubInfo_isDtl %>";
var dt1_fccremain_isDtl = "<%=fieldIdFccInfo_isDtl %>";
//所有字段是否是明细表字段:集合数组
var dt1_fieldId_isDtl_array = [dt1_subject_isDtl, dt1_organizationtype_isDtl, dt1_organizationid_isDtl, dt1_budgetperiod_isDtl, dt1_applyamount_isDtl,
dt1_hrmremain_isDtl, dt1_deptremain_isDtl, dt1_subcomremain_isDtl, dt1_fccremain_isDtl];
//是否包含了明细表字段
var dt1_haveIsDtlField = (dt1_subject_isDtl=="1"||dt1_organizationtype_isDtl=="1"||dt1_organizationid_isDtl=="1"
||dt1_budgetperiod_isDtl=="1"||dt1_applyamount_isDtl=="1"||dt1_hrmremain_isDtl=="1"
||dt1_deptremain_isDtl=="1"||dt1_subcomremain_isDtl=="1"||dt1_fccremain_isDtl=="1");
//是否是明细表字段;1:是明细表;0:是主表;-1:未配置字段;
var dt1_subject2_isDtl = "<%=fieldIdSubject2_isDtl %>";
var dt1_organizationtype2_isDtl = "<%=fieldIdOrgType2_isDtl %>";
var dt1_organizationid2_isDtl = "<%=fieldIdOrgId2_isDtl %>";
var dt1_budgetperiod2_isDtl = "<%=fieldIdOccurdate2_isDtl %>";
var dt1_hrmremain2_isDtl = "<%=fieldIdHrmInfo2_isDtl %>";
var dt1_deptremain2_isDtl = "<%=fieldIdDepInfo2_isDtl %>";
var dt1_subcomremain2_isDtl = "<%=fieldIdSubInfo2_isDtl %>";
var dt1_fccremain2_isDtl = "<%=fieldIdFccInfo2_isDtl %>";
//所有字段是否是明细表字段:集合数组
var dt1_fieldId_isDtl_array2 = [dt1_subject2_isDtl, dt1_organizationtype2_isDtl, dt1_organizationid2_isDtl, dt1_budgetperiod2_isDtl,
dt1_hrmremain2_isDtl, dt1_deptremain2_isDtl, dt1_subcomremain2_isDtl, dt1_fccremain2_isDtl];
//是否包含了明细表字段
var dt1_haveIsDtlField2 = (dt1_subject2_isDtl=="1"||dt1_organizationtype2_isDtl=="1"||dt1_organizationid2_isDtl=="1"
||dt1_budgetperiod2_isDtl=="1"||dt1_hrmremain2_isDtl=="1"
||dt1_deptremain2_isDtl=="1"||dt1_subcomremain2_isDtl=="1"||dt1_fccremain2_isDtl=="1");
var __workflowid = "<%=workflowid %>";
var __requestid = "<%=requestid %>";
/**
* 回写主表或明细表预算信息
*/
function bindfee(){
if(dt1_haveIsDtlField || dt1_haveIsDtlField2){
var detailAllRowIndexStr = "";
try{
detailAllRowIndexStr = WfForm.getDetailAllRowIndexStr("detail_1");
} catch (e) {}
if(detailAllRowIndexStr != ""){
var detailAllRowIndexStr_array = detailAllRowIndexStr.split(",");
for(var rowIdx = 0; rowIdx < detailAllRowIndexStr_array.length; rowIdx++){
var idx = detailAllRowIndexStr_array[rowIdx];
getFnaInfoData(idx, "");
getFnaInfoData(idx, "2");
}
}
}
if(dt1_organizationtype_isDtl!="1" || dt1_budgetperiod_isDtl!="1"){
getFnaInfoData("");
}
if((dt1_organizationtype2_isDtl!="1" && dt1_organizationtype != dt1_organizationtype2) || (dt1_budgetperiod2_isDtl!="1" && dt1_budgetperiod != dt1_budgetperiod2)){
getFnaInfoData("", "2");
}
}
/**
* 一次性回写主表或明细表预算信息
*/
function bindfees(){
if(dt1_haveIsDtlField || dt1_haveIsDtlField2){
var detailAllRowIndexStr = "";
try{
detailAllRowIndexStr = WfForm.getDetailAllRowIndexStr("detail_1");
} catch (e) {}
if(detailAllRowIndexStr != ""){
var detailAllRowIndexStr_array = detailAllRowIndexStr.split(",");
var idxs = '';
for(var rowIdx = 0; rowIdx < detailAllRowIndexStr_array.length; rowIdx++){
var idx = detailAllRowIndexStr_array[rowIdx];
idxs += idx + ',';
}
idxs = idxs.substring(0,idxs.lastIndexOf(','));
getFnaInfoDatas(idxs, "");//一次性更新
getFnaInfoDatas(idxs, "2");//一次性更新
}
}
if(dt1_organizationtype_isDtl!="1" || dt1_budgetperiod_isDtl!="1"){
getFnaInfoData("");
}
if((dt1_organizationtype2_isDtl!="1" && dt1_organizationtype != dt1_organizationtype2) || (dt1_budgetperiod2_isDtl!="1" && dt1_budgetperiod != dt1_budgetperiod2)){
getFnaInfoData("", "2");
}
}
/**
* 更新预算信息
*/
function getFnaInfoData(rowIndex, type){
var budgetfeetype = "";
var orgType = "";
var orgId = "";
var applyDate = "";
if(type == "2"){
budgetfeetype = getWfMainAndDetailFieldValueForPc_e9(dt1_subject2, dt1_subject2_isDtl, rowIndex);
orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, rowIndex);
orgId = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, rowIndex);
applyDate = getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod2, dt1_budgetperiod2_isDtl, rowIndex);
}else{
budgetfeetype = getWfMainAndDetailFieldValueForPc_e9(dt1_subject, dt1_subject_isDtl, rowIndex);
orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, rowIndex);
orgId = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, rowIndex);
applyDate = getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod, dt1_budgetperiod_isDtl, rowIndex);
}
var _data = "budgetfeetype="+budgetfeetype+"&orgtype="+orgType+"&orgid="+orgId+"&applydate="+applyDate+"&fromRequestTypeBudgetKPI=fnaSubmitRequestJsChange";
jQuery.ajax({
url : "/workflow/request/FnaBudgetInfoAjax.jsp",
type : "post",
processData : false,
data : _data,
dataType : "html",
success: function do4Success(msg){
getFnaInfoData_callBack(jQuery.trim(msg), rowIndex, type);
}
});
}
/**
* 更新所有预算信息
*/
function getFnaInfoDatas(rowIndexs, type){
var budgetfeetype = "";
var orgType = "";
var orgId = "";
var applyDate = "";
rowIndexs = rowIndexs.split(",");
if(type == "2"){
for(var i=0;i<rowIndexs.length;i++){
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_subject2, dt1_subject2_isDtl, rowIndexs[i])==''){
budgetfeetype += "0,";
}else{
budgetfeetype += getWfMainAndDetailFieldValueForPc_e9(dt1_subject2, dt1_subject2_isDtl, rowIndexs[i])+",";
}
}catch(e0){
budgetfeetype += "0,";
}
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, rowIndexs[i])==''){
orgType += "0,";
}else{
orgType += getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, rowIndexs[i])+",";
}
}catch(e0){
orgType += "0,";
}
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, rowIndexs[i])==''){
orgId += "0,";
}else{
orgId += getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, rowIndexs[i])+",";
}
}catch(e0){
orgId += "0,";
}
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod2, dt1_budgetperiod2_isDtl, rowIndexs[i])==''){
applyDate += " ,";
}else{
applyDate += getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod2, dt1_budgetperiod2_isDtl, rowIndexs[i])+",";
}
}catch(e0){
applyDate += " ,";
}
}
}else{
for(var i=0;i<rowIndexs.length;i++){
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_subject, dt1_subject_isDtl, rowIndexs[i])==''){
budgetfeetype += "0,";
}else{
budgetfeetype += getWfMainAndDetailFieldValueForPc_e9(dt1_subject, dt1_subject_isDtl, rowIndexs[i])+",";
}
}catch(e0){
budgetfeetype += "0,";
}
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, rowIndexs[i])==''){
orgType += "0,";
}else{
orgType += getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, rowIndexs[i])+",";
}
}catch(e0){
orgType += "0,";
}
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, rowIndexs[i])==''){
orgId += "0,";
}else{
orgId += getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, rowIndexs[i])+",";
}
}catch(e0){
orgId += "0,";
}
try{
if(getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod, dt1_budgetperiod_isDtl, rowIndexs[i])==''){
applyDate += " ,";
}else{
applyDate += getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod, dt1_budgetperiod_isDtl, rowIndexs[i])+",";
}
}catch(e0){
applyDate += " ,";
}
}
}
budgetfeetype = budgetfeetype.substring(0,budgetfeetype.lastIndexOf(','));
orgType = orgType.substring(0,orgType.lastIndexOf(','));
orgId = orgId.substring(0,orgId.lastIndexOf(','));
applyDate = applyDate.substring(0,applyDate.lastIndexOf(','));
var _data = "budgetfeetype="+budgetfeetype+"&orgtype="+orgType+"&orgid="+orgId+"&applydate="+applyDate;
jQuery.ajax({
url : "/api/fna/workflow/budgetInfo",
type : "post",
processData : false,
data : _data,
dataType : "json",
success: function do4Success(msg){
for(var i=0;i<rowIndexs.length;i++){
getFnaInfoData_callBack(msg['detail'+i], rowIndexs[i],type);
}
}
});
}
/**
* 预算信息回调方法
*/
function getFnaInfoData_callBack(msg, rowIndex, type){
var orgType = -1;
if(type == "2"){
orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, rowIndex);
}else{
orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, rowIndex);
}
var fnainfos = jQuery.trim(msg).split("|");
var budgetAutoMoveInfo = "";
if(fnainfos.length>=5){
budgetAutoMoveInfo = fnainfos[4];
if(budgetAutoMoveInfo != ""){
budgetAutoMoveInfo = "<%=SystemEnv.getHtmlLabelName(126630,user.getLanguage())%>:"+budgetAutoMoveInfo;
}
}
var budgetAmount_currentPeriod = "";
var budget_avail_color = "#000000";
var canBudgetChangeAmt = "";
if(fnainfos.length>=6){
try{
var budgetChangeInfo_str = fnainfos[5];
if(budgetChangeInfo_str!=null && budgetChangeInfo_str!=""){
var budgetChangeInfo_array = eval("["+budgetChangeInfo_str+"]");
if(budgetChangeInfo_array && budgetChangeInfo_array.length==1){
budgetAmount_currentPeriod = budgetChangeInfo_array[0].budgetAmount_currentPeriod;
if(budgetAmount_currentPeriod==null){
budgetAmount_currentPeriod = "";
}
try{
if(budgetChangeInfo_array[0].budget_avail_color){
budget_avail_color = budgetChangeInfo_array[0].budget_avail_color;
}
}catch(exBudgetChangeInfo1){}
try{
if(budgetChangeInfo_array[0].canBudgetChangeAmt){
canBudgetChangeAmt = budgetChangeInfo_array[0].canBudgetChangeAmt;
if(canBudgetChangeAmt==""){
canBudgetChangeAmt = "0.00";
}
}
}catch(exBudgetChangeInfo1){}
}
}
}catch(exBudgetChangeInfo){}
}
var _dt1_remain_array = [];
if(type == "2"){
_dt1_remain_array = [dt1_hrmremain2, dt1_deptremain2, dt1_subcomremain2, dt1_fccremain2];
}else{
_dt1_remain_array = [dt1_hrmremain, dt1_deptremain, dt1_subcomremain, dt1_fccremain];
}
var _dt1_remain_array_len = _dt1_remain_array.length;
var _dt1_remain_only = "";
if(getFnaNotEmptyCount(_dt1_remain_array)==1){
_dt1_remain_only = getFnaOnlyNotEmptyValue(_dt1_remain_array);
}
var _dt1_remain_exsits_array = [];
for(var i=0;i<_dt1_remain_array_len;i++){
var _dt1_remain = _dt1_remain_array[i];
if(_dt1_remain_only!=""&&_dt1_remain_only!=_dt1_remain){
continue;
}
var values = fnainfos[i].split(",");
if((_dt1_remain_only!=""&&_dt1_remain_only==_dt1_remain) || (getFnaSameValueCount(_dt1_remain_array, _dt1_remain)>1)){
//个人:orgType==0;部门:orgType==2;分部:orgType==3;成本中心:orgType==4;
if(_dt1_remain_array[orgType] == _dt1_remain){
values = fnainfos[orgType].split(",");
}
}
var _fontColor_values0 = "";
if(budget_avail_color!=null && budget_avail_color!=""){
_fontColor_values0 = "color:"+budget_avail_color+" !important;";
}
var tempmsg = "<font style=\"font-weight: bolder !important;"+_fontColor_values0+"\" ><%=SystemEnv.getHtmlLabelName(18768,user.getLanguage())%>: "+formatNumber(fnaRound2(values[0],2),'#,##0.00')+"</font>"+
"<br><span style=\"color: blue !important;\"><%=SystemEnv.getHtmlLabelName(18503,user.getLanguage())%>: "+formatNumber(fnaRound2(values[1],2),'#,##0.00')+"</span>"+
"<br><span style=\"color: green !important;\"><%=SystemEnv.getHtmlLabelName(18769,user.getLanguage())%>: "+formatNumber(fnaRound2(values[2],2),'#,##0.00')+"</span>";
if(budgetAutoMoveInfo!=""){
tempmsg += "<br>"+budgetAutoMoveInfo;
}
try{
if(canBudgetChangeAmt!=""){
tempmsg = "<%=SystemEnv.getHtmlLabelName(507223,user.getLanguage())%>: "+formatNumber(fnaRound2(canBudgetChangeAmt,2),'#,##0.00')+"<br>"+tempmsg;
}
}catch(exBudgetChangeInfo1){}
<%if(costControlCycle==1 || costControlCycle==5 || costControlCycle==6){ %>
//1=按预算年度累计; 5=按预算年度合计; 6=按跨年合计
if((orgType=="0" && i==0) || (orgType=="1" && i==1) || (orgType=="2" && i==2) || (orgType=="3" && i==3)){
tempmsg = "<span style=\"font-weight: bolder !important;\"><%=SystemEnv.getHtmlLabelName(383165,user.getLanguage())%>: "+formatNumber(fnaRound2(budgetAmount_currentPeriod,2),'#,##0.00')+"</span><br>"+tempmsg;
}else{
if(jQuery.inArray(_dt1_remain, _dt1_remain_exsits_array)>=0){
continue;
}
}
_dt1_remain_exsits_array.push(_dt1_remain);
<%} %>
var dt1_haveIsDtlField_value = "1";
if(type == "2"){
dt1_haveIsDtlField_value = (dt1_haveIsDtlField2?"1":"0");
}else{
dt1_haveIsDtlField_value = (dt1_haveIsDtlField?"1":"0");
}
//setWfMainAndDetailFieldSpanValueForPc(tempmsg, _dt1_remain, dt1_haveIsDtlField_value, rowIndex);
//WfForm.changeSingleField("field" + _dt1_remain + "_" + rowIndex + "span", {value:tempmsg});
setWfMainAndDetailFieldSpanValueForPc(tempmsg, _dt1_remain, dt1_haveIsDtlField_value, rowIndex);
}
}
function setWfMainAndDetailFieldSpanValueForPc(valueForSpan, fieldId, isDtl, _idx){
if(isDtl=="1"){
jQuery("#field"+fieldId+"_"+_idx+"span").html(valueForSpan);
return;
}else{
jQuery("#field"+fieldId+"span").html(valueForSpan);
return;
}
}
//预算变更就是明细
//提交事件前出发函数
function doBeforeSubmit_fna(callback){
try{
WfForm.controlBtnDisabled(true);//把流程中的按钮置灰
var temprequestid = __requestid;
var poststr = "";
try{
if(dt1_haveIsDtlField || dt1_haveIsDtlField2){
var detailAllRowIndexStr1 = "";//明细表1下标id
try{
detailAllRowIndexStr1 = WfForm.getDetailAllRowIndexStr("detail_1");
} catch (e) {}
if(detailAllRowIndexStr1 != ""){
var detailAllRowIndexStr_array = detailAllRowIndexStr1.split(",");
for(var rowIdx = 0; rowIdx < detailAllRowIndexStr_array.length; rowIdx++){
try{
var idx = detailAllRowIndexStr_array[rowIdx];
var budgetfeetype = getWfMainAndDetailFieldValueForPc_e9(dt1_subject, dt1_subject_isDtl, idx);
var orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, idx);
var orgid = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, idx);
var applydate = getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod, dt1_budgetperiod_isDtl, idx);
var applyamount = getWfMainAndDetailFieldValueForPc_e9(dt1_applyamount, dt1_applyamount_isDtl, idx);
budgetfeetype = (budgetfeetype=="") ? "0" : budgetfeetype;
orgType = (orgType=="") ? "-1" : orgType;
applyamount = (applyamount=="") ? "0" : applyamount;
var budgetfeetype2 = getWfMainAndDetailFieldValueForPc_e9(dt1_subject2, dt1_subject2_isDtl, idx);
var orgtype2 = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, idx);
var orgid2 = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, idx);
var applydate2 = getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod2, dt1_budgetperiod2_isDtl, idx);
budgetfeetype2 = (budgetfeetype2=="") ? "0" : budgetfeetype2;
orgtype2 = (orgtype2=="") ? "-1" : orgtype2;
if(poststr!=""){
poststr += "|";
}
poststr += budgetfeetype+","+orgType+","+orgid+","+applydate+","+applyamount+","+
budgetfeetype2+","+orgtype2+","+orgid2+","+applydate2+",postStrEnd";
}catch(e){
//console.log("e:"+e);
}
}
}
}else{
var budgetfeetype = getWfMainAndDetailFieldValueForPc_e9(dt1_subject, dt1_subject_isDtl, "");
var orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, "");
var orgid = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, "");
var applydate = getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod, dt1_budgetperiod_isDtl, "");
var applyamount = getWfMainAndDetailFieldValueForPc_e9(dt1_applyamount, dt1_applyamount_isDtl, "");
budgetfeetype = (budgetfeetype=="") ? "0" : budgetfeetype;
orgType = (orgType=="") ? "-1" : orgType;
applyamount = (applyamount=="") ? "0" : applyamount;
var budgetfeetype2 = getWfMainAndDetailFieldValueForPc_e9(dt1_subject2, dt1_subject2_isDtl, "");
var orgtype2 = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, "");
var orgid2 = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, "");
var applydate2 = getWfMainAndDetailFieldValueForPc_e9(dt1_budgetperiod2, dt1_budgetperiod2_isDtl, "");
budgetfeetype2 = (budgetfeetype2=="") ? "0" : budgetfeetype2;
orgtype2 = (orgtype2=="") ? "-1" : orgtype2;
if(poststr!=""){
poststr += "|";
}
poststr += budgetfeetype+","+orgType+","+orgid+","+applydate+","+applyamount+","+
budgetfeetype2+","+orgtype2+","+orgid2+","+applydate2+",postStrEnd";
}
}catch(ex001){
//alert(ex001);
}
if(poststr == ""){
WfForm.controlBtnDisabled(false);//取消流程中的按钮置灰
callback(); //继续提交需调用callback,不调用代表阻断
return;
}
var _data = "poststr="+poststr+"&requestid="+temprequestid+"&workflowid="+__workflowid;
jQuery.ajax({
url : "/fna/budget/FnaChangeifoverJsonAjax.jsp",
type : "post",
processData : false,
data : _data,
dataType : "json",
success: function do4Success(fnainfo){
if(fnainfo.flag){
WfForm.controlBtnDisabled(false);
callback(); //继续提交需调用callback,不调用代表阻断
return;
}else{
var errorType = fnainfo.errorType;
var errorInfo = fnainfo.errorInfo;
if(errorInfo!=null){
errorInfo = errorInfo.replace("\n","<br>");
}else{
errorInfo="";
}
if(errorType=="alert"){
WfForm.controlBtnDisabled(false);
if(__fna_haveNotTopDialogAlertVal){
alert(errorInfo._fnaReplaceAll("<br>","\n"));
}else{
top.Dialog.alert(errorInfo);
}
return;
}else if(errorType=="confirm"){
if(__fna_haveNotTopDialogAlertVal){
if(confirm(errorInfo._fnaReplaceAll("<br>","\n"))){
WfForm.controlBtnDisabled(false);
callback(); //继续提交需调用callback,不调用代表阻断
return;
}else{
WfForm.controlBtnDisabled(false);
return;
}
}else{
top.Dialog.confirm(errorInfo,
function(){
WfForm.controlBtnDisabled(false);
callback(); //继续提交需调用callback,不调用代表阻断
return;
},function(){
WfForm.controlBtnDisabled(false);
return;
}
);
}
}else{
WfForm.controlBtnDisabled(false);
if(__fna_haveNotTopDialogAlertVal){
alert(errorInfo._fnaReplaceAll("<br>","\n"));
}else{
top.Dialog.alert(errorInfo);
}
return;
}
}
}
});
}catch(ex2){
WfForm.controlBtnDisabled(false);
alert(ex2.message);
return;
}
}
//清理科目id
function clearSubjectById(rowId,type){
<%if(subjectFilter){ %>
var budgetfeetype = getWfMainAndDetailFieldValueForPc_e9(dt1_subject, dt1_subject_isDtl, rowId);
var orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, rowId);
var orgid = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, rowId);
var subject_fieldId = "field"+dt1_subject;
var subject_isDtl = dt1_subject_isDtl;
if(type == "2"){
budgetfeetype = getWfMainAndDetailFieldValueForPc_e9(dt1_subject2, dt1_subject2_isDtl, rowId);
orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, rowId);
orgid = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, rowId);
subject_fieldId = "field"+dt1_subject2;
subject_isDtl = dt1_subject2_isDtl;
}
if(budgetfeetype != "" && orgid !=""){
jQuery.ajax({
url : "/fna/wfPage/getClearSubjectInfo.jsp",
type : "post",
processData : false,
data : "budgetfeetype="+budgetfeetype+"&orgtype="+orgType+"&orgid="+orgid,
dataType : "json",
success: function do4Success(fnainfo){
if(fnainfo.flag){
if(fnainfo.change != "1"){
if(subject_isDtl == 0){
WfForm.changeSingleField(subject_fieldId, {value:""});
}else if(subject_isDtl == 1){
WfForm.changeSingleField(subject_fieldId + "_" + rowId, {value:""});
}
getFnaInfoData(rowId,type);
}
}else{
if(__fna_haveNotTopDialogAlertVal){
alert(fnainfo.errorInfo._fnaReplaceAll("<br>","\n"));
}else{
top.Dialog.alert(fnainfo.errorInfo);
}
}
}
});
}
<%}%>
}
//全主表或主表明细表处理事件(科目联动)
function mainRelateSubject(subject_isDtl,detailTableStr,type){
if(subject_isDtl == 0){
clearSubjectById("",type);
appendBrowserOtherData("");
}else{
var detailIndexStr1 = "";
try{
detailIndexStr1 = WfForm.getDetailAllRowIndexStr(detailTableStr);
} catch (e) {}
if(detailIndexStr1 != ""){
var detailIndexArray = detailIndexStr1.split(",");
for(var rowIdx = 0; rowIdx < detailIndexArray.length; rowIdx++){
var idx = detailIndexArray[rowIdx];
clearSubjectById(idx,type);
appendBrowserOtherData(idx);
}
}
}
}
//全主表或主表明细表处理事件(预算信息联动)
function mainRelateBudgetInfo(organizationtype_isDtl,organizationid_isDtl,subject_isDtl,budgetperiod_isDtl,detailTableStr,type){
if(organizationtype_isDtl == 0 && organizationid_isDtl == 0 && subject_isDtl == 0 && budgetperiod_isDtl == 0){
getFnaInfoData("",type);
}else{
var detailIndexStr1 = "";
try{
detailIndexStr1 = WfForm.getDetailAllRowIndexStr(detailTableStr);
} catch (e) {}
if(detailIndexStr1 != ""){
var detailIndexArray = detailIndexStr1.split(",");
for(var rowIdx = 0; rowIdx < detailIndexArray.length; rowIdx++){
var idx = detailIndexArray[rowIdx];
getFnaInfoData(idx,type);
}
}
}
}
//传入科目浏览按钮的过滤依据数据
function appendBrowserOtherData(idx){
var orgType = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype, dt1_organizationtype_isDtl, idx);
var orgId = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid, dt1_organizationid_isDtl, idx);
var subject_fieldId = "field"+dt1_subject;
var orgType2 = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationtype2, dt1_organizationtype2_isDtl, idx);
var orgId2 = getWfMainAndDetailFieldValueForPc_e9(dt1_organizationid2, dt1_organizationid2_isDtl, idx);
var subject_fieldId2 = "field"+dt1_subject2;
if(dt1_subject == dt1_subject2){
if(idx != null && idx.length != 0){
WfForm.appendBrowserDataUrlParam(subject_fieldId+"_"+idx,{"orgType":orgType,"orgId":orgId,"orgType2":orgType2,"orgId2":orgId2});
}else{
WfForm.appendBrowserDataUrlParam(subject_fieldId,{"orgType":orgType,"orgId":orgId,"orgType2":orgType2,"orgId2":orgId2});
}
}else{
if(idx != null && idx.length != 0){
WfForm.appendBrowserDataUrlParam(subject_fieldId+"_"+idx,{"orgType":orgType,"orgId":orgId});
WfForm.appendBrowserDataUrlParam(subject_fieldId2+"_"+idx,{"orgType":orgType2,"orgId":orgId2});
}else{
WfForm.appendBrowserDataUrlParam(subject_fieldId,{"orgType":orgType,"orgId":orgId});
WfForm.appendBrowserDataUrlParam(subject_fieldId2,{"orgType":orgType2,"orgId":orgId2});
}
}
}
//明细1新增成功后触发事件,addIndexStr即刚新增的行标示,添加多行为(1,2,3)
function _customAddFun0(addIndexStr){
appendBrowserOtherData(addIndexStr);
appendBrowserOtherData(addIndexStr);
getFnaInfoData(addIndexStr,"");
getFnaInfoData(addIndexStr,"2");
}
jQuery(document).ready(function(){
/**
* 字段绑定事件 (字段在主表,是否全主表,不是则变动影响所有明细) 0:主表;1:明细表
* 承担类型 => 承担主体(组件已做),科目
* 承担主体 => 科目,预算
* 科目 => 预算
* 日期 => 预算
*/
//承担类型
if(dt1_organizationtype_isDtl == 0){
var fieldStr = "field" + dt1_organizationtype;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateSubject(dt1_subject_isDtl,"detail_1","");
});
}else if(dt1_organizationtype_isDtl == 1){
var fieldStr = "field" + dt1_organizationtype;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
if(dt1_subject_isDtl == 1){//剔除科目主表,承担主体明细表的情况
clearSubjectById(rowIndex,"");
appendBrowserOtherData(rowIndex);
}
});
}
if(dt1_organizationtype2_isDtl == 0){
var fieldStr = "field" + dt1_organizationtype2;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateSubject(dt1_subject2_isDtl,"detail_1","2");
});
}else if(dt1_organizationtype2_isDtl == 1){
var fieldStr = "field" + dt1_organizationtype2;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
if(dt1_subject2_isDtl == 1){
clearSubjectById(rowIndex,"2");
appendBrowserOtherData(rowIndex);
}
});
}
//承担主体
if(dt1_organizationid_isDtl == 0){
var fieldStr = "field" + dt1_organizationid;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateSubject(dt1_subject_isDtl,"detail_1","");
mainRelateBudgetInfo(dt1_organizationtype_isDtl,dt1_organizationid_isDtl,dt1_subject_isDtl,dt1_budgetperiod_isDtl,"detail_1","");
});
}else if(dt1_organizationid_isDtl == 1){
var fieldStr = "field" + dt1_organizationid;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
if(dt1_subject_isDtl == 1){//剔除科目主表,承担主体明细表的情况
clearSubjectById(rowIndex,"");
appendBrowserOtherData(rowIndex);
}
getFnaInfoData(rowIndex,"");
});
}
if(dt1_organizationid2_isDtl == 0){
var fieldStr = "field" + dt1_organizationid2;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateSubject(dt1_subject2_isDtl,"detail_1","2");
mainRelateBudgetInfo(dt1_organizationtype2_isDtl,dt1_organizationid2_isDtl,dt1_subject2_isDtl,dt1_budgetperiod2_isDtl,"detail_1","2");
});
}else if(dt1_organizationid2_isDtl == 1){
var fieldStr = "field" + dt1_organizationid2;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
if(dt1_subject2_isDtl == 1){
clearSubjectById(rowIndex,"2");
appendBrowserOtherData(rowIndex);
}
getFnaInfoData(rowIndex,"2");
});
}
//科目
if(dt1_subject_isDtl == 0){
var fieldStr = "field" + dt1_subject;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateBudgetInfo(dt1_organizationtype_isDtl,dt1_organizationid_isDtl,dt1_subject_isDtl,dt1_budgetperiod_isDtl,"detail_1","");
});
}else if(dt1_subject_isDtl == 1){
var fieldStr = "field" + dt1_subject;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
getFnaInfoData(rowIndex,"");
});
}
if(dt1_subject2_isDtl == 0){
var fieldStr = "field" + dt1_subject2;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateBudgetInfo(dt1_organizationtype2_isDtl,dt1_organizationid2_isDtl,dt1_subject2_isDtl,dt1_budgetperiod2_isDtl,"detail_1","2");
});
}else if(dt1_subject2_isDtl == 1){
var fieldStr = "field" + dt1_subject2;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
getFnaInfoData(rowIndex,"2");
});
}
//日期
if(dt1_budgetperiod_isDtl == 0){
var fieldStr = "field" + dt1_budgetperiod;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateBudgetInfo(dt1_organizationtype_isDtl,dt1_organizationid_isDtl,dt1_subject_isDtl,dt1_budgetperiod_isDtl,"detail_1","");
});
}else if(dt1_budgetperiod_isDtl == 1){
var fieldStr = "field" + dt1_budgetperiod;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
getFnaInfoData(rowIndex,"");
});
}
if(dt1_budgetperiod2_isDtl == 0){
var fieldStr = "field" + dt1_budgetperiod2;
WfForm.bindFieldChangeEvent(fieldStr, function(obj,id,value){
mainRelateBudgetInfo(dt1_organizationtype2_isDtl,dt1_organizationid2_isDtl,dt1_subject2_isDtl,dt1_budgetperiod2_isDtl,"detail_1","2");
});
}else if(dt1_budgetperiod2_isDtl == 1){
var fieldStr = "field" + dt1_budgetperiod2;
WfForm.bindDetailFieldChangeEvent(fieldStr,function(id,rowIndex,value){
getFnaInfoData(rowIndex,"2");
});
}
//设置浏览按钮初始传值
if(dt1_organizationtype_isDtl == 0 && dt1_organizationid_isDtl == 0 && dt1_subject_isDtl == 0){//全主表
appendBrowserOtherData("");
}else{
if(dt1_subject_isDtl == 1){//剔除科目主表,承担主体明细表的情况
var detailIndexStr1 = "";
try{
detailIndexStr1 = WfForm.getDetailAllRowIndexStr("detail_1");
} catch (e) {}
if(detailIndexStr1 != ""){
var detailIndexArray = detailIndexStr1.split(",");
for(var rowIdx = 0; rowIdx < detailIndexArray.length; rowIdx++){
var idx = detailIndexArray[rowIdx];
appendBrowserOtherData(idx);
}
}
}
}
if(dt1_organizationtype2_isDtl == 0 && dt1_organizationid2_isDtl == 0 && dt1_subject2_isDtl == 0){//全主表
appendBrowserOtherData("");
}else{
if(dt1_subject2_isDtl == 1){//剔除科目主表,承担主体明细表的情况
var detailIndexStr1 = "";
try{
detailIndexStr1 = WfForm.getDetailAllRowIndexStr("detail_1");
} catch (e) {}
if(detailIndexStr1 != ""){
var detailIndexArray = detailIndexStr1.split(",");
for(var rowIdx = 0; rowIdx < detailIndexArray.length; rowIdx++){
var idx = detailIndexArray[rowIdx];
appendBrowserOtherData(idx);
}
}
}
}
/* if(dt1_haveIsDtlField || dt1_haveIsDtlField2){
var fieldStr1 = "field" + dt1_organizationid + ",field" + dt1_subject + ",field" + dt1_budgetperiod;
var fieldStr2 = "field" + dt1_organizationid2 + ",field" + dt1_subject2 + ",field" + dt1_budgetperiod2;
WfForm.bindDetailFieldChangeEvent(fieldStr1,function(id,rowIndex,value){
//console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
getFnaInfoData(rowIndex, "");
});
WfForm.bindDetailFieldChangeEvent(fieldStr2,function(id,rowIndex,value){
//console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
getFnaInfoData(rowIndex, "2");
});
} */
//更新明细表或主表预算信息
//bindfee();
bindfees();
//绑定提交前事件
WfForm.registerCheckEvent(WfForm.OPER_SUBMIT,function(callback){
doBeforeSubmit_fna(callback);
});
});
</script>