123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140 |
- /* ---------------------------------------------------------------------
- *
- * SMRFC00700_고정자산바코드출력.xrw (SMRFC00700.xfm - JScript )
- *
- * - Version :
- * 1) : Ver.1.00.01
- * : Create By
- * : 2008.08.22
- ---------------------------------------------------------------------- */
- function fInitialize()
- {
- misfGridInit(grd_fixasetlist); // 고정자산 List
- misfGridInit(grd_cpfixasetlist); // 고정자산 (바코드)List
- misfGridInit(grd_barcodetarget); // Barcode Print target Grid
- rszfGoodFlagListByPgmGubn(cmb_goodflag_search,"2","N");
- model.resetInstanceNode("/root/send");
-
- misfComboComCdListMulti("Z0007","cmb_instcd_search");
- model.setValue("/root/send/fixasetlist/instcd_search", getUserInfo("dutplceinstcd")); // 기관 설정
- fSetPrintUseCheck();
-
- misfMsterDetailSet(grd_fixasetlist, null, "TRRFC00202", "N");
-
- addComboItem("cmb_goodflag_search", "전체", "", "above");
- cmb_goodflag_search.select(0);
-
- var curdate = getCurrentDate();
- var cvtdate = curdate.toDate("YYYYMMDD");
-
- //model.setValue(ipt_possnfrdd_search.attribute("ref") ,cvtdate.getAddDate(-1,"Y").getDateFormat("YYYYMMDD"));
- //model.setValue(ipt_possntodd_search.attribute("ref") ,curdate);
-
- // 대분류 코드 콤보 설정.
- rszfLMSComboList(model.getValue(cmb_goodflag_search.attribute("ref")), "", "", "cmb_lrgcd_search", "", "L");
- grd_fixasetlist.fixedcellcheckbox(0,1) = true;
- //바코드 object 선언
- misfMakeBrcdPrntObjHanDo("CommAX");
- grd_fixasetlist.fixedcellcheckbox(0,grd_fixasetlist.colRef("choice"),false) = true;
-
- model.setValue("/root/main/barcdprntsetup/comm",2);
- model.refresh();
- }
- function fSetPrintUseCheck(){
- var instcd = model.getValue(cmb_instcd_search.attribute("ref")).getTrim();
- if (instcd == "014"){
- //btn_prntset.visible = "false";
- }else{
- //btn_prntset.visible = "true";
- }
- model.refresh();
- }
- function fGridItemCheck( choiceFlag ) {
- var choiceCnt = 0;
- if (grd_fixasetlist.rows - grd_fixasetlist.fixedRows <= 0 ) {
- messageBox("선택할 데이터가","I004");
- return false;
- }
-
- if ( choiceFlag == "check" ) {
- /*
- var goodflagengnm = "";
- var goodmodel = "";
- var possndd = "";
- var mngtdeptnm = "";
- var fixasetcd = "";
-
- var instcd = "";
- var goodflaghngnm = "";
-
- var installplcecd = "";
- var installplcenm = "";
- var cntrdeptnm = "";
- var suplplcenm = "";
-
- var barcdprntyn = "";
-
- var i = 1;
-
- for( cnt = grd_fixasetlist.fixedRows; cnt < grd_fixasetlist.rows ; cnt++ ) {
-
- if( grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("choice") ) == "Y") {
-
- choiceCnt = choiceCnt + 1;
-
- grd_barcodetarget.addRow(false); //그리드 열추가
-
- goodflagengnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/goodflagengnm");
- goodmodel = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/goodmodel");
- possndd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/possndd");
- mngtdeptnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/mngtdeptnm");
- fixasetcd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/fixasetcd");
-
- instcd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/instcd");
- goodflaghngnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/goodflaghngnm");
-
- installplcecd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/installplcecd");
- installplcenm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/installplcenm");
- cntrdeptnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/cntrdeptnm");
- suplplcenm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/suplplcenm");
-
-
- //필요한 항목들을 전부 노드에서 가져와서 변수에 저장한다음 프린트한다.
- /*
- 장비명 goodflagengnm
- 모델명+제조원 goodmodel
- SN+취득일자 ?? + possndd
- 부서명(관리) mngtdeptnm
- 코드번호(바코드번호) fixasetcd
- 바코드
- */
-
- //바코드출력 함수 호출 및 매개변수 넘겨주기
- //BarcodePrtRFCMFACD(goodflagengnm , goodmodel , possndd , mngtdeptnm , fixasetcd);
-
- //선택된 고정자산자료들을 해당 노드에 부어주고 그 엄마 노드를 펑션에 보내서 바코드 출력하는 데 쓴다.
- /*
- model.setValue("/root/send/barcodetarget["+i+"]/fixasetcd" , fixasetcd , true );
- model.setValue("/root/send/barcodetarget["+i+"]/goodflagengnm" , goodflagengnm , true );
- model.setValue("/root/send/barcodetarget["+i+"]/goodmodel" , goodmodel , true );
- model.setValue("/root/send/barcodetarget["+i+"]/possndd" , possndd , true );
- model.setValue("/root/send/barcodetarget["+i+"]/mngtdeptnm" , mngtdeptnm , true );
-
- model.setValue("/root/send/barcodetarget["+i+"]/instcd" , instcd );
- model.setValue("/root/send/barcodetarget["+i+"]/goodflaghngnm" , goodflaghngnm , true );
-
- model.setValue("/root/send/barcodetarget["+i+"]/installplcecd" , installplcecd , true );
- model.setValue("/root/send/barcodetarget["+i+"]/installplcenm" , installplcenm , true );
- model.setValue("/root/send/barcodetarget["+i+"]/cntrdeptnm" , cntrdeptnm , true );
- model.setValue("/root/send/barcodetarget["+i+"]/suplplcenm" , suplplcenm , true );
-
- //출력함수에 해당 노드 첫번째 를 넘기고 출력이 잘 되었다면 그리드의 스테이터스를 update로 하고
- //출력여부를 Y로 셋팅한다.
- //바코드출력 함수 호출 및 매개변수(해당노드) 넘겨주기
- //BarcodePrtRFCMFACD(goodflagengnm , goodmodel , possndd , mngtdeptnm , fixasetcd);
-
- grd_barcodetarget.rowStatus(i) = 2;
- i = i+1;
- }
- }
-
- model.refresh();
- */
-
- model.resetInstanceNode("/root/copytemp");
- var varcopy = instance1.selectNodes(grd_fixasetlist.nodeset + "[choice='Y']");
- if ( varcopy.length == 0 ) {
- messageBox("선택한 데이터가","I004");
- return false;
- }
- }
- return true;
- }
- function fItemAllChoice( vFlag ) {
- if( fGridItemCheck()!=true ) return;
- for( cnt = grd_fixasetlist.fixedRows; cnt < grd_fixasetlist.rows ; cnt++ ) {
- grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("choice") ) = vFlag;
- }
- }
- function fBarcodePrt() {
- misfGridInit(grd_cpfixasetlist); // 고정자산 (바코드)List
- var instcd = model.getValue(cmb_instcd_search.attribute("ref"));
- var goodnm, mngtdeptnm, installplcenm;
- var cnt = 0;
- if (instcd == '014'){
- var node = instance1.selectSingleNode("/root/main/list/fixaset/fixasetlist[choice='Y']");
-
- if (node == null){
-
- messageBox("선택할 데이터가","I004");
- return false;
-
- }
-
- for (var i = grd_fixasetlist.fixedRows;i<grd_fixasetlist.rows;i++){
-
- var chk = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("choice")).getTrim();
- var goodflag = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflag")).getTrim();
-
- if (chk == "Y"){
- // [2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflagengnm")).getTrim();
- }else{
- goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflaghngnm")).getTrim();
- }
-
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1")) = goodnm.cut(goodnm.num(goodnm, 20));
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm2")) = goodnm.substr2(goodnm.num(goodnm, 20)-1, goodnm.length);
-
- mngtdeptnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("mngtdeptnm")).getTrim();
- installplcenm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("installplcenm")).getTrim();
-
- if (installplcenm == ""){
- deptnm = mngtdeptnm;
- }else{
- deptnm = mngtdeptnm + "/" + installplcenm;
- }
-
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1")) = deptnm.cut(deptnm.num(deptnm, 20));
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm2")) = deptnm.substr2(deptnm.num(deptnm, 20)-1, deptnm.length);
-
-
- grd_cpfixasetlist.addRow();
-
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodnm2" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm2" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodmodel")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodmodel"));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("mngtno" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("mngtno" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("deptnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("deptnm2" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm2" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("possndd" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("possndd" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("fixasetcd")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("fixasetcd"));
-
-
- }
- }
- exeReportPreview("RPRFC00701","XMLSTR");
-
- }else{
-
- fBarcodePrt_CmdType();
-
- }
- }
- function fBarcodePrt_CmdType(){
- if( fGridItemCheck( "check" ) != true ) return;
- misfGridInit(grd_barcodetarget); // Barcode Print target Grid 초기화
- model.resetInstanceNode("/root/copytemp");
- var varcopy = instance1.selectNodes(grd_fixasetlist.nodeset + "[choice='Y']");
- if ( varcopy.length > 0 ) {
- var rCSV = getNodeListCSV(varcopy);
-
- //model.setValue("/root/copytemp", rCSV);
- //var CSV = model.getValue("/root/copytemp");
- //setCSVToNode("/root/send", CSV, "barcodetarget");
- setCSVToNode("/root/main", rCSV, "barcodetarget");
- }
-
- /*
- for( cnt = grd_fixasetlist.fixedRows; cnt < grd_fixasetlist.rows; cnt++ ) {
- if ( grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("choice") ) == "Y" ) {
- grd_barcodetarget.addItem();
- grd_barcodetarget.valueMatrix( grd_barcodetarget.rows - grd_barcodetarget.fixedRows, grd_barcodetarget.colRef("instcd") ) = grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("instcd"))
- }
- }
-
- */
- //grd_barcodetarget.gridToInstance();
-
- model.refresh();
-
- for ( i = grd_barcodetarget.fixedRows ; i< grd_barcodetarget.rows; i++) {
- //라벨출력 한줄씩 시키고 라벨 출력 했으면 해당 row를 update로 바꾼다
- grd_barcodetarget.rowStatus(i) = 2;
- }
- /*
- var nowdate = getCurrentDate();
- var checkdate = nowdate.toDate("YYYYMMDD");
- var checkdatestring = checkdate.getDateFormat("YYYYMMDD");
- var nextcheckdatestring = checkdate.getAddDate(+1,"Y").getDateFormat("YYYYMMDD")
- */
- model.setValue("/root/send/barcodetarget" ,grd_barcodetarget.getUpdateData());
-
- if (model.getValue(cmb_instcd_search.attribute("ref")) == "013"){
- if ( BarcodePrtRFCMFACD_013("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
- {
- return;
- }
- }else if ((model.getValue(cmb_instcd_search.attribute("ref")) == "114")||(model.getValue(cmb_instcd_search.attribute("ref")) == "032")||(model.getValue(cmb_instcd_search.attribute("ref")) == "103")){
- if ( BarcodePrtRFCMFACD_103("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
- {
- return;
- }
- }else if (model.getValue(cmb_instcd_search.attribute("ref")) == "014"){
- BarcodePrtRFCMFACD_014(); //바코드출력
- }else if (model.getValue(cmb_instcd_search.attribute("ref")) == "011"){
- if ( BarcodePrtRFCMFACD_011("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
- {
- return;
- }
- }else{
- if ( BarcodePrtRFCMFACD("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
- {
- return;
- }
-
- }
- /*
- if ( BarcodePrtRFCMFACD("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
- {
- return;
- }*/
-
- //바코드 출력한 물품들 출력여부를 Y로 셋팅한다.
- misfSave("TXRFC00701");
-
- //바뀐 그리드에 row에 update를 submit 날려서 DB에 저장한다.
- //현재 노드셋을 다 넘겨준다.
- //var today = curdate.toString();
- //alert(today);
- //BarcodePrtRFCMFACD("/root/main/barcdprntsetup","/root/send/barcodetarget",checkdatestring , nextcheckdatestring);
-
- btn_search.dispatch("DOMActivate");
-
-
- }
- //프린터 설정
- function fSetPrint() {
- var count = getNodesetCount("/root/main/barcdprntsetup/prntsetupinfo/setupinfo");
-
- if(count == 0) {
- model.makeNode("/root/main/barcdprntsetup/prntsetupinfo/setupinfo");
- }
-
- open("SPRPZ00700_바코드프린터설정.xrw", "", "", "", "", "/root/main/barcdprntsetup/prntsetupinfo/setupinfo", "/root/main/barcdprntsetup/prntsetupinfo/setupinfo");
- }
- /*
- *바코드 출력 함수
- * psRef 바코드프린트 셋팅관련 노드셋
- * pRef 고정자산 프린트 관련 노드셋
- * cvtdate 점검일(오늘날짜)
- * nextcvtdate 다음점검일(현재는 일년뒤로 셋팅되어 있음)
- */
- function BarcodePrtRFCMFACD(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
- var vInstance = document.models(0).instances(0);
- var cntHR = vInstance.selectNodes(pRef).length; // 고정자산 프린트 할 전체 목록의 갯수
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 바코드프린터 셋팅관련
- var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); // 바코드프린터 종류
- var portOpenTF = "";
- // Lcount , Mcont
- var KCount = 0;
- var PCount = 0;
- if (pKCount == null || pKCount == ""){
- KCount = 0;
- }else{
- KCount = pKCount;
- }
- if (pPCount == null || pPCount == ""){
- PCount = 0;
- }else{
- PCount = pPCount;
- }
- if (cntHR > 0 && sPrntKind != 0){
- var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
- var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
- var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
- if (sCommKind == "01") { //통신유형(PRT)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
- } else if (sCommKind == "02") { //통신유형(COM)
- var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
- var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
- var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
- var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
- var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
- CommAX.CommPort = sComm;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- if(KCount > 0){
- //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
- portOpenTF = "TRUE";
- }else if(KCount == 0){
- //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
- portOpenTF = CommAX.PortOpen("true");
- }
- } else if (sCommKind == "03") { //통신유형(TCP/IP)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
- }
- var DeptNm = "";
- if ( (portOpenTF == "TRUE" && sCommKind == "02")
- ||(sCommKind == "01") || (sCommKind == "03")){
- for (i=1 ; i<= cntHR;i++){
- var goodflag = model.getvalue(pRef+ "["+i+"]/goodflag" ).getTrim();
- var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
- var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
- var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
- var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
- var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
- var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
- var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
- var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
- var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
- var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
- var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
- var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
- var prodcmpynm = model.getvalue(pRef+ "["+i+"]/prodcmpynm" ).getTrim();
-
- var leftmargin = 250;
- var leftmarginother = 10;
-
- //시작 위치 설정
- if (sLeftBank == "" || sLeftBank == "-") sLeftBank = leftmargin; //350
- if (sTopBank == "" || sTopBank == "-") sTopBank = 20;
-
- var sSndMsg = "";
- if(sPrntKind == "1") {
- sSndMsg += misfBP_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
- //sSndMsg += misfBP_ChangeFont("A", 0, 0); // 폰트 설정
- //misfBP_FieldDataHNEW(pX, pY, pW, pH, pData)
- //시작(X, Y)
- //sSndMsg += misfBP_StartFormat(0, 30);
- sSndMsg += "^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO10,46^AQN,16,16^FD^FS";
-
- //장비명
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflagengnm.substr(0,20));
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflagengnm.substr(20,20));
- }else{
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflaghngnm.substr(0,20));
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflaghngnm.substr(20,20));
- }
- //모델명
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 75 , 24 , 24 , "- "+goodmodel);
-
- //취득일자(일-월-년 순서로 출력)+SN
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= G) => (goodflag= GE)
- if (goodflag == "GE") {
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+mngtno); //82
- }else {
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+"_"+mngtno); //82
- }
-
- //부서명(관리부서)
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm); //100 , mngtdeptnm
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- //제조원(장비만...)
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "- "+prodcmpynm);
- }else{
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "-");
- }
-
- //코드번호
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 205 , 24 , 24 , "- "+fixasetcd);
-
- //바코드
- sSndMsg += misfBP_ChangeFont("F", 10, 10);
- sSndMsg += misfBP_BarCode_Code39NEW(0, 240, "N", 50, "*" +fixasetcd + "*"); // 바코드 //114
-
-
- sSndMsg += misfBP_EndFormat();
-
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- }
- }//end if(sPrntKind == "1")
- }//end for
- //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
- if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
- CommAX.PortOpen("false");
- }
- }else if((portOpenTF = "FALSE" && sCommKind == "02")){
- messageBox("아래 사항을 확인후 재출력해주십시오."
- + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
- + " \n 2.케이블 확인"
- + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
- return false;
- }
- }//End if
- }//End Function
- function BarcodePrtRFCMFACD_011(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
- var vInstance = document.models(0).instances(0);
- var cntHR = vInstance.selectNodes(pRef).length; // 고정자산 프린트 할 전체 목록의 갯수
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 바코드프린터 셋팅관련
- var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); // 바코드프린터 종류
- var portOpenTF = "";
- // Lcount , Mcont
- var KCount = 0;
- var PCount = 0;
- if (pKCount == null || pKCount == ""){
- KCount = 0;
- }else{
- KCount = pKCount;
- }
- if (pPCount == null || pPCount == ""){
- PCount = 0;
- }else{
- PCount = pPCount;
- }
- if (cntHR > 0 && sPrntKind != 0){
- var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
- var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
- var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
- if (sCommKind == "01") { //통신유형(PRT)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
- } else if (sCommKind == "02") { //통신유형(COM)
- var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
- var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
- var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
- var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
- var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
- CommAX.CommPort = sComm;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- if(KCount > 0){
- //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
- portOpenTF = "TRUE";
- }else if(KCount == 0){
- //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
- portOpenTF = CommAX.PortOpen("true");
- }
- } else if (sCommKind == "03") { //통신유형(TCP/IP)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
- }
- var DeptNm = "";
- if ( (portOpenTF == "TRUE" && sCommKind == "02")
- ||(sCommKind == "01") || (sCommKind == "03")){
- for (i=1 ; i<= cntHR;i++){
- var goodflag = model.getvalue(pRef+ "["+i+"]/goodflag" ).getTrim();
- var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
- var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
- var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
- var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
- var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
- var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
- var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
- var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
- var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
- var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
- var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
- var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
- var prodcmpynm = model.getvalue(pRef+ "["+i+"]/prodcmpynm" ).getTrim();
-
- var leftmargin = 250;
- var leftmarginother = 10;
-
- //시작 위치 설정
- if (sLeftBank == "" || sLeftBank == "-") sLeftBank = leftmargin; //350
- if (sTopBank == "" || sTopBank == "-") sTopBank = 20;
-
- var sSndMsg = "";
- if(sPrntKind == "1") {
- sSndMsg += misfBP_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
- //sSndMsg += misfBP_ChangeFont("A", 0, 0); // 폰트 설정
- //misfBP_FieldDataHNEW(pX, pY, pW, pH, pData)
- //시작(X, Y)
- //sSndMsg += misfBP_StartFormat(0, 30);
- sSndMsg += "^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO10,46^AQN,16,16^FD^FS";
-
- //장비명
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 27 , 27 , goodflagengnm.substr(0,20));
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 27 , 27 , goodflagengnm.substr(20,20));
-
- }else{
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 27 , 27 , goodflaghngnm.substr(0,20));
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 27 , 27 , goodflaghngnm.substr(20,20));
- }
- //모델명
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 75 , 24 , 24 , "- "+goodmodel);
-
- //취득일자(일-월-년 순서로 출력)+SN
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(0,4)+"-"+possndd.substr(4,2)+"-"+possndd.substr(6,2)+"_"+mngtno); //82
-
- //부서명(관리부서)
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm); //100 , mngtdeptnm
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- //제조원(장비만...)
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "- "+prodcmpynm);
- }else{
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "-");
- }
-
- //코드번호
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 205 , 30 , 30 , "- "+fixasetcd);
-
- //바코드
- sSndMsg += misfBP_ChangeFont("F", 10, 10);
- sSndMsg += misfBP_BarCode_Code39NEW(0, 240, "N", 50, "*" +fixasetcd + "*"); // 바코드 //114
-
-
- sSndMsg += misfBP_EndFormat();
-
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- }
- }//end if(sPrntKind == "1")
- }//end for
- //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
- if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
- CommAX.PortOpen("false");
- }
- }else if((portOpenTF = "FALSE" && sCommKind == "02")){
- messageBox("아래 사항을 확인후 재출력해주십시오."
- + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
- + " \n 2.케이블 확인"
- + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
- return false;
- }
- }//End if
- }//End Function
- function BarcodePrtRFCMFACD_103(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
- var vInstance = document.models(0).instances(0);
- var cntHR = vInstance.selectNodes(pRef).length; // 고정자산 프린트 할 전체 목록의 갯수
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 바코드프린터 셋팅관련
- var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); // 바코드프린터 종류
- var portOpenTF = "";
- // Lcount , Mcont
- var KCount = 0;
- var PCount = 0;
- if (pKCount == null || pKCount == ""){
- KCount = 0;
- }else{
- KCount = pKCount;
- }
- if (pPCount == null || pPCount == ""){
- PCount = 0;
- }else{
- PCount = pPCount;
- }
- if (cntHR > 0 && sPrntKind != 0){
- var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
- var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
- var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
- if (sCommKind == "01") { //통신유형(PRT)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
- } else if (sCommKind == "02") { //통신유형(COM)
- var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
- var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
- var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
- var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
- var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
- CommAX.CommPort = sComm;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- if(KCount > 0){
- //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
- portOpenTF = "TRUE";
- }else if(KCount == 0){
- //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
- portOpenTF = CommAX.PortOpen("true");
- }
- } else if (sCommKind == "03") { //통신유형(TCP/IP)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
- }
- var DeptNm = "";
- if ( (portOpenTF == "TRUE" && sCommKind == "02")
- ||(sCommKind == "01") || (sCommKind == "03")){
- for (i=1 ; i<= cntHR;i++){
- var goodflag = model.getvalue(pRef+ "["+i+"]/goodflag" ).getTrim();
- var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
- var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
- var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
- var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
- var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
- var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
- var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
- var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
- var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
- var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
- var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
- var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
- var prodcmpynm = model.getvalue(pRef+ "["+i+"]/prodcmpynm" ).getTrim();
-
- var leftmargin = 220;
- var leftmarginother = 270;
-
- //시작 위치 설정
- if (sLeftBank == "" || sLeftBank == "-") sLeftBank = leftmargin; //350
- if (sTopBank == "" || sTopBank == "-") sTopBank = 20;
-
- var sSndMsg = "";
- if(sPrntKind == "1") {
- sSndMsg += misfBP_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
- //sSndMsg += misfBP_ChangeFont("A", 0, 0); // 폰트 설정
- //misfBP_FieldDataHNEW(pX, pY, pW, pH, pData)
- //시작(X, Y)
- //sSndMsg += misfBP_StartFormat(0, 30);
- sSndMsg += "^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO10,46^AQN,16,16^FD^FS";
-
- //장비명
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflagengnm.substr(0,27));
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflagengnm.substr(27,20));
- }else{
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflaghngnm.substr(0,27));
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflaghngnm.substr(27,20));
- }
- //모델명
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 75 , 24 , 24 , "- "+goodmodel);
-
- //취득일자(일-월-년 순서로 출력)+SN
- //if (goodflag == "G") {
- // sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+mngtno); //82
- //}else {
- // sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+"_"+mngtno); //82
- //}
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+"_"+mngtno); //82
-
- //부서명(관리부서)
- //sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm); //100 , mngtdeptnm
- //부서명(관리부서)+설치장소
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm+"_"+installplcenm ); //100 , mngtdeptnm
- //if (goodflag == "E"){
- //제조원(장비만...)
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "- "+prodcmpynm);
- //}else{
- //sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "-");
- //}
-
- //코드번호
- sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 205 , 24 , 24 , "- "+fixasetcd);
-
- //바코드
- sSndMsg += misfBP_ChangeFont("F", 10, 10);
- sSndMsg += misfBP_BarCode_Code39NEW(310, 240, "N", 50, "*" +fixasetcd + "*"); // 바코드 //114
-
- //title
- if (instcd == '114'){
- sSndMsg += misfBP_FieldDataHNEW(70 , 195 , 28 , 28 , "산학협력단");
- }else if (instcd == '032'){
- sSndMsg += misfBP_FieldDataHNEW(60 , 195 , 28 , 28 , "의과학연구원");
- }
-
- sSndMsg += misfBP_EndFormat();
-
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- }
- }//end if(sPrntKind == "1")
- }//end for
- //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
- if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
- CommAX.PortOpen("false");
- }
- }else if((portOpenTF = "FALSE" && sCommKind == "02")){
- messageBox("아래 사항을 확인후 재출력해주십시오."
- + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
- + " \n 2.케이블 확인"
- + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
- return false;
- }
- }//End if
- }//End Function
- function fBarElementPrt(pValue, pSndMsg, iXPos, iYPos){
- var aStr = "";
- var iWidth = 0;
- var aFlag = new Array();
- aStr = misfGetHanGul(pValue, aFlag);
- for (var iNo=0; iNo < aStr.length; iNo++) {
- if (aFlag[iNo] == "E") {
- pSndMsg += "^CF030,30^FO"+(Number(iXPos)+Number(iWidth))+","+ iYPos +"^FD" + aStr[iNo] + "^FS";
- iWidth = iWidth + (Number(aStr[iNo].length) * 14);
- } else {
- pSndMsg += CommAX.PrtImgOut((Number(iXPos)+Number(iWidth)), iYPos, aStr[iNo], 1, 1);
- pSndMsg += CommAX.HanImageData();
- iWidth = iWidth + (Number(aStr[iNo].length) * 24);
- }
- }
- return pSndMsg;
- }
-
- /*
- *바코드 출력 함수
- * psRef 바코드프린트 셋팅관련 노드셋
- * pRef 고정자산 프린트 관련 노드셋
- * cvtdate 점검일(오늘날짜)
- * nextcvtdate 다음점검일(현재는 일년뒤로 셋팅되어 있음)
- */
- function BarcodePrtRFCMFACD_013(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
- var vInstance = document.models(0).instances(0);
- var cntHR = vInstance.selectNodes(pRef).length; //고정자산 프린트 할 전체 목록의 갯수
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; //바코드프린터 셋팅관련
- var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); //바코드프린터 종류
- var portOpenTF = "";
- // Lcount , Mcont
- var KCount = 0;
- var PCount = 0;
- if (pKCount == null || pKCount == ""){
- KCount = 0;
- }else{
- KCount = pKCount;
- }
- if (pPCount == null || pPCount == ""){
- PCount = 0;
- }else{
- PCount = pPCount;
- }
- //
- if (cntHR > 0 && sPrntKind != 0){
- var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
- var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
- var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
- if (sCommKind == "01") { //통신유형(PRT)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
- if(KCount > 0){
- //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
- portOpenTF = "TRUE";
- }else if(KCount == 0){
- portOpenTF = CommAX.PortOpen("true");
- }
-
- } else if (sCommKind == "02") { //통신유형(COM)
- var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
- var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
- var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
- var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
- var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
- CommAX.CommPort = sComm;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- if(KCount > 0){
- //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
- portOpenTF = "TRUE";
- }else if(KCount == 0){
- //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
- portOpenTF = CommAX.PortOpen("true");
- }
- } else if (sCommKind == "03") { //통신유형(TCP/IP)
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
- }
- var DeptNm = "";
- if ( (portOpenTF == "TRUE" && sCommKind == "02")
- ||(sCommKind == "01") || (sCommKind == "03")){
- for (i=1 ; i<= cntHR;i++){
- var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
- var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
- var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
- var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
- var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
- var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
- var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
- var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
- var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
- var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
- var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
- var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
-
- var sSndMsg = "";
- var iXPos = 0, iYPos = 0;
- if(sPrntKind == "1") {
- //시작(X, Y)
- sSndMsg += misfBP_StartFormat(0, 0); // 시작위치 셋팅
-
- iXPos = Number(sLeftBank) + 190;
- iYPos = Number(sTopBank) + 115;
-
- //제품명
- sSndMsg += fBarElementPrt(goodflagengnm, sSndMsg, iXPos, iYPos);
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- sSndMsg = "";
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- sSndMsg = "";
- }
-
- //Serial No.
- iYPos += 30;
- sSndMsg += fBarElementPrt("S/N:"+mngtno, sSndMsg, iXPos, iYPos);
-
- //사용부서
- iYPos += 60;
- sSndMsg += fBarElementPrt(mngtdeptnm, sSndMsg, iXPos, iYPos);
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- sSndMsg = "";
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- sSndMsg = "";
- }
-
-
- //구입일자
- iYPos += 50;
- sSndMsg += misfBP_ChangeFont("C", 18, 18); // 폰트 설정
- sSndMsg += misfBP_FieldDataA(iXPos, iYPos, possndd.substr(0,4)+"-"+possndd.substr(4,2)
- +"-"+possndd.substr(6,2));
- //자산코드
- iYPos += 50;
- sSndMsg += misfBP_ChangeFont("B", 17, 17); // 폰트 설정
- //sSndMsg += misfBP_FieldDataA(iXPos, iYPos, fixasetcd);
- sSndMsg += misfBP_FieldDataA(iXPos, iYPos, fixasetcd.substr(0,1)+"-"+fixasetcd.substr(1,2)
- +"-"+fixasetcd.substr(3,2)
- +"-"+fixasetcd.substr(5,fixasetcd.length-4));
- //자산코드(바코드 type)
- iXPos = 80;
- iYPos += 40;
- sSndMsg += misfBP_ChangeFont("C", 35, 35); // 폰트 설정
- sSndMsg += misfBP_BarCode_Code39NEW(iXPos, iYPos, "N", 70, "*" +fixasetcd + "*"); // 바코드 //114
- sSndMsg += misfBP_EndFormat();
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- }
- }//end if(sPrntKind == "1")
- }//end for
- //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
- if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
- CommAX.PortOpen("false");
- }
- }else if((portOpenTF = "FALSE" && sCommKind == "02")){
- messageBox("아래 사항을 확인후 재출력해주십시오."
- + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
- + " \n 2.케이블 확인"
- + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
- return false;
- }
- }//End if
- }//End Function
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
- function fGetBrcdPrntInfo() {
- model.makeNode("/root/main/barcdprntsetup");
- model.makeNode("/root/send/scrnid");
- model.setValue("/root/send/scrnid", getScreenID());
- model.createChild("xforms:submission", "id:TRRPZ00701;mediatype:application/x-www-form-urlencoded; method:post; ref:" + "/root/send" + "; resultref:" + "/root/main/barcdprntsetup" + "; ");
- submit("TRRPZ00701");
- }
- // 경북대 병원 버전
- function fBarcodePrtKnu() {
- misfGridInit(grd_cpfixasetlist); // 고정자산 (바코드)List
- var instcd = model.getValue(cmb_instcd_search.attribute("ref"));
- var goodnm, mngtdeptnm, installplcenm;
- var cnt = 0;
- var node = instance1.selectSingleNode("/root/main/list/fixaset/fixasetlist[choice='Y']");
-
- if (node == null){
-
- messageBox("선택할 데이터가","I004");
- return false;
-
- }
-
- for (var i = grd_fixasetlist.fixedRows;i<grd_fixasetlist.rows;i++){
-
- var chk = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("choice")).getTrim();
- var goodflag = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflag")).getTrim();
-
- if (chk == "Y"){
- // [2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
- if (goodflag == "EQ"){
- goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflagengnm")).getTrim();
- }else{
- goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflaghngnm")).getTrim();
- }
-
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1")) = goodnm;
-
- mngtdeptnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("mngtdeptnm")).getTrim();
- installplcenm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("installplcenm")).getTrim();
-
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1")) = mngtdeptnm;
- grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm2")) = installplcenm;
- grd_cpfixasetlist.addRow();
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("fixasetcd")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("fixasetcd"));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("possndd" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("possndd" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodspec" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodspec" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("deptnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1" ));
- grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("suplplcenm")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("suplplcenm"));
-
- }
- }
- exeReportPreview("RPRFC00702","XMLSTR");
-
- }
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|