123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[//Grid data 동호회 중복 체크
- function misGetDouList(pSubmit_Id) {
- var submit_node = model.children(pSubmit_Id).attribute("ref");
-
- var ins = document.models( 0 ).instances( 0 );
- var node = ins.selectNodes(MASTDETAIL_NODE + "/*");
- var node_detail = null;
- var master_name = new Array();
- var current_name = new Array();
- var save_yn = new Array();
-
- for (var i = 0; i < node.length ; i++) {
- node_detail = ins.selectNodes(MASTDETAIL_NODE + "/" + node.item(i).nodeName + "/*");
-
- for (var j = 0; j < node_detail.length; j++) {
-
- if ( node_detail.item(j).nodeName == "master") {
- master_name[i] = model.getValue(MASTDETAIL_NODE + "/" + node.item(i).nodeName + "/" + node_detail.item(j).nodeName);
- }
- else if ( node_detail.item(j).nodeName == "current") {
- current_name[i] = model.getValue(MASTDETAIL_NODE + "/" + node.item(i).nodeName + "/" + node_detail.item(j).nodeName);
- }
- else if ( node_detail.item(j).nodeName == "saveyn") {
- save_yn[i] = model.getValue(MASTDETAIL_NODE + "/" + node.item(i).nodeName + "/" + node_detail.item(j).nodeName);
- }
-
- }
- }
-
- var update_grid = null;
- var node_list = null;
- var save_node = null;
- for (var k = 0; k < master_name.length; k++)
- {
- if (save_yn[k] == "Y")
- {
- update_grid = document.controls(current_name[k]);
-
- node_list = update_grid.nodeset.split("/");
-
- for (var h = 0; h < node_list.length; h++)
- {
- save_node = node_list[h];
- }
-
-
- model.setValue(submit_node + "/" + save_node , update_grid.getUpdateData());
-
- }
- }
-
- submit(pSubmit_Id);
-
- if (model.getValue(gvErrorMsgPath + "/type") != "error") {
- for (var k = 0; k < master_name.length; k++) {
- if (save_yn[k] == "Y") {
- update_grid = document.controls(current_name[k]);
- }
- }
- }
- }
- //동호회 단체 콤보 박스
- /*
- pcdgrupid : 그룹ID
- pcontrol_name : Data detting될 Control 명
- */
- function misfComboClubCdList(pInstcd, pcontrol_name,pall, pEmplno) {
- var control_id = pcontrol_name.attribute("id");
-
- var comcd_node = "/root/send/comcdref";
- var comcd_rsltnode = "/root/init/comcd";
- var comcd_itemset = "/root/init/" + control_id;
-
- model.removeNodeset(comcd_node);
- model.removeNodeset(comcd_itemset);
-
- model.makeNode(comcd_node);
- model.makeNode(comcd_node + "/cmninstcd");
- model.makeNode(comcd_node + "/cmntcd");
- model.makeNode(comcd_node + "/cmntnm");
- model.makeNode(comcd_node + "/emplno");
-
- model.makeNode(comcd_rsltnode);
- model.makeNode(comcd_itemset);
-
- pcontrol_name.choices.itemset.attribute("nodeset") = comcd_itemset+"/comcodelist";
- pcontrol_name.choices.itemset.label.attribute("ref") = "cmntnm";
- pcontrol_name.choices.itemset.value.attribute("ref") = "cmntcd";
- pcontrol_name.refresh();
-
- model.setValue(comcd_node + "/cmninstcd", pInstcd);
- model.setValue(comcd_node + "/emplno", pEmplno);
- model.removeChild("TRRPA00403");
- model.createChild("xforms:submission", "id:TRRPA00403;mediatype:application/x-www-form-urlencoded; method:post; ref:" + comcd_node + "; resultref:" + comcd_rsltnode + "; ");
- submit("TRRPA00403");
-
- if(pall != null && pall == "Y")
- {
- model.makeValue(comcd_itemset+"/comcodelist[" +1+ "]/cmntnm", "전체");
- model.makeValue(comcd_itemset+"/comcodelist[" +1+ "]/cmntcd", "");
- sourcenode = document.models(0).instances(0).selectSingleNode(comcd_rsltnode);
- tarnode = document.models(0).instances(0).selectSingleNode(comcd_itemset);
-
- var sourcenodelist = sourcenode.childNodes;
- while (childNode = sourcenodelist.nextNode())tarnode.appendChild(childNode);
-
- }
- else model.copyNode(comcd_itemset,comcd_rsltnode);
-
- model.refresh();
- }
- function rpsCheckEmplNo(pGrid_name, pEmplNo) {
- var ret = "N";
- if(pEmplNo !="" ){
- for (var i = 1; i < pGrid_name.rows; i++) {
- if (pEmplNo == pGrid_name.valueMatrix(i, pGrid_name.colRef("emplno"))) {
- ret = "Y";
- break;
- }
- }
- }
- return ret;
- }
- /****************************************************************************************
- * Argument : N/A
- * Description : 오늘 날자 계산
- ****************************************************************************************/
- function mis_to_day() {
- var now = new Date();
- var yr = now.getYear();
- var mName = now.getMonth() + 1;
- var dName = now.getDate();
- if (yr < 100)
- year=("19"+yr).toString();
- else
- year=yr.toString();
- if (mName <10)
- month=("0"+mName).toString();
- else
- month=mName.toString();
- if (dName <10)
- day=("0"+dName).toString();
- else
- day=dName.toString();
- return year+month+day;
- }
- // 사용빈도 : 중
- // 함수명: 하이픈('-')제거함수
- // 설 명: 날짜타입의 '-'이 붙어있는 숫자에서 '-'를 제거하여 숫자만 리턴
- // 인 자: obj(화면 컨트롤)
- // --------------------------------------------------------------------------------------------
- // 사용법: 2004-05-01일 경우 20040501을 리턴
- // cmm_del_hyphen(myForm.txtCtl)
- // --------------------------------------------------------------------------------------------
- function mis_del_hyphen(obj) {
- var str = String(obj.value);
- if (str.length < 1) {
- return "";
- } else {
- var st = "";
- var sp = "-";
- for (var i = 0; i < str.length; i++) {
- if (sp.indexOf(str.substring(i, i + 1)) == -1) {
- st += str.substring(i, i + 1);
- }
- }
- return st;
- }
- }
- /****************************************************************************************
- * Argument : pGrid_name : Grid id명
- * : pMaster_Grid : pGrid_name의 마스터 Grid id명
- * : pSubmit_Id : pGrid_name을 조회할 Submit id
- * : pSave_Yn : pGrid_name 저장여부("Y","N")
- * : pSelectionMode : pGrid_name 의 선택모드 "free", "byrow", "bycol"..
- * Description : 화면에서 multilinegrid의 마스터 Detail관계 설정
- ****************************************************************************************/
- function rpafMsterDetailSet(pGrid_name, pMaster_Grid, pSubmit_Id, pSave_Yn, pSelectionMode)
- {
- var current_gridnode = MASTDETAIL_NODE + "_" + pGrid_name.name;
-
- dsf_createDs(MASTDETAIL_NODE);
- dsf_createDsRow(current_gridnode, [
- {col:"current", val:pGrid_name.name}
- , {col:"master", val:""}
- , {col:"submit", val:pSubmit_Id}
- , {col:"saveyn", val:pSave_Yn}
- ]);
-
- if (utlf_isNull(pMaster_Grid)) {
- this.objects[current_gridnode].setColumn(0,"master", "");
- }
- else {
- this.objects[current_gridnode].setColumn(0,"master", pGrid_name.name);
- }
-
- for(var i = 0; i < pGrid_name.getCellCount("body"); i++) {
- pGrid_name.setCellProperty("body",i,"selectbackground","#ccffff");
- }
-
- // if(!utlf_isNull(pSelectionMode))
- // {
- // pGrid_name.focusColor = "#ccffff";
- // }
- // else
- // {
- // pGrid_name.focusColor = "#ccffff";
- // }
- }
- //Grid 입력,삭제 처리.
- /*
- pGrid_Name : 입력,삭제할 multilinegrid id명
- pIAD_Flag : 행추가,행삽입,행삭제 여부("A","I","D")
- pRefresh_Flag : 행추가, 삽입후 misfGridDefaultSet (Default 값 셋팅 유무 Y, N ) default : Y(사용)
- */
- function rpaMultGridIUD(pGrid_Name, pIAD_Flag, pRefresh_Flag ) {
- model.setfocus(pGrid_Name.attribute("id"));
- if (pIAD_Flag == "I")
- {
- pGrid_Name.insertRow(pGrid_Name.row, "below", false);
- pGrid_Name.select(pGrid_Name.row, pGrid_Name.col) = true;
- }
- else if (pIAD_Flag == "D")
- {
- var sRowIdxes = "";
- var iSelectedCnt = pGrid_Name.selectedCells.length;
-
- for(var i=0; i<iSelectedCnt; i++)
- {
- var iRowIdx = pGrid_Name.selectedCells.item(i).row;
- if(!misfGetRowIdxExists(sRowIdxes, iRowIdx)) continue;
- sRowIdxes = sRowIdxes + iRowIdx + ",";
- if (pGrid_Name.rowstatus(iRowIdx) == 4)
- {
- pGrid_Name.removeStatus(iRowIdx,"delete");
- }
- else
- {
- if (misfCheckDeleteYN(pGrid_Name) == "Y")
- {
- // 1 : 초기 insert 한상태, 3 : insert한 Row를 Edit 한경우 3으로 변경됨
- if(pGrid_Name.rowstatus(iRowIdx) == 1 || pGrid_Name.rowstatus(iRowIdx) == 3)
- {
- pGrid_Name.deleteRow(pGrid_Name.row, false);
- if(i+1 == iSelectedCnt) pGrid_Name.select(pGrid_Name.row, pGrid_Name.col) = true;
- }
- else
- {
- pGrid_Name.addStatus(iRowIdx,"delete");
- }
- }
- else
- {
- messageBox("세부내역이 존재 하므로 삭제 ", "E001");
- }
- }
- }
- }
- else if (pIAD_Flag == "A") {
- pGrid_Name.addRow(false);
- pGrid_Name.select(pGrid_Name.row, pGrid_Name.col) = true;
- // pGrid_Name.refresh();
- }
-
- if ( pRefresh_Flag != "N" ) {
-
- if (pIAD_Flag == "A" || pIAD_Flag == "I") {
- // pGrid_Name.dispatch("onrowchanged");
- misfGridDefaultSet(pGrid_Name);
-
- pGrid_Name.col = 1;
- }
- }
- }
- ]]></Script>
|