123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700 |
- var gTimerID = "";
- var gv_stdDate_Path = "C:\\Envelope";
- /**
- * @desc : 화면초기화
- *
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- var rslt_ref = "/root/main/common";
- swt_barcode.selectedIndex = 1;
- model.makeValue("/root/send/reqdata/instcd", getUserInfo("dutplceinstcd"));
- submit("TRMRC01606");
- model.resetInstanceNode("/root/send/reqdata");
- //mmbfGetDeptCodeComboList("/root/send", rslt_ref, "O", getCurrentDate());
- copyNodeset("/root/init/cretchart/deptinfo", "/root/main/common/dept");
- copyNodeset("/root/init/reprntbarcode/deptinfo", "/root/main/common/dept");
-
- /* 원본_20090617
- if(document.all("CommAX") == null){
- lzzfMakeBrcdPrntObjHanDo("CommAX");
- }
- */
- if(document.all("CommAX") == null){
- var scrnid = getScreenID();
- model.resetInstanceNode("/root/send/reqdata");
- model.makeValue("/root/send/scrnid", scrnid);
- submit("TRLLC90101");
- lzzfMakeBrcdPrntObjHanDo("CommAX");
- }
-
- fGetBrcdPrntInfo();
- copyNodeType("/root/hidden/barcode/barcodeinfo", "/root/main/barcdprntsetup/prntsetupinfo/setupinfo", "append");
- model.refresh();
-
- }
- function fGetPatSearch(flag, trg, txt){
- model.resetInstanceNode("/root/temp");
- model.resetInstanceNOde("/root/send/reqdata");
- if(flag == "pid"){
- model.makeValue("/root/send/reqdata/pid", txt);
- submit("TRMRC01604");
- } else if(flag == "patnm"){
- if(trg == "1"){
- var usr_val = txt;
- model.makeValue("/root/temp/srchcond", "2");
- model.makeValue("/root/temp/hngnm", usr_val);
- model.makeValue("/root/temp/autoflag","Y");
- } else if(trg == "2"){
- var usr_val = txt;
- model.makeValue("/root/temp/srchcond", "2");
- model.makeValue("/root/temp/hngnm", usr_val);
- model.makeValue("/root/temp/autoflag","Y");
- }
- modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send");
- }
- if(trg == "1"){
- model.setValue("/root/main/cretchart/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
- model.setValue("/root/main/cretchart/patnm", model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- } else if(trg == "2"){
- model.setValue("/root/main/reprntbarcode/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
- model.setValue("/root/main/reprntbarcode/patnm", model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- }
- model.refresh();
- }
- function fBarCodePrnt(pRef){
-
- model.resetInstanceNode("/root/main/exstchart");
- model.resetInstanceNode("/root/main/barcodeinfo");
- model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/cretchart/pid"));
- model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/cretchart/orddeptcd"));
- model.makeValue("/root/send/reqdata/ioflag", "O");
- if(submit("TRMRC01603")){
- var getNodeListCnt = getNodesetCount("/root/main/exstchart");
- if((getNodeListCnt > 0) && (model.getValue("/root/main/exstchart/pid") != "")){
- messageBox("챠트를 신규 생성", "E001");
- model.removeNodeset("/root/send/reqdata");
- return;
- }
- }
- var val_pid = model.getValue("/root/send/reqdata/pid");
-
- // 병원별로 등록번호 표시방법이 틀림
- for(i = val_pid.length; i < 10; i++){
- val_pid = "0" + val_pid;
- }
-
- model.makeValue("/root/send/reqdata/orddd", "");
- model.makeValue("/root/send/reqdata/dschdd", "");
- model.makeValue("/root/send/reqdata/atdoctid", "");
- model.makeValue("/root/send/reqdata/bcno", val_pid);
- model.makeValue("/root/send/reqdata/chrtrem", "");
- opt_message.attribute("visibility") = "visable";
- img_progress.attribute("visibility") = "visable";
-
- if(submit("TXMRC01601")){
- fBarCodePrnterSetting(pRef);
- opt_message.attribute("visibility") = "hidden";
- img_progress.attribute("visibility") = "hidden";
- }
-
- model.removeNodeset("/root/send/reqdata");
- }
- function fBarCodeRePrnt(pRef){
- model.makeValue("/root/send/scrnid", getScreenID());
- submit("TRLLC90101");
- lzzfMakeBrcdPrntObjHanDo("CommAX");
-
- model.resetInstanceNode("/root/main/exstchart");
- model.resetInstanceNode("/root/main/barcodeinfo");
- model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/reprntbarcode/pid"));
- model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/reprntbarcode/orddeptcd"));
- model.makeValue("/root/send/reqdata/ioflag", "O");
-
- if(submit("TRMRC01601")){
- if(model.getValue("/root/main/exstchart/pid") != "" ){
- model.setValue("/root/main/barcodeinfo/pid", model.getValue("/root/main/exstchart/pid"));
- model.setValue("/root/main/barcodeinfo/orddeptcd", model.getValue("/root/main/exstchart/orddeptcd"));
- model.setValue("/root/main/barcodeinfo/ioflag", model.getValue("/root/main/exstchart/ordtype"));
- model.setValue("/root/main/barcodeinfo/orddd", model.getValue("/root/main/exstchart/orddd"));
- model.setValue("/root/main/barcodeinfo/atdoctid", model.getValue("/root/main/exstchart/atdoctid"));
- model.setValue("/root/main/barcodeinfo/bcno", model.getValue("/root/main/exstchart/bcno"));
- model.setValue("/root/main/barcodeinfo/fstrgstrid", "");
- model.setValue("/root/main/barcodeinfo/lastupdtrid", "");
- model.setValue("/root/main/barcodeinfo/chrtrem", "");
- model.setValue("/root/main/barcodeinfo/hngnm", model.getValue("/root/main/exstchart/hngnm"));
- model.setValue("/root/main/barcodeinfo/rrgstno", model.getValue("/root/main/exstchart/rrgstno"));
- model.setValue("/root/main/barcodeinfo/fsexamflag", model.getValue("/root/main/exstchart/fsexamflag"));
- model.setValue("/root/main/barcodeinfo/depthngnm", model.getValue("/root/main/exstchart/depthngnm"));
- model.setValue("/root/main/barcodeinfo/deptengabbr", model.getValue("/root/main/exstchart/deptengabbr"));
- fBarCodePrnterSetting(pRef);
- } else {
- messageBox("등록된 챠트가", "I004");
- }
- opt_message.attribute("visibility") = "hidden";
- img_progress.attribute("visibility") = "hidden";
- }
- model.removeNodeset("/root/send/reqdata");
- }
- function fBarCodePrnterSetting(pRef){
- var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo";
- var vInstance = document.models(0).instances(0);
- var cntHR = vInstance.selectNodes(pRef).length;
- var sPrntKind = model.getValue(barcdRef + "[1]/prntkind");
- var portOpenTF = "";
-
- model.makeValue("/root/send/scrnid", getScreenID()); // 20090617
- submit("TRLLC90101"); // 20090617
- if(document.all("CommAX") == null){
- lzzfMakeBrcdPrntObjHanDo("CommAX");
- }
- if(cntHR > 0 && sPrntKind != 0){
- var sCommKind = model.getValue(barcdRef + "[1]/commkind");
- var sLeftBank = model.getValue(barcdRef + "[1]/blank/left");
- var sTopBank = model.getValue(barcdRef + "[1]/blank/top");
-
- if(sCommKind == "01") {
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
- } else if(sCommKind == "02") {
- var sComm = model.getValue(barcdRef + "[1]/comm02/comm");
- var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit");
- var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit");
- var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate");
- var sParity = model.getValue(barcdRef + "[1]/comm02/parity");
-
- //alert(sComm+"," + sDataBit + "," + sStopBit + "," + sBaudRate + "," +sParity);
- CommAX.CommPort = sComm;
- CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
- portOpenTF = CommAX.PortOpen("true");
- } else if(sCommKind == "03") {
- var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
- }
-
- fSetLblPaper(sCommKind, sLeftBank, sTopBank, sPrntKind, portOpenTF, barcdRef);
-
- /////////////////////////////////////////////////////////////////////
- // sPrntKind
- /*
- // SATO일 경우
- if(sPrntKind == "2" || sPrntKind == "6" || sPrntKind == "7"){
-
- }else{
- // 기존그대로
- }
-
- if(portOpenTF == "TRUE"){
- fSetLblPaper(sCommKind, sLeftBank, sTopBank, sPrntKind);
- }
- //CommAX.PortClose();
- */
- }
-
- }
- function fSetLblPaper(sCommKind, sLeftBank, sTopBank, sPrntKind, portOpenTF, barcdRef){
- var barcodeinfo = "/root/main/barcodeinfo";
- var sSndMsg = "";
-
- var sBcno = model.getvalue(barcodeinfo+"/bcno");
- var sPatnm = model.getvalue(barcodeinfo+"/hngnm");
- var sPid = model.getvalue(barcodeinfo+"/pid");
- var sDeptEngAbbr = model.getvalue(barcodeinfo+"/deptengabbr");
- var sRrsgtno = model.getvalue(barcodeinfo+"/rrgstno");
- var sOrddd = model.getvalue(barcodeinfo+"/orddd");
- var sFsexamflag = model.getvalue(barcodeinfo+"/fsexamflag");
-
- if(sFsexamflag == "F"){
- sFsexamflag = "병초";
- } else if(sFsexamflag == "D"){
- sFsexamflag = "과초";
- }
- if (sLeftBank == "" || sLeftBank == "-") sLeftBank = 0;
- if (sTopBank == "" || sTopBank == "-") sTopBank = 0;
-
- var iLeft = model.getValue(barcdRef + "[1]/blank/left");
- var iTop = model.getValue(barcdRef + "[1]/blank/top");
- if(iLeft == "" || iLeft == "-"){
- iLeft = 0;
- }
- if(iTop == "" || iTop == "-"){
- iTop = 0;
- }
-
- // SATO일 경우_20090617
- if(sPrntKind == "2" || sPrntKind == "6" || sPrntKind == "7"){
- ///////////////////////////////////////////////////////////////
- // 추후 추가하여야 함.
- // sato인 경우 여백 조정 및 함수 틀림. 아래 내용을 참조하여 추가하여야 함
-
- var esc = String.fromCharCode(27);
- var sSndMsg = esc + "A" + esc + "A105500800"; // 시작위치 셋팅 (A1aaaabbbb:출력 용지 규격(aaaa:세로크기_최대 2848, bbbb:가로크기_최대 832))
-
- // 병원별 등록번호 표시방법 여부(HardCode 테이블 이용) - 2009/06/01 추가
- mmbfGetHardCodeInfoNm("/root/send/harddata","/root/temp/hardcode", 3801); //OCR서식의 등록번호 체크로직 표시 여부
- var hardcd = model.getValue("/root/temp/hardcode/hardcd/hardcd");
-
- //alert(hardcd);
-
- if (hardcd == "Y")
- {
- // 출력할 데이터 생성
- for(var i = sPid.length; i < 10; i++){
- sPid = "0" + sPid;
- }
- var tmp_pid = model.getvalue(barcodeinfo+"/pid");
-
- if(tmp_pid.length >= 9){
- sPid = sPid.substring(0, 2) + " " + sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- } else {
- sPid = sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- }
- }
-
-
- /* 병원별 적용으로 변경(20090701)
- // 출력할 데이터 생성
- for(var i = sPid.length; i < 10; i++){
- sPid = "0" + sPid;
- }
- var tmp_pid = model.getvalue(barcodeinfo+"/pid");
-
- if(tmp_pid.length >= 9){
- sPid = sPid.substring(0, 2) + " " + sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- } else {
- sPid = sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- }
- */
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+20, parseInt(iLeft)+270, sPid, 2, 2);
-
- if (sPatnm.length > 3)
- {
- sPatnm = sPatnm.substring(0, 1) + " " + sPatnm.substring(1, 2) + " " + sPatnm.substring(2, 3) + " " + sPatnm.substring(3, 4);
- }
- else
- {
- sPatnm = sPatnm.substring(0, 1) + " " + sPatnm.substring(1, 2) + " " + sPatnm.substring(2, 3);
- }
-
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+90, parseInt(iLeft)+280, sPatnm, 2, 2);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+100, parseInt(iLeft)+620, sDeptEngAbbr, 2, 2);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+100, parseInt(iLeft)+720, sFsexamflag, 2, 2);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+160, parseInt(iLeft)+230, sRrsgtno.substring(0,8)+"******", 1, 1.5);
-
- if(sOrddd != ""){
- sOrddd = sOrddd.substring(0, 4) + "-" + sOrddd.substring(4, 6) + "-" + sOrddd.substring(6, 8);
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+160, parseInt(iLeft)+490, sOrddd, 1, 1.5);
- }
- sSndMsg += esc + "V" + parseInt(iTop)+220 + esc + "H" + parseInt(iLeft)+200 + esc + "BG02100" + sBcno; // 바코드(BGaabbb : a-간격(01~12), b-높이(001~600))
- sSndMsg += CommAX.PrtImgOut(parseInt(iTop)+350, parseInt(iLeft)+300, "*" + sBcno + "*", 1, 1);
-
- // 종료 및 출력물 출력수량
- sSndMsg += esc + "Q1" + esc + "Z";
- CommAX.SendMsg(sSndMsg);
- CommAX.PortOpen("false");
-
- }else{ // 기존그대로
- // if(sPrntKind == "1") {
- if(portOpenTF == "TRUE"){
- sSndMsg += chrtBarCode_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
- //sSndMsg += chrtBarCode_ChangeFont("A", 0, 0); // 폰트 설정
-
- // 병원별 등록번호 표시방법 여부(HardCode 테이블 이용) - 2009/06/01 추가
- mmbfGetHardCodeInfoNm("/root/send/harddata","/root/temp/hardcode", 3801); //OCR서식의 등록번호 체크로직 표시 여부
- var hardcd = model.getValue("/root/temp/hardcode/hardcd/hardcd");
-
- //alert(hardcd);
-
- if (hardcd == "Y")
- {
- // 출력할 데이터 생성
- for(var i = sPid.length; i < 10; i++){
- sPid = "0" + sPid;
- }
- var tmp_pid = model.getvalue(barcodeinfo+"/pid");
- if(tmp_pid.length >= 9){
- sPid = sPid.substring(0, 2) + " " + sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- } else {
- sPid = sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- }
- }
- else
- {
- var instcd = getUserInfo("dutplceinstcd");
-
- if (instcd == "013")
- {
- if (sPid < 1314016)
- {
- for(var i = sPid.length; i < 6; i++){
- sPid = "0" + sPid;
- }
- }
- var tmp_pid = model.getvalue(barcodeinfo+"/pid");
- if(tmp_pid.length >= 7){
- sPid = sPid.substring(0, 2) + " " + sPid.substring(2, 4) + " " + sPid.substring(4, 6) + "-" + sPid.substring(6, 7);
- } else {
- sPid = sPid.substring(0, 2) + " " + sPid.substring(2, 4) + " " + sPid.substring(4, 6);
- }
-
- }
- }
-
- /* 병원별 적용으로 변경(20090701)
- for(var i = sPid.length; i < 10; i++){
- sPid = "0" + sPid;
- }
- var tmp_pid = model.getvalue(barcodeinfo+"/pid");
- if(tmp_pid.length >= 9){
- sPid = sPid.substring(0, 2) + " " + sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- } else {
- sPid = sPid.substring(2, 5) + " " + sPid.substring(5, 7) + " " + sPid.substring(7, 9) + " - " + sPid.substring(9, 10);
- }
- //alert(sPid);
- */
-
- sSndMsg += chrtBarCode_ChangeFont("C", 52, 32); // Height, width폰트 설정
- sSndMsg += chrtBarCode_FieldDataA(70, 20, sPid); // 가로, 세로, 텍스트 환자등록번호
-
- sPatnm = sPatnm.substring(0, 1) + " " + sPatnm.substring(1, 2) + " " + sPatnm.substring(2, 3);
- //alert(sPatnm);
- /* sSndMsg += chrtBarCode_ChangeFont("C", 100, 100); // Height, width폰트 설정
- sSndMsg += CommAX.PrtImgOut("GRAPH002", sPatnm); //환자이름
- sSndMsg += chrtBarCode_FiendOrigin(75, 90);
- sSndMsg += "^XGGRAPH002,2,2^FS";
- */
- sSndMsg += chrtBarCode_ChangeFont("C", 100, 100); // Height, width폰트 설정
- sSndMsg += CommAX.PrtImgOut(75, 90, sPatnm, 2, 2); //환자이름
- sSndMsg += CommAX.HanImageData();
-
- sSndMsg += chrtBarCode_ChangeFont("C", 32, 32); // Height, width폰트 설정
- sSndMsg += chrtBarCode_FieldDataA(380, 100, sDeptEngAbbr); // 가로, 세로, 텍스트 부서영문약어
-
-
- /* sSndMsg += chrtBarCode_ChangeFont("C", 300, 300); // Height, width폰트 설정
- sSndMsg += CommAX.PrtImgOut("GRAPH003", sFsexamflag); //초재진구분
- sSndMsg += chrtBarCode_FiendOrigin(500, 100);
- sSndMsg += "^XGGRAPH003,2,2^FS";
- */
- sSndMsg += chrtBarCode_ChangeFont("C", 300, 300); // Height, width폰트 설정
- sSndMsg += CommAX.PrtImgOut(500, 100, sFsexamflag, 1, 1); //초재진구분
- sSndMsg += CommAX.HanImageData();
-
- sSndMsg += chrtBarCode_ChangeFont("C", 20, 20); // Height, width폰트 설정
- sSndMsg += chrtBarCode_FieldDataA(30, 160, sRrsgtno); // 주민번호
-
- if(sOrddd != ""){
- sOrddd = sOrddd.substring(0, 4) + "-" + sOrddd.substring(4, 6) + "-" + sOrddd.substring(6, 8);
- sSndMsg += chrtBarCode_ChangeFont("C", 20, 20); // Height, width폰트 설정
- sSndMsg += chrtBarCode_FieldDataA(390, 160, sOrddd); // 진료일자
- }
-
- sSndMsg += chrtBarCode_ChangeFont("F", 10, 10);
- sSndMsg += chrtBarCode_BarCode_Code39(50, 185, "N", 60, sBcno); // 바코드
-
- sSndMsg += chrtBarCode_ChangeFont("C", 10, 10); // 폰트 설정
- sSndMsg += chrtBarCode_FieldDataA(190, 250, "*" + sBcno + "*"); //바코드번호
-
- sSndMsg += chrtBarCode_EndFormat(1);
- if(sCommKind == "01") {
- CommAX.SendMessageToLPT(sSndMsg);
- } else if(sCommKind == "02") {
- CommAX.SendMessage(sSndMsg);
- }
- }
- }
- CommAX.PortOpen("false");
- }
- function test(){
- CommAX.CommPort = "1"; // 출력 Port
- CommAX.Settings = "9600,n,8,1"; // Comm 설정
- var sSndMsg = "";
- var portOpenTF = CommAX.PortOpen("true");
- if(portOpenTF == "TRUE"){
- //alert("open");
- sSndMsg += chrtBarCode_StartFormat(0, 0);
- sSndMsg += chrtBarCode_FieldDataA(140, 140, "1111");
- sSndMsg += chrtBarCode_EndFormat(1);
- CommAX.SendMessage(sSndMsg);
- }
- CommAX.PortOpen("false");
- }
- function fGetDeptEngAbbr(engabbr, ref, resref){
- var deptcd = model.getValue(ref+"[deptengabbr='" + engabbr + "']/deptcd");
- model.setValue(resref, deptcd);
- model.refresh();
- }
- function fGetOutEnvelopeInfo(){
- model.resetInstanceNode("/root/send/reqdata");
-
- model.makeValue("/root/send/reqdata/frompid", model.getValue("/root/main/envelopebarcode/frompid"));
- model.makeValue("/root/send/reqdata/topid", model.getValue("/root/main/envelopebarcode/topid"));
- model.makeValue("/root/send/reqdata/stddate", model.getValue("/root/main/envelopebarcode/stddate"));
- model.makeValue("/root/send/reqdata/fsexamflag", model.getValue("/root/main/envelopebarcode/fsexamflag"));
- if(submit("TRMRC01602")){
- messageBox("검색을", "I002")
- }
- model.removeNodeset("/root/send/reqdata");
- //model.setValue("/root/main/envelopebarcode/frompid", "");
- fLastEnvelopeStdData();
- model.refresh();
- }
- /*
- ===============================================================================
- File Name : LZZ001.js
- File Explanation : 바코드출력 Common js (for Zebra ZPL )
- File Author : Jin Hwa Ji. 2007-05-08
- Revision Details :
- ===============================================================================
- */
- /**
- * @group : commonweb
- * @ver : 2007.05.08 (CMCDEV-0001)
- * @by : Jin Hwa Ji [ACK Co., Ltd.]
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * <pre>
- * 바코드 Format 시작
- *
- * </pre>
- * @param : pX = 시작 가로위치 (in dots)
- * @param : pY = 시작 세로위치 (in dots)
- * @return :
- * @---------------------------------------------------
- */
- function chrtBarCode_StartFormat(pX, pY) {
- return "^XA" + "^LH" + pX + "," + pY;
- }
- /**
- * @group : commonweb
- * @ver : 2007.05.08 (CMCDEV-0001)
- * @by : Jin Hwa Ji [ACK Co., Ltd.]
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * <pre>
- * 바코드 Format 종료
- *
- * </pre>
- * @param : pCnt = 출력매수
- * @return :
- * @---------------------------------------------------
- */
- function chrtBarCode_EndFormat(pCnt) {
- var vCnt = 1;
-
- if (isNull(pCnt)) {
- vCnt = 1;
- } else {
- vCnt = pCnt
- }
- return "^PQ" + vCnt + "^XZ";
-
- }
- /**
- * @group : commonweb
- * @ver : 2007.05.08 (CMCDEV-0001)
- * @by : Jin Hwa Ji [ACK Co., Ltd.]
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * <pre>
- * 바코드 Format 종료
- *
- * </pre>
- * @param : pX = 시작 가로위치 (in dots)
- * @param : pY = 시작 세로위치 (in dots)
- * @return :
- * @---------------------------------------------------
- */
- function chrtBarCode_FiendOrigin(pX, pY) {
- return "^FO" + pX + "," + pY;
-
- }
- /**
- * @group : commonweb
- * @ver : 2007.05.08 (CMCDEV-0001)
- * @by : Jin Hwa Ji [ACK Co., Ltd.]
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * <pre>
- * 기본 Font 설정
- *
- * </pre>
- * @param : pF = Default Font
- * @param : pH = Height(in dots) - Default 9
- * @param : pW = Width(in dots) - Default 5
- * @return :
- * @---------------------------------------------------
- */
- function chrtBarCode_ChangeFont(pF, pH, pW) {
- var sBuf = "";
-
- sBuf = "^CF" + pF;
- sBuf += "," + pH;
- sBuf += "," + pW;
-
- return sBuf;
- }
- /**
- * @group : commonweb
- * @ver : 2007.05.08 (CMCDEV-0001)
- * @by : Jin Hwa Ji [ACK Co., Ltd.]
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * <pre>
- * 알파벳, 숫자 Field정의
- *
- * </pre>
- * @param : pX = 시작 가로위치 (in dots)
- * @param : pY = 시작 세로위치 (in dots)
- * @param : pData = Field Data
- * @param : pReverse = 배경 기준으로 역상으로표시 ( Y:역상으로 )
- * @return :
- * @---------------------------------------------------
- */
- function chrtBarCode_FieldDataA(pX, pY, pData, pReverse) {
- var sBuf = "";
- sBuf = chrtBarCode_FiendOrigin(pX, pY);
- if (!isNull(pReverse)) {
- if (pReverse.getTrim() == "Y") {
- sBuf += "^FR";
- }
- }
-
- sBuf += "^FD" + pData + "^FS";
-
- return sBuf;
- }
- /**
- * @group : commonweb
- * @ver : 2007.05.08 (CMCDEV-0001)
- * @by : Jin Hwa Ji [ACK Co., Ltd.]
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * <pre>
- * 바코드 정의(Code 39)
- *
- * </pre>
- * @param : pX = 시작 가로위치
- * @param : pY = 시작 세로위치
- * @param : pO = 방향
- * @param : pH = 바코드 Height
- * @param : pData = 바코드정보
- * @return :
- * @---------------------------------------------------
- */
- function chrtBarCode_BarCode_Code39(pX, pY, pO, pH, pData) {
- var sBuf = "";
-
- sBuf = chrtBarCode_FiendOrigin(pX, pY);
- sBuf += "^BY2,2.0";
- sBuf += "^B3" + pO + ",N," + pH + ",N,N^FD" + pData + "^FS";
- return sBuf;
- }
- function fAutoPrntBarCd(){
- model.makeValue("/root/send/reqdata/curr_date", getCurrentDate()+getCurrentTime());
- submit("TRMRC01604");
- gTimerID = window.setInterval( "fAutoPrntBarCd();", 300000);
- if(submit("TXMRC01601")){
- fBarCodePrnterSetting(pRef);
- }
- }
- function fLastEnvelopeStdData(){
- model.resetInstanceNode("/root/send/reqdata");
- if(model.getValue("/root/main/envelopebarcode/fsexamflag") == "F"){
- model.makeValue("/root/send/reqdata/fsexamflag", model.getValue("/root/main/envelopebarcode/fsexamflag"));
- submit("TRMRC01605");
- var node_cnt = getNodesetCount("/root/init/envelope/stddata");
- if(model.getValue("/root/init/envelope/stddata") != ""){
- model.setValue("/root/main/envelopebarcode/frompid", model.getValue("/root/init/envelope/stddata"));
- }
- } else if(model.getValue("/root/main/envelopebarcode/fsexamflag") == "D"){
- model.makeValue("/root/send/reqdata/fsexamflag", model.getValue("/root/main/envelopebarcode/fsexamflag"));
- submit("TRMRC01605");
- var node_cnt = getNodesetCount("/root/init/envelope/stddata");
- if(model.getValue("/root/init/envelope/stddata") != ""){
- model.setValue("/root/main/envelopebarcode/stddate", model.getValue("/root/init/envelope/stddata"));
- }
- }
- model.resetInstanceNode("/root/send/reqdata");
- model.refresh();
- }
- function fEnvelopePrnt(pRef){
- model.resetInstanceNode("/root/main/barcodeinfo");
- model.resetInstanceNode("/root/send/reqdata");
- var result_cnt = getNodesetCount("/root/main/envelopebarcode/info/list");
- //alert(result_cnt);
- for(var cnt = 1; cnt <= result_cnt; cnt++){
- model.setValue("/root/main/barcodeinfo/pid", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/pid"));
- model.setValue("/root/main/barcodeinfo/orddeptcd", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/orddeptcd"));
- model.setValue("/root/main/barcodeinfo/ioflag", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/ordtype"));
- model.setValue("/root/main/barcodeinfo/orddd", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/orddd"));
- model.setValue("/root/main/barcodeinfo/atdoctid", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/atdoctid"));
- var barcode = model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/bcno");
- for(var i = barcode.length; i < 10; i++){
- barcode = "0" + barcode;
- }
- model.setValue("/root/main/barcodeinfo/bcno", barcode);
- model.setValue("/root/main/barcodeinfo/fstrgstrid", "");
- model.setValue("/root/main/barcodeinfo/lastupdtrid", "");
- model.setValue("/root/main/barcodeinfo/chrtrem", "");
- model.setValue("/root/main/barcodeinfo/hngnm", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/hngnm"));
- model.setValue("/root/main/barcodeinfo/rrgstno", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/rrgstno"));
- model.setValue("/root/main/barcodeinfo/fsexamflag", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/fsexamflag"));
- model.setValue("/root/main/barcodeinfo/depthngnm", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/depthngnm"));
- model.setValue("/root/main/barcodeinfo/deptengabbr", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/deptengabbr"));
- model.setValue("/root/main/barcodeinfo/cretno", model.getValue("/root/main/envelopebarcode/info/list["+cnt+"]/cretno"));
- fBarCodePrnterSetting(pRef);
- model.resetInstanceNode("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/barcodeinfo/pid"));
- model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/barcodeinfo/orddeptcd"));
- model.makeValue("/root/send/reqdata/ordtype", model.getValue("/root/main/barcodeinfo/ioflag"));
- model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/barcodeinfo/orddd"));
- model.makeValue("/root/send/reqdata/orddrid", model.getValue("/root/main/barcodeinfo/atdoctid"));
- model.makeValue("/root/send/reqdata/fsexamflag", model.getValue("/root/main/barcodeinfo/fsexamflag"));
- model.makeValue("/root/send/reqdata/stddata", model.getValue("/root/main/barcodeinfo/pid"));
- model.makeValue("/root/send/reqdata/cretno", model.getValue("/root/main/barcodeinfo/cretno"));
- if(model.getValue("/root/main/envelopebarcode/topid") == "9999999999"){
- submit("TXMRC01602");
- }
- }
- fLastEnvelopeStdData();
- model.setValue("/root/main/envelopebarcode/topid","9999999999");
- model.refresh();
- }
|