123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352 |
- var acptno = "";
- /**
- * @---------------------------------------------------
- * @desc : SMMQK00100_QI활동계획서가 load될때 실행되는 function
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- var ano = "";
-
- if(isPopup() == true){
- acptno = opener.javascript.getParameter("ano");
- model.setValue("/root/main/cond/acptno", acptno);
- }
-
- /*+++++++++++++++++++++++권한별 화면 설정+++++++++++++++++++++++*/
- groupRevitalize("grp_plan", "D", "N"); //모든 콘트롤 활성화로 초기화
- var userAuth = "";
-
- //최초등록일 경우
- if(acptno == ""){
- model.setValue("/root/main/cond/prcsstagecd", "0");
- var rgstrid = getUserId();
- var rgstrhngnm = getUserInfo("usernm");
- var rgstrdeptcd = getUserInfo("dutplcecd");
- var rgstrdeptnm = getUserInfo("dutplcenm");
- var rgstdd = getCurrentDate();
-
- model.setValue("/root/main/cond/rgstrid", rgstrid);
- model.setValue("/root/main/cond/rgstrhngnm", rgstrhngnm);
- model.setValue("/root/main/cond/rgstrdeptcd", rgstrdeptcd);
- model.setValue("/root/main/cond/rgstrdeptnm", rgstrdeptnm);
- model.setValue("/root/main/cond/rgstrdd", rgstdd);
- model.setValue("/root/main/cond/prizyn", "N"); //포상유무
-
- btn_fbreflt.disabled = true;
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
-
- }
- //조회일 경우
- else if(acptno != ""){
-
- submit("TRMQK00100");
- copyNodeType("/root/main/cond", "/root/tmp/cond", "replace");
- model.refresh();
-
- var prcsstatcd = model.getValue("/root/main/cond/prcsstatcd");
- userAuth = fchkUser(); //사용자별 권한정보 가져오기
-
- //1. 현재상태가 저장인 경우
- if(prcsstatcd == "1"){
- tar_feedbackcnts.disabled = true;
- btn_fbreflt.disabled = true;
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- }
- //2. 현재상태가 전송인 경우
- if(prcsstatcd == "2"){
- groupRevitalize("grp_plan", "D", "Y");
- btn_filedown.disabled = false;
- if(userAuth == "U"){
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- }
- if(userAuth == "Q"){
- btn_fbreq.disabled = false;
- btn_end.disabled = false;
- }
- }
- //3. 현재상태가 F/B요청 경우
- if(prcsstatcd == "3"){
- if(userAuth == "U"){
- btn_save.disabled = true;
- btn_tran.disabled = true;
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- }
- else if(userAuth == "Q"){
- groupRevitalize("grp_plan", "D", "Y");
- btn_filedown.disabled = false;
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- //QI팀이라도 등록자, 팀장,간사에 속해있으면 F/B반영을 할수잇다.
- var loginID = getUserId();
- var rgstID = model.getValue("/root/main/cond/rgstrid");
- var chfID = model.getValue("/root/main/cond/chfid");
- var staffid = model.getValue("/root/main/cond/staffid");
- if(loginID == rgstID || loginID == chfID || loginID == staffid){
- groupRevitalize("grp_plan", "D", "N");
- btn_save.disabled = true;
- btn_tran.disabled = true;
- }
- }
- }
- //4. 현재상태가 F/B반영 경우
- if(prcsstatcd == "4"){
- if(userAuth == "U"){
- groupRevitalize("grp_plan", "D", "Y");
- btn_filedown.disabled = false;
- btn_save.disabled = true;
- btn_tran.disabled = true;
- btn_fbreflt.disabled = true;
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- }
- else if(userAuth == "Q"){
- groupRevitalize("grp_plan", "D", "Y");
- btn_filedown.disabled = false;
- btn_fbreq.disabled = false;
- btn_end.disabled = false;
- }
- }
- //5. 현재상태가 마감인 경우
- if(prcsstatcd == "5"){
- groupRevitalize("grp_plan", "D", "Y");
- btn_filedown.disabled = false;
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- }
- }
-
- //첨부파일 유무에따른 버튼활성화 상태 설정
- if(model.getValue("/root/main/cond/attfile") == ""){
- btn_filedel.disabled = true;
- btn_filedown.disabled = true;
- }
- //Qi팀 여부에따른 FeedBack입력란 활성화
- if(userAuth == "Q" && prcsstatcd != "5" && prcsstatcd != "1" && prcsstatcd != "3"){
- tar_feedbackcnts.disabled = false;
- }
- else{
- tar_feedbackcnts.disabled = true;
- }
- //Other이면 조회만 되게끔 설정
- if(userAuth == "O"){
- groupRevitalize("grp_plan", "D", "Y");
- btn_fbreq.disabled = true;
- btn_end.disabled = true;
- tar_feedbackcnts.disabled = true;
- btn_filedown.disabled = false;
- }
-
- //양식 저장경로 가져오기
- submit("TRMQK00103");
- btn_fileform.disabled = false;
-
- //항상
- btn_del.disabled = false;
-
- /*+++++++++++++++++++++++권한별 화면 설정 끝+++++++++++++++++++++++*/
-
-
- mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/dept", "I");
-
- model.refresh();
- }
- /**
- * @---------------------------------------------------
- * @desc : 팀장, 간사 세부정보 조회 function
- * @param : kind : 팀장간사구분
- * @return :
- * @---------------------------------------------------
- */
- function getUserPopInfo(kind){
- model.resetInstanceNode("/root/main/userpopupinfo");
- model.removeNodeset("/root/main/tempuserinfo");
- model.makeNode("/root/main/tempuserinfo");
- model.removeNode("/root/send/userinfo/userid");
- model.makeNode("/root/send/userinfo/userid");
- model.setValue("/root/main/userpopupinfo/param", "_OneS_DD");
-
- modal("SPZSU10103_사용자부서선택조회", "", "200", "200", "SPZSU10103","/root/main/userpopupinfo","/root/main/temp");
- var iParam = getParameter("SPZSU10103_");
- setCSVToNode("/root/main/tempuserinfo", iParam);
- clearParameter("SPZSU10103_");
- var emplno = model.getValue("/root/main/tempuserinfo/list/userid");
- var empInm = model.getValue("/root/main/tempuserinfo/list/usernm");
- //2017.02.28 팀장 및 간사 소속부서를 근무지부서로 수정
- //var empdeptcd = model.getValue("/root/main/tempuserinfo/list/posdeptcd");
- //var empdeptnm = model.getValue("/root/main/tempuserinfo/list/posdeptnm");
-
- var empdeptcd = model.getValue("/root/main/tempuserinfo/list/dutplcecd");
- var empdeptnm = model.getValue("/root/main/tempuserinfo/list/dutplcenm");
-
- model.setValue("/root/send/userinfo/userid", emplno);
- submit("TRMQK00101");
-
- var empemail = model.getValue("/root/tmp/userinfo/email");
- var emptel = model.getValue("/root/tmp/userinfo/tel");
- var empmpphonno = model.getValue("/root/tmp/userinfo/mpphonno");
-
- if(kind == "1"){
- model.setValue("/root/main/cond/chfid", emplno);
- model.setValue("/root/main/cond/chfhngnm", empInm);
- model.setValue("/root/main/cond/chfdeptcd", empdeptcd);
- model.setValue("/root/main/cond/chfdeptnm", empdeptnm);
- model.setValue("/root/main/cond/chfemail", empemail);
- model.setValue("/root/main/cond/chfcntctel", emptel);
- model.setValue("/root/main/cond/chfceltel", empmpphonno);
-
- }
- else if(kind == "2"){
- model.setValue("/root/main/cond/staffid", emplno);
- model.setValue("/root/main/cond/staffhngnm", empInm);
- model.setValue("/root/main/cond/staffdeptcd", empdeptcd);
- model.setValue("/root/main/cond/staffdeptnm", empdeptnm);
- model.setValue("/root/main/cond/staffemail", empemail);
- model.setValue("/root/main/cond/staffcntctel", emptel);
- model.setValue("/root/main/cond/staffceltel", empmpphonno);
- }
-
- model.refresh();
- }
- /**
- * @---------------------------------------------------
- * @desc : QI활동 계획서 저장 function
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSave(){
- /*+++++++++++++++++++++++필수 입력란 체크+++++++++++++++++++++++*/
- if(!isRequiredGroup("grp_plan")){
- return false;
- }
-
- if(fChkSave() == false ){
- return false;
- }
- /*+++++++++++++++++++++++끝+++++++++++++++++++++++*/
-
- model.removenode("/root/send/cond/condition");
- model.makeNode("/root/send/cond/condition");
- copyNodeType("/root/send/cond/condition", "/root/main/cond", "replace");
- submit("TXMQK00100");
-
- model.removenode("/root/send/cond/attach/file");
- model.makeNode("/root/send/cond/attach/file");
-
-
- acptno = model.getValue("/root/main/cond/acptno");
- model.setValue("/root/main/cond/prcsstagecd" , "0");
- fInitialize();
- }
- /**
- * @---------------------------------------------------
- * @desc : Login User 권한 조회
- * @param :
- * @return : userAuth(사용자권한) U:사용자 Q:QI관리자 O:Other
- * @---------------------------------------------------
- */
- function fchkUser(){
-
- var userAuth = ""
- var loginID = getUserId(); //로그인ID
- var dutplcecd = getUserInfo("dutplcecd");
- var rgstrdeptcd = model.getValue("/root/main/cond/rgstrdeptcd"); //등록부서
- var rgstID = model.getValue("/root/main/cond/rgstrid"); //등록자ID
- var chfID = model.getValue("/root/main/cond/chfid"); //팀장ID
- var staffid = model.getValue("/root/main/cond/staffid"); //간사ID
-
- if(checkUserGroup("UGE_QIO")){
- userAuth = "Q";
- }
- else if(loginID == rgstID || loginID == chfID || loginID == staffid || dutplcecd == rgstrdeptcd ){
- userAuth = "U";
- }
- else if(loginID != rgstID && loginID != chfID && loginID != staffid){
- userAuth = "O";
- }
-
- return userAuth;
- }
- function fChkSave()
- {
- if (model.getValue("/root/main/cond/majrdeptnm") == "")
- {
- messageBox("주무부서는","I003");
- return false;
- }
-
- if (model.getValue("/root/main/cond/chfhngnm") == "" | model.getValue("/root/main/cond/chfdeptnm") == "")
- {
- messageBox("팀장은","I003");
- return false;
- }
-
- if (model.getValue("/root/main/cond/staffhngnm") == "" || model.getValue("/root/main/cond/staffdeptnm") == "")
- {
- messageBox("간사는","I003");
- return false;
- }
-
- }
- function fDel()
- {
-
- var prcsstatcd = model.getValue("/root/main/cond/prcsstatcd");
- var prcsstagecd = model.getValue("/root/main/cond/prcsstagecd");
- var planrgstrid = model.getValue("/root/main/cond/planrgstrid");
- var planrgstrhngnm = model.getValue("/root/main/cond/planrgstrhngnm");
-
-
- var userAuth = "";
-
- userAuth = fchkUser(); //사용자별 권한정보 가져오기
-
- if (userAuth != "Q"){
-
- if (prcsstatcd != "1") {
- messageBox("삭제할 수 없는 상태입니다","I999");
- return false;
- }
-
- if (planrgstrid != getUserInfo("userid")) {
- messageBox("삭제할 수 있는 사용자가 아닙니다. 등록자:"+planrgstrhngnm,"I999");
- return false;
- }
-
-
-
- }
-
- if ( messageBox ( "삭제 하시겠습니까?","Q") != "6" )
- return false;
-
-
- model.removenode("/root/send/cond/condition");
- model.makeNode("/root/send/cond/condition");
- copyNodeType("/root/send/cond/condition", "/root/main/cond", "replace");
- submit("TXMQK00200");
-
- var delcnt = model.getValue("/root/hidden/cnt/delcnt");
-
- if (delcnt > 0){
- messageBox("정상","I002");
- window.close();
- }
- else {
- messageBox("삭제오류","");
- }
- }
|