SMMNV99998.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. /* ---------------------------------------------------------------------
  2. 입간판 전문의 진료일정수정
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By dhkim
  6. : 2009.09.16
  7. ----------------------------------------------------------------------*/
  8. var grdPath = "/root/main/signboardinfo/signboardinfolist";
  9. /**
  10. * @group :
  11. * @ver : 2009.09.16
  12. * @by : dhkim
  13. * @---------------------------------------------------
  14. * @type : function
  15. * @access : public
  16. * @desc : 화면초기화
  17. * @param :
  18. * @param :
  19. * @return :
  20. * @---------------------------------------------------
  21. */
  22. function fInitialize(){
  23. //센터인지 일반진료과인지 조회
  24. //입간판타이틀 조회
  25. if(!submit('TRMNV99901')){
  26. messageBox('문제가 발생하여 타이틀조회를 실패하였습니다.', 'E');
  27. return false;
  28. }
  29. }
  30. /**
  31. * @group :
  32. * @ver : 2009.09.16
  33. * @by : dhkim
  34. * @---------------------------------------------------
  35. * @type : function
  36. * @access : public
  37. * @desc : 진료일정조회
  38. * @param :
  39. * @param :
  40. * @return :
  41. * @---------------------------------------------------
  42. */
  43. var ip;
  44. function fSearch(){
  45. ip = model.getValue('/root/cond/ipaddr');
  46. if(ip == null || ip == ''){
  47. messageBox('조회할 진료일정을 선택하세요.', 'E');
  48. return;
  49. }
  50. model.removenode('/root/send');
  51. model.makeValue('/root/send/ipaddr', ip);
  52. model.removenode('/root/main/signboardinfo');
  53. model.makeNode('/root/main/signboardinfo');
  54. //진료일정조회
  55. if(!submit('TRMNV99902')){
  56. messageBox('문제가 발생하여 진료일정조회를 실패하였습니다.', 'E');
  57. return false;
  58. }else{
  59. //선택진료 색 변경
  60. for(var i = 1; i <= grd_scheinfo.rows;i++){
  61. if(model.getValue(grdPath+"["+i+"]/choyn") == "Y"){
  62. grd_scheinfo.cellstyle("background-color", i, 0, i, 14) = '#ccffff';//선택진료
  63. }else{
  64. grd_scheinfo.cellstyle("background-color", i, 0, i, 14) = '#ffffff';
  65. }
  66. }
  67. }
  68. model.refresh();
  69. }
  70. /**
  71. * @group :
  72. * @ver : 2009.09.18
  73. * @by : dhkim
  74. * @---------------------------------------------------
  75. * @type : function
  76. * @access : public
  77. * @desc : 진료일정추가
  78. * @param :
  79. * @param :
  80. * @return :
  81. * @---------------------------------------------------
  82. */
  83. function fAdd(){
  84. grd_scheinfo.addRow();
  85. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/stat", 'i');//-:조회, i:신규, u:수정, d:삭제
  86. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/bgclr", '#FFFFFF');//기본배경색
  87. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/ftface", '굴림체');//기본글씨체
  88. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_supdeptnm", '10');//기본글씨크기
  89. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_fieldnm", '10');//기본글씨크기
  90. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_subdeptnm", '10');//기본글씨크기
  91. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_drnm", '10');//기본글씨크기
  92. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_amsche", '10');//기본글씨크기
  93. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_pmsche", '10');//기본글씨크기
  94. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fs_spclmednm", '10');//기본글씨크기
  95. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/choyn", 'N');//기본선택진료여부
  96. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/ipaddr", ip);
  97. //윗행의 과명, 세부분야, 진료과를 기본 세팅
  98. if(grd_scheinfo.row > 1){
  99. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/supdeptnm", model.getValue(grdPath +"["+(grd_scheinfo.row-1)+"]/supdeptnm"));
  100. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/fieldnm", model.getValue(grdPath +"["+(grd_scheinfo.row-1)+"]/fieldnm"));
  101. model.setValue(grdPath + "[" + grd_scheinfo.row + "]/subdeptnm", model.getValue(grdPath +"["+(grd_scheinfo.row-1)+"]/subdeptnm"));
  102. }
  103. grd_scheinfo.addStatus(grd_scheinfo.row, 'insert');
  104. model.refresh();
  105. }
  106. /**
  107. * @group :
  108. * @ver : 2010.03.26
  109. * @by : dhkim
  110. * @---------------------------------------------------
  111. * @type : function
  112. * @access : public
  113. * @desc : 진료일정삽입
  114. * @param :
  115. * @param :
  116. * @return :
  117. * @---------------------------------------------------
  118. */
  119. function fInsert(){
  120. var curRow = grd_scheinfo.row;
  121. if(curRow < 0){
  122. messageBox("삽입할 행을 선택하세요.", "E");
  123. return;
  124. }else{
  125. grd_scheinfo.insertRow(curRow);
  126. model.setValue(grdPath+"[" + curRow + "]/stat", 'i');//-:조회, i:신규, u:수정, d:삭제
  127. grd_scheinfo.addStatus(curRow, 'insert');
  128. }
  129. model.refresh();
  130. grd_scheinfo.refresh();
  131. }
  132. /**
  133. * @group :
  134. * @ver : 2009.09.18
  135. * @by : dhkim
  136. * @---------------------------------------------------
  137. * @type : function
  138. * @access : public
  139. * @desc : 진료일정삭제
  140. * @param :
  141. * @param :
  142. * @return :
  143. * @---------------------------------------------------
  144. */
  145. function fDelete(){
  146. //저장되어있는 행이면 D로 표시, 신규행이면 바로삭제
  147. var curRow = grd_scheinfo.row;
  148. if(curRow < 0){
  149. messageBox("삭제할 행을 선택하세요.", "E");
  150. return;
  151. }else{
  152. grd_scheinfo.deleteRow(curRow);
  153. /*
  154. var state = model.getValue(grdPath+"[" + curRow + "]/stat");
  155. if(state == "i"){
  156. grd_scheinfo.deleteRow(curRow);
  157. }else{
  158. model.setValue(grdPath+"[" + curRow + "]/stat", 'd');//-:조회, i:신규, u:수정, d:삭제
  159. grd_scheinfo.addStatus(curRow, 'delete');
  160. }
  161. */
  162. }
  163. model.refresh();
  164. grd_scheinfo.refresh();
  165. }
  166. /**
  167. * @group :
  168. * @ver : 2010.03.26
  169. * @by : dhkim
  170. * @---------------------------------------------------
  171. * @type : function
  172. * @access : public
  173. * @desc : 진료일정수정
  174. * @param :
  175. * @param :
  176. * @return :
  177. * @---------------------------------------------------
  178. */
  179. function fModify(){
  180. model.setValue(grdPath+"[" + grd_scheinfo.row + "]/stat", 'u');//-:조회, i:신규, u:수정, d:삭제
  181. grd_scheinfo.addStatus(grd_scheinfo.row, 'update');
  182. }
  183. /**
  184. * @group :
  185. * @ver : 2009.09.18
  186. * @by : dhkim
  187. * @---------------------------------------------------
  188. * @type : function
  189. * @access : public
  190. * @desc : 진료일정수정내역 저장
  191. * @param :
  192. * @param :
  193. * @return :
  194. * @---------------------------------------------------
  195. */
  196. function fSave(){
  197. var sortseq="";
  198. //저장전 sortseq 재정렬
  199. for(var i = 1; i < grd_scheinfo.rows; i++){
  200. if(i < 9){
  201. sortseq = "00";
  202. }else if(i>9 && i<99){
  203. sortseq = "0";
  204. }
  205. model.setValue(grdPath+"[" + (i) + "]/sortseq", sortseq+i);
  206. }
  207. model.removenode('/root/send');
  208. model.makeValue('/root/send/savedata', grd_scheinfo.getUpdateDataAll('i'));
  209. model.refresh();
  210. if(submit('TXMNV99801')){
  211. fSearch();
  212. }
  213. }
  214. /**
  215. * @group :
  216. * @ver : 2010.03.26
  217. * @by : dhkim
  218. * @---------------------------------------------------
  219. * @type : function
  220. * @access : public
  221. * @desc : 선택진료 색깔적용
  222. * @param :
  223. * @param :
  224. * @return :
  225. * @---------------------------------------------------
  226. */
  227. function fSetChoiceYn(choyn){
  228. var cells = grd_scheinfo.selectedCells; //선택된 쎌의 배열
  229. var sRow, sCol, sColNm; //선택된 쎌의 row, col 값, 선택된 col의 필드명
  230. for(var i = 0; i < cells.length; i++){
  231. sRow = cells.item(i).row;
  232. sCol = cells.item(i).col;
  233. sColNm = grd_scheinfo.colAttribute(sCol, "ref");
  234. //선택진료여부값 세팅
  235. model.setValue(grdPath+"[" + sRow + "]/choyn", choyn);
  236. //선택된 쎌의 전체 행 색상 변경
  237. for(var j = 0; j <= 14; j++){
  238. if(choyn == "Y"){
  239. grd_scheinfo.cellStyle('background-color', sRow, j) = "#ccffff";
  240. }else{
  241. grd_scheinfo.cellStyle('background-color', sRow, j) = "#ffffff";
  242. }
  243. }
  244. }
  245. //색변경후 선택 해제
  246. grd_scheinfo.row = 0;
  247. grd_scheinfo.col = 0;
  248. model.refresh();
  249. }
  250. /**
  251. * @group :
  252. * @ver : 2010.04.01
  253. * @by : dhkim
  254. * @---------------------------------------------------
  255. * @type : function
  256. * @access : public
  257. * @desc : 선택된 쎌의 글씨크기변경
  258. * @param :
  259. * @param :
  260. * @return :
  261. * @---------------------------------------------------
  262. */
  263. function fSetFontSize(ftSize){
  264. if(ftSize > 0){
  265. var cells = grd_scheinfo.selectedCells; //선택된 쎌의 배열
  266. var sRow, sCol, sColNm; //선택된 쎌의 row, col 값, 선택된 col의 필드명
  267. for(var i = 0; i < cells.length; i++){
  268. sRow = cells.item(i).row;
  269. sCol = cells.item(i).col;
  270. sColNm = grd_scheinfo.colAttribute(sCol, "ref");
  271. //선택된 쎌의 글씨크기변경(show)
  272. grd_scheinfo.cellStyle('font-size', sRow, sCol) = ftSize;
  273. //변경된 글씨체 값을 노드에 세팅
  274. model.setValue(grdPath+"[" + sRow + "]/fs_"+sColNm, ftSize);
  275. }
  276. //글씨크기변경후 선택 해제
  277. grd_scheinfo.row = 0;
  278. grd_scheinfo.col = 0;
  279. //콤보 값 초기화
  280. model.setValue("/root/temp/fontinfo/size", "");
  281. model.refresh();
  282. grd_scheinfo.refresh();
  283. }else{
  284. messageBox("글씨크기를 선택하세요.", "E");
  285. }
  286. }