123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- /**
- * @desc : 화면초기화
- *
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- model.setFocus("ipt_reqdata");
- model.setValue("/root/init/today", getCurrentDate());
- submit("TRMRF00802");
- model.refresh();
- }
- /**
- * @desc : 버튼활성화 혹은 비활성화
- *
- * @param : 버튼 속성값(boolean)
- * @return :
- * @---------------------------------------------------
- */
- function fCtrlDisabled(bool){
- ipt_unitnm.disabled = bool;
- cmb_unitkind.disabled = bool;
- ipt_exchval.disabled = bool;
- ipt_rem.disabled = bool;
- ipt_unitfromdt.disabled = bool;
- ipt_unittodt.disabled = bool;
- }
- //datagrid.vscroll.atttribute("hopos") = XX
- /**
- * @desc : 단위리스트 조회
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqUnitlist(){
- fCtrlDisabled(true);
- model.copyNode("/root/send/reqdata", "/root/main/condition");
- submit("TRMRF00801");
- }
- /**
- * @desc : 단위리스트 추가
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddUnitlist(){
- /* grd_unitlist.addItem();
- iRow = grd_unitlist.row;
- grd_unitlist.vscroll.attribute("pos") = iRow * grd_unitlist.dataheight;//새로운 행으로 스크롤 이동*/
- model.resetInstanceNode("/root/main/newunit");
- model.makeValue("/root/main/newunit/unitfromdt", model.getValue("/root/init/today"));
- model.makeValue("/root/main/newunit/unittodt" ,"99991231");
- model.makeValue("/root/main/newunit/status" , "i");
- fCtrlDisabled(false); //아이템 입력창의 input콘트롤의 활성화
-
- cmb_valiyn.disabled = true;
- model.setFocus("ipt_unitnm");
- model.refresh();
- }
- /**
- * @desc : 단위리스트 수정
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetUnitlist(){
-
- var curRow = grd_unitlist.row - grd_unitlist.fixedRows + 1;
- if(curRow < 1){
- messageBox("수정할 행을 ","C002");
- return;
- }
-
- // fValiCheck();
- model.makeValue("/root/main/newunit/status" , "u");
- iRow = grd_unitlist.row;
- if(iRow < 1){
- return;
- }
- grd_unitlist.rowStatus(iRow) = 2;
- fCtrlDisabled(false);
- cmb_valiyn.disabled = false;
- model.setFocus("ipt_unitnm");
- model.refresh();
- //fCompareNodes 비교위해 copynode
- model.makeNode("/root/main/newunit2");
- model.copyNode("/root/main/newunit2","/root/main/newunit");
- }
- /**
- * @group :
- * @ver : 2007.06.13
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 두개의 노드셋을 비교한다.
- * @param : originalNode :
- * @param : copyNode :
- * @return : true, false
- * @---------------------------------------------------
- */
- function fCompareNodes1(originalNode, copyNode){
- var ins = document.models( 0 ).instances( 0 );
- var original = ins.selectSingleNode(originalNode).xml;
- var copy = ins.selectSingleNode(copyNode).xml;
- var replace = original.setReplaceWord("newunit2","newunit");
- if(replace == null || copy == null){
-
- return false;
- }else if (replace == copy){
-
- return true;
- }else{
-
- return false;
- }
- }
- /**
- * @desc : 단위리스트 저장
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveUnitlist(){
-
- //status 값 i,u일경우 저장
- var flag;
- var status = model.getValue("/root/main/newunit/status");
-
- if(status == "i" || status =="u")
- {
- flag = true;
- }
- if(!flag)
- return;
-
- if(status == "u")
- {
- //수정 여부 check
- var compare = fCompareNodes1("/root/main/newunit2","/root/main/newunit");
-
- if(status=="u" && compare == true)
- {
- messageBox("수정된 내용이","I004");
- fCtrlDisabled(true);
- cmb_valiyn.disabled = true;
- return;
- }
- //2009.01.21 강지훈 수정
- //변경이력을 남기지 않고 Update.
- var ret = messageBox("변경 이력을 저장", "S001");
- if(ret == "6"){
- model.makeValue("/root/main/newunit/histsaveyn", "Y");
-
- }
- else if(ret == "7"){
- model.makeValue("/root/main/newunit/histsaveyn", "N");
- }
- else{
- return;
- }
- }
- model.copyNode("/root/send/savedata", "/root/main/newunit");
-
- //fUpdateToDt();
-
- submit("TXMRF00801");
- fCtrlDisabled(true);
- cmb_valiyn.disabled = true;
- }
- /**
- * @desc : 단위리스트 newunit으로 복사
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyUnit(){
- iRow = grd_unitlist.row;
- if(iRow < 1){
- return;
- }
- model.copyNode("/root/main/newunit", "/root/main/unitlist[" + iRow + "]");
- // itemidxseq를 unitkind에 넣는다.
- model.setValue("/root/main/newunit/unitkind",model.getValue("/root/main/unitlist[" + iRow + "]/itemidxseq"));
- fCtrlDisabled(true);
- cmb_valiyn.disabled = true;
- var todt = model.getValue("/root/main/unitlist[" + iRow + "]/unittodt");
- var fromdt = model.getValue("/root/main/unitlist[" + iRow + "]/unitfromdt");
- if(fromdt <= getCurrentDate()+getCurrentTime && todt > getCurrentDate()+getCurrentTime ){
- model.setValue("/root/temp/valiyn","Y");
- } else {
- model.setValue("/root/temp/valiyn","N");
- }
- model.refresh();
- }
- /**
- * @desc : 단위 리스트입력부분 초기화
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClearUnit(){
- model.setValue("/root/main/newunit/unitcd","");
- model.setValue("/root/main/newunit/unitnm","");
- model.setValue("/root/main/newunit/unitkind","");
- model.setValue("/root/main/newunit/exchval","");
- model.setValue("/root/main/newunit/fstrgstrnm","");
- model.setValue("/root/main/newunit/fstrgstdt","");
- model.setValue("/root/main/newunit/lastupdtrnm","");
- model.setValue("/root/main/newunit/lastupdtdt","");
- model.setValue("/root/main/newunit/rem","");
- model.setValue("/root/main/newunit/unitfromdt","");
- model.setValue("/root/main/newunit/unittodt","");
- model.refresh();
- }
- /**
- * @desc : 무효 아이템 수정시 valicheck변경
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fValiCheck(){
- // 무효 아이템 수정시 valicheck변경
- var todt = model.getValue("/root/main/newunit/unittodt");
-
- if(getCurrentDate()+getCurrentTime > todt){
- model.setValue("/root/main/valicheck","Y");
-
- }
- }
- /**
- * @desc : 무효화된 단위 수정시 unittodt 새로 넣어준다.
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fUpdateTodt(){
- //무효화된 단위 수정시 unittodt 새로 넣어준다.
- var valicheck = model.getValue("/root/main/valicheck");
- if(valicheck=="Y"){
- model.setValue("/root/send/savedata/unittodt","29991231999999");
- model.setValue("/root/main/valicheck","N");
- model.refresh();
- }
- }
|