123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- /* ---------------------------------------------------------------------
- *
- * SMRFC00600_수리부품코드등록.xrw
- *
- * - Version :
- * 1) : Ver.1.00.01
- * : Create By
- * : 2010.08.13
- ---------------------------------------------------------------------- */
- // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
- function fInitialize() {
-
- rszfUserGoodFlagList(cmb_goodflag_search,getUserInfo("userid"));
- misfComboComCdListMulti("R0039,R0035,Z0007", "cmb_deliveunit,cmb_prodplce,cmb_instcd");
-
- model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
- //물품구분일 경우 첫번째 index 자동 설정
- //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= B) => (goodflag= BC)
- model.setValue(cmb_goodflag_search.attribute("ref"), "BC");
-
- misfGridInit(grd_goodlist);
- misfGridInit(grd_costhistinfo);
- model.resetInstanceNode("/root/main/gooddet/gooddetlist");
- misfComboCopyItemSet(cmb_deliveunit, "" , grd_costhistinfo, "deliveunit"); //수불단위
- misfComboCopyItemSet(cmb_prodplce , "" , grd_costhistinfo, "prodplce" ); //제조국
-
- rszfLMSComboList("BC", "", "", "cmb_lrgcd_search", "", "L", "Y", "Y");
- rszfLMSComboList("BC", "", "", "ipt_lrgcd", "", "L", "", "Y");
- model.refresh();
-
- }
-
- function fCheckAuth() {
- btn_search.disabled = !checkAuth("R") ;
- btn_save.disabled = !checkAuth("X") ;
- }
-
- function fDisabledControl(state)
- {
- if (state == "i"){
- btn_choidel.disabled = true;
- btn_save.disabled = false;
- btn_goodcdcopy.disabled = false;
-
- ipt_nonusetretdd.disabled = true;
- ipt_nonusetretresn.disabled = true;
- btn_maincustlastsuplplce.disabled = false
- btn_suppcustcd.disabled = false;
- btn_mngtdeptcd.disabled = false;
- ipt_lrgcd.disabled = false;
- ipt_mdlcd.disabled = false;
- ipt_smlcd.disabled = false;
-
- }
- if (state == "u"){
- btn_choidel.disabled = false;
- btn_save.disabled = false;
-
- btn_goodcdcopy.disabled = true;
-
- ipt_nonusetretdd.disabled = false;
- ipt_nonusetretresn.disabled = false;
- btn_maincustlastsuplplce.disabled = false
- btn_suppcustcd.disabled = false;
- btn_mngtdeptcd.disabled = false;
-
- ipt_lrgcd.disabled = true;
- ipt_mdlcd.disabled = true;
- ipt_smlcd.disabled = true;
-
- }
- if (state == "d"){
- btn_goodcdcopy.disabled = true;
-
- ipt_nonusetretdd.disabled = true;
- ipt_nonusetretresn.disabled = true;
-
- btn_choidel.disabled = false;
- btn_save.disabled = false;
-
- btn_goodcdcopy.disabled = true;
-
- ipt_nonusetretdd.disabled = true;
- ipt_nonusetretresn.disabled = true;
- btn_maincustlastsuplplce.disabled = true;
- btn_suppcustcd.disabled = true;
- btn_mngtdeptcd.disabled = true;
- ipt_lrgcd.disabled = true;
- ipt_mdlcd.disabled = true;
- ipt_smlcd.disabled = true;
- }
- if (state == "x" || state == "h"){
- btn_choidel.disabled = true;
- btn_save.disabled = true;
-
- btn_goodcdcopy.disabled = true;
-
- ipt_nonusetretdd.disabled = true;
- ipt_nonusetretresn.disabled = true;
- btn_maincustlastsuplplce.disabled = true;
- btn_suppcustcd.disabled = true;
- btn_mngtdeptcd.disabled = true;
- ipt_lrgcd.disabled = true;
- ipt_mdlcd.disabled = true;
- ipt_smlcd.disabled = true;
- }
-
- }
-
- function fGoodCdCopy()
- {
- if(model.getValue(cmb_goodflag_search.attribute("ref")).length== 0 )
- {
- messageBox("물품구분을 " ,"C002");
- model.setFocus("cmb_goodflag");
- return false;
- }
- if(model.getValue(ipt_lrgcd.attribute("ref")).length== 0 )
- {
- messageBox("대분류코드를 " ,"C002");
- model.setFocus("ipt_lrgcd");
- return false;
- }
- if(model.getValue(ipt_mdlcd.attribute("ref")).length== 0 )
- {
- messageBox("중분류코드를 " ,"C002");
- model.setFocus("ipt_mdlcd");
- return false;
- }
-
- model.setValue("/root/send/goodcopy/instcd" , model.getValue(cmb_instcd.attribute("ref")));
- model.setValue("/root/send/goodcopy/goodflag" , model.getValue(cmb_goodflag_search.attribute("ref")));
- model.setValue("/root/send/goodcopy/lrgcd" , model.getValue(ipt_lrgcd.attribute("ref")));
- model.setValue("/root/send/goodcopy/mdlcd" , model.getValue(ipt_mdlcd.attribute("ref")));
- model.setValue("/root/send/goodcopy/smlcd" , model.getValue(ipt_smlcd.attribute("ref")));
-
- submit("TRRFC00601");
- var goodcd = model.getValue("/root/main/goodcopy/goodlist/goodcd");
- //if(goodcd.length == 0)goodcd = model.getValue(cmb_goodflag_search.attribute("ref")) + model.getValue(ipt_lrgcd.attribute("ref")) + model.getValue(ipt_mdlcd.attribute("ref")) + "0001";
-
- model.setValue(ipt_goodcd.attribute("ref"), goodcd);
- grp_detail.refresh();
- }
-
- function fSetDataSave() {
-
- var status = model.getValue(ipt_status.attribute("ref"));
- var instcd = model.getValue(cmb_instcd.attribute("ref"));
- var goodflag = model.getValue(cmb_goodflag_search.attribute("ref"));
- var fromdd = model.getValue(ipt_fromdd.attribute("ref"));
- var lrgcd = model.getValue(ipt_lrgcd.attribute("ref"));
- var mdlcd = model.getValue(ipt_mdlcd.attribute("ref"));
- var smlcd = model.getValue(ipt_smlcd.attribute("ref"));
- var goodcd = model.getValue(ipt_goodcd.attribute("ref"));
- var goodnm = model.getValue(ipt_goodnm.attribute("ref"));
- var goodhngnm = model.getValue(ipt_goodhngnm.attribute("ref"));
- var goodengnm = model.getValue(ipt_goodengnm.attribute("ref"));
- var goodspec = model.getValue(ipt_goodspec.attribute("ref"));
- var goodmodel = model.getValue(ipt_goodmodel.attribute("ref"));
- var maincustlastsuplplce = model.getValue(ipt_maincustlastsuplplce.attribute("ref"));
- var suppcustcd = model.getValue(ipt_suppcustcd.attribute("ref"));
- var deliveunit = model.getValue(cmb_deliveunit.attribute("ref"));
- var prodplce = model.getValue(cmb_prodplce.attribute("ref"));
- var winacnt = model.getValue(ipt_winacnt.attribute("ref"));
- var amtacnt = model.getValue(ipt_amtacnt.attribute("ref"));
- var goodunitcost = model.getValue(ipt_goodunitcost.attribute("ref"));
- var mainmngtdeptcd = model.getValue(ipt_mainmngtdeptcd.attribute("ref"));
- var prodcmpycd = model.getValue(ipt_prodcmpycd.attribute("ref"));
- var cmt = model.getValue(tar_cmt.attribute("ref"));
- var mdlcd = model.getValue(ipt_mdlcd.attribute("ref"));
- var smlcd = model.getValue(ipt_smlcd.attribute("ref"));
- var appfixasetcd = model.getValue(ipt_appfixasetcd.attribute("ref"));
- var todd = model.getValue(ipt_nonusetretdd.attribute("ref"));
- var nonusetretresn = model.getValue(ipt_nonusetretresn.attribute("ref"));
- goodhngnm = ( goodhngnm == null ) ? "-" : goodhngnm ;
- goodengnm = ( goodengnm == null ) ? "-" : goodengnm ;
- goodspec = ( goodspec == null ) ? "-" : goodspec ;
- goodmodel = ( goodmodel == null ) ? "-" : goodmodel ;
- mdlcd = ( mdlcd == null ) ? "-" : mdlcd ;
- smlcd = ( smlcd == null ) ? "-" : smlcd ;
- amtacnt = ( amtacnt == null ) ? "-" : amtacnt ;
- mainmngtdeptcd = ( mainmngtdeptcd == null ) ? "-" : mainmngtdeptcd ;
- prodplce = ( prodplce == null ) ? "-" : prodplce ;
- prodcmpycd = ( prodcmpycd == null ) ? "-" : prodcmpycd ;
- goodunitcost = ( goodunitcost == null ) ? "0" : goodunitcost ;
- maincustlastsuplplce = ( maincustlastsuplplce == null ) ? "-" : maincustlastsuplplce ;
- suppcustcd = ( suppcustcd == null ) ? "-" : suppcustcd ;
- cmt = ( cmt == null ) ? "-" : cmt ;
- todd = ( todd == null ) ? "-" : todd ;
- nonusetretresn = ( nonusetretresn == null ) ? "-" : nonusetretresn ;
-
- var save = "m" + "▦" // 타이틀 setting
- + "instcd" + "▦"
- + "goodflag" + "▦"
- + "fromdd" + "▦"
- + "lrgcd" + "▦"
- + "mdlcd" + "▦"
- + "smlcd" + "▦"
- + "goodcd" + "▦"
- + "goodnm" + "▦"
- + "goodhngnm" + "▦"
- + "goodengnm" + "▦"
- + "goodspec" + "▦"
- + "goodmodel" + "▦"
- + "maincustlastsuplplce" + "▦"
- + "suppcustcd" + "▦"
- + "deliveunit" + "▦"
- + "prodplce" + "▦"
- + "winacnt" + "▦"
- + "amtacnt" + "▦"
- + "goodunitcost" + "▦"
- + "mainmngtdeptcd" + "▦"
- + "prodcmpycd" + "▦"
- + "todd" + "▦"
- + "nonusetretresn" + "▦"
- + "appfixasetcd" + "▦"
- + "cmt" + "▩"
- + status + "▦" // 해당 값들 setting
- + instcd + "▦"
- + goodflag + "▦"
- + fromdd + "▦"
- + lrgcd + "▦"
- + mdlcd + "▦"
- + smlcd + "▦"
- + goodcd + "▦"
- + goodnm + "▦"
- + goodhngnm + "▦"
- + goodengnm + "▦"
- + goodspec + "▦"
- + goodmodel + "▦"
- + maincustlastsuplplce + "▦"
- + suppcustcd + "▦"
- + deliveunit + "▦"
- + prodplce + "▦"
- + winacnt + "▦"
- + amtacnt + "▦"
- + goodunitcost + "▦"
- + mainmngtdeptcd + "▦"
- + prodcmpycd + "▦"
- + todd + "▦"
- + nonusetretresn + "▦"
- + appfixasetcd + "▦"
- + cmt + "▩" ;
- model.makeValue("/root/send/save/goodlist", save);
- }
- // 부품 마스터 저장시 데이타 Validation 체크
- function fDataValiChk()
- {
- var smsg = "";
-
- if(ipt_goodcd.value.getTrim()=="") smsg += cap_goodcd.value.getTrim() +", ";
- //if(ipt_goodnm.value.getTrim()=="") smsg += cap_goodnm.value.getTrim() +", ";
- if(ipt_goodengnm.value.getTrim()=="") smsg += cap_goodengnm.value.getTrim() +", ";
- if(ipt_goodhngnm.value.getTrim()=="") smsg += cap_goodhngnm.value.getTrim() +", ";
- //if(ipt_goodmodel.value.getTrim()=="") smsg += cap_goodmodel.value.getTrim() +", ";
- if(ipt_goodspec.value.getTrim()=="") smsg += cap_goodspec.value.getTrim() +", ";
- if(ipt_fromdd.value.getTrim()=="") smsg += cap_fromdd.value.getTrim() +", ";
- if(ipt_lrgcd.value.getTrim()=="") smsg += cap_lrgcd.value.getTrim() +", ";
- if(ipt_mdlcd.value.getTrim()=="") smsg += cap_mdlcd.value.getTrim() +", ";
- //if(ipt_maincustlastsuplplce.value.getTrim() == "") smsg += cap_maincustlastsuplplce.value.getTrim() +", ";
- //if(ipt_winacnt.value.getTrim()=="") smsg += cap_winacnt.value.getTrim() +", ";
- //if(ipt_amtacnt.value.getTrim()=="") smsg += cap_amtacnt.value.getTrim() +", ";
- if(cmb_deliveunit.value.getTrim()=="") smsg += cap_deliveunit.value.getTrim() +", ";
- if (smsg == ""){
- return true;
- }else{
- messageBox(smsg.substr(0, smsg.length-2) + "은(는)","I003");
- return false;
-
- }
- }
-
- /* ------------------------------------------------- */
- /* ------End Of List ------------------------------- */
- /* -------------------------------------------------- */
|