SSAHA04910.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /**
  2. * @desc : 공지사항 화면 초기화
  3. * @
  4. * @param :
  5. * @return :
  6. * @author :
  7. * @---------------------------------------------------
  8. */
  9. function ahafInitialize(){
  10. btn_search.disabled = !checkAuth("R") ;
  11. // 노드만듬
  12. model.makeNode("/root/main/SMAHA04910_cond/fromdd"); // 게시시작일자
  13. model.makeNode("/root/main/SMAHA04910_cond/todd"); // 게시종료일자
  14. model.makeNode("/root/main/SMAHA04910_noticeinfo/noticelist");
  15. //조회조건 초기화
  16. ipt_fromdd.value = "";
  17. ipt_todd.value = "";
  18. ahaGetNoticeList();
  19. }
  20. /**
  21. * @desc : 공지사항 목록 조회하여 보여줌
  22. * @
  23. * @param :
  24. * @return :
  25. * @author : 이상준
  26. * @---------------------------------------------------
  27. */
  28. function ahaGetNoticeList(){
  29. // 조회조건을 설정
  30. var fromdd_t = model.getValue("/root/main/SSAHA04910/cond/fromdd_t");
  31. var todd_t = model.getValue("/root/main/SSAHA04910/cond/todd_t");
  32. var ntcflag = model.getValue("/root/main/SSAHA04910/cond/ntcflag");
  33. model.setValue("/root/send/fromdd_t", fromdd_t);
  34. model.setValue("/root/send/todd_t", todd_t);
  35. model.setValue("/root/send/ntcflag", ntcflag);
  36. // 노드 삭제
  37. model.removeNodeset("/root/main/SSAHA04910/noticeinfo/noticelist");
  38. // 공지 리스트를 조회
  39. submit("TRAHA04911");
  40. //긴급 공지인 경우 글자색 변경
  41. // var gridrows = grd_notice.rows - grd_notice.fixedRows;
  42. // for(var i = 1; i <= gridrows ; i++){
  43. // var deliveflag = model.getValue("/root/main/SSAHA04910/noticeinfo/noticelist[" + i + "]/ntcflag");
  44. // if(deliveflag == 'Y'){
  45. // grd_notice.rowstyle(i, "data", "color") = "#c0000ff";
  46. // }
  47. // else
  48. // {
  49. // grd_notice.rowstyle(i, "data", "color") = "";
  50. // }
  51. //}
  52. model.refresh();
  53. }
  54. /**
  55. * @desc : 파일 다운로드 버튼 클릭시 이벤트
  56. * @
  57. * @param :
  58. * @return :
  59. * @author :
  60. * @---------------------------------------------------
  61. */
  62. function fFileDown() {
  63. //파일명를 받아옴
  64. var getfilenm = model.getValue("/root/main/listinfo/listinfo/attfilenm");
  65. //파일명이 있는 경우 다운로드
  66. if(getfilenm != ""){
  67. //파일명을 받아옴
  68. var filenm = model.getValue("/root/main/listinfo/listinfo/attfilenm");
  69. //파일명의 확장자만 받아옴
  70. var fileext = filenm.lastIndexOf(".");
  71. var ext = filenm.substring(fileext +1);
  72. //파일을 다운로드 하기 위해 저장할 창을 띄움
  73. var filesave = window.fileDialog("save","|",false,filenm,ext,"All Files(*.*)|*.*");
  74. //키값을 받아옴
  75. var getno = model.getValue("/root/main/listinfo/listinfo/genrno");
  76. var getdd = model.getValue("/root/main/listinfo/listinfo/genrdd");
  77. //키값을 가지고 DB에 저장된 데이타를 조회하러 간다
  78. if (filesave != "") {
  79. model.download(getActionURL("TRMMO04904")+"&genrno="+getno+"&genrdd="+getdd ,filesave);
  80. }
  81. }
  82. }
  83. /**
  84. * @desc : 공지사항이 보여질 사용자 선택
  85. * @
  86. * @param :
  87. * @return :
  88. * @author :
  89. * @---------------------------------------------------
  90. */
  91. function fSchToUserPart() {
  92. model.removeNodeset("/root/properties/parameters");
  93. //팝업창을 띄워 선택한 id,명을 저장하기 위한 변수를 선언한다.
  94. var sdeptnm ='';
  95. var susernm = '';
  96. var suserid = '';
  97. var sdeptcd = '';
  98. //대상의 종류를 받아온다.
  99. var gettrgtcmd = model.getValue("/root/main/listinfo/listinfo/trgtcmd");
  100. //현재 대상이 몇개인지 확인
  101. var getrows = model.getValue("/root/main/trgtinfo/count");
  102. if(gettrgtcmd == 0){
  103. //전체의 경우 전체의 기본값을 보낸다.
  104. model.makeValue("/root/main/listinfo/listinfo/trgtint", '00000000');
  105. model.makeValue("/root/main/listinfo/listinfo/trgtnm",'-');
  106. }else if(gettrgtcmd == 1){
  107. //부모창에서 자식창으로 전달할 data를 보냄
  108. var cmd = model.getValue("/root/main/trgtinfo/cmd");
  109. if(gettrgtcmd == cmd){
  110. for(var i = 1; i <= getrows; i++){
  111. setParameter("count", model.getValue("/root/main/trgtinfo/count"));
  112. if( i == 1 ){
  113. setParameter("cd", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd"));
  114. setParameter("nm", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm"));
  115. }else{
  116. addParameter("cd", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd"));
  117. addParameter("nm", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm"));
  118. }
  119. }
  120. }
  121. //model.removeNodeset("/root/main/trgtinfo");
  122. modal("SPMMB08200", "1","150", "150", "SPMMB08200", "", "");
  123. //팝업창에서 확인버튼을 부르면 실행
  124. var useyn = model.getValue("/root/properties/parameters/useyn/useynvalue");
  125. if(useyn == 'Y'){
  126. model.copyNode("/root/main/trgtinfo","");
  127. //팝업창에서 선택한 사용자의 개수를 받아온다.
  128. var getrows = model.getValue("/root/properties/parameters/count/countvalue");
  129. model.makeNode("/root/main/trgtinfo/count");
  130. model.makeNode("/root/main/trgtinfo/cmd");
  131. model.makeValue("/root/main/trgtinfo/count" , getrows);
  132. model.makeValue("/root/main/trgtinfo/cmd" , gettrgtcmd);
  133. //선택한 사용자 개수만큰 포문을 돌려 사용자id, 사용자명을 임의의 변수에 저장한다.
  134. for(var i = 1 ; i <= getrows ; i++){
  135. suserid = suserid + getParameter("cd" , i);
  136. susernm = susernm + getParameter("nm" , i);
  137. //저장하면서 콤마로 구분한다.
  138. if(i != getrows){
  139. susernm = susernm + ", ";
  140. }
  141. model.makeNode("/root/main/trgtinfo/trgtlist[" + i + "]/cd");
  142. model.makeNode("/root/main/trgtinfo/trgtlist[" + i + "]/nm");
  143. model.makeValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd" , getParameter("cd" , i));
  144. model.makeValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm" , getParameter("nm" , i));
  145. }
  146. //임의의 변수에 저한해둔 값을 인스턴스에 넣는다.
  147. model.makeValue("/root/main/listinfo/listinfo/trgtnm", susernm);
  148. model.makeValue("/root/main/listinfo/listinfo/trgtint", suserid);
  149. }else{
  150. var count = model.getValue("/root/main/trgtinfo/count");
  151. var cmd = model.getValue("/root/main/trgtinfo/cmd");
  152. for(var i = 1 ; i <= count ; i++){
  153. suserid = suserid + model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd");
  154. susernm = susernm + model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm");
  155. //저장하면서 콤마로 구분한다.
  156. if(i != count){
  157. susernm = susernm + ", ";
  158. }
  159. }
  160. //임의의 변수에 저한해둔 값을 인스턴스에 넣는다.
  161. model.makeValue("/root/main/listinfo/listinfo/trgtnm", susernm);
  162. model.makeValue("/root/main/listinfo/listinfo/trgtint", suserid);
  163. model.makeValue("/root/main/listinfo/listinfo/trgtcmd",cmd);
  164. }
  165. }else if(gettrgtcmd == 2){
  166. var cmd = model.getValue("/root/main/trgtinfo/cmd");
  167. if(gettrgtcmd == cmd){
  168. //부모창에서 자식창으로 전달할 data를 보냄
  169. for(var i = 1; i <= getrows; i++){
  170. setParameter("count", model.getValue("/root/main/trgtinfo/count"));
  171. if( i == 1 ){
  172. setParameter("cd", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd"));
  173. setParameter("nm", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm"));
  174. }else{
  175. addParameter("cd", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd"));
  176. addParameter("nm", model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm"));
  177. }
  178. }
  179. }
  180. //model.removeNodeset("/root/main/trgtinfo");
  181. modal("SPMMB08100", "1","150", "150", "SPMMB08100", "", "");
  182. //팝업창에서 확인버튼을 부르면 실행
  183. var useyn = model.getValue("/root/properties/parameters/useyn/useynvalue");
  184. if(useyn == 'Y'){
  185. model.removeNodeset("/root/main/trgtinfo");
  186. //팝업창에서 선택한 사용자의 개수를 받아온다.
  187. var getrows = model.getValue("/root/properties/parameters/count/countvalue");
  188. model.makeNode("/root/main/trgtinfo/count");
  189. model.makeNode("/root/main/trgtinfo/cmd");
  190. model.makeValue("/root/main/trgtinfo/count" , getrows);
  191. model.makeValue("/root/main/trgtinfo/cmd" , gettrgtcmd);
  192. //선택한 사용자 개수만큰 포문을 돌려 부서id, 부서명을 임의의 변수에 저장한다.
  193. for(var i = 1 ; i <= getrows ; i++){
  194. sdeptcd = sdeptcd + getParameter("cd" , i);
  195. sdeptnm = sdeptnm + getParameter("nm" , i);
  196. //저장하면서 콤마로 구분한다.
  197. if(i != getrows){
  198. sdeptnm = sdeptnm + ", ";
  199. }
  200. model.makeNode("/root/main/trgtinfo/trgtlist[" + i + "]/cd");
  201. model.makeNode("/root/main/trgtinfo/trgtlist[" + i + "]/nm");
  202. model.makeValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd" , getParameter("cd" , i));
  203. model.makeValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm" , getParameter("nm" , i));
  204. }
  205. //임의의 변수에 저한해둔 값을 인스턴스에 넣는다.
  206. model.makeValue("/root/main/listinfo/listinfo/trgtnm", sdeptnm);
  207. model.makeValue("/root/main/listinfo/listinfo/trgtint", sdeptcd);
  208. } else{
  209. var count = model.getValue("/root/main/trgtinfo/count");
  210. var cmd = model.getValue("/root/main/trgtinfo/cmd");
  211. for(var i = 1 ; i <= count ; i++){
  212. sdeptcd = sdeptcd + model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/cd");
  213. sdeptnm = sdeptnm + model.getValue("/root/main/trgtinfo/trgtlist[" + i + "]/nm");
  214. //저장하면서 콤마로 구분한다.
  215. if(i != count){
  216. sdeptnm = sdeptnm + ", ";
  217. }
  218. }
  219. //임의의 변수에 저한해둔 값을 인스턴스에 넣는다.
  220. model.makeValue("/root/main/listinfo/listinfo/trgtnm", sdeptnm);
  221. model.makeValue("/root/main/listinfo/listinfo/trgtint", sdeptcd);
  222. model.makeValue("/root/main/listinfo/listinfo/trgtcmd",cmd);
  223. }
  224. }
  225. model.refresh();
  226. }
  227. /**
  228. * @desc : 파일첨부버튼 클릭시 이벤트
  229. * @
  230. * @param :
  231. * @return :
  232. * @author :
  233. * @---------------------------------------------------
  234. */
  235. function fFileAdd() {
  236. //******파일을 첨부하기 위해 파일열기가 open 되게 한다.
  237. //파일의 크기를 측정한다.
  238. var maxsize = upload1.attribute("filesize");
  239. var name = model.getValue("/root/main/listinfo/listinfo/attfilenm");
  240. if(name != '' || name == '-'){
  241. var fileupdata = messageBox(name + " 파일 수정을" , "S001");
  242. if(fileupdata == '6'){
  243. //파일 삭제
  244. //input박스에 나타난 명을 제거
  245. ipt_att.value = "";
  246. //파일 저장
  247. //파일을 받아오기 위해 파일열기 팝업창을 띄운다.
  248. var fileopen = window.fileDialog("open","|","false");
  249. //파일 경로가 아닌 이름만 input박스에 넣기 위한 처리
  250. model.makeValue("/root/main/listinfo/listinfo/attfilenm", fileopen);
  251. var name = model.getValue("/root/main/listinfo/listinfo/attfilenm");
  252. //lastIndexOf함수는 \\이것을 뒤어세 검색하여 나오면 앞에 것은 지운다.
  253. var filename = name.lastIndexOf("\\");
  254. //open 파일명를 input박스에 넣는다.
  255. ipt_att.value = fileopen.substring(filename + 1);
  256. //선택한 파일이 저장버튼을 눌렀을때 저장이 되게 하기 위해 파일 저장 인스턴스에 파일주소를 저장해 둔다.
  257. model.makeValue("/root/send/file/filename", name);
  258. model.refresh();
  259. //파일 크기가 너무 큰경우 메세지를 띄운다.
  260. if (!checkFileSize(upload1)){
  261. ipt_att.value = "";
  262. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  263. }
  264. model.makeValue("/root/main/listinfo/listinfo/fileyn", 'Y');
  265. }else if(fileupdata == '7'){
  266. messageBox(name + " 파일 수정을 하지", "E007");
  267. model.makeValue("/root/main/listinfo/listinfo/fileyn", 'N');
  268. }else{
  269. }
  270. }else{
  271. //파일을 받아오기 위해 파일열기 팝업창을 띄운다.
  272. var fileopen = window.fileDialog("open","|","false");
  273. //파일 경로가 아닌 이름만 input박스에 넣기 위한 처리
  274. model.makeValue("/root/main/listinfo/listinfo/attfilenm", fileopen);
  275. var name = model.getValue("/root/main/listinfo/listinfo/attfilenm");
  276. //lastIndexOf함수는 \\이것을 뒤어세 검색하여 나오면 앞에 것은 지운다.
  277. var filename = name.lastIndexOf("\\");
  278. //open 파일명를 input박스에 넣는다.
  279. ipt_att.value = fileopen.substring(filename + 1);
  280. //선택한 파일이 저장버튼을 눌렀을때 저장이 되게 하기 위해 파일 저장 인스턴스에 파일주소를 저장해 둔다.
  281. model.makeValue("/root/send/file/filename", name);
  282. model.refresh();
  283. //파일 크기가 너무 큰경우 메세지를 띄운다.
  284. if (!checkFileSize(upload1)){
  285. ipt_att.value = "";
  286. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  287. }
  288. model.makeValue("/root/main/listinfo/listinfo/fileyn", 'Y');
  289. }
  290. }
  291. /**
  292. * @desc : 삭제시 발생하는 이벤트
  293. * @
  294. * @param :
  295. * @return :
  296. * @author :
  297. * @---------------------------------------------------
  298. */
  299. function fFileDel() {
  300. //등록된 파일을 삭제하기 위해 상태값을 삭제로 만든다.
  301. model.makeValue("/root/main/listinfo/listinfo/status",'d');
  302. var name = model.getValue("/root/main/listinfo/listinfo/attfilenm");
  303. if((name != '')){
  304. var fileupdata = messageBox(name + " 파일 삭제를" , "S001");
  305. if(fileupdata == '6'){
  306. //파일 삭제
  307. //input박스에 나타난 명을 제거
  308. ipt_att.value = "";
  309. }
  310. }
  311. //기존 상태값으로 변경한다.
  312. model.makeValue("/root/main/listinfo/listinfo/status",'u');
  313. model.refresh();
  314. }
  315. /**
  316. * @desc : 공지사항 내용 상세 조회
  317. * @
  318. * @param :
  319. * @return :
  320. * @author :
  321. * @---------------------------------------------------
  322. */
  323. function fNoticeDetlReq() {
  324. //선택한 그리스row값을 받아 row값을 저장해 둔다.
  325. var gridrow = grd_notice.row;
  326. var rows = grd_notice.rows;
  327. var getnm = '';
  328. //그리드의 대상명을 받아옴
  329. var trgtnm = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow +"]/trgtnm");
  330. //그리드 대상명이 존재하는 경우 화면에 보여줌
  331. if(trgtnm != ''){
  332. model.makeValue("/root/main/listinfo/listinfo/trgtnm", trgtnm);
  333. }else{
  334. //대상명이 존재하지 않는 경우
  335. //********************대상이 여러대상일 경우 대상을 모두 받아온다.
  336. //대상종류를 받아옴
  337. var getcmd = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow +"]/trgtcmd");
  338. //공지사항에 해당하는 대상을 조회(대상의코드를 받아옴)
  339. model.copyNode("/root/send/reqdata","/root/main/noticeinfo/noticelist[" + gridrow +"]");
  340. submit("TRMMO04902");
  341. //대상이 전체인 경우
  342. if(getcmd == 0){
  343. model.makeValue("/root/main/listinfo/listinfo/trgtint",'00000000');
  344. //******************대상이 개인인 경우
  345. }else if(getcmd == 1){
  346. //대상 개인의 id 조건을 가지고 대상 개인명을 조회
  347. model.copyNode("/root/send/savedata","/root/main/delivetrgt");
  348. submit("TRMMB08203");
  349. //대상 조회에 ","구분하여 연결하여 개인명을 나타내기 위해 변수에 연결하여 저장
  350. var count = getNodesetCnt(model, "/root/main/choiuserinfo/choiuserlist");
  351. for(var i = 1 ; i <= count ; i++){
  352. getnm = getnm + model.getValue("/root/main/choiuserinfo/choiuserlist[" + i + "]/usernm");
  353. //대상 조회에 ","구분
  354. if(i != count){
  355. getnm = getnm + ", ";
  356. }
  357. }
  358. model.removeNodeset("/root/main/choideptinfo");
  359. model.removeNodeset("/root/main/choiuserinfo");
  360. //************대상이 부서인 경우
  361. }else if(getcmd == 2){
  362. //대상 부서의 cd 조건을 가지고 대상 부서명을 조회
  363. model.copyNode("/root/send/savedata","/root/main/delivetrgt");
  364. submit("TRMMB08102");
  365. //대상 조회에 ","구분하여 연결하상여 부서명을 나타내기 위해 변수에 연결하여 저장
  366. var count = getNodesetCnt(model, "/root/main/choideptinfo/choideptlist");
  367. for(var i = 1 ; i <= count ; i++){
  368. getnm = getnm + model.getValue("/root/main/choideptinfo/choideptlist[" + i + "]/deptnm");
  369. //대상 조회에 ","구분
  370. if(i != count){
  371. getnm = getnm + ", ";
  372. }
  373. }
  374. model.removeNodeset("/root/main/choideptinfo");
  375. model.removeNodeset("/root/main/choiuserinfo");
  376. }
  377. if(getcmd == 0){
  378. model.makeValue("/root/main/listinfo/listinfo/trgtnm",'-');
  379. }else{
  380. model.makeValue("/root/main/listinfo/listinfo/trgtnm",getnm);
  381. }
  382. model.makeValue("/root/main/listinfo/listinfo/trgtcmd",getcmd);
  383. model.makeValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/trgtcmd",getcmd);
  384. if(getcmd == 0){
  385. model.makeValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/trgtnm",'-');
  386. }else{
  387. model.makeValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/trgtnm",getnm);
  388. }
  389. }
  390. //선택한 그리드 값을 오르쪽에 뿌려준다.
  391. var getdelivetitl = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/delivetitl");
  392. var getdeliveflag = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/deliveflag");
  393. var getattfilenm = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/attfilenm");
  394. var getdelivecnts = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/delivecnts");
  395. var getgenrno = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/genrno");
  396. var getgenrdd = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/genrdd");
  397. var getuserid = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/updtrid");
  398. var getfromdd = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/fromdd");
  399. var gettodd = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/todd");
  400. var getnm = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/trgtnm");
  401. var getcmd = model.getValue("/root/main/noticeinfo/noticelist[" + gridrow + "]/trgtcmd");
  402. model.makeValue("/root/main/listinfo/listinfo/delivetitl", getdelivetitl);
  403. model.makeValue("/root/main/listinfo/listinfo/deliveflag", getdeliveflag);
  404. model.makeValue("/root/main/listinfo/listinfo/delivecnts", getdelivecnts);
  405. model.makeValue("/root/main/listinfo/listinfo/genrno", getgenrno);
  406. model.makeValue("/root/main/listinfo/listinfo/genrdd", getgenrdd);
  407. model.makeValue("/root/main/listinfo/listinfo/updtrid", getuserid);
  408. model.makeValue("/root/main/listinfo/listinfo/fromdd", getfromdd);
  409. model.makeValue("/root/main/listinfo/listinfo/todd", gettodd);
  410. model.makeValue("/root/main/listinfo/listinfo/trgtnm", getnm);
  411. model.makeValue("/root/main/listinfo/listinfo/trgtcmd", getcmd);
  412. if(getattfilenm == ''){
  413. model.makeValue("/root/main/listinfo/listinfo/attfilenm", '-');
  414. }else{
  415. model.makeValue("/root/main/listinfo/listinfo/attfilenm", getattfilenm);
  416. }
  417. model.refresh();
  418. }
  419. /**
  420. * @desc : 공지사항 내용 삭제
  421. * @
  422. * @param :
  423. * @return :
  424. * @author :
  425. * @---------------------------------------------------
  426. */
  427. function fNoticeDel() {
  428. //상태값을 삭제로 인스턴스에 넣는다.
  429. model.makeValue("/root/main/listinfo/listinfo/status","d");
  430. //조건의 값들을 가지고 삭제하러 간다.
  431. model.makeValue("/root/main/listinfo/listinfo/orddrid",model.getValue("/root/main/cond/orddrid"));
  432. var username = getUserName();
  433. var name = model.getValue("/root/main/listinfo/listinfo/updtrid");
  434. model.makeValue("/root/main/listinfo/listinfo/orddeptcd",model.getValue("/root/main/cond/orddeptcd"));
  435. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  436. if (username == name) {
  437. submit("TXMMO04901");
  438. } else {
  439. messageBox("작성자만 삭제 ","I006");
  440. return;
  441. }
  442. //조회된 조건 초기화
  443. ipt_titl.value = "";
  444. ipt_att.value = "";
  445. ipt_cnts.value = "";
  446. ipt_trgtnm.value = "";
  447. //현재날짜 받아옴
  448. var getdate = getCurrentDate();
  449. model.makeValue("/root/main/listinfo/listinfo/fromdd", getdate);
  450. //한달을 기준으로 한달안에 보내진 공지사항만 보여줌
  451. var todd = ((getCurrentDate().toDate()).getAddDate(30)).getDateFormat();
  452. model.makeValue("/root/main/listinfo/listinfo/todd",todd);
  453. model.refresh();
  454. //구분과 대상을 기본으로 나두기
  455. cmb_flag.select(0);
  456. cmb_trgtcmd.select(0);
  457. model.makeValue("/root/main/listinfo/listinfo/trgtnm",'-');
  458. ipt_trgtnm.value = "-";
  459. model.refresh();
  460. }
  461. /**
  462. * @desc : 공지사항 신규 /수정 후 저장
  463. * @
  464. * @param :
  465. * @return :
  466. * @author :
  467. * @---------------------------------------------------
  468. */
  469. function fExeSvae() {
  470. var status = model.getValue("/root/main/listinfo/listinfo/status");
  471. if (status =="i") {
  472. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  473. submit("TXMMO04901");
  474. //키값을 부여 받은것을 다른 대상과 첨부파일 저장시에도 같은 키값으로 저장되도록 값을 보낸다.
  475. //발생번호, 발생날짜를 대상,첨부파일 저장시에도 키값을 가져가도록 키값을 넘겨줌
  476. var getDD = model.getValue("/root/main/keyinfo/keylist/genrdd");
  477. var getNO = model.getValue("/root/main/keyinfo/keylist/genrno");
  478. model.makeValue("/root/main/listinfo/listinfo/genrdd", getDD);
  479. model.makeValue("/root/main/listinfo/listinfo/genrno", getNO);
  480. var gettrgtcmd = model.getValue("/root/main/listinfo/listinfo/Trgtcmd");
  481. if(gettrgtcmd == 0){
  482. //전체인 경우 기본 전체값을 가지고 저장하러 간다.
  483. model.makeValue("/root/main/listinfo/listinfo/trgtint",'00000000');
  484. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  485. submit("TXMMO04902");
  486. }else{
  487. var gettrgtrow = model.getValue("/root/properties/parameters/count/countvalue");
  488. for(var i = 1 ; i <= gettrgtrow ; i++){
  489. var getid = model.getValue("/root/properties/parameters/cd/cdvalue[" + i + "]");
  490. model.makeValue("/root/main/listinfo/listinfo/trgtint", getid);
  491. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  492. submit("TXMMO04902");
  493. }
  494. }
  495. // 수정일 때 로직 추가
  496. } else if (status=="u") {
  497. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  498. model.makeValue("/root/send/savedata/delivecnts", model.getValue("/root/main/listinfo/listinfo/delivecnts"));
  499. model.makeValue("/root/send/savedata/delivetitl", model.getValue("/root/main/listinfo/listinfo/delivetitl"));
  500. model.makeValue("/root/send/savedata/fromdd", model.getValue("/root/main/listinfo/listinfo/fromdd"));
  501. model.makeValue("/root/send/savedata/todd", model.getValue("/root/main/listinfo/listinfo/todd"));
  502. model.makeValue("/root/send/savedata/trgtcmd", model.getValue("/root/main/listinfo/listinfo/trgtcmd"));
  503. submit("TXMMO04901");
  504. var getDD = model.getValue("/root/main/listinfo/listinfo/genrdd");
  505. var getNo = model.getValue("/root/main/listinfo/listinfo/genrno");
  506. var getTrgtCmd = model.getValue("/root/main/listinfo/listinfo/trgtcmd");
  507. if (getTrgtCmd == 0 || getTrgtCmd == null || getTrgtCmd =="") {
  508. model.makeValue("/root/main/listinfo/listinfo/trgtint",'00000000');
  509. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  510. submit("TXMMO04902");
  511. } else {
  512. var gettrgtrow = model.getValue("/root/properties/parameters/count/countvalue");
  513. for(var i = 1 ; i <= gettrgtrow ; i++){
  514. var getid = model.getValue("/root/properties/parameters/cd/cdvalue[" + i + "]");
  515. model.makeValue("/root/main/listinfo/listinfo/trgtint", getid);
  516. model.copyNode("/root/send/savedata","/root/main/listinfo/listinfo");
  517. submit("TXMMO04902");
  518. }
  519. }
  520. }
  521. //model.copyNode("/root/main/delivetrgt","");
  522. var fileyn = model.getValue("/root/main/listinfo/listinfo/fileyn");
  523. //신규 등록이거나 파일을 삭제하였고 첨부파일 명이 있는경우
  524. if((fileyn == 'Y')){
  525. //**********첨부파일을 BLOB 형태로 DB에 올림
  526. //선택한 파일의 첨부파일을 선택하기 위해 키를 가지고 간다.
  527. var getno = model.getValue("/root/main/listinfo/listinfo/genrno");
  528. var getdd = model.getValue("/root/main/listinfo/listinfo/genrdd");
  529. model.makeValue("/root/send/file/genrno", getno);
  530. model.makeValue("/root/send/file/genrdd", getdd);
  531. model.makeValue("/root/send/file/orddrid",model.getValue("/root/main/cond/orddrid"));
  532. model.makeValue("/root/send/file/orddeptcd",model.getValue("/root/main/cond/orddeptcd"));
  533. // 파일을 DB에 올린다.
  534. submit("TXMMO04903");
  535. }
  536. fInitialize_SMMMO05000();
  537. grd_notice.refresh();
  538. }
  539. function zsnfNewNotice() {
  540. //**********초기화
  541. //제목, 대상, 첨부, 내용에 data 제거
  542. ipt_ntcsubject.value = "";
  543. ipt_attfilenm.value = "";
  544. ipt_ntccnts.value = "";
  545. //기간을 초기화
  546. var getdate = getCurrentDate();
  547. model.makeValue("/root/main/iteminfo/fromdd", getdate);
  548. var todd = ((getCurrentDate().toDate()).getAddDate(30)).getDateFormat();
  549. model.makeValue("/root/main/iteminfo/todd",todd);
  550. //콤보박스를 초기화
  551. cmb_ntcflag.select(0);
  552. cmb_ntctrgtjobkind.select(0);
  553. cmb_trgtcmd.select(0);
  554. cmb_targetflag.select(0);
  555. //대상이 전체로 초기화 되므로 전체로 대상내용에 나타나게 한다
  556. model.setValue("/root/main/iteminfo/targetinfo/targetlist_cmb",'');
  557. model.removeNodeset("/root/main/iteminfo/targetinfo/targetlist");
  558. model.refresh();
  559. }