SMMRF04800.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 서식 수가 매핑 관리 ( SMMRF04800_서식수가매핑관리.xrw )
  4. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  5. */
  6. var g_grdEditrow = "";
  7. var gf_grdEditrow = "";
  8. /**
  9. * @desc : 줄 추가
  10. * @id :
  11. * @event : xforms-select
  12. * @return : void
  13. * @authur :
  14. */
  15. function fAddGridRow_back(pGrid)
  16. {
  17. var sGridID = document.controls(pGrid);
  18. var ref = sGridID.attribute("nodeset");
  19. g_grdEditrow = sGridID.rows;
  20. if(g_grdEditrow >= "2") {
  21. sGridID.addRow();
  22. //sGridID.isselected(g_grdEditrow) = true;
  23. g_grdEditrow = sGridID.rows;
  24. sGridID.topRow = g_grdEditrow;
  25. // 업무용도 세팅
  26. //var bizflag = model.getValue("/root/send/reqdata/bizflag");
  27. //model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/bizflag", bizflag);
  28. var fstrgstdt = getCurrentDate();
  29. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/fstrgstdt", fstrgstdt);
  30. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/status", "1");
  31. // 수가구분
  32. //model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (g_grdEditrow-2) + "]/calcscorflag", "O");
  33. model.refresh();
  34. }
  35. }
  36. /**
  37. * @desc : 줄 삭제
  38. * @id :
  39. * @event : xforms-select
  40. * @return : void
  41. * @authur :
  42. */
  43. //function fDelGridRow(pGrid)
  44. function fDelGridRow_back()
  45. {
  46. //var sGridID = document.controls(pGrid);
  47. //var ref = sGridID.attribute("nodeset");
  48. //var iRow = sGridID.row;
  49. //if(iRow < 1) return;
  50. //var iStatus = sGridID.rowStatus(iRow);
  51. //for (var i = 1; i < sGridID.selectedRows; i++){
  52. //if(iStatus == 1 || iStatus == 3){
  53. //sGridID.deleteRow(iRow);
  54. //}else{
  55. //sGridID.rowStatus(iRow) = 4;
  56. //}
  57. var arrRows = new Array();
  58. for(var i = 0; i < grd_ocrmechlist.selectedRows; i++)
  59. {
  60. arrRows[i] = grd_ocrmechlist.selectedRow(i);
  61. }
  62. for(var j = arrRows.length - 1; j >= 0; j--)
  63. {
  64. //grd_ocrmechlist.deleteRow(arrRows[j]);
  65. alert(arrRows[j]);
  66. grd_ocrmechlist.rowStatus(arrRows[j]) = 4;
  67. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + j + "]/status", "4");
  68. alert(model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + j + "]/status"));
  69. }
  70. //}
  71. g_grdEditrow = "";
  72. model.refresh();
  73. }
  74. function fAddRow(flag) {
  75. var iRow = 0;
  76. var currentTime = getCurrentTime();
  77. var fstrgstdt = getCurrentDate();
  78. if(flag == "I") {
  79. grd_ocrmechlist.addItem();
  80. iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
  81. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/status", "1");
  82. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/fstrgstdt", fstrgstdt);
  83. } else if(flag == "D") {
  84. grd_ocrmechlist.addItem();
  85. iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
  86. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/status", "I" );
  87. }
  88. //var colNum = grd_ocrmechlist.colRef("graph");
  89. grd_ocrmechlist.cellstyle("background-image", grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 2, 0) = "../../../com/commonweb/images/icon_i.gif"
  90. grd_ocrmechlist.cellstyle("background-position", grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 2, 0) = "center center"
  91. }
  92. function fDelRow(flag) {
  93. var iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
  94. var currentTime = getCurrentTime();
  95. if(model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/calcscorcd") == ""){
  96. return;
  97. }
  98. if(flag == "I") {
  99. iRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
  100. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + iRow + "]/status", "4");
  101. grd_ocrmechlist.cellstyle("background-image", iRow+1, 0) = "../../../com/commonweb/images/icon_d.gif"
  102. grd_ocrmechlist.cellstyle("background-position", iRow+1, 0) = "center center"
  103. }
  104. model.refresh();
  105. }
  106. // 동의서 코드찾기 Popup
  107. function fCodePopUp(pFlag)
  108. {
  109. //var gridObj = window.document.controls("grd_ocrmechlist");
  110. //var CurrentRow = gridObj.attribute("row");
  111. var CurrentRow = grd_ocrmechlist.row - grd_ocrmechlist.fixedRows + 1;
  112. //if( CurrentRow == (g_grdEditrow-1) )
  113. var chk = model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/status");
  114. //수정되기 전 데이터.
  115. var preFormcd = model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/formcd");
  116. //수정되기 전 데이터를 저장하기 위한 Element생성
  117. var selNode = instance1.selectSingleNode("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]");
  118. var preFormcdNode = instance1.createElement("preformcd");
  119. //수정되기전 데이터 맵핑.
  120. model.setValue(preFormcdNode, preFormcd);
  121. var preFormcdIndex = instance1.selectSingleNode("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/preformcd");
  122. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  123. var preCalcscorcd = model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/calcscorcd");
  124. var preCalcscorcdNode = instance1.createElement("precalcscorcd");
  125. model.setValue(preCalcscorcdNode, preCalcscorcd);
  126. var preCalcscorcdIndex = instance1.selectSingleNode("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/precalcscorcd");
  127. //한번만 append 실행.
  128. if(preCalcscorcdIndex == null) {
  129. selNode.appendChild(preCalcscorcdNode);
  130. }
  131. // KNUH_20101020_박성호_end
  132. //한번만 append 실행.
  133. if(preFormcdIndex == null) {
  134. selNode.appendChild(preFormcdNode);
  135. }
  136. if(pFlag == "1" && chk == "1" || pFlag == "1" && chk == "")
  137. {
  138. //modal("../../../pam/calcscormngtweb/xrw/SMPIC00200", 1,10, 10, "SMPIC00200", "/root/send", "/root/main");
  139. model.removeNode("/root/temp/mech");
  140. modal("SMPIC00200", 1,10, 10, "SMPIC00200", "", "/root/temp/mech");
  141. var hngnm = model.getValue("/root/temp/mech/hngnm");
  142. var calcscorcd = model.getValue("root/temp/mech/calcscorcd");
  143. var fromdd = model.getValue("root/temp/mech/fromdd");
  144. var todd = model.getValue("root/temp/mech/todd");
  145. //Popup에서 선택하지 않고 닫았을 경우 기존 데이터 보존.
  146. if(calcscorcd == "") {
  147. return;
  148. }
  149. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/hngnm",hngnm);
  150. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/calcscorcd",calcscorcd);
  151. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/fromdd",fromdd);
  152. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/todd",todd);
  153. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/status", "1");
  154. grd_ocrmechlist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_i.gif"
  155. grd_ocrmechlist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
  156. }else if(pFlag == "2"){
  157. setParameter("srch_cond", "OCR:Y");
  158. //modal("SPMRF03600", 1,10, 10, "SPMRF03600", "", "/root/main/formlist");
  159. modal("SPMRF03600", 1,10, 10);
  160. var formnm = getParameter("formnm");
  161. var formcd = getParameter("formcd");
  162. //Popup에서 선택하지 않고 닫았을 경우 기존 데이터 보존.
  163. if(formcd == "") {
  164. return;
  165. }
  166. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/formnm",formnm);
  167. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (grd_ocrmechlist.row-1) + "]/formcd",formcd);
  168. if(chk == "") { //INSERT
  169. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/status", "1");
  170. grd_ocrmechlist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_i.gif"
  171. grd_ocrmechlist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
  172. } else if(chk == "0" || chk == "2") { //UPDATE
  173. model.setValue("/root/main/ocrmechlist/ocrmechlistinfo[" + CurrentRow + "]/status", "2");
  174. grd_ocrmechlist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_u.gif"
  175. grd_ocrmechlist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
  176. }
  177. }
  178. model.refresh();
  179. }
  180. // 제증명 코드찾기 Popup
  181. function fPROFCodePopUp(pFlag)
  182. {
  183. var gridObj = window.document.controls("grd_mechlist");
  184. var CurrentRow = gridObj.attribute("row");
  185. var gridrowcnt = document.controls("grd_mechlist");
  186. gf_grdEditrow = gridrowcnt.rows;
  187. //마지막 Row의 서식이름 가져오기 (마지막 Row가 Insert인지 Update인지 확인하기 위한 것)
  188. var endCell = model.getValue("/root/main/mechlist/mechlistinfo[" + (gf_grdEditrow-1) + "]/formnm");
  189. //수정되기 전 데이터
  190. var preFormcd = model.getValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formcd");
  191. //수정되기 전 데이터를 저장하기 위한 Element생성
  192. var selNode = instance1.selectSingleNode("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]");
  193. var preFormcdNode = instance1.createElement("preformcd");
  194. //수정되기전 데이터 맵핑.
  195. model.setValue(preFormcdNode, preFormcd);
  196. var preFormcdIndex = instance1.selectSingleNode("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/preformcd");
  197. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  198. var preCalcscorcd = model.getValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/calcscorcd");
  199. var preCalcscorcdNode = instance1.createElement("precalcscorcd");
  200. model.setValue(preCalcscorcdNode, preCalcscorcd);
  201. var preCalcscorcdIndex = instance1.selectSingleNode("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/precalcscorcd");
  202. //한번만 append 실행.
  203. if(preCalcscorcdIndex == null) {
  204. selNode.appendChild(preCalcscorcdNode);
  205. }
  206. // KNUH_20101020_박성호_end
  207. //한번만 append 실행.
  208. if(preFormcdIndex == null) {
  209. selNode.appendChild(preFormcdNode);
  210. }
  211. if( CurrentRow == (gf_grdEditrow-1) && endCell == "")
  212. {
  213. if(pFlag == "1")
  214. {
  215. //modal("../../../pam/calcscormngtweb/xrw/SMPIC00200", 1,10, 10, "SMPIC00200", "/root/send", "/root/main");
  216. model.removeNode("/root/temp/mech");
  217. modal("SMPIC00200", 1,10, 10, "SMPIC00200", "", "/root/temp/mech");
  218. var hngnm = model.getValue("/root/temp/mech/hngnm");
  219. var calcscorcd = model.getValue("root/temp/mech/calcscorcd");
  220. if(calcscorcd == "") {
  221. return;
  222. } else {
  223. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/hngnm",hngnm);
  224. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/calcscorcd",calcscorcd);
  225. }
  226. } else if(pFlag == "2"){
  227. setParameter("srch_cond", "OCR:Y");
  228. //modal("SPMRF03600", 1,10, 10, "SPMRF03600", "", "/root/main/formlist");
  229. modal("SPMRF03600", 1,10, 10);
  230. var formnm = getParameter("formnm");
  231. var formcd = getParameter("formcd");
  232. if(formcd == "") {
  233. return;
  234. } else {
  235. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formnm",formnm);
  236. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formcd",formcd);
  237. }
  238. }
  239. var iRow = grd_mechlist.row;
  240. grd_mechlist.rowStatus(iRow) = 1;
  241. } else {
  242. if(pFlag == "2"){
  243. setParameter("srch_cond", "OCR:Y");
  244. //modal("SPMRF03600", 1,10, 10, "SPMRF03600", "", "/root/main/formlist");
  245. modal("SPMRF03600", 1,10, 10);
  246. var formnm = getParameter("formnm");
  247. var formcd = getParameter("formcd");
  248. if(formcd == "") {
  249. return;
  250. } else {
  251. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formnm",formnm);
  252. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/formcd",formcd);
  253. var iRow = grd_mechlist.row;
  254. grd_mechlist.rowStatus(iRow) = 2;
  255. }
  256. }
  257. // KNUH_20101019_박성호_start 수가 수정 가능하도록 수정
  258. else if (pFlag == "1")
  259. {
  260. //modal("../../../pam/calcscormngtweb/xrw/SMPIC00200", 1,10, 10, "SMPIC00200", "/root/send", "/root/main");
  261. model.removeNode("/root/temp/mech");
  262. modal("SMPIC00200", 1,10, 10, "SMPIC00200", "", "/root/temp/mech");
  263. var hngnm = model.getValue("/root/temp/mech/hngnm");
  264. var calcscorcd = model.getValue("root/temp/mech/calcscorcd");
  265. if(calcscorcd == "") {
  266. return;
  267. } else {
  268. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/hngnm",hngnm);
  269. model.setValue("/root/main/mechlist/mechlistinfo[" + grd_mechlist.row + "]/calcscorcd",calcscorcd);
  270. var iRow = grd_mechlist.row;
  271. grd_mechlist.rowStatus(iRow) = 2;
  272. }
  273. }
  274. // KNUH_20101019_박성호_end
  275. model.refresh();
  276. }
  277. }
  278. function fSaveComn_back()
  279. {
  280. var ref = "/root/main/ocrmechlist/ocrmechlistinfo";
  281. var ref2 = "/root/send/savedata";
  282. var gridObj = grd_ocrmechlist;
  283. var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▩";
  284. var dataString = "";
  285. for ( var i = 1; i < gridObj.rows; i++){
  286. if (gridObj.rowStatus(i) != 0) {
  287. var instcd = model.getValue(ref + "[" + i + "]/instcd");
  288. var calcscorcd = model.getValue(ref + "[" + i + "]/calcscorcd");
  289. var formcd = model.getValue(ref + "[" + i + "]/formcd");
  290. var calcscorflag = model.getValue(ref + "[" + i + "]/calcscorflag");
  291. var bizflag = model.getValue(ref + "[" + i + "]/bizflag");
  292. var detcalcscorflag = model.getValue(ref + "[" + i + "]/detcalcscorflag");
  293. if ((calcscorcd != "") && (formcd != "")){
  294. if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
  295. model.makeValue(ref2 + "[" + i + "]/status", "i");
  296. model.makeValue(ref2 + "[" + i + "]/instcd", instcd);
  297. model.makeValue(ref2 + "[" + i + "]/calcscorcd", calcscorcd);
  298. model.makeValue(ref2 + "[" + i + "]/formcd", formcd);
  299. model.makeValue(ref2 + "[" + i + "]/calcscorflag", calcscorflag);
  300. model.makeValue(ref2 + "[" + i + "]/bizflag", bizflag);
  301. model.makeValue(ref2 + "[" + i + "]/detcalcscorflag", detcalcscorflag);
  302. }
  303. if (gridObj.rowStatus(i) == 4) {
  304. model.makeValue(ref2 + "[" + i + "]/status", "d");
  305. model.makeValue(ref2 + "[" + i + "]/instcd", instcd);
  306. model.makeValue(ref2 + "[" + i + "]/calcscorcd", calcscorcd);
  307. model.makeValue(ref2 + "[" + i + "]/formcd", formcd);
  308. model.makeValue(ref2 + "[" + i + "]/calcscorflag", calcscorflag);
  309. model.makeValue(ref2 + "[" + i + "]/bizflag", bizflag);
  310. model.makeValue(ref2 + "[" + i + "]/detcalcscorflag", detcalcscorflag);
  311. }
  312. }
  313. }
  314. }
  315. if(calcscorcd == ""){
  316. messageBox("수가코드를 ", "C001");
  317. return;
  318. }
  319. if(formcd == ""){
  320. messageBox("서식코드를 ", "C001");
  321. return;
  322. }
  323. if (calcscorcd.length > 0){
  324. model.removenode("/root/send/savedata");
  325. model.makeValue("/root/send/savedata", savedata + dataString);
  326. model.refresh();
  327. submit("TXMRF04801");
  328. }
  329. }
  330. function fSaveComn()
  331. {
  332. var ref = "/root/main/ocrmechlist/ocrmechlistinfo";
  333. var gridObj = grd_ocrmechlist;
  334. var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▩";
  335. var dataString = "";
  336. for ( var i = 1; i < gridObj.rows; i++){
  337. //if (gridObj.rowStatus(i) != 0) {
  338. if (gridObj.rowStatus(i) != 0) {
  339. var instcd = model.getValue(ref + "[" + (i-1) + "]/instcd");
  340. var calcscorcd = model.getValue(ref + "[" + (i-1) + "]/calcscorcd");
  341. var formcd = model.getValue(ref + "[" + (i-1) + "]/formcd");
  342. var calcscorflag = model.getValue(ref + "[" + (i-1) + "]/calcscorflag");
  343. var bizflag = model.getValue(ref + "[" + (i-1) + "]/bizflag");
  344. var detcalcscorflag = model.getValue(ref + "[" + (i-1) + "]/detcalcscorflag");
  345. if ((calcscorcd != "") && (formcd != "")){
  346. if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
  347. dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
  348. }
  349. if (gridObj.rowStatus(i) == 4) {
  350. dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
  351. }
  352. }
  353. }
  354. }
  355. if (calcscorcd.length > 0){
  356. model.removenode("/root/send/savedata");
  357. model.makeValue("/root/send/savedata", savedata + dataString);
  358. model.refresh();
  359. submit("TXMRF04801");
  360. }
  361. }
  362. function fOCRSave(){
  363. var ref = "/root/main/ocrmechlist/ocrmechlistinfo";
  364. var RowCnt = grd_ocrmechlist.rows;
  365. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  366. //var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▩";
  367. var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▦precalcscorcd▩";
  368. // KNUH_20101020_박성호_end
  369. var dataString = "";
  370. for ( i=1; i<=RowCnt; i++) {
  371. if(model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status") == "1" ||
  372. model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status") == "4" ||
  373. model.getValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status") == "2") {
  374. var flag = model.getValue(ref + "[" + i + "]/status");
  375. var instcd = model.getValue(ref + "[" + i + "]/instcd");
  376. var calcscorcd = model.getValue(ref + "[" + i + "]/calcscorcd");
  377. var formcd = model.getValue(ref + "[" + i + "]/formcd");
  378. var calcscorflag = model.getValue(ref + "[" + i + "]/calcscorflag");
  379. var bizflag = model.getValue(ref + "[" + i + "]/bizflag");
  380. var detcalcscorflag = model.getValue(ref + "[" + i + "]/detcalcscorflag");
  381. var precalcscorcd = model.getValue(ref + "[" + i + "]/precalcscorcd");
  382. var preformcd = model.getValue(ref + "[" + i + "]/preformcd");
  383. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  384. var precalcscorcd = model.getValue(ref + "[" + i + "]/precalcscorcd");
  385. // KNUH_20101020_박성호_end
  386. if ((calcscorcd != "") && (formcd != "")){
  387. //if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
  388. if (flag == 1 || flag == 3) {
  389. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  390. //dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
  391. dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
  392. // KNUH_20101020_박성호_end
  393. }
  394. //if (gridObj.rowStatus(i) == 4) {
  395. if (flag == 4) {
  396. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  397. //dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
  398. dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
  399. // KNUH_20101020_박성호_end
  400. }
  401. if (flag == 2) {
  402. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  403. //dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
  404. dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
  405. // KNUH_20101020_박성호_end
  406. }
  407. }
  408. grd_ocrmechlist.cellstyle("background-image", i+1, 0) = "../../../com/commonweb/images/grid_bg.gif"
  409. }
  410. }
  411. model.removenode("/root/send/savedata");
  412. model.makeValue("/root/send/savedata", savedata + dataString);
  413. submit("TXMRF04801");
  414. // KNUH_20101101_박성호_start 오류 수정(저장후 그리드 행 추가 버튼시 에러)
  415. //for(var i = 1 ; i <= grd_ocrmechlist.rows ; i++) {
  416. // model.makeValue("/root/main/ocrmechlist/ocrmechlistinfo[" + i + "]/status", 0);
  417. //}
  418. for(var i = 3 ; i <= grd_ocrmechlist.rows ; i++) {
  419. model.makeValue("/root/main/ocrmechlist/ocrmechlistinfo[" + (i-2) + "]/status", 0);
  420. }
  421. // KNUH_20101020_박성호_end
  422. }
  423. function fSavePrnt()
  424. {
  425. var ref = "/root/main/prntmechlist/prntmechlistinfo";
  426. var gridObj = grd_prntmechlist;
  427. var savedata = "status▦prntcnt▦formcd▦formfromdt▦formtodt▦deptcd▩";
  428. var dataString = "";
  429. for ( var i = 1; i < gridObj.rows; i++)
  430. {
  431. //if (gridObj.rowStatus(i) != 0) {
  432. if(model.getValue("/root/main/prntmechlist/prntmechlistinfo[" + i + "]/status") == "U"){
  433. var instcd = model.getValue(ref + "[" + i + "]/instcd");
  434. var formcd = model.getValue(ref + "[" + i + "]/formcd");
  435. var formfromdt = model.getValue(ref + "[" + i + "]/formfromdt");
  436. var formtodt = model.getValue(ref + "[" + i + "]/formtodt");
  437. var deptcd = model.getValue(ref + "[" + i + "]/deptcd");
  438. //if (gridObj.rowStatus(i) == 2){
  439. var prntcnt = model.getValue(ref + "[" + i + "]/prntcnt");
  440. dataString = dataString + "u▦" + prntcnt + "▦" + formcd + "▦" + formfromdt + "▦" + formtodt + "▦" + deptcd + "▩";
  441. //}
  442. }
  443. }
  444. if (formcd.length > 0){
  445. model.removenode("/root/send/savedata");
  446. model.makeValue("/root/send/savedata", savedata + dataString);
  447. model.refresh();
  448. submit("TXMRF04803");
  449. }
  450. submit("TRMRF04803");
  451. model.refresh();
  452. }
  453. // 진정동의서 팝업
  454. function fJinJeongPopUp(pFlag)
  455. {
  456. var CurrentRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
  457. var chk = model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (grd_jinjeonglist.row-1) + "]/status");
  458. //수정되기 전 데이터.
  459. var preFormcd = model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/formcd");
  460. //수정되기 전 데이터를 저장하기 위한 Element생성
  461. var selNode = instance1.selectSingleNode("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]");
  462. var preFormcdNode = instance1.createElement("preformcd");
  463. //수정되기전 데이터 맵핑.
  464. model.setValue(preFormcdNode, preFormcd);
  465. var preFormcdIndex = instance1.selectSingleNode("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/preformcd");
  466. var preCalcscorcd = model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/calcscorcd");
  467. var preCalcscorcdNode = instance1.createElement("precalcscorcd");
  468. model.setValue(preCalcscorcdNode, preCalcscorcd);
  469. var preCalcscorcdIndex = instance1.selectSingleNode("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/precalcscorcd");
  470. //한번만 append 실행.
  471. if(preCalcscorcdIndex == null) {
  472. selNode.appendChild(preCalcscorcdNode);
  473. }
  474. // KNUH_20101020_박성호_end
  475. //한번만 append 실행.
  476. if(preFormcdIndex == null) {
  477. selNode.appendChild(preFormcdNode);
  478. }
  479. if(pFlag == "2"){
  480. setParameter("srch_cond", "JINJEONG:Y");
  481. modal("SPMRF03600", 1,10, 10);
  482. var formnm = getParameter("formnm");
  483. var formcd = getParameter("formcd");
  484. //Popup에서 선택하지 않고 닫았을 경우 기존 데이터 보존.
  485. if(formcd == "") {
  486. return;
  487. }
  488. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (grd_jinjeonglist.row-1) + "]/formnm",formnm);
  489. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (grd_jinjeonglist.row-1) + "]/formcd",formcd);
  490. if(chk == "") { //INSERT
  491. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/status", "1");
  492. grd_jinjeonglist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_i.gif"
  493. grd_jinjeonglist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
  494. } else if(chk == "0" || chk == "2") { //UPDATE
  495. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + CurrentRow + "]/status", "2");
  496. grd_jinjeonglist.cellstyle("background-image", CurrentRow+1, 0) = "../../../com/commonweb/images/icon_u.gif"
  497. grd_jinjeonglist.cellstyle("background-position", CurrentRow+1, 0) = "center center"
  498. }
  499. }
  500. model.refresh();
  501. }
  502. //진정동의서 한줄 추가
  503. function fAddRow_JinJeong(flag) {
  504. var iRow = 0;
  505. if(flag == "I") {
  506. grd_jinjeonglist.addItem();
  507. iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
  508. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/status", "1");
  509. } else if(flag == "D") {
  510. grd_jinjeonglist.addItem();
  511. iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
  512. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/status", "I" );
  513. }
  514. //var colNum = grd_jinjeonglist.colRef("graph");
  515. grd_jinjeonglist.cellstyle("background-image", grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 2, 0) = "../../../com/commonweb/images/icon_i.gif"
  516. grd_jinjeonglist.cellstyle("background-position", grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 2, 0) = "center center"
  517. }
  518. //진정동의서 한줄 삭제
  519. function fDelRow_JinJeong(flag) {
  520. var iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
  521. if(model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/formcd") == ""){
  522. return;
  523. }
  524. if(flag == "I") {
  525. iRow = grd_jinjeonglist.row - grd_jinjeonglist.fixedRows + 1;
  526. model.setValue("/root/main/jinjeonglist/jinjeonglistinfo[" + iRow + "]/status", "4");
  527. grd_jinjeonglist.cellstyle("background-image", iRow+1, 0) = "../../../com/commonweb/images/icon_d.gif"
  528. grd_jinjeonglist.cellstyle("background-position", iRow+1, 0) = "center center"
  529. }
  530. model.refresh();
  531. }
  532. //진정동의서 저장
  533. function fJinJeongSave(){
  534. var ref = "/root/main/jinjeonglist/jinjeonglistinfo";
  535. var RowCnt = grd_jinjeonglist.rows;
  536. var savedata = "status▦formcd▦preformcd▩";
  537. var dataString = "";
  538. for ( i=1; i<=RowCnt; i++) {
  539. if(model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + i + "]/status") == "1" ||
  540. model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + i + "]/status") == "4" ||
  541. model.getValue("/root/main/jinjeonglist/jinjeonglistinfo[" + i + "]/status") == "2") {
  542. var flag = model.getValue(ref + "[" + (i) + "]/status");
  543. var instcd = model.getValue(ref + "[" + (i) + "]/instcd");
  544. var formcd = model.getValue(ref + "[" + (i) + "]/formcd");
  545. var preformcd = model.getValue(ref + "[" + (i) + "]/preformcd");
  546. if (formcd != ""){
  547. if (flag == 1 || flag == 3) { //인서트
  548. dataString = dataString + "i▦" + formcd + "▩";
  549. }
  550. if (flag == 4) { //삭제
  551. dataString = dataString + "d▦" + formcd + "▩";
  552. }
  553. if (flag == 2) { //갱신
  554. dataString = dataString + "u▦" + formcd + "▦" + preformcd + "▩";
  555. }
  556. }
  557. grd_jinjeonglist.cellstyle("background-image", i+1, 0) = "../../../com/commonweb/images/grid_bg.gif"
  558. }
  559. }
  560. model.removenode("/root/send/savedata");
  561. model.makeValue("/root/send/savedata", savedata + dataString);
  562. model.refresh();
  563. submit("TXMRF04804");
  564. for(var i = 3 ; i <= grd_jinjeonglist.rows ; i++) {
  565. model.makeValue("/root/main/jinjeonglist/jinjeonglistinfo[" + (i-2) + "]/status", 0);
  566. }
  567. }
  568. function fSavePROF()
  569. {
  570. var ref = "/root/main/mechlist/mechlistinfo";
  571. var gridObj = grd_mechlist;
  572. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  573. //var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▩";
  574. var savedata = "status▦calcscorcd▦formcd▦calcscorflag▦bizflag▦detcalcscorflag▦preformcd▦precalcscorcd▩";
  575. // KNUH_20101020_박성호_end
  576. var dataString = "";
  577. for ( var i = 1; i < gridObj.rows; i++){
  578. if (gridObj.rowStatus(i) != 0) {
  579. var instcd = model.getValue(ref + "[" + i + "]/instcd");
  580. var calcscorcd = model.getValue(ref + "[" + i + "]/calcscorcd");
  581. var formcd = model.getValue(ref + "[" + i + "]/formcd");
  582. var calcscorflag = model.getValue(ref + "[" + i + "]/calcscorflag");
  583. var bizflag = model.getValue(ref + "[" + i + "]/bizflag");
  584. var detcalcscorflag = model.getValue(ref + "[" + i + "]/detcalcscorflag");
  585. var preformcd = model.getValue(ref + "[" + i + "]/preformcd");
  586. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  587. var precalcscorcd = model.getValue(ref + "[" + i + "]/precalcscorcd");
  588. // KNUH_20101020_박성호_end
  589. if ((calcscorcd != "") && (formcd != "")){
  590. if (gridObj.rowStatus(i) == 1 || gridObj.rowStatus(i) == 3) {
  591. dataString = dataString + "i▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
  592. }
  593. if (gridObj.rowStatus(i) == 4) {
  594. dataString = dataString + "d▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▩";
  595. }
  596. if(gridObj.rowStatus(i) == 2) {
  597. // KNUH_20101020_박성호_start 수가 수정 가능하도록 수정
  598. //dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▩";
  599. dataString = dataString + "u▦" + calcscorcd + "▦" + formcd + "▦" + calcscorflag + "▦" + bizflag + "▦" + detcalcscorflag + "▦" + preformcd + "▦" + precalcscorcd + "▩";
  600. // KNUH_20101020_박성호_end
  601. }
  602. }
  603. }
  604. }
  605. if (calcscorcd.length > 0){
  606. model.removenode("/root/send/savedata");
  607. model.makeValue("/root/send/savedata", savedata + dataString);
  608. model.refresh();
  609. submit("TXMRF04802");
  610. }
  611. }
  612. // 제증명 수가를 엑셀로 저장
  613. function excel_save(){
  614. var fileName = window.fileDialog("save", "|", true, "", "", "Excel Files(*.xls)|*.xls");
  615. if (fileName != ""){
  616. grd_mechlist.saveExcel(fileName, "SheetName", false, false, "", "", false);
  617. }
  618. }