123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- /* ---------------------------------------------------------------------
- 물품청구관리(SMMNP04900.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By kim bo sung
- : 2007.09.19
- 2) : Ver.1.01.01
- : Kim Jin Myoung
- : 2009.06.03
- ---------------------------------------------------------------------- */
- var xPathData = "/root/main/rsdhdemdinfo/rsdhdemdlist" ; //
- var xSendReqData = "/root/send/reqdata"; //보내는값
- var xSendSaveData = "/root/send/savedata"; //받은 리스트 갯수값
- var xCondData = "/root/main/cond"; //조건항목들
- var xErrMsg = "/root/properties/error/msg";
- var xTempData = "/root/temp";
- // --------------------------------------------------
- // 화면 초기화
- // --------------------------------------------------
- function fInit() {
- grd_purclist.fixedcellcheckbox(0,11) = true; //그리드 헤더에 체크버튼 추가
- grd_trustlist.fixedcellcheckbox(0,11) = true; //그리드 헤더에 체크버튼 추가
- grd_depositlist.fixedcellcheckbox(0,11) = true; //그리드 헤더에 체크버튼 추가
- grd_newlist.fixedcellcheckbox(0,11) = true; //그리드 헤더에 체크버튼 추가
- var curtDate = getCurrentDate();
- curtDate = curtDate.substr(0, 8);
- model.removenode("/root/send");
- model.makeValue("/root/send/reqdata/cdgrupid", "093");//퇴실장소
- model.makeValue("/root/send/reqdata/supcdid", "");//서브구분
- model.makeValue("/root/send/reqdata/cdid", model.getValue("/root/main/cond/deptflag"));//서브구분
- submit("TRMNP04903");
- model.setValue("/root/main/cond/reqdeptcd", model.getValue("/root/init/hardcodeinfo/cdnm"));
- model.removeNodeset("/root/main/rsdhdemdinfo/rsdhdemdlist");
- model.setValue("/root/main/cond/purcflag", "1");
- model.toggle("case1");
- btn_cncl.visible = true;
- btn_cnfm.visible = false;
- btn_save.visible = true;
- grd_purclist.explorerbar = "sort";
- grd_trustlist.explorerbar = "sort";
- grd_depositlist.explorerbar = "sort";
- grd_newlist.explorerbar = "sort";
- model.setValue("/root/main/cond/reqfromdd", curtDate);
- model.setValue("/root/main/cond/reqtodd", curtDate);
- model.removeNodeset(xPathData);
- model.refresh();
- }
- // --------------------------------------------------
- // 그리드 조회
- // --------------------------------------------------
- function fSearch() {
- if( model.getValue("/root/main/cond/purcflag") == "N" ) {//신규일 경우
- if( model.getValue("/root/main/cond/goodcd") == "" ) {
- messageBox("신규일때는 물품코드를 입력하셔야 됩니다.!", "E000");
- return;
- }
- }
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.copyNode(xSendReqData, xCondData);
- submit("TRMNP04901");
- }
- // --------------------------------------------------
- // 팝업호출
- // --------------------------------------------------
- function fPopup() {
- var refflag = model.getValue("/root/temp/refflag");
- if( refflag == "1" ) { /*물품명으로 검색*/
- setParameter("refnm", model.getValue("/root/main/cond/goodnm"));
- setParameter("refflag", "1");
- }else if( refflag == "2" ) { /*물품코드으로 검색*/
- setParameter("refnm", model.getValue("/root/main/cond/goodcd"));
- setParameter("refflag", "2");
- }
- setParameter("goodflag", model.getValue("/root/main/cond/goodflag"));
- setParameter("tabflag", "CCR");
- setParameter("menuparam", "S");
- setParameter("openflag", "STOC");
- setParameter("cartgubn", model.getValue("/root/main/cond/deptflag"));
- modal("SMMNP04460" ,"", "100", "100", "SMMNP04460", "", "");
- var getData = model.getValue("/root/properties/parameters/SendData/SendDatavalue");
- if( getData == "") {
- return;
- }else {
- var getDataTemp1 = getData.split("▩");
- var getDataTemp2 = getDataTemp1[0].split("|");
- model.setValue("/root/main/cond/goodcd", getDataTemp2[0]);
- model.setValue("/root/main/cond/goodnm", getDataTemp2[1]);
- model.setValue("/root/main/cond/allsizespecid", getDataTemp2[2]);
- //model.setValue("/root/main/cond/goodflag", getDataTemp2[3]);
- model.refresh();
- if( model.getValue("/root/temp/chkcncl") == "C" ) {//팝업에서 취소를 선택하거나 창을 강제로 닫았을 경우
- return;
- }else {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04901"); //청구내역조회
- }
- }
- }
- // --------------------------------------------------
- // 엑셀저장
- // --------------------------------------------------
- function fSaveExcel(pGrid) {
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (fileName != "")
- {
- pGrid.saveExcel(fileName, "SheetName", false, false, "", "", true);
- }
- }
- // --------------------------------------------------
- // 재고반영여부 체크
- // --------------------------------------------------
- function fCheck() {
- var iNode = "/root/main/rsdhdemdinfo/rsdhdemdlist";
- var iRow = -1;
- iRow = grd_rsdhdemdlist.row;
- var chkflag = model.getValue( iNode + "[" + iRow + "]/" + "chkflag");
- if( chkflag == "true" ) {
- var endflag = model.getValue( iNode + "[" + iRow + "]/" + "opprocflag");
- var deliveqty = model.getValue( iNode + "[" + iRow + "]/" + "deliveqty");
- if( endflag == "Y" ) {
- messageBox("재고에 이미 반영 ", "I001");
- model.setValue(iNode + "[" + iRow + "]/" + "chkflag", "false");
- model.refresh();
- return;
- }else if( (deliveqty == "")||(deliveqty == 0) ) {
- messageBox("입고수량이 ", "I004");
- model.setValue(iNode + "[" + iRow + "]/" + "chkflag", "false");
- model.refresh();
- return;
- }
- }
- }
- // --------------------------------------------------
- // 확정
- // --------------------------------------------------
- function fSaveCnfm() {
- var iRows = -1;
- var chkflag, reqdd, delivedd, goodcd, allsizespecid, goodflag, reqmthd, reqno, reqseqno, reqflag, winqty, bfwinqty, statcd;
- var deliveqty, reqdeptcd, deliveseqno, deliveno, opprocflag, deptflag, opinflag, reqqty, opinflag, reqdd, cmt, stat, prcpexchqty;
- var cnt = 0, cnt2 = 0;
- if( model.getValue("/root/main/cond/purcflag") == "1" ) {//구매
- iRows = grd_purclist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "2" ) {//수탁
- iRows = grd_trustlist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "3" ) {//가납
- iRows = grd_depositlist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "N" ) {//신규
- iRows = grd_newlist.rows;
- }
- var rsdhdemdlist = "m▦rownum▦goodcd▦allsizespecid▦delivedd▦deliveno▦deliveseqno▦winqty▦reqdeptcd▦goodflag▦reqmthd"
- + "▦cartgubn▦reqno▦reqseqno▦reqflag▦statcd▦opinflag▦reqdd▦cmt▦prcpexchqty";
- for( var i = 1; i <= iRows; i++ ) {
- chkflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/chkflag");
- delivedd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/delivedd");
- deliveno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveno");
- goodcd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/goodcd");
- allsizespecid = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/allsizespecid");
- deliveseqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveseqno");
- deliveqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveqty");
- reqdeptcd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqdeptcd");
- goodflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/goodflag");
- reqmthd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqmthd");
- reqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqno");
- reqseqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqseqno");
- reqflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqflag");
- winqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/winqty");
- bfwinqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/bfwinqty");
- opinflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/opinflag");
- reqqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqqty");
- opinflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/opinflag");
- reqdd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqdd");
- cmt = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/cmt");
- prcpexchqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/prcpexchqty");
- deptflag = model.getValue("/root/main/cond/deptflag");
- if( chkflag == "true" ) {
- if( parseInt(winqty) > 0 ) {
- stat = "U";
- if( opinflag == "Y" ) {
- if( cmt == "" ) {
- messageBox("반영된 물품은 확정할 수 없습니다.!", "E000");
- return;
- }else {//비고만 업데이트
- stat = "S";
- }
- }
- if( parseInt(winqty) == parseInt(reqqty) ) {
- statcd = "Y";
- }else {
- //KNUH_20101111_김병국_start
- messageBox("청구수량과 입고수량은 같아야합니다.", "E");
- return;
-
- statcd = "S";
- //KNUH_20101111_END
- }
- cnt += 1;
- rsdhdemdlist = rsdhdemdlist + "▩" + stat + "▦" + cnt + "▦" + goodcd + "▦" + allsizespecid + "▦" + delivedd
- + "▦" + deliveno + "▦" + deliveseqno + "▦" + (parseInt(winqty)-parseInt(bfwinqty)) + "▦" + reqdeptcd + "▦" + goodflag
- + "▦" + reqmthd + "▦" + deptflag + "▦" + reqno + "▦" + reqseqno + "▦" + reqflag
- + "▦" + statcd + "▦" + opinflag + "▦" + reqdd + "▦" + cmt + "▦" + prcpexchqty;
- }
- }
- }
- if( cnt > 0 ) {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.setValue("/root/send/savedata", rsdhdemdlist);
- submit("TXMNP04901");
- }else {
- messageBox("선택한것이 없거나 입고량이 0이거나 이미 반영된 것", "E008");
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 신규저장 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSave() {
- var iRows = -1;
- var chkflag, reqdd, delivedd, goodcd, allsizespecid, goodflag, reqmthd, reqno, reqseqno, reqflag, winqty, bfwinqty, statcd;
- var deliveqty, reqdeptcd, deliveseqno, deliveno, opprocflag, deptflag, opinflag, reqqty, opinflag, reqdd, cmt, stat;
- var cnt = 0, cnt2 = 0;
- if( model.getValue("/root/main/cond/purcflag") == "1" ) {//구매
- iRows = grd_purclist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "2" ) {//수탁
- iRows = grd_trustlist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "3" ) {//가납
- iRows = grd_depositlist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "N" ) {//신규
- iRows = grd_newlist.rows;
- }
- var rsdhdemdlist = "m▦rownum▦goodcd▦allsizespecid▦delivedd▦deliveno▦deliveseqno▦winqty▦reqdeptcd▦goodflag▦reqmthd"
- + "▦cartgubn▦reqno▦reqseqno▦reqflag▦statcd▦opinflag▦reqdd▦cmt";
- for( var i = 1; i <= iRows; i++ ) {
- chkflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/chkflag");
- delivedd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/delivedd");
- deliveno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveno");
- goodcd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/goodcd");
- allsizespecid = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/allsizespecid");
- deliveseqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveseqno");
- deliveqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveqty");
- reqdeptcd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqdeptcd");
- goodflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/goodflag");
- reqmthd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqmthd");
- reqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqno");
- reqseqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqseqno");
- reqflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqflag");
- winqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/winqty");
- bfwinqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/bfwinqty");
- opinflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/opinflag");
- reqqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqqty");
- opinflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/opinflag");
- reqdd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqdd");
- cmt = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/cmt");
- deptflag = model.getValue("/root/main/cond/deptflag");
- if( chkflag == "true" ) {
- if( parseInt(winqty) > 0 ) {
- cnt += 1;
- rsdhdemdlist = rsdhdemdlist + "▩" + "I" + "▦" + cnt + "▦" + goodcd + "▦" + allsizespecid + "▦" + delivedd
- + "▦" + deliveno + "▦" + deliveseqno + "▦" + (parseInt(winqty)-parseInt(bfwinqty)) + "▦" + reqdeptcd + "▦" + goodflag
- + "▦" + reqmthd + "▦" + deptflag + "▦" + reqno + "▦" + reqseqno + "▦" + reqflag
- + "▦" + statcd + "▦" + opinflag + "▦" + reqdd + "▦" + cmt;
- }else {
- messageBox("입고수량이 0보다 커야합니다.", "E000");
- return;
- }
- }
- }
- if( cnt > 0 ) {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.setValue("/root/send/savedata", rsdhdemdlist);
- submit("TXMNP04902");
- }else {
- messageBox("선택한것이 없거나 입고량이 0이거나 이미 반영된 것", "E008");
- }
- }
- // --------------------------------------------------
- // 취소
- // --------------------------------------------------
- function fSaveCncl() {
- var iRows = -1;
- var chkflag, reqdd, delivedd, goodcd, allsizespecid, goodflag, reqmthd, reqno, reqseqno, reqflag, winqty, bfwinqty, statcd;
- var deliveqty, reqdeptcd, deliveseqno, deliveno, opprocflag, deptflag, opinflag, reqdd, cmt, prcpexchqty;
- var cnt = 0;
- if( model.getValue("/root/main/cond/purcflag") == "1" ) {//구매
- iRows = grd_purclist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "2" ) {//수탁
- iRows = grd_trustlist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "3" ) {//가납
- iRows = grd_depositlist.rows;
- }else if( model.getValue("/root/main/cond/purcflag") == "N" ) {//신규
- iRows = grd_newlist.rows;
- }
- var rsdhdemdlist = "m▦rownum▦goodcd▦allsizespecid▦delivedd▦deliveno▦deliveseqno▦winqty▦reqdeptcd▦goodflag"
- + "▦reqmthd▦cartgubn▦reqno▦reqseqno▦reqflag▦statcd▦opinflag▦reqdd▦cmt▦prcpexchqty";
- for( var i = 1; i <= iRows; i++ ) {
- chkflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/chkflag");
- delivedd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/delivedd");
- deliveno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveno");
- goodcd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/goodcd");
- allsizespecid = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/allsizespecid");
- deliveseqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveseqno");
- deliveqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/deliveqty");
- reqdeptcd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqdeptcd");
- goodflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/goodflag");
- reqmthd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqmthd");
- reqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqno");
- reqseqno = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqseqno");
- reqflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqflag");
- winqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/winqty");
- bfwinqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/bfwinqty");
- reqqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqqty");
- reqdd = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/reqdd");
- opinflag = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/opinflag");
- cmt = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/cmt");
- prcpexchqty = model.getValue("/root/main/rsdhdemdinfo/rsdhdemdlist["+i+"]/prcpexchqty");
- deptflag = model.getValue("/root/main/cond/deptflag");
- if( chkflag == "true" ) {
- if( opinflag != "Y" ) { //재고반영이 된것만
- messageBox("미반영 물품은 취소 할 수 없습니다.!", "E000");
- return;
- }
- if( parseInt(winqty) == 0 ) {//취소수량이 0일경우 이전 입고량으로 대체하여 취소함.
- winqty = bfwinqty;
- }
- statcd = "N";
- cnt += 1;
- rsdhdemdlist = rsdhdemdlist + "▩" + "C" + "▦" + cnt + "▦" + goodcd + "▦" + allsizespecid + "▦" + delivedd + "▦" + deliveno
- + "▦" + deliveseqno + "▦" + parseInt(winqty) + "▦" + reqdeptcd + "▦" + goodflag + "▦" + reqmthd + "▦" + deptflag
- + "▦" + reqno + "▦" + reqseqno + "▦" + reqflag + "▦" + statcd + "▦" + opinflag + "▦" + reqdd
- + "▦" + cmt + "▦" + prcpexchqty;
- }
- }
- if( cnt > 0 ) {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.setValue("/root/send/savedata", rsdhdemdlist);
- submit("TXMNP04901");
- }else {
- messageBox("선택한 것이 없거나 반영된 것이", "I004");
- }
- }
|