123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- /* ---------------------------------------------------------------------
-
- SMRSI00400_입고내역조회.xrw (SMRSI00400.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By Francis Choi
- : 2015.05.02
- ---------------------------------------------------------------------- */
-
- var xAuth = !(checkAuth("X"));
- var pAuth = !(checkAuth("P"));
-
- var vPurcAuth = "1";
- // --------------------------------------------------
- // 화면 Control을 초기화한다
- // --------------------------------------------------
- function fInit() {
-
- fInitialize();
-
- return;
- }
-
- // --------------------------------------------------------------
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- // --------------------------------------------------------------
- function fInitialize() {
- model.resetInstanceNode("/root/send");
-
- //rszfUserGoodFlagList(cmb_goodflag,getUserInfo("userid"),"Y");
- rszfGoodFlagListByPgmGubn(cmb_goodflag,"1","Y");
-
- rszfUserInstList(cmb_instcd,getUserInfo("userid"),"N");
-
- misfComboComCdList("R0111",cmb_purcflag,"Y");
-
- //misfComboComCdListMulti("Z0007,R0025","cmb_instcd,cmb_goodflag" );
- //rszfComboAppendBlankChild("cmb_instcd,cmb_goodflag");
-
- model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
- model.setValue(ipt_windeptcd.attribute("ref") , getUserInfo("dutplcecd"));
- model.setValue(ipt_windeptnm.attribute("ref") , getUserInfo("dutplcenm"));
-
- model.setValue(ipt_winfrdd.attribute("ref") , getCurrentDate());
- model.setValue(ipt_wintodd.attribute("ref") , getCurrentDate());
-
- misfGridInit(grd_goodwin);
- misfMsterDetailSet(grd_goodwin ,null , "TRRSI00401" ,"N", "byrow");
- misfMsterDetailSet(grd_gooddmndreq,grd_goodwin, "TRRSI00403" ,"N", "byrow");
- // misfMsterDetailSet(grd_gooddmndreq,grd_goodwin, "TRRSD00403" ,"N", "byrow");
- //화면에서 Grid의 마스터 Detail관계 설정
- /*
- 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"..
- function misfMsterDetailSet(pGrid_name, pMaster_Grid, pSubmit_Id, pSave_Yn, pSelectionMode)
- */
-
- // grd_goodwin.fixedcellcheckbox(0,grd_goodwin.colRef("chkyn")) = true;
-
- model.refresh();
- }
-
- // ---------------------------------------
- // 청구 출고 내역을 조회한다
- // ---------------------------------------
- function fAfterRetrieveDetail() {
- var SumDeliveQty = 0;
-
-
- for (var currow = grd_gooddmndreq.fixedRows ; currow < grd_gooddmndreq.rows ; currow++) {
- SumDeliveQty += parseFloat(grd_gooddmndreq.valueMatrix(currow , grd_gooddmndreq.colRef("deliveqty")));
- }
-
- model.setValue(opt_sumdeliveqty.attribute("ref"), SumDeliveQty);
-
- model.refresh();
- }
-
- // ---------------------------------------
- // 입고내역 Sum처리 한다
- // ---------------------------------------
- function fAfterGoodwin() {
- var SumWinQty = 0;
- var SumWinAmt = 0;
-
- for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) {
- SumWinQty += parseFloat(grd_goodwin.valueMatrix(fRow , grd_goodwin.colRef("winqty")));
- SumWinAmt += parseFloat(grd_goodwin.valueMatrix(fRow , grd_goodwin.colRef("winamt")));
-
- if(grd_goodwin.valueMatrix(fRow, grd_goodwin.colRef("chkyn")) == "Y")
- {
- grd_goodwin.isReadOnly(fRow, grd_goodwin.fixedCols-1, fRow, grd_goodwin.cols-1) = true;
- } else {
- grd_goodwin.isReadOnly(fRow, grd_goodwin.fixedCols-1, fRow, grd_goodwin.cols-1) = false;
- }
- }
-
- model.setValue(opt_winqty.attribute("ref"),SumWinQty);
- model.setValue(opt_winamt.attribute("ref"),SumWinAmt);
-
- model.refresh();
- }
- //-----------------------------------
- // 입고 검수 확인 저장
- //-----------------------------------
- function fCheckPersonSave(){
- var vCnt = 0 ;
- var cPath = "/root/init/winchecklist";
- var sPath = "/root/main/list/goodwin/goodwinlist";
-
- var tPath = "/root/send/winchecklists";
- var tPath2 = "/root/send/winchecklists/winchecklist";
- var Winchecklist = "instcd" + "▦" // 01 기관코드
- + "goodflag" + "▦" // 02 물품구분
- + "windd" + "▦" // 03 입고일자
- + "winno" + "▦" // 04 입고번호
- + "winseqno" + "▦" // 05 입고일련번호
- + "windeptcd" + "▦" // 06 입고부서코드
- + "chkdd" + "▦" // 07 검수일자
- + "chkpsn" + "▦" // 08 검수자id
- + "chkyn" + "▩" ; // 09 검수유무
-
- for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) {
- if ((model.getValue(sPath+"[" + fRow + "]/chkyn" ) =="Y") &&
- (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="N") ){
-
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/instcd" ) + "▦"; // 01 기관코드
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/goodflag" ) + "▦"; // 02 물품구분
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/windd" ) + "▦"; // 03 입고일자
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/winno" ) + "▦"; // 04 입고번호
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/winseqno" ) + "▦"; // 05 입고일련번호
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/windeptcd") + "▦"; // 06 입고부서코드
- Winchecklist += getCurrentDate() + "▦"; // 07 검수일자
- Winchecklist += getUserInfo("userid") + "▦"; // 08 검수자id
- Winchecklist += model.getValue(sPath + "[" + fRow + "]/chkyn" ) + "▩"; // 09 검수유무
-
- vCnt++;
- } else {
- if (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="Y") {
-
- model.setValue(sPath+"[" + fRow + "]/chkyn" , "Y");
-
- }
- }
- }
-
- if (vCnt > 0) {
- model.removenode(tPath);
- model.makeValue(tPath2, Winchecklist);
-
- submit("TXRSI00103");
-
- btn_search.dispatch("DOMActivate");
-
- }
- }
- //-----------------------------------
- // 입고 검수 확인 저장
- //-----------------------------------
- function fCheckPersonSave2(){
- var vCnt = 0 ;
- var cPath = "/root/init/winchecklist";
- var sPath = "/root/main/list/goodwin/goodwinlist";
-
- var tPath = "/root/send/winchecklists";
- var tPath2 = "/root/send/winchecklists/winchecklist";
- model.removenode(tPath);
-
-
- for (var fRow = grd_goodwin.fixedRows; fRow < grd_goodwin.rows ; fRow++ ) {
- if ((model.getValue(sPath+"[" + fRow + "]/chkyn" ) =="Y") &&
- (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="N") ){
-
- model.setValue(cPath + "/instcd" , model.getValue(sPath + "[" + fRow + "]/instcd" )) ; // 01 기관코드
- model.setValue(cPath + "/goodflag" , model.getValue(sPath + "[" + fRow + "]/goodflag" )) ; // 02 물품구분
- model.setValue(cPath + "/windd" , model.getValue(sPath + "[" + fRow + "]/windd" )) ; // 03 입고일자
- model.setValue(cPath + "/winno" , model.getValue(sPath + "[" + fRow + "]/winno" )) ; // 04 입고번호
- model.setValue(cPath + "/winseqno" , model.getValue(sPath + "[" + fRow + "]/winseqno" )) ; // 05 입고일련번호
- model.setValue(cPath + "/windeptcd", model.getValue(sPath + "[" + fRow + "]/windeptcd")) ; // 06 입고부서코드
- model.setValue(cPath + "/chkdd" , getCurrentDate() ) ; // 07 검수일자
- model.setValue(cPath + "/chkpsn" , getUserInfo("userid") ) ; // 08 검수자id
- model.setValue(cPath + "/chkyn" , model.getValue(sPath + "[" + fRow + "]/chkyn" )) ; // 09 검수유무
-
- xNode = instance1.selectSingleNode(tPath);
-
- if (vCnt == 0) {
- model.makeNode(tPath2 );
- model.copyNode(tPath2 , cPath);
- } else {
- model.duplicate(tPath , cPath);
- }
-
- vCnt++;
- } else {
- if (model.getValue(sPath+"[" + fRow + "]/oldchkyn") =="Y") {
-
- model.setValue(sPath+"[" + fRow + "]/chkyn" , "Y");
-
- }
- }
- }
-
-
- if (vCnt > 0) {
- submit("TXRSI00103");
- }
-
- //if (submit("TXRSI00103")) {
-
- // btn_search.dispatch("DOMActivate");
-
- //}
- // alert(vCnt);
- }
- function fWinAllSelect()
- {
- var sPath = "/root/main/list/goodwin/goodwinlist";
- for(var liRow = grd_goodwin.fixedRows; liRow < grd_goodwin.rows ; liRow++)
- {
- if (model.getValue(sPath+"[" + liRow + "]/oldchkyn") =="N") {
- if (model.getValue(sPath+"[" + liRow + "]/chkyn" ) =="Y")
- model.setValue(sPath+"[" + liRow + "]/chkyn", "N" );
- else
- model.setValue(sPath+"[" + liRow + "]/chkyn", "Y" );
- }
- }
- }
- //-----------------------------------
- // 입고 전체 선택 / 취소
- //-----------------------------------
-
-
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|