123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- /* ---------------------------------------------------------------------
- 방재고실사입력(SMMNP03900.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By 김진명
- : 2007.12.18
- ---------------------------------------------------------------------- */
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 초기화 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fInit() {
- model.removeNodeset("/root/main/stoclist");
- submit("TRMNP04604");
-
- //2009.04.08 하드코딩 소스 변경
- model.makeValue("/root/send/cdgrupid", "038");
- submit("TRMNP00323", false);
- model.setValue("/root/main/cond/refdeptflag", model.getValue("/root/viewctrl/viewctrllist/viewctrlinfo/cdnm"));//CCR Main
-
- if(model.getValue("/root/main/cond/refdeptflag") == "A") {
- cmb_oproomcd.value = "1111";
- }
-
- var level = model.getValue("/root/temp/logginlevel/usrlevel");
- var stocflag = model.getValue("/root/main/cond/stocflag");
- if( level == "C"||level == "M" ) {//관리자 합산컬럼 보기
- grd_stoclist.colHidden(15) = false;
- grd_stoclist.colHidden(14) = false;
- }else {
- grd_stoclist.colHidden(15) = true;
- grd_stoclist.colHidden(14) = true;
- }
- grd_stoclist.explorerbar = "sort";
- grd_stoclist.fixedcellcheckbox(0,20) = true;
- submit("TRMNP03905");
- addComboItem("cmb_oproomcd", "전 체", "", "above" );
- submit("TRMNP03004") // 수술실(Rosette) 가져오기
- addComboItem("cmb_rosette","전체","","above");
- model.removenode("/root/send");
- //------------(20101011) 경북대)
- //model.setValue("/root/main/cond/goodflag", "Y");
- addComboItem("cmb_goodflag","전체","","above");
- //------------(20101011) 경북대)
- model.removeNodeset("/root/init/lrglist");
- model.removeNodeset("/root/init/mdllist");
- model.removeNodeset("/root/init/smllist");
- model.setValue("/root/main/cond/lrgcd", "");
- model.setValue("/root/main/cond/mdlcd", "");
- model.setValue("/root/main/cond/smlcd", "");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04463");
- addComboItem("cmb_lrg", "전 체", "", "above" );
- //2009-06-22 K.J.M 병원별 Display 여부
- model.removenode("/root/send");
- model.makeValue("/root/send/reqdata/cdgrupid", "106");//병원별 Display 여부
- model.makeValue("/root/send/reqdata/supcdid", "");//서브구분
- model.makeValue("/root/send/reqdata/cdid", "");//서브구분
- submit("TRMNP04903", false);
- if( model.getValue("/root/init/hardcodeinfo/cdid").substr(4, 1) == "Y" ) {//삭제 버튼
- btn_delete.visible = "true";
- chk_delehist.visible = "true";
- model.setValue("/root/main/cond/delflag", "Y");
- }else {
- btn_delete.visible = "false";
- chk_delehist.visible = "false";
- model.setValue("/root/main/cond/delflag", "");
- }
- model.refresh();
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 방재고실사입력 조회(관리자) */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSearch(flag) {
- var oproomcd = model.getValue("/root/main/cond/oproomcd");
- var stocflag = model.getValue("/root/main/cond/stocflag");
- var goodcd = model.getValue("/root/main/cond/goodcd");
-
- if(flag=="1") {
-
- } else {
- if(model.getValue("/root/main/cond/refcnfmyn") == "N" || model.getValue("/root/main/cond/refcnfmyn") == "Y") {
-
- } else {
- if( oproomcd == "" && goodcd == "") {
- messageBox("수술방을 선택하지 ", "E007");
- model.setFocus("cmb_oproomcd");
- return;
- }
- }
- }
- model.removeNodeset("/root/main/stoclist");
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP03904");
- if( stocflag == "R" || stocflag == "U" ) {
- grd_stoclist.colStyle(17, "data", "background-color") = "#ccffcc";
- grd_stoclist.colDisabled(17) = "false"
- grd_stoclist.colDisabled(19) = "true";
- }else {
- grd_stoclist.colStyle(19, "data", "background-color") = "#ccffcc";
- grd_stoclist.colDisabled(17) = "true"
- grd_stoclist.colDisabled(19) = "false";
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 방재고실사입력 버튼 이력조회 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fHistSearch() {
- var oproomcd = model.getValue("/root/main/cond/oproomcd");
- var stocflag = model.getValue("/root/main/cond/stocflag");
- if( oproomcd == "" ) {
- messageBox("수술방을 선택하지 ", "E007");
- model.setFocus("cmb_oproomcd");
- return;
- }
- grd_stoclist.colDisabled(19) = "true";
- grd_stoclist.colDisabled(17) = "true";
- grd_stoclist.colDisabled(23) = "true";
- grd_stoclist.colDisabled(24) = "true";
- grd_stoclist.colDisabled(25) = "true";
- model.removeNodeset("/root/main/stoclist");
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.makeValue("/root/send/reqdata/searflag", "H");
- submit("TRMNP03904");
- if( stocflag == "R" || stocflag == "U" ) {
- grd_stoclist.colStyle(15, "data", "background-color") = "#ccffcc";
- }else if( stocflag == "I" ){
- grd_stoclist.colStyle(17, "data", "background-color") = "#ccffcc";
- }else {
- grd_stoclist.colStyle(15, "data", "background-color") = "transparent";
- grd_stoclist.colStyle(17, "data", "background-color") = "transparent";
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 물품 조회 팝업 후 처리 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSetGoodCd(paramData) {
- //var getData = model.getValue("/root/properties/parameters/SendData/SendDatavalue");
- var variable = "'";
- var goodcd = "";
- var goodnm = "";
- var oldgoodcd, oldgoodnm, oldvariable;
- oldgoodcd = model.getValue("/root/main/cond/goodcd");
- oldgoodnm = model.getValue("/root/main/cond/goodnm");
- oldvariable = model.getValue("/root/main/cond/variable");
- var getData = paramData;
- if( getData != "") {
- if( model.getValue("/root/temp/chkcncl") != "C" ) {
- var getDataTemp1 = getData.split("▩");
- for( var i = 0; i < getDataTemp1.length-1; i++) {
- var getDataTemp2 = getDataTemp1[i].split("|");
- variable = variable + getDataTemp2[0] + getDataTemp2[2] + "'";
- goodcd = goodcd + getDataTemp2[0];
- goodnm = goodnm + getDataTemp2[1];
- if(( i+1) != (getDataTemp1.length-1) ) {
- variable = variable + ", '";
- goodcd = goodcd + ", ";
- goodnm = goodnm + ", ";
- }
- //if( getDataTemp1.length - 1 = 1 ) {
- //model.setValue("/root/main/cond/allsizespecid", goodnm);
- //}
- }
- if( oldgoodcd != "" ) {
- goodcd = oldgoodcd + ", " + goodcd
- }
- if( oldgoodnm != "" ) {
- goodnm = oldgoodnm + ", " + goodnm
- }
- if( oldvariable != "" ) {
- variable = oldvariable + ", " + variable
- }
- model.setValue("/root/main/cond/goodcd", goodcd);
- model.setValue("/root/main/cond/goodnm", goodnm);
- model.setValue("/root/main/cond/variable", variable);
- model.refresh();
- fSearch();
- }
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 방재고실사입력 실사량입력 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSave( ) {
- var iRows = -1;
- var chkflag, oproomcd, goodcd, allsizespecid, bfsafestocqty, safestocqty, reqcnfmyn;
- var stocqty, refdeptflag, stocflag, undeliveqty, deliveqty, stat, cnfmyn, reqdd, inspqty, reqqty;
- var cnt = 0, chkcnt = 0;
- iRows = grd_stoclist.rows;
- var stoclist = "m▦oproomcd▦goodcd▦allsizespecid▦bfsafestocqty▦inspqty▦refdeptflag▦safestocqty▦stocflag▦reqqty▦deliveqty▦undeliveqty▦cnfmyn▦reqdd";
- if( model.getValue("/root/main/cond/searflag") == "A" ) {
- messageBox("전체조회시는 저장을 ", "E001");
- return;
- }
- for( var i = 1; i <= iRows; i++ ) {
- chkflag = model.getValue("/root/main/stoclist[" + i + "]/chkflag");
- oproomcd = model.getValue("/root/main/stoclist[" + i + "]/oproomcd");
- goodcd = model.getValue("/root/main/stoclist[" + i + "]/goodcd");
- allsizespecid = model.getValue("/root/main/stoclist[" + i + "]/allsizespecid");
- bfsafestocqty = model.getValue("/root/main/stoclist[" + i + "]/bfsafestocqty");
- safestocqty = model.getValue("/root/main/stoclist[" + i + "]/safestocqty");
- stocqty = model.getValue("/root/main/stoclist[" + i + "]/stocqty");
- inspqty = model.getValue("/root/main/stoclist[" + i + "]/inspqty");
- deliveqty = model.getValue("/root/main/stoclist[" + i + "]/deliveqty");
- rtnqty = model.getValue("/root/main/stoclist[" + i + "]/rtnqty");
- undeliveqty = model.getValue("/root/main/stoclist[" + i + "]/undeliveqty");
- stat = model.getValue("/root/main/stoclist[" + i + "]/stat");
- reqdd = model.getValue("/root/main/stoclist[" + i + "]/reqdd");
- reqcnfmyn = model.getValue("/root/main/stoclist[" + i + "]/reqcnfmyn");
- refdeptflag = model.getValue("/root/main/cond/refdeptflag");
- stocflag = model.getValue("/root/main/cond/stocflag");
- if( (reqcnfmyn == "Y")&&(reqdd == getCurrentDate().substr(0, 8)) ) {
- messageBox("확정된 당일의뢰는 CCR에서 확정취소를 해야만 수정가능합니다.", "E000");
- return;
- }else if( (reqcnfmyn == "Y")&&(reqdd != getCurrentDate().substr(0, 8)) ) {
- reqdd = getCurrentDate().substr(0, 8);
- }
- if( stocflag == "R"||stocflag == "U" ) {//재고등록, 변경일때는 실사량 0
- inspqty = "0";
- cnfmyn = "N";
- reqqty = (parseInt(safestocqty) - parseInt(bfsafestocqty));
- }else {
- cnfmyn = "N";//재고실사일경우 자동 승인 ==> CSR 승인으로 변경 2009.04.13
- reqqty = "0";
- }
- if( chkflag == "true" ) {
- //if( stocflag == "R" ) {
- // if( parseInt(bfsafestocqty) > 1 ) {//안전재고가 있으면 변경으로 해야함
- // messageBox("안전재고가 있는경우 안전재고 변경으로 변경 가능합니다.", "E000");
- // return;
- // }
- //}
- if( stocflag == "R"||stocflag == "U" ) {//재고등록, 변경
- if( parseInt(reqqty) == 0 ) {
- chkcnt += 1;
- continue;
- }
- if( parseInt(bfsafestocqty) < 1 ) {//이전 재고가 있으면 0입력가능
- if( safestocqty == "0"||safestocqty == "" ) {
- messageBox("수량을 입력하지 않았습니다.!", "E000");
- return;
- }
- }
- }else {
- if( inspqty == "0"||inspqty == "" ) {//실사량을 입력하지 않으면 리턴
- messageBox("수량을 입력하지 않았습니다.!", "E000");
- return;
- }
- if( reqcnfmyn == "Y" ) {//실사, 확정이면 I
- stat = "I";
- }
- }
- //2009.05.13 안전재고등록, 변경 확정된 조회리스트에서 수량변경시 재고변경 및 입력으로 플래그 셋팅
- if( (reqqty != 0)&&(parseInt(inspqty) == 0)&&(stocflag == "R"||stocflag == "U")&&(reqcnfmyn == "Y") ) {
- if( parseInt(bfsafestocqty) != 0 ) {//안전재고가 있다가 다시 0으로 되는경우 변경으로 셋팅되는 문제가 있어 수정 2009.12.21 K. J. M
- stocflag = "U";
- }else {
- stocflag = "R";
- }
- stat = "I";
- }
- cnt += 1;
- stoclist = stoclist + "▩" + stat + "▦" + oproomcd + "▦" + goodcd + "▦" + allsizespecid + "▦" + bfsafestocqty + "▦" + inspqty
- + "▦" + refdeptflag + "▦" + safestocqty + "▦" + stocflag + "▦" + reqqty
- + "▦" + "0" + "▦" + "0" + "▦" + cnfmyn + "▦" + reqdd;
- }
- }
- 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", stoclist);
- submit("TXMNP03901");
- }else {
- if( chkcnt > 0 ) {
- messageBox("변경된 수량이 없습니다.", "E000");
- }else {
- messageBox("선택한것이", "I004");
- }
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 방재고 등록 이력 삭제 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fDelHist() {
- var chkflag, goodcd, allsizespecid, oproomcd, refdeptflag, pFlag, reqdd;
- var cnt = 0;
- var dellist = "m▦goodcd▦allsizespecid▦oproomcd▦refdeptflag▦reqdd";
- for( var i = 1; i <= grd_stoclist.rows; i++ ) {
- chkflag = model.getValue("/root/main/stoclist[" + i + "]/chkflag");
- goodcd = model.getValue("/root/main/stoclist[" + i + "]/goodcd");
- allsizespecid = model.getValue("/root/main/stoclist[" + i + "]/allsizespecid");
- oproomcd = model.getValue("/root/main/stoclist[" + i + "]/oproomcd");
- reqdd = model.getValue("/root/main/stoclist[" + i + "]/reqdd");
- refdeptflag = model.getValue("/root/main/cond/refdeptflag");
- if( chkflag == "true" ) {
- dellist = dellist + "▩" + "C" + "▦" + goodcd + "▦" + allsizespecid + "▦" + oproomcd + "▦" + refdeptflag + "▦" + reqdd;
- cnt++;
- }
- }
- 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", dellist);
- submit("TXMNP03903");
- fHistSearch();
- }else {
- messageBox("선택하신 물품이 없습니다.!", "E000");
- return;
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 다음 행으로 자동 이동 이벤트 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fNextRow() {
- var row = -1;
- var rows = -1;
- var col = -1;
- var stocflag = model.getValue("/root/main/cond/stocflag");
- row = grd_stoclist.row;
- rows = grd_stoclist.rows;
- col = grd_stoclist.col;
- if( (row == (rows-1))||(row < 1)||(col == 1) ) {
- return;
- }else {
- if( stocflag == "R" || stocflag == "U" ) {//안전재고등록, 변경
- if( col == 17 ) {
- grd_stoclist.row = row + 1;
- grd_stoclist.editCell();
- }
- }else {
- if( col == 19 ) {
- grd_stoclist.row = row + 1;
- grd_stoclist.editCell();
- }
- }
- }
- }
|