SMMQK00100.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. var acptno = "";
  2. /**
  3. * @---------------------------------------------------
  4. * @desc : SMMQK00100_QI활동계획서가 load될때 실행되는 function
  5. * @param :
  6. * @return :
  7. * @---------------------------------------------------
  8. */
  9. function fInitialize(){
  10. var ano = "";
  11. if(isPopup() == true){
  12. acptno = opener.javascript.getParameter("ano");
  13. model.setValue("/root/main/cond/acptno", acptno);
  14. }
  15. /*+++++++++++++++++++++++권한별 화면 설정+++++++++++++++++++++++*/
  16. groupRevitalize("grp_plan", "D", "N"); //모든 콘트롤 활성화로 초기화
  17. var userAuth = "";
  18. //최초등록일 경우
  19. if(acptno == ""){
  20. model.setValue("/root/main/cond/prcsstagecd", "0");
  21. var rgstrid = getUserId();
  22. var rgstrhngnm = getUserInfo("usernm");
  23. var rgstrdeptcd = getUserInfo("dutplcecd");
  24. var rgstrdeptnm = getUserInfo("dutplcenm");
  25. var rgstdd = getCurrentDate();
  26. model.setValue("/root/main/cond/rgstrid", rgstrid);
  27. model.setValue("/root/main/cond/rgstrhngnm", rgstrhngnm);
  28. model.setValue("/root/main/cond/rgstrdeptcd", rgstrdeptcd);
  29. model.setValue("/root/main/cond/rgstrdeptnm", rgstrdeptnm);
  30. model.setValue("/root/main/cond/rgstrdd", rgstdd);
  31. model.setValue("/root/main/cond/prizyn", "N"); //포상유무
  32. btn_fbreflt.disabled = true;
  33. btn_fbreq.disabled = true;
  34. btn_end.disabled = true;
  35. }
  36. //조회일 경우
  37. else if(acptno != ""){
  38. submit("TRMQK00100");
  39. copyNodeType("/root/main/cond", "/root/tmp/cond", "replace");
  40. model.refresh();
  41. var prcsstatcd = model.getValue("/root/main/cond/prcsstatcd");
  42. userAuth = fchkUser(); //사용자별 권한정보 가져오기
  43. //1. 현재상태가 저장인 경우
  44. if(prcsstatcd == "1"){
  45. tar_feedbackcnts.disabled = true;
  46. btn_fbreflt.disabled = true;
  47. btn_fbreq.disabled = true;
  48. btn_end.disabled = true;
  49. }
  50. //2. 현재상태가 전송인 경우
  51. if(prcsstatcd == "2"){
  52. groupRevitalize("grp_plan", "D", "Y");
  53. btn_filedown.disabled = false;
  54. if(userAuth == "U"){
  55. btn_fbreq.disabled = true;
  56. btn_end.disabled = true;
  57. }
  58. if(userAuth == "Q"){
  59. btn_fbreq.disabled = false;
  60. btn_end.disabled = false;
  61. }
  62. }
  63. //3. 현재상태가 F/B요청 경우
  64. if(prcsstatcd == "3"){
  65. if(userAuth == "U"){
  66. btn_save.disabled = true;
  67. btn_tran.disabled = true;
  68. btn_fbreq.disabled = true;
  69. btn_end.disabled = true;
  70. }
  71. else if(userAuth == "Q"){
  72. groupRevitalize("grp_plan", "D", "Y");
  73. btn_filedown.disabled = false;
  74. btn_fbreq.disabled = true;
  75. btn_end.disabled = true;
  76. //QI팀이라도 등록자, 팀장,간사에 속해있으면 F/B반영을 할수잇다.
  77. var loginID = getUserId();
  78. var rgstID = model.getValue("/root/main/cond/rgstrid");
  79. var chfID = model.getValue("/root/main/cond/chfid");
  80. var staffid = model.getValue("/root/main/cond/staffid");
  81. if(loginID == rgstID || loginID == chfID || loginID == staffid){
  82. groupRevitalize("grp_plan", "D", "N");
  83. btn_save.disabled = true;
  84. btn_tran.disabled = true;
  85. }
  86. }
  87. }
  88. //4. 현재상태가 F/B반영 경우
  89. if(prcsstatcd == "4"){
  90. if(userAuth == "U"){
  91. groupRevitalize("grp_plan", "D", "Y");
  92. btn_filedown.disabled = false;
  93. btn_save.disabled = true;
  94. btn_tran.disabled = true;
  95. btn_fbreflt.disabled = true;
  96. btn_fbreq.disabled = true;
  97. btn_end.disabled = true;
  98. }
  99. else if(userAuth == "Q"){
  100. groupRevitalize("grp_plan", "D", "Y");
  101. btn_filedown.disabled = false;
  102. btn_fbreq.disabled = false;
  103. btn_end.disabled = false;
  104. }
  105. }
  106. //5. 현재상태가 마감인 경우
  107. if(prcsstatcd == "5"){
  108. groupRevitalize("grp_plan", "D", "Y");
  109. btn_filedown.disabled = false;
  110. btn_fbreq.disabled = true;
  111. btn_end.disabled = true;
  112. }
  113. }
  114. //첨부파일 유무에따른 버튼활성화 상태 설정
  115. if(model.getValue("/root/main/cond/attfile") == ""){
  116. btn_filedel.disabled = true;
  117. btn_filedown.disabled = true;
  118. }
  119. //Qi팀 여부에따른 FeedBack입력란 활성화
  120. if(userAuth == "Q" && prcsstatcd != "5" && prcsstatcd != "1" && prcsstatcd != "3"){
  121. tar_feedbackcnts.disabled = false;
  122. }
  123. else{
  124. tar_feedbackcnts.disabled = true;
  125. }
  126. //Other이면 조회만 되게끔 설정
  127. if(userAuth == "O"){
  128. groupRevitalize("grp_plan", "D", "Y");
  129. btn_fbreq.disabled = true;
  130. btn_end.disabled = true;
  131. tar_feedbackcnts.disabled = true;
  132. btn_filedown.disabled = false;
  133. }
  134. //양식 저장경로 가져오기
  135. submit("TRMQK00103");
  136. btn_fileform.disabled = false;
  137. //항상
  138. btn_del.disabled = false;
  139. /*+++++++++++++++++++++++권한별 화면 설정 끝+++++++++++++++++++++++*/
  140. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/dept", "I");
  141. model.refresh();
  142. }
  143. /**
  144. * @---------------------------------------------------
  145. * @desc : 팀장, 간사 세부정보 조회 function
  146. * @param : kind : 팀장간사구분
  147. * @return :
  148. * @---------------------------------------------------
  149. */
  150. function getUserPopInfo(kind){
  151. model.resetInstanceNode("/root/main/userpopupinfo");
  152. model.removeNodeset("/root/main/tempuserinfo");
  153. model.makeNode("/root/main/tempuserinfo");
  154. model.removeNode("/root/send/userinfo/userid");
  155. model.makeNode("/root/send/userinfo/userid");
  156. model.setValue("/root/main/userpopupinfo/param", "_OneS_DD");
  157. modal("SPZSU10103_사용자부서선택조회", "", "200", "200", "SPZSU10103","/root/main/userpopupinfo","/root/main/temp");
  158. var iParam = getParameter("SPZSU10103_");
  159. setCSVToNode("/root/main/tempuserinfo", iParam);
  160. clearParameter("SPZSU10103_");
  161. var emplno = model.getValue("/root/main/tempuserinfo/list/userid");
  162. var empInm = model.getValue("/root/main/tempuserinfo/list/usernm");
  163. //2017.02.28 팀장 및 간사 소속부서를 근무지부서로 수정
  164. //var empdeptcd = model.getValue("/root/main/tempuserinfo/list/posdeptcd");
  165. //var empdeptnm = model.getValue("/root/main/tempuserinfo/list/posdeptnm");
  166. var empdeptcd = model.getValue("/root/main/tempuserinfo/list/dutplcecd");
  167. var empdeptnm = model.getValue("/root/main/tempuserinfo/list/dutplcenm");
  168. model.setValue("/root/send/userinfo/userid", emplno);
  169. submit("TRMQK00101");
  170. var empemail = model.getValue("/root/tmp/userinfo/email");
  171. var emptel = model.getValue("/root/tmp/userinfo/tel");
  172. var empmpphonno = model.getValue("/root/tmp/userinfo/mpphonno");
  173. if(kind == "1"){
  174. model.setValue("/root/main/cond/chfid", emplno);
  175. model.setValue("/root/main/cond/chfhngnm", empInm);
  176. model.setValue("/root/main/cond/chfdeptcd", empdeptcd);
  177. model.setValue("/root/main/cond/chfdeptnm", empdeptnm);
  178. model.setValue("/root/main/cond/chfemail", empemail);
  179. model.setValue("/root/main/cond/chfcntctel", emptel);
  180. model.setValue("/root/main/cond/chfceltel", empmpphonno);
  181. }
  182. else if(kind == "2"){
  183. model.setValue("/root/main/cond/staffid", emplno);
  184. model.setValue("/root/main/cond/staffhngnm", empInm);
  185. model.setValue("/root/main/cond/staffdeptcd", empdeptcd);
  186. model.setValue("/root/main/cond/staffdeptnm", empdeptnm);
  187. model.setValue("/root/main/cond/staffemail", empemail);
  188. model.setValue("/root/main/cond/staffcntctel", emptel);
  189. model.setValue("/root/main/cond/staffceltel", empmpphonno);
  190. }
  191. model.refresh();
  192. }
  193. /**
  194. * @---------------------------------------------------
  195. * @desc : QI활동 계획서 저장 function
  196. * @param :
  197. * @return :
  198. * @---------------------------------------------------
  199. */
  200. function fSave(){
  201. /*+++++++++++++++++++++++필수 입력란 체크+++++++++++++++++++++++*/
  202. if(!isRequiredGroup("grp_plan")){
  203. return false;
  204. }
  205. if(fChkSave() == false ){
  206. return false;
  207. }
  208. /*+++++++++++++++++++++++끝+++++++++++++++++++++++*/
  209. model.removenode("/root/send/cond/condition");
  210. model.makeNode("/root/send/cond/condition");
  211. copyNodeType("/root/send/cond/condition", "/root/main/cond", "replace");
  212. submit("TXMQK00100");
  213. model.removenode("/root/send/cond/attach/file");
  214. model.makeNode("/root/send/cond/attach/file");
  215. acptno = model.getValue("/root/main/cond/acptno");
  216. model.setValue("/root/main/cond/prcsstagecd" , "0");
  217. fInitialize();
  218. }
  219. /**
  220. * @---------------------------------------------------
  221. * @desc : Login User 권한 조회
  222. * @param :
  223. * @return : userAuth(사용자권한) U:사용자 Q:QI관리자 O:Other
  224. * @---------------------------------------------------
  225. */
  226. function fchkUser(){
  227. var userAuth = ""
  228. var loginID = getUserId(); //로그인ID
  229. var dutplcecd = getUserInfo("dutplcecd");
  230. var rgstrdeptcd = model.getValue("/root/main/cond/rgstrdeptcd"); //등록부서
  231. var rgstID = model.getValue("/root/main/cond/rgstrid"); //등록자ID
  232. var chfID = model.getValue("/root/main/cond/chfid"); //팀장ID
  233. var staffid = model.getValue("/root/main/cond/staffid"); //간사ID
  234. if(checkUserGroup("UGE_QIO")){
  235. userAuth = "Q";
  236. }
  237. else if(loginID == rgstID || loginID == chfID || loginID == staffid || dutplcecd == rgstrdeptcd ){
  238. userAuth = "U";
  239. }
  240. else if(loginID != rgstID && loginID != chfID && loginID != staffid){
  241. userAuth = "O";
  242. }
  243. return userAuth;
  244. }
  245. function fChkSave()
  246. {
  247. if (model.getValue("/root/main/cond/majrdeptnm") == "")
  248. {
  249. messageBox("주무부서는","I003");
  250. return false;
  251. }
  252. if (model.getValue("/root/main/cond/chfhngnm") == "" | model.getValue("/root/main/cond/chfdeptnm") == "")
  253. {
  254. messageBox("팀장은","I003");
  255. return false;
  256. }
  257. if (model.getValue("/root/main/cond/staffhngnm") == "" || model.getValue("/root/main/cond/staffdeptnm") == "")
  258. {
  259. messageBox("간사는","I003");
  260. return false;
  261. }
  262. }
  263. function fDel()
  264. {
  265. var prcsstatcd = model.getValue("/root/main/cond/prcsstatcd");
  266. var prcsstagecd = model.getValue("/root/main/cond/prcsstagecd");
  267. var planrgstrid = model.getValue("/root/main/cond/planrgstrid");
  268. var planrgstrhngnm = model.getValue("/root/main/cond/planrgstrhngnm");
  269. var userAuth = "";
  270. userAuth = fchkUser(); //사용자별 권한정보 가져오기
  271. if (userAuth != "Q"){
  272. if (prcsstatcd != "1") {
  273. messageBox("삭제할 수 없는 상태입니다","I999");
  274. return false;
  275. }
  276. if (planrgstrid != getUserInfo("userid")) {
  277. messageBox("삭제할 수 있는 사용자가 아닙니다. 등록자:"+planrgstrhngnm,"I999");
  278. return false;
  279. }
  280. }
  281. if ( messageBox ( "삭제 하시겠습니까?","Q") != "6" )
  282. return false;
  283. model.removenode("/root/send/cond/condition");
  284. model.makeNode("/root/send/cond/condition");
  285. copyNodeType("/root/send/cond/condition", "/root/main/cond", "replace");
  286. submit("TXMQK00200");
  287. var delcnt = model.getValue("/root/hidden/cnt/delcnt");
  288. if (delcnt > 0){
  289. messageBox("정상","I002");
  290. window.close();
  291. }
  292. else {
  293. messageBox("삭제오류","");
  294. }
  295. }