SMRFC00700.js 127 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  1. /* ---------------------------------------------------------------------
  2. *
  3. * SMRFC00700_고정자산바코드출력.xrw (SMRFC00700.xfm - JScript )
  4. *
  5. * - Version :
  6. * 1) : Ver.1.00.01
  7. * : Create By
  8. * : 2008.08.22
  9. ---------------------------------------------------------------------- */
  10. function fInitialize()
  11. {
  12. misfGridInit(grd_fixasetlist); // 고정자산 List
  13. misfGridInit(grd_cpfixasetlist); // 고정자산 (바코드)List
  14. misfGridInit(grd_barcodetarget); // Barcode Print target Grid
  15. rszfGoodFlagListByPgmGubn(cmb_goodflag_search,"2","N");
  16. model.resetInstanceNode("/root/send");
  17. misfComboComCdListMulti("Z0007","cmb_instcd_search");
  18. model.setValue("/root/send/fixasetlist/instcd_search", getUserInfo("dutplceinstcd")); // 기관 설정
  19. fSetPrintUseCheck();
  20. misfMsterDetailSet(grd_fixasetlist, null, "TRRFC00202", "N");
  21. addComboItem("cmb_goodflag_search", "전체", "", "above");
  22. cmb_goodflag_search.select(0);
  23. var curdate = getCurrentDate();
  24. var cvtdate = curdate.toDate("YYYYMMDD");
  25. //model.setValue(ipt_possnfrdd_search.attribute("ref") ,cvtdate.getAddDate(-1,"Y").getDateFormat("YYYYMMDD"));
  26. //model.setValue(ipt_possntodd_search.attribute("ref") ,curdate);
  27. // 대분류 코드 콤보 설정.
  28. rszfLMSComboList(model.getValue(cmb_goodflag_search.attribute("ref")), "", "", "cmb_lrgcd_search", "", "L");
  29. grd_fixasetlist.fixedcellcheckbox(0,1) = true;
  30. //바코드 object 선언
  31. misfMakeBrcdPrntObjHanDo("CommAX");
  32. grd_fixasetlist.fixedcellcheckbox(0,grd_fixasetlist.colRef("choice"),false) = true;
  33. model.setValue("/root/main/barcdprntsetup/comm",2);
  34. model.refresh();
  35. }
  36. function fSetPrintUseCheck(){
  37. var instcd = model.getValue(cmb_instcd_search.attribute("ref")).getTrim();
  38. if (instcd == "014"){
  39. //btn_prntset.visible = "false";
  40. }else{
  41. //btn_prntset.visible = "true";
  42. }
  43. model.refresh();
  44. }
  45. function fGridItemCheck( choiceFlag ) {
  46. var choiceCnt = 0;
  47. if (grd_fixasetlist.rows - grd_fixasetlist.fixedRows <= 0 ) {
  48. messageBox("선택할 데이터가","I004");
  49. return false;
  50. }
  51. if ( choiceFlag == "check" ) {
  52. /*
  53. var goodflagengnm = "";
  54. var goodmodel = "";
  55. var possndd = "";
  56. var mngtdeptnm = "";
  57. var fixasetcd = "";
  58. var instcd = "";
  59. var goodflaghngnm = "";
  60. var installplcecd = "";
  61. var installplcenm = "";
  62. var cntrdeptnm = "";
  63. var suplplcenm = "";
  64. var barcdprntyn = "";
  65. var i = 1;
  66. for( cnt = grd_fixasetlist.fixedRows; cnt < grd_fixasetlist.rows ; cnt++ ) {
  67. if( grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("choice") ) == "Y") {
  68. choiceCnt = choiceCnt + 1;
  69. grd_barcodetarget.addRow(false); //그리드 열추가
  70. goodflagengnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/goodflagengnm");
  71. goodmodel = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/goodmodel");
  72. possndd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/possndd");
  73. mngtdeptnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/mngtdeptnm");
  74. fixasetcd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/fixasetcd");
  75. instcd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/instcd");
  76. goodflaghngnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/goodflaghngnm");
  77. installplcecd = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/installplcecd");
  78. installplcenm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/installplcenm");
  79. cntrdeptnm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/cntrdeptnm");
  80. suplplcenm = model.getValue("/root/main/list/fixaset/fixasetlist["+cnt+"]/suplplcenm");
  81. //필요한 항목들을 전부 노드에서 가져와서 변수에 저장한다음 프린트한다.
  82. /*
  83. 장비명 goodflagengnm
  84. 모델명+제조원 goodmodel
  85. SN+취득일자 ?? + possndd
  86. 부서명(관리) mngtdeptnm
  87. 코드번호(바코드번호) fixasetcd
  88. 바코드
  89. */
  90. //바코드출력 함수 호출 및 매개변수 넘겨주기
  91. //BarcodePrtRFCMFACD(goodflagengnm , goodmodel , possndd , mngtdeptnm , fixasetcd);
  92. //선택된 고정자산자료들을 해당 노드에 부어주고 그 엄마 노드를 펑션에 보내서 바코드 출력하는 데 쓴다.
  93. /*
  94. model.setValue("/root/send/barcodetarget["+i+"]/fixasetcd" , fixasetcd , true );
  95. model.setValue("/root/send/barcodetarget["+i+"]/goodflagengnm" , goodflagengnm , true );
  96. model.setValue("/root/send/barcodetarget["+i+"]/goodmodel" , goodmodel , true );
  97. model.setValue("/root/send/barcodetarget["+i+"]/possndd" , possndd , true );
  98. model.setValue("/root/send/barcodetarget["+i+"]/mngtdeptnm" , mngtdeptnm , true );
  99. model.setValue("/root/send/barcodetarget["+i+"]/instcd" , instcd );
  100. model.setValue("/root/send/barcodetarget["+i+"]/goodflaghngnm" , goodflaghngnm , true );
  101. model.setValue("/root/send/barcodetarget["+i+"]/installplcecd" , installplcecd , true );
  102. model.setValue("/root/send/barcodetarget["+i+"]/installplcenm" , installplcenm , true );
  103. model.setValue("/root/send/barcodetarget["+i+"]/cntrdeptnm" , cntrdeptnm , true );
  104. model.setValue("/root/send/barcodetarget["+i+"]/suplplcenm" , suplplcenm , true );
  105. //출력함수에 해당 노드 첫번째 를 넘기고 출력이 잘 되었다면 그리드의 스테이터스를 update로 하고
  106. //출력여부를 Y로 셋팅한다.
  107. //바코드출력 함수 호출 및 매개변수(해당노드) 넘겨주기
  108. //BarcodePrtRFCMFACD(goodflagengnm , goodmodel , possndd , mngtdeptnm , fixasetcd);
  109. grd_barcodetarget.rowStatus(i) = 2;
  110. i = i+1;
  111. }
  112. }
  113. model.refresh();
  114. */
  115. model.resetInstanceNode("/root/copytemp");
  116. var varcopy = instance1.selectNodes(grd_fixasetlist.nodeset + "[choice='Y']");
  117. if ( varcopy.length == 0 ) {
  118. messageBox("선택한 데이터가","I004");
  119. return false;
  120. }
  121. }
  122. return true;
  123. }
  124. function fItemAllChoice( vFlag ) {
  125. if( fGridItemCheck()!=true ) return;
  126. for( cnt = grd_fixasetlist.fixedRows; cnt < grd_fixasetlist.rows ; cnt++ ) {
  127. grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("choice") ) = vFlag;
  128. }
  129. }
  130. function fBarcodePrt() {
  131. misfGridInit(grd_cpfixasetlist); // 고정자산 (바코드)List
  132. var instcd = model.getValue(cmb_instcd_search.attribute("ref"));
  133. var goodnm, mngtdeptnm, installplcenm;
  134. var cnt = 0;
  135. if (instcd == '014'){
  136. var node = instance1.selectSingleNode("/root/main/list/fixaset/fixasetlist[choice='Y']");
  137. if (node == null){
  138. messageBox("선택할 데이터가","I004");
  139. return false;
  140. }
  141. for (var i = grd_fixasetlist.fixedRows;i<grd_fixasetlist.rows;i++){
  142. var chk = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("choice")).getTrim();
  143. var goodflag = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflag")).getTrim();
  144. if (chk == "Y"){
  145. // [2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  146. if (goodflag == "EQ"){
  147. goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflagengnm")).getTrim();
  148. }else{
  149. goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflaghngnm")).getTrim();
  150. }
  151. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1")) = goodnm.cut(goodnm.num(goodnm, 20));
  152. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm2")) = goodnm.substr2(goodnm.num(goodnm, 20)-1, goodnm.length);
  153. mngtdeptnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("mngtdeptnm")).getTrim();
  154. installplcenm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("installplcenm")).getTrim();
  155. if (installplcenm == ""){
  156. deptnm = mngtdeptnm;
  157. }else{
  158. deptnm = mngtdeptnm + "/" + installplcenm;
  159. }
  160. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1")) = deptnm.cut(deptnm.num(deptnm, 20));
  161. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm2")) = deptnm.substr2(deptnm.num(deptnm, 20)-1, deptnm.length);
  162. grd_cpfixasetlist.addRow();
  163. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1" ));
  164. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodnm2" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm2" ));
  165. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodmodel")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodmodel"));
  166. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("mngtno" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("mngtno" ));
  167. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("deptnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1" ));
  168. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("deptnm2" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm2" ));
  169. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("possndd" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("possndd" ));
  170. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("fixasetcd")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("fixasetcd"));
  171. }
  172. }
  173. exeReportPreview("RPRFC00701","XMLSTR");
  174. }else{
  175. fBarcodePrt_CmdType();
  176. }
  177. }
  178. function fBarcodePrt_CmdType(){
  179. if( fGridItemCheck( "check" ) != true ) return;
  180. misfGridInit(grd_barcodetarget); // Barcode Print target Grid 초기화
  181. model.resetInstanceNode("/root/copytemp");
  182. var varcopy = instance1.selectNodes(grd_fixasetlist.nodeset + "[choice='Y']");
  183. if ( varcopy.length > 0 ) {
  184. var rCSV = getNodeListCSV(varcopy);
  185. //model.setValue("/root/copytemp", rCSV);
  186. //var CSV = model.getValue("/root/copytemp");
  187. //setCSVToNode("/root/send", CSV, "barcodetarget");
  188. setCSVToNode("/root/main", rCSV, "barcodetarget");
  189. }
  190. /*
  191. for( cnt = grd_fixasetlist.fixedRows; cnt < grd_fixasetlist.rows; cnt++ ) {
  192. if ( grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("choice") ) == "Y" ) {
  193. grd_barcodetarget.addItem();
  194. grd_barcodetarget.valueMatrix( grd_barcodetarget.rows - grd_barcodetarget.fixedRows, grd_barcodetarget.colRef("instcd") ) = grd_fixasetlist.valueMatrix( cnt, grd_fixasetlist.colRef("instcd"))
  195. }
  196. }
  197. */
  198. //grd_barcodetarget.gridToInstance();
  199. model.refresh();
  200. for ( i = grd_barcodetarget.fixedRows ; i< grd_barcodetarget.rows; i++) {
  201. //라벨출력 한줄씩 시키고 라벨 출력 했으면 해당 row를 update로 바꾼다
  202. grd_barcodetarget.rowStatus(i) = 2;
  203. }
  204. /*
  205. var nowdate = getCurrentDate();
  206. var checkdate = nowdate.toDate("YYYYMMDD");
  207. var checkdatestring = checkdate.getDateFormat("YYYYMMDD");
  208. var nextcheckdatestring = checkdate.getAddDate(+1,"Y").getDateFormat("YYYYMMDD")
  209. */
  210. model.setValue("/root/send/barcodetarget" ,grd_barcodetarget.getUpdateData());
  211. if (model.getValue(cmb_instcd_search.attribute("ref")) == "013"){
  212. if ( BarcodePrtRFCMFACD_013("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
  213. {
  214. return;
  215. }
  216. }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")){
  217. if ( BarcodePrtRFCMFACD_103("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
  218. {
  219. return;
  220. }
  221. }else if (model.getValue(cmb_instcd_search.attribute("ref")) == "014"){
  222. BarcodePrtRFCMFACD_014(); //바코드출력
  223. }else if (model.getValue(cmb_instcd_search.attribute("ref")) == "011"){
  224. if ( BarcodePrtRFCMFACD_011("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
  225. {
  226. return;
  227. }
  228. }else{
  229. if ( BarcodePrtRFCMFACD("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
  230. {
  231. return;
  232. }
  233. }
  234. /*
  235. if ( BarcodePrtRFCMFACD("/root/main/barcdprntsetup","/root/main/barcodetarget") == false ) //바코드출력
  236. {
  237. return;
  238. }*/
  239. //바코드 출력한 물품들 출력여부를 Y로 셋팅한다.
  240. misfSave("TXRFC00701");
  241. //바뀐 그리드에 row에 update를 submit 날려서 DB에 저장한다.
  242. //현재 노드셋을 다 넘겨준다.
  243. //var today = curdate.toString();
  244. //alert(today);
  245. //BarcodePrtRFCMFACD("/root/main/barcdprntsetup","/root/send/barcodetarget",checkdatestring , nextcheckdatestring);
  246. btn_search.dispatch("DOMActivate");
  247. }
  248. //프린터 설정
  249. function fSetPrint() {
  250. var count = getNodesetCount("/root/main/barcdprntsetup/prntsetupinfo/setupinfo");
  251. if(count == 0) {
  252. model.makeNode("/root/main/barcdprntsetup/prntsetupinfo/setupinfo");
  253. }
  254. open("SPRPZ00700_바코드프린터설정.xrw", "", "", "", "", "/root/main/barcdprntsetup/prntsetupinfo/setupinfo", "/root/main/barcdprntsetup/prntsetupinfo/setupinfo");
  255. }
  256. /*
  257. *바코드 출력 함수
  258. * psRef 바코드프린트 셋팅관련 노드셋
  259. * pRef 고정자산 프린트 관련 노드셋
  260. * cvtdate 점검일(오늘날짜)
  261. * nextcvtdate 다음점검일(현재는 일년뒤로 셋팅되어 있음)
  262. */
  263. function BarcodePrtRFCMFACD(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
  264. var vInstance = document.models(0).instances(0);
  265. var cntHR = vInstance.selectNodes(pRef).length; // 고정자산 프린트 할 전체 목록의 갯수
  266. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 바코드프린터 셋팅관련
  267. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); // 바코드프린터 종류
  268. var portOpenTF = "";
  269. // Lcount , Mcont
  270. var KCount = 0;
  271. var PCount = 0;
  272. if (pKCount == null || pKCount == ""){
  273. KCount = 0;
  274. }else{
  275. KCount = pKCount;
  276. }
  277. if (pPCount == null || pPCount == ""){
  278. PCount = 0;
  279. }else{
  280. PCount = pPCount;
  281. }
  282. if (cntHR > 0 && sPrntKind != 0){
  283. var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
  284. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
  285. var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
  286. if (sCommKind == "01") { //통신유형(PRT)
  287. var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
  288. } else if (sCommKind == "02") { //통신유형(COM)
  289. var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
  290. var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
  291. var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
  292. var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
  293. var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
  294. CommAX.CommPort = sComm;
  295. CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
  296. if(KCount > 0){
  297. //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
  298. portOpenTF = "TRUE";
  299. }else if(KCount == 0){
  300. //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
  301. portOpenTF = CommAX.PortOpen("true");
  302. }
  303. } else if (sCommKind == "03") { //통신유형(TCP/IP)
  304. var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
  305. }
  306. var DeptNm = "";
  307. if ( (portOpenTF == "TRUE" && sCommKind == "02")
  308. ||(sCommKind == "01") || (sCommKind == "03")){
  309. for (i=1 ; i<= cntHR;i++){
  310. var goodflag = model.getvalue(pRef+ "["+i+"]/goodflag" ).getTrim();
  311. var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
  312. var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
  313. var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
  314. var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
  315. var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
  316. var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
  317. var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
  318. var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
  319. var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
  320. var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
  321. var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
  322. var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
  323. var prodcmpynm = model.getvalue(pRef+ "["+i+"]/prodcmpynm" ).getTrim();
  324. var leftmargin = 250;
  325. var leftmarginother = 10;
  326. //시작 위치 설정
  327. if (sLeftBank == "" || sLeftBank == "-") sLeftBank = leftmargin; //350
  328. if (sTopBank == "" || sTopBank == "-") sTopBank = 20;
  329. var sSndMsg = "";
  330. if(sPrntKind == "1") {
  331. sSndMsg += misfBP_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
  332. //sSndMsg += misfBP_ChangeFont("A", 0, 0); // 폰트 설정
  333. //misfBP_FieldDataHNEW(pX, pY, pW, pH, pData)
  334. //시작(X, Y)
  335. //sSndMsg += misfBP_StartFormat(0, 30);
  336. sSndMsg += "^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO10,46^AQN,16,16^FD^FS";
  337. //장비명
  338. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  339. if (goodflag == "EQ"){
  340. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflagengnm.substr(0,20));
  341. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflagengnm.substr(20,20));
  342. }else{
  343. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflaghngnm.substr(0,20));
  344. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflaghngnm.substr(20,20));
  345. }
  346. //모델명
  347. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 75 , 24 , 24 , "- "+goodmodel);
  348. //취득일자(일-월-년 순서로 출력)+SN
  349. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= G) => (goodflag= GE)
  350. if (goodflag == "GE") {
  351. sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+mngtno); //82
  352. }else {
  353. sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+"_"+mngtno); //82
  354. }
  355. //부서명(관리부서)
  356. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm); //100 , mngtdeptnm
  357. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  358. if (goodflag == "EQ"){
  359. //제조원(장비만...)
  360. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "- "+prodcmpynm);
  361. }else{
  362. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "-");
  363. }
  364. //코드번호
  365. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 205 , 24 , 24 , "- "+fixasetcd);
  366. //바코드
  367. sSndMsg += misfBP_ChangeFont("F", 10, 10);
  368. sSndMsg += misfBP_BarCode_Code39NEW(0, 240, "N", 50, "*" +fixasetcd + "*"); // 바코드 //114
  369. sSndMsg += misfBP_EndFormat();
  370. if(sCommKind == "01") {
  371. CommAX.SendMessageToLPT(sSndMsg);
  372. } else if(sCommKind == "02") {
  373. CommAX.SendMessage(sSndMsg);
  374. }
  375. }//end if(sPrntKind == "1")
  376. }//end for
  377. //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
  378. if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
  379. CommAX.PortOpen("false");
  380. }
  381. }else if((portOpenTF = "FALSE" && sCommKind == "02")){
  382. messageBox("아래 사항을 확인후 재출력해주십시오."
  383. + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
  384. + " \n 2.케이블 확인"
  385. + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
  386. return false;
  387. }
  388. }//End if
  389. }//End Function
  390. function BarcodePrtRFCMFACD_011(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
  391. var vInstance = document.models(0).instances(0);
  392. var cntHR = vInstance.selectNodes(pRef).length; // 고정자산 프린트 할 전체 목록의 갯수
  393. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 바코드프린터 셋팅관련
  394. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); // 바코드프린터 종류
  395. var portOpenTF = "";
  396. // Lcount , Mcont
  397. var KCount = 0;
  398. var PCount = 0;
  399. if (pKCount == null || pKCount == ""){
  400. KCount = 0;
  401. }else{
  402. KCount = pKCount;
  403. }
  404. if (pPCount == null || pPCount == ""){
  405. PCount = 0;
  406. }else{
  407. PCount = pPCount;
  408. }
  409. if (cntHR > 0 && sPrntKind != 0){
  410. var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
  411. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
  412. var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
  413. if (sCommKind == "01") { //통신유형(PRT)
  414. var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
  415. } else if (sCommKind == "02") { //통신유형(COM)
  416. var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
  417. var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
  418. var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
  419. var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
  420. var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
  421. CommAX.CommPort = sComm;
  422. CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
  423. if(KCount > 0){
  424. //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
  425. portOpenTF = "TRUE";
  426. }else if(KCount == 0){
  427. //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
  428. portOpenTF = CommAX.PortOpen("true");
  429. }
  430. } else if (sCommKind == "03") { //통신유형(TCP/IP)
  431. var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
  432. }
  433. var DeptNm = "";
  434. if ( (portOpenTF == "TRUE" && sCommKind == "02")
  435. ||(sCommKind == "01") || (sCommKind == "03")){
  436. for (i=1 ; i<= cntHR;i++){
  437. var goodflag = model.getvalue(pRef+ "["+i+"]/goodflag" ).getTrim();
  438. var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
  439. var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
  440. var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
  441. var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
  442. var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
  443. var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
  444. var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
  445. var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
  446. var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
  447. var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
  448. var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
  449. var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
  450. var prodcmpynm = model.getvalue(pRef+ "["+i+"]/prodcmpynm" ).getTrim();
  451. var leftmargin = 250;
  452. var leftmarginother = 10;
  453. //시작 위치 설정
  454. if (sLeftBank == "" || sLeftBank == "-") sLeftBank = leftmargin; //350
  455. if (sTopBank == "" || sTopBank == "-") sTopBank = 20;
  456. var sSndMsg = "";
  457. if(sPrntKind == "1") {
  458. sSndMsg += misfBP_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
  459. //sSndMsg += misfBP_ChangeFont("A", 0, 0); // 폰트 설정
  460. //misfBP_FieldDataHNEW(pX, pY, pW, pH, pData)
  461. //시작(X, Y)
  462. //sSndMsg += misfBP_StartFormat(0, 30);
  463. sSndMsg += "^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO10,46^AQN,16,16^FD^FS";
  464. //장비명
  465. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  466. if (goodflag == "EQ"){
  467. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 27 , 27 , goodflagengnm.substr(0,20));
  468. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 27 , 27 , goodflagengnm.substr(20,20));
  469. }else{
  470. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 27 , 27 , goodflaghngnm.substr(0,20));
  471. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 27 , 27 , goodflaghngnm.substr(20,20));
  472. }
  473. //모델명
  474. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 75 , 24 , 24 , "- "+goodmodel);
  475. //취득일자(일-월-년 순서로 출력)+SN
  476. sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(0,4)+"-"+possndd.substr(4,2)+"-"+possndd.substr(6,2)+"_"+mngtno); //82
  477. //부서명(관리부서)
  478. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm); //100 , mngtdeptnm
  479. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  480. if (goodflag == "EQ"){
  481. //제조원(장비만...)
  482. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "- "+prodcmpynm);
  483. }else{
  484. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "-");
  485. }
  486. //코드번호
  487. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 205 , 30 , 30 , "- "+fixasetcd);
  488. //바코드
  489. sSndMsg += misfBP_ChangeFont("F", 10, 10);
  490. sSndMsg += misfBP_BarCode_Code39NEW(0, 240, "N", 50, "*" +fixasetcd + "*"); // 바코드 //114
  491. sSndMsg += misfBP_EndFormat();
  492. if(sCommKind == "01") {
  493. CommAX.SendMessageToLPT(sSndMsg);
  494. } else if(sCommKind == "02") {
  495. CommAX.SendMessage(sSndMsg);
  496. }
  497. }//end if(sPrntKind == "1")
  498. }//end for
  499. //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
  500. if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
  501. CommAX.PortOpen("false");
  502. }
  503. }else if((portOpenTF = "FALSE" && sCommKind == "02")){
  504. messageBox("아래 사항을 확인후 재출력해주십시오."
  505. + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
  506. + " \n 2.케이블 확인"
  507. + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
  508. return false;
  509. }
  510. }//End if
  511. }//End Function
  512. function BarcodePrtRFCMFACD_103(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
  513. var vInstance = document.models(0).instances(0);
  514. var cntHR = vInstance.selectNodes(pRef).length; // 고정자산 프린트 할 전체 목록의 갯수
  515. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 바코드프린터 셋팅관련
  516. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); // 바코드프린터 종류
  517. var portOpenTF = "";
  518. // Lcount , Mcont
  519. var KCount = 0;
  520. var PCount = 0;
  521. if (pKCount == null || pKCount == ""){
  522. KCount = 0;
  523. }else{
  524. KCount = pKCount;
  525. }
  526. if (pPCount == null || pPCount == ""){
  527. PCount = 0;
  528. }else{
  529. PCount = pPCount;
  530. }
  531. if (cntHR > 0 && sPrntKind != 0){
  532. var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
  533. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
  534. var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
  535. if (sCommKind == "01") { //통신유형(PRT)
  536. var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
  537. } else if (sCommKind == "02") { //통신유형(COM)
  538. var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
  539. var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
  540. var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
  541. var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
  542. var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
  543. CommAX.CommPort = sComm;
  544. CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
  545. if(KCount > 0){
  546. //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
  547. portOpenTF = "TRUE";
  548. }else if(KCount == 0){
  549. //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
  550. portOpenTF = CommAX.PortOpen("true");
  551. }
  552. } else if (sCommKind == "03") { //통신유형(TCP/IP)
  553. var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
  554. }
  555. var DeptNm = "";
  556. if ( (portOpenTF == "TRUE" && sCommKind == "02")
  557. ||(sCommKind == "01") || (sCommKind == "03")){
  558. for (i=1 ; i<= cntHR;i++){
  559. var goodflag = model.getvalue(pRef+ "["+i+"]/goodflag" ).getTrim();
  560. var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
  561. var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
  562. var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
  563. var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
  564. var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
  565. var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
  566. var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
  567. var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
  568. var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
  569. var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
  570. var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
  571. var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
  572. var prodcmpynm = model.getvalue(pRef+ "["+i+"]/prodcmpynm" ).getTrim();
  573. var leftmargin = 220;
  574. var leftmarginother = 270;
  575. //시작 위치 설정
  576. if (sLeftBank == "" || sLeftBank == "-") sLeftBank = leftmargin; //350
  577. if (sTopBank == "" || sTopBank == "-") sTopBank = 20;
  578. var sSndMsg = "";
  579. if(sPrntKind == "1") {
  580. sSndMsg += misfBP_StartFormat(sLeftBank, sTopBank); // 시작위치 셋팅
  581. //sSndMsg += misfBP_ChangeFont("A", 0, 0); // 폰트 설정
  582. //misfBP_FieldDataHNEW(pX, pY, pW, pH, pData)
  583. //시작(X, Y)
  584. //sSndMsg += misfBP_StartFormat(0, 30);
  585. sSndMsg += "^SEE:UHANGUL.DAT^FS^CWQ,E:AAAAA.FNT^FS^CI26^FO10,46^AQN,16,16^FD^FS";
  586. //장비명
  587. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  588. if (goodflag == "EQ"){
  589. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflagengnm.substr(0,27));
  590. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflagengnm.substr(27,20));
  591. }else{
  592. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 15 , 25 , 25 , goodflaghngnm.substr(0,27));
  593. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 47 , 25 , 25 , goodflaghngnm.substr(27,20));
  594. }
  595. //모델명
  596. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 75 , 24 , 24 , "- "+goodmodel);
  597. //취득일자(일-월-년 순서로 출력)+SN
  598. //if (goodflag == "G") {
  599. // sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+mngtno); //82
  600. //}else {
  601. // sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+"_"+mngtno); //82
  602. //}
  603. sSndMsg += misfBP_FieldDataHNEW(leftmarginother, 105 , 24 , 24 , "- "+possndd.substr(6,2)+possndd.substr(4,2)+possndd.substr(2,2)+"_"+mngtno); //82
  604. //부서명(관리부서)
  605. //sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm); //100 , mngtdeptnm
  606. //부서명(관리부서)+설치장소
  607. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 140 , 24 , 24 , "- "+mngtdeptnm+"_"+installplcenm ); //100 , mngtdeptnm
  608. //if (goodflag == "E"){
  609. //제조원(장비만...)
  610. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "- "+prodcmpynm);
  611. //}else{
  612. //sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 172 , 24 , 24 , "-");
  613. //}
  614. //코드번호
  615. sSndMsg += misfBP_FieldDataHNEW(leftmarginother , 205 , 24 , 24 , "- "+fixasetcd);
  616. //바코드
  617. sSndMsg += misfBP_ChangeFont("F", 10, 10);
  618. sSndMsg += misfBP_BarCode_Code39NEW(310, 240, "N", 50, "*" +fixasetcd + "*"); // 바코드 //114
  619. //title
  620. if (instcd == '114'){
  621. sSndMsg += misfBP_FieldDataHNEW(70 , 195 , 28 , 28 , "산학협력단");
  622. }else if (instcd == '032'){
  623. sSndMsg += misfBP_FieldDataHNEW(60 , 195 , 28 , 28 , "의과학연구원");
  624. }
  625. sSndMsg += misfBP_EndFormat();
  626. if(sCommKind == "01") {
  627. CommAX.SendMessageToLPT(sSndMsg);
  628. } else if(sCommKind == "02") {
  629. CommAX.SendMessage(sSndMsg);
  630. }
  631. }//end if(sPrntKind == "1")
  632. }//end for
  633. //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
  634. if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
  635. CommAX.PortOpen("false");
  636. }
  637. }else if((portOpenTF = "FALSE" && sCommKind == "02")){
  638. messageBox("아래 사항을 확인후 재출력해주십시오."
  639. + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
  640. + " \n 2.케이블 확인"
  641. + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
  642. return false;
  643. }
  644. }//End if
  645. }//End Function
  646. function fBarElementPrt(pValue, pSndMsg, iXPos, iYPos){
  647. var aStr = "";
  648. var iWidth = 0;
  649. var aFlag = new Array();
  650. aStr = misfGetHanGul(pValue, aFlag);
  651. for (var iNo=0; iNo < aStr.length; iNo++) {
  652. if (aFlag[iNo] == "E") {
  653. pSndMsg += "^CF030,30^FO"+(Number(iXPos)+Number(iWidth))+","+ iYPos +"^FD" + aStr[iNo] + "^FS";
  654. iWidth = iWidth + (Number(aStr[iNo].length) * 14);
  655. } else {
  656. pSndMsg += CommAX.PrtImgOut((Number(iXPos)+Number(iWidth)), iYPos, aStr[iNo], 1, 1);
  657. pSndMsg += CommAX.HanImageData();
  658. iWidth = iWidth + (Number(aStr[iNo].length) * 24);
  659. }
  660. }
  661. return pSndMsg;
  662. }
  663. /*
  664. *바코드 출력 함수
  665. * psRef 바코드프린트 셋팅관련 노드셋
  666. * pRef 고정자산 프린트 관련 노드셋
  667. * cvtdate 점검일(오늘날짜)
  668. * nextcvtdate 다음점검일(현재는 일년뒤로 셋팅되어 있음)
  669. */
  670. function BarcodePrtRFCMFACD_013(psRef , pRef , cvtdate , nextcvtdate , pKCount , pPCount){
  671. var vInstance = document.models(0).instances(0);
  672. var cntHR = vInstance.selectNodes(pRef).length; //고정자산 프린트 할 전체 목록의 갯수
  673. var barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; //바코드프린터 셋팅관련
  674. var sPrntKind = model.getValue(barcdRef + "[1]/prntkind"); //바코드프린터 종류
  675. var portOpenTF = "";
  676. // Lcount , Mcont
  677. var KCount = 0;
  678. var PCount = 0;
  679. if (pKCount == null || pKCount == ""){
  680. KCount = 0;
  681. }else{
  682. KCount = pKCount;
  683. }
  684. if (pPCount == null || pPCount == ""){
  685. PCount = 0;
  686. }else{
  687. PCount = pPCount;
  688. }
  689. //
  690. if (cntHR > 0 && sPrntKind != 0){
  691. var sCommKind = model.getValue(barcdRef + "[1]/commkind"); //통신유형(PRT , COM , TCP/IP)
  692. var sLeftBank = model.getValue(barcdRef + "[1]/blank/left"); //왼쪽여백
  693. var sTopBank = model.getValue(barcdRef + "[1]/blank/top"); //위쪽여백
  694. if (sCommKind == "01") { //통신유형(PRT)
  695. var sSetUpVal = model.getValue(barcdRef + "[1]/comm01/setupval");
  696. if(KCount > 0){
  697. //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
  698. portOpenTF = "TRUE";
  699. }else if(KCount == 0){
  700. portOpenTF = CommAX.PortOpen("true");
  701. }
  702. } else if (sCommKind == "02") { //통신유형(COM)
  703. var sComm = model.getValue(barcdRef + "[1]/comm02/comm" ); //COM Port
  704. var sDataBit = model.getValue(barcdRef + "[1]/comm02/databit" ); //Data Bit
  705. var sStopBit = model.getValue(barcdRef + "[1]/comm02/stopbit" ); //Stop Bit
  706. var sBaudRate = model.getValue(barcdRef + "[1]/comm02/baudrate"); //Baud Rate
  707. var sParity = model.getValue(barcdRef + "[1]/comm02/parity" ); //Parity
  708. CommAX.CommPort = sComm;
  709. CommAX.Settings = sBaudRate + "," + sParity + "," + sDataBit + "," + sStopBit;
  710. if(KCount > 0){
  711. //이미 포트 오픈 되어 있으므로 "TRUE" 셋팅
  712. portOpenTF = "TRUE";
  713. }else if(KCount == 0){
  714. //port open 반환값 -> String 문자 포트 오픈 성공이면 "TRUE" , 실패하면 "FALSE"
  715. portOpenTF = CommAX.PortOpen("true");
  716. }
  717. } else if (sCommKind == "03") { //통신유형(TCP/IP)
  718. var sSetUpVal = model.getValue(barcdRef + "[1]/comm03/setupval");
  719. }
  720. var DeptNm = "";
  721. if ( (portOpenTF == "TRUE" && sCommKind == "02")
  722. ||(sCommKind == "01") || (sCommKind == "03")){
  723. for (i=1 ; i<= cntHR;i++){
  724. var fixasetcd = model.getvalue(pRef+ "["+i+"]/fixasetcd" ).getTrim();
  725. var goodflagengnm = model.getvalue(pRef+ "["+i+"]/goodflagengnm").getTrim();
  726. var goodmodel = model.getvalue(pRef+ "["+i+"]/goodmodel" ).getTrim();
  727. var possndd = model.getvalue(pRef+ "["+i+"]/possndd" ).getTrim();
  728. var mngtdeptnm = model.getvalue(pRef+ "["+i+"]/mngtdeptnm" ).getTrim();
  729. var mngtno = model.getvalue(pRef+ "["+i+"]/mngtno" ).getTrim();
  730. var instcd = model.getvalue(pRef+ "["+i+"]/instcd" ).getTrim();
  731. var goodflaghngnm = model.getvalue(pRef+ "["+i+"]/goodflaghngnm").getTrim();
  732. var installplcecd = model.getvalue(pRef+ "["+i+"]/installplcecd").getTrim();
  733. var installplcenm = model.getvalue(pRef+ "["+i+"]/installplcenm").getTrim();
  734. var cntrdeptnm = model.getvalue(pRef+ "["+i+"]/cntrdeptnm" ).getTrim();
  735. var suplplcenm = model.getvalue(pRef+ "["+i+"]/suplplcenm" ).getTrim();
  736. var sSndMsg = "";
  737. var iXPos = 0, iYPos = 0;
  738. if(sPrntKind == "1") {
  739. //시작(X, Y)
  740. sSndMsg += misfBP_StartFormat(0, 0); // 시작위치 셋팅
  741. iXPos = Number(sLeftBank) + 190;
  742. iYPos = Number(sTopBank) + 115;
  743. //제품명
  744. sSndMsg += fBarElementPrt(goodflagengnm, sSndMsg, iXPos, iYPos);
  745. if(sCommKind == "01") {
  746. CommAX.SendMessageToLPT(sSndMsg);
  747. sSndMsg = "";
  748. } else if(sCommKind == "02") {
  749. CommAX.SendMessage(sSndMsg);
  750. sSndMsg = "";
  751. }
  752. //Serial No.
  753. iYPos += 30;
  754. sSndMsg += fBarElementPrt("S/N:"+mngtno, sSndMsg, iXPos, iYPos);
  755. //사용부서
  756. iYPos += 60;
  757. sSndMsg += fBarElementPrt(mngtdeptnm, sSndMsg, iXPos, iYPos);
  758. if(sCommKind == "01") {
  759. CommAX.SendMessageToLPT(sSndMsg);
  760. sSndMsg = "";
  761. } else if(sCommKind == "02") {
  762. CommAX.SendMessage(sSndMsg);
  763. sSndMsg = "";
  764. }
  765. //구입일자
  766. iYPos += 50;
  767. sSndMsg += misfBP_ChangeFont("C", 18, 18); // 폰트 설정
  768. sSndMsg += misfBP_FieldDataA(iXPos, iYPos, possndd.substr(0,4)+"-"+possndd.substr(4,2)
  769. +"-"+possndd.substr(6,2));
  770. //자산코드
  771. iYPos += 50;
  772. sSndMsg += misfBP_ChangeFont("B", 17, 17); // 폰트 설정
  773. //sSndMsg += misfBP_FieldDataA(iXPos, iYPos, fixasetcd);
  774. sSndMsg += misfBP_FieldDataA(iXPos, iYPos, fixasetcd.substr(0,1)+"-"+fixasetcd.substr(1,2)
  775. +"-"+fixasetcd.substr(3,2)
  776. +"-"+fixasetcd.substr(5,fixasetcd.length-4));
  777. //자산코드(바코드 type)
  778. iXPos = 80;
  779. iYPos += 40;
  780. sSndMsg += misfBP_ChangeFont("C", 35, 35); // 폰트 설정
  781. sSndMsg += misfBP_BarCode_Code39NEW(iXPos, iYPos, "N", 70, "*" +fixasetcd + "*"); // 바코드 //114
  782. sSndMsg += misfBP_EndFormat();
  783. if(sCommKind == "01") {
  784. CommAX.SendMessageToLPT(sSndMsg);
  785. } else if(sCommKind == "02") {
  786. CommAX.SendMessage(sSndMsg);
  787. }
  788. }//end if(sPrntKind == "1")
  789. }//end for
  790. //portopen이 true이고 통신유형이 com이고 출력할 병리 바코드가 없을때 port close
  791. if( portOpenTF == "TRUE" && sCommKind == "02" && PCount == 0){
  792. CommAX.PortOpen("false");
  793. }
  794. }else if((portOpenTF = "FALSE" && sCommKind == "02")){
  795. messageBox("아래 사항을 확인후 재출력해주십시오."
  796. + " \n 1.프린트설정 화면에서 통신유형을 com 으로 선택한 경우 port 번호 확인"
  797. + " \n 2.케이블 확인"
  798. + " \n 3.먼저 출력중인 바코드 확인(모두 출력된 후 재출력하십시오.)", "I", "");
  799. return false;
  800. }
  801. }//End if
  802. }//End Function
  803. /* ------------------------------------------------- */
  804. /* ------End Of List ------------------------------- */
  805. /* -------------------------------------------------- */
  806. function fGetBrcdPrntInfo() {
  807. model.makeNode("/root/main/barcdprntsetup");
  808. model.makeNode("/root/send/scrnid");
  809. model.setValue("/root/send/scrnid", getScreenID());
  810. model.createChild("xforms:submission", "id:TRRPZ00701;mediatype:application/x-www-form-urlencoded; method:post; ref:" + "/root/send" + "; resultref:" + "/root/main/barcdprntsetup" + "; ");
  811. submit("TRRPZ00701");
  812. }
  813. // 경북대 병원 버전
  814. function fBarcodePrtKnu() {
  815. misfGridInit(grd_cpfixasetlist); // 고정자산 (바코드)List
  816. var instcd = model.getValue(cmb_instcd_search.attribute("ref"));
  817. var goodnm, mngtdeptnm, installplcenm;
  818. var cnt = 0;
  819. var node = instance1.selectSingleNode("/root/main/list/fixaset/fixasetlist[choice='Y']");
  820. if (node == null){
  821. messageBox("선택할 데이터가","I004");
  822. return false;
  823. }
  824. for (var i = grd_fixasetlist.fixedRows;i<grd_fixasetlist.rows;i++){
  825. var chk = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("choice")).getTrim();
  826. var goodflag = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflag")).getTrim();
  827. if (chk == "Y"){
  828. // [2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= E) => (goodflag= EQ)
  829. if (goodflag == "EQ"){
  830. goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflagengnm")).getTrim();
  831. }else{
  832. goodnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodflaghngnm")).getTrim();
  833. }
  834. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1")) = goodnm;
  835. mngtdeptnm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("mngtdeptnm")).getTrim();
  836. installplcenm = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("installplcenm")).getTrim();
  837. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1")) = mngtdeptnm;
  838. grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm2")) = installplcenm;
  839. grd_cpfixasetlist.addRow();
  840. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("fixasetcd")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("fixasetcd"));
  841. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("possndd" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("possndd" ));
  842. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodnm1" ));
  843. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("goodspec" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("goodspec" ));
  844. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("deptnm1" )) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("deptnm1" ));
  845. grd_cpfixasetlist.valueMatrix(grd_cpfixasetlist.row, grd_cpfixasetlist.colRef("suplplcenm")) = grd_fixasetlist.valueMatrix(i, grd_fixasetlist.colRef("suplplcenm"));
  846. }
  847. }
  848. exeReportPreview("RPRFC00702","XMLSTR");
  849. }
  850. /* ------------------------------------------------- */
  851. /* ------End Of List ------------------------------- */
  852. /* -------------------------------------------------- */