SSZSN00100.js 23 KB

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