123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /* ---------------------------------------------------------------------
-
- 단가계약 Master Setting
- - Version :
- 1) : Ver.1.00.01
- : Create By Chungpd
- : 2010.11.02
- ---------------------------------------------------------------------- */
- // 초기화하기
- function fInitialize()
- {
- // 금일 날자 설정
- var curdate = getCurrentDate();
- var cvtdate = curdate.toDate("YYYYMMDD");
- var contermfromdd = model.getValue(cal_contermfromdd.attribute("ref"));
-
- misfComboComCdListMulti("Z0007","cmb_instcd");
-
- model.setValue("/root/send/search/instcd" , getUserInfo("dutplceinstcd")); // 기관 설정
- model.setValue(cmb_instcd.attribute("ref"), getUserInfo("dutplceinstcd")); // 기관 설정
- model.setValue(cal_purccondd.attribute("ref") , curdate);
-
- model.setValue("/root/send/nosearch/instcd" , model.getValue(cmb_instcd.attribute("ref")));
- model.setValue("/root/send/nosearch/purccondd" , model.getValue(cal_purccondd.attribute("ref")));
-
- if (submit("TRRSP00102")){
- var purcconno = model.getValue("/root/main/list/purcconnoinfo/maxpurcconno/purcconno");
-
- model.setValue(ipt_purcconno.attribute("ref"), purcconno);
- }
-
- model.setValue("/root/send/nosearch/instcd" , "");
- model.setValue("/root/send/nosearch/purccondd" , "");
- model.refresh();
-
- }
- // 공통에 변경된 사항이 있는지를 인지하기 위한 함수 (불필요한 transaction을 줄이고자하는 의도로 작성했음)
- function fCmprChngVal()
- {
- var bfpath = "/root/submain/list/purcconinfo/purcconmainlist";
- var prestpath = "/root/main/list/purcconinfo/purcconmainlist";
- var chngflag = false;
- if ( model.getValue(bfpath+"/suplplcecd" ) != model.getValue(prestpath+"/suplplcecd" ) // 납품처코드
- || model.getValue(bfpath+"/contermfromdd") != model.getValue(prestpath+"/contermfromdd") // 계약기간(from)
- || model.getValue(bfpath+"/contermtodd" ) != model.getValue(prestpath+"/contermtodd" )){ // 계약기간(to)
- chngflag = true;
- }
- return chngflag;
-
- }
- // 저장 - 공통항목으로 Grouping된 것을 하위단에 풀어주며 풀린 데이타를 서버 PGM으로 넘기는 기능이 함수에 녹아있음.
- function fSave(){
- var updtdata = "", rowno = "";
- var goodcntnm = model.getValue("/root/main/list/purcconinfo/purcconmainlist/goodcntnm").getTrim();
- if (goodcntnm == ""){
- messageBox("참조할 계약건이 ", "E014");
- return;
- }
- if (fSaveValiChk() == false) return;
-
- for(i=1;i<grd_purccon.rows;i++){
- var valiflag = grd_purccon.valueMatrix(i, grd_purccon.colRef("valiflag"));
- if (fCmprChngVal() == true && valiflag == "Y"){
- if (grd_purccon.rowStatus(i) == "0"){
- grd_purccon.rowStatus(i) = "2";
- }
-
- grd_purccon.valueMatrix(i, grd_purccon.colRef("suplplcecd" )) = model.getValue(ipt_suplplcecd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("contermfromdd")) = model.getValue(cal_contermfromdd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("contermtodd" )) = model.getValue(cal_contermtodd.attribute("ref"));
- grd_purccon.valueMatrix(i, grd_purccon.colRef("fromdd" )) = model.getValue(cal_contermfromdd.attribute("ref"));
- }
- }
-
- updtdata = getGridUpdateData(grd_purccon);
-
- if(updtdata == ""){
- messageBox("저장할 데이타가 ","E014");
- return false;
- }
-
- model.setValue("/root/send/save/purcconlist", updtdata);
- if (submit("TXRSP00601")){
- messageBox("저장이","I002");
- }else{
- messageBox("저장","E009");
- return;
- }
- //ipt_purcconno.dispatch("xforms-value-changed");
- }
- // 저장하기전에 필수항목 점검
- function fSaveValiChk()
- {
- var smsg = "";
-
- if(cal_contermfromdd.value.getTrim() == "") smsg += "거래처, ";
- if(cal_contermfromdd.value.getTrim() == "") smsg += "계약기간(시작일), ";
- if(cal_contermtodd.value.getTrim() == "") smsg += "계약기간(마감일), ";
- if (smsg == ""){
- return true;
- }else{
- messageBox(smsg.substr(0, smsg.length-2) + "은(는)","I003");
- return false;
- }
- }
- // 데이타의 무결성을 위해 수정시 기본키로 잡혀 있는 계약일자와 번호는 절대 수정 불가능 상태로 만드는 기능
- function fDisabledControl(state)
- {
- cal_purccondd.disabled = state;
- ipt_purcconno.disabled = state;
- }
|