123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- /* ---------------------------------------------------------------------
- 분할_재사용품_구매전송(SMMNP04800.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By 김진명
- : 2007.09.27
- ---------------------------------------------------------------------- */
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 분할_재사용품_구매전송 초기화 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fInit() {
- var curtDate = getCurrentDate();
- curtDate = curtDate.substr(0, 8);
- model.setValue("/root/main/cond/refopfromdd", getDateAddc(getCurrentDate(), -7));
- model.setValue("/root/main/cond/refoptodd", curtDate);
- submit("TRMNP03004") // 수술실(Rosette) 가져오기
- addComboItem("cmb_rosette","전체","","above");
- model.removenode("/root/send");
- model.makeNode("/root/send");
- model.makeValue("/root/send/reqdata/opcnfmdd" ,model.getValue("/root/main/cond/refopfromdd") );
- model.makeValue("/root/send/reqdata/rosette" ,model.getValue("/root/main/cond/oprosette"));
- submit("TRMNP03002"); // 수술실코드 가져오기
- addComboItem("cmb_oproomlist","전체","","above");
- //submit("TRMNP04603", false);
- //addComboItem("cmb_oproomlist", "전 체", "ALL", "above" );
- grd_reqgoodlist.fixedcellcheckbox(0,15) = true;
- btn_cncl.visible = false;
- btn_send.visible = true;
- grd_reqgoodlist.explorerbar = "sort";
- grd_reqgoodlist.colHidden(grd_reqgoodlist.colRef("senddd")) = true;//전송일자
- grd_reqgoodlist.colHidden(grd_reqgoodlist.colRef("sendyn")) = true;//전송여부
- grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("goodnm")) = "250";//물품명
- grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("goodspec")) = "105";//규격
- grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("goodmodel")) = "95"; //모델
- grd_reqgoodlist.colWidth(grd_reqgoodlist.colRef("prodcmpynm")) = "95"; //제조원
- model.removenode("/root/main/reqgoodlist");
- model.refresh();
- //fSearch();
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 콤보아이템 제거 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function removeComboItem( comboID ) {
- var comboObj = document.all.item(comboID);
- var comboItemNodeSet = comboObj.choices.itemset.attribute("nodeset");
- model.removenode(comboItemNodeSet + "[1]");//CCR
- model.removenode(comboItemNodeSet + "[1]");//C-C(Clean-Zone)
- model.removenode(comboItemNodeSet + "[1]");//C-O(OR창고)
- model.refresh();
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 분할_재사용품_구매전송 조회 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSearch() {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04801");
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 분할_재사용품_구매전송 저장(구매청구) */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSaveSend() {
- var iRows = -1;
- var chkflag, goodcd, allsizespecid, sendqty = 0, oprsrvno, deptcd, deliveunit, ddavguseqty = 0, basevol = 0, oproomcd, oldgoodcd, oldallsizespecid, totsendqty = 0;
- var oldoprsrvno, olddeliveunit, oldddavguseqty = 0, oldbasevol = 0, reqdeptcd, cartgubn, acmlbaseqty, studydeptcd;
- var cnt = 0, sendexchqty = 0;
- var rowCnt = 1, rowCnt2 = 1;
- iRows = grd_reqgoodlist.rows;
- var reqgoodlist = "m▦rownum▦goodcd▦allsizespecid▦sendqty▦oproomcd▦cartgubn▦sendexchqty";
- var sendgoodlist = "m▦rownum▦goodcd▦allsizespecid▦totsendqty▦deptcd▦ddavguseqty▦deliveunit▦basevol▦reqdeptcd▦studydeptcd";
- var iNode = "/root/main/reqgoodlist";
- for( var i = 1; i <= iRows; i++ ) {
- chkflag = model.getValue( iNode + "[" + i +"]/" + "chkflag" );
- goodcd = model.getValue( iNode + "[" + i +"]/" + "goodcd" );
- allsizespecid = model.getValue( iNode + "[" + i +"]/" + "allsizespecid" );
- sendqty = model.getValue( iNode + "[" + i +"]/" + "sendqty" );
- deptcd = model.getValue( iNode + "[" + i +"]/" + "deptcd" );
- deliveunit = model.getValue( iNode + "[" + i +"]/" + "deliveunit" );
- ddavguseqty = model.getValue( iNode + "[" + i +"]/" + "ddavguseqty" );
- basevol = model.getValue( iNode + "[" + i +"]/" + "basevol" );
- reqdeptcd = model.getValue( iNode + "[" + i +"]/" + "reqdeptcd" );
- acmlbaseqty = model.getValue( iNode + "[" + i +"]/" + "acmlbaseqty" );
- studydeptcd = model.getValue( iNode + "[" + i +"]/" + "studydeptcd" );
- oproomcd = model.getValue( "/root/main/cond/oproomcd");
- cartgubn = model.getValue( "/root/main/cond/refdeptflag");
- sendexchqty = ( parseInt(acmlbaseqty) * parseInt(sendqty) );
- //sendexchqty = parseInt(sendqty);
- if( chkflag == "true" ) {
- if( parseInt(sendqty) < 1 ) {
- messageBox("전송 수량을 입력하십시요!", "E000");
- return;
- }
- if( cnt == 0 ) {
- oldgoodcd = goodcd;
- oldallsizespecid = allsizespecid;
- }
- reqgoodlist = reqgoodlist + "▩" + "i" + "▦" + rowCnt + "▦" + goodcd + "▦" + allsizespecid
- + "▦" + sendqty + "▦" + oproomcd + "▦" + cartgubn + "▦" + sendexchqty;
- rowCnt += 1;
- cnt += 1;
- if( ( goodcd == oldgoodcd )&&( allsizespecid == oldallsizespecid ) ) {
- totsendqty = totsendqty + parseInt(sendqty);
- oldgoodcd = goodcd;
- oldallsizespecid = allsizespecid;
- olddeliveunit = deliveunit;
- oldddavguseqty = ddavguseqty;
- oldbasevol = basevol;
- }else {
- sendgoodlist = sendgoodlist + "▩" + "i" + "▦" + rowCnt2 + "▦" + oldgoodcd + "▦" + oldallsizespecid
- + "▦" + totsendqty + "▦" + deptcd + "▦" + ddavguseqty + "▦" + deliveunit
- + "▦" + basevol + "▦" + reqdeptcd + "▦" + studydeptcd;
- totsendqty = parseInt(sendqty);
- oldgoodcd = goodcd;
- oldallsizespecid = allsizespecid;
- rowCnt2 += 1;
- }
- }
- if( i == ( iRows - 1 ) ) {
- sendgoodlist = sendgoodlist + "▩" + "i" + "▦" + rowCnt2 + "▦" + oldgoodcd + "▦" + oldallsizespecid
- + "▦" + totsendqty + "▦" + deptcd + "▦" + oldddavguseqty + "▦" + olddeliveunit
- + "▦" + oldbasevol + "▦" + reqdeptcd + "▦" + studydeptcd;
- }
- }
- if( cnt > 0 ) {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.makeNode("/root/send/senddata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.setValue("/root/send/savedata", reqgoodlist);
- model.setValue("/root/send/senddata", sendgoodlist);
- submit("TXMNP04801");
- }else {
- messageBox("선택한것이", "I004");
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 분할_재사용품_구매전송 취소(구매청구취소)*/
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fCnclSend() {
- var iRows = -1;
- var chkflag, goodcd, allsizespecid, sendqty = 0, oprsrvno, deptcd, deliveunit, ddavguseqty = 0, basevol = 0, oproomcd, oldgoodcd, oldallsizespecid, totsendqty = 0;
- var oldoprsrvno, olddeliveunit, oldddavguseqty = 0, oldbasevol = 0, reqdeptcd, cartgubn, acmlbaseqty, studydeptcd;
- var cnt = 0, sendexchqty = 0;
- var rowCnt = 1, rowCnt2 = 1;
- iRows = grd_reqgoodlist.rows;
- var reqgoodlist = "m▦rownum▦goodcd▦allsizespecid▦sendqty▦oproomcd▦cartgubn▦sendexchqty";
- var sendgoodlist = "m▦rownum▦goodcd▦allsizespecid▦totsendqty▦deptcd▦ddavguseqty▦deliveunit▦basevol▦reqdeptcd▦studydeptcd";
- var iNode = "/root/main/reqgoodlist";
- for( var i = 1; i <= iRows; i++ ) {
- chkflag = model.getValue( iNode + "[" + i +"]/" + "chkflag" );
- goodcd = model.getValue( iNode + "[" + i +"]/" + "goodcd" );
- allsizespecid = model.getValue( iNode + "[" + i +"]/" + "allsizespecid" );
- sendqty = model.getValue( iNode + "[" + i +"]/" + "sendqty" );
- deptcd = model.getValue( iNode + "[" + i +"]/" + "deptcd" );
- deliveunit = model.getValue( iNode + "[" + i +"]/" + "deliveunit" );
- ddavguseqty = model.getValue( iNode + "[" + i +"]/" + "ddavguseqty" );
- basevol = model.getValue( iNode + "[" + i +"]/" + "basevol" );
- reqdeptcd = model.getValue( iNode + "[" + i +"]/" + "reqdeptcd" );
- acmlbaseqty = model.getValue( iNode + "[" + i +"]/" + "acmlbaseqty" );
- studydeptcd = model.getValue( iNode + "[" + i +"]/" + "studydeptcd" );
- oproomcd = model.getValue( "/root/main/cond/oproomcd");
- cartgubn = model.getValue( "/root/main/cond/refdeptflag");
- sendexchqty = ( parseInt(acmlbaseqty) * parseInt(sendqty) );
- if( chkflag == "true" ) {
- if( cnt == 0 ) {
- oldgoodcd = goodcd;
- oldallsizespecid = allsizespecid;
- }
- reqgoodlist = reqgoodlist + "▩" + "u" + "▦" + rowCnt + "▦" + goodcd + "▦" + allsizespecid
- + "▦" + (-1*parseInt(sendqty)) + "▦" + oproomcd + "▦" + cartgubn + "▦" + sendexchqty;
- rowCnt += 1;
- cnt += 1;
- if( ( goodcd == oldgoodcd )&&( allsizespecid == oldallsizespecid ) ) {
- totsendqty = totsendqty + parseInt(sendqty);
- oldgoodcd = goodcd;
- oldallsizespecid = allsizespecid;
- olddeliveunit = deliveunit;
- oldddavguseqty = ddavguseqty;
- oldbasevol = basevol;
- }else {
- sendgoodlist = sendgoodlist + "▩" + "u" + "▦" + rowCnt2 + "▦" + oldgoodcd + "▦" + oldallsizespecid
- + "▦" + (-1*totsendqty)+ "▦" + deptcd + "▦" + ddavguseqty + "▦" + deliveunit
- + "▦" + basevol + "▦" + reqdeptcd + "▦" + studydeptcd;
- totsendqty = parseInt(sendqty);
- oldgoodcd = goodcd;
- oldallsizespecid = allsizespecid;
- rowCnt2 += 1;
- }
- }
- if( i == ( iRows - 1 ) ) {
- sendgoodlist = sendgoodlist + "▩" + "u" + "▦" + rowCnt2 + "▦" + oldgoodcd + "▦" + oldallsizespecid
- + "▦" + (-1*totsendqty)+ "▦" + deptcd + "▦" + oldddavguseqty + "▦" + olddeliveunit
- + "▦" + oldbasevol + "▦" + reqdeptcd + "▦" + studydeptcd;
- }
- }
- if( cnt > 0 ) {
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.makeNode("/root/send/savedata");
- model.makeNode("/root/send/senddata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.setValue("/root/send/savedata", reqgoodlist);
- model.setValue("/root/send/senddata", sendgoodlist);
- submit("TXMNP04801");
- }else {
- messageBox("선택한것이", "I004");
- }
- }
|