SMRFC00600.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /* ---------------------------------------------------------------------
  2. *
  3. * SMRFC00600_수리부품코드등록.xrw
  4. *
  5. * - Version :
  6. * 1) : Ver.1.00.01
  7. * : Create By
  8. * : 2010.08.13
  9. ---------------------------------------------------------------------- */
  10. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  11. function fInitialize() {
  12. rszfUserGoodFlagList(cmb_goodflag_search,getUserInfo("userid"));
  13. misfComboComCdListMulti("R0039,R0035,Z0007", "cmb_deliveunit,cmb_prodplce,cmb_instcd");
  14. model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
  15. //물품구분일 경우 첫번째 index 자동 설정
  16. //[2010.08.26]AS-IS 코드 TO_BE 코드 전환을 위한 물품구분 변경 (goodflag= B) => (goodflag= BC)
  17. model.setValue(cmb_goodflag_search.attribute("ref"), "BC");
  18. misfGridInit(grd_goodlist);
  19. misfGridInit(grd_costhistinfo);
  20. model.resetInstanceNode("/root/main/gooddet/gooddetlist");
  21. misfComboCopyItemSet(cmb_deliveunit, "" , grd_costhistinfo, "deliveunit"); //수불단위
  22. misfComboCopyItemSet(cmb_prodplce , "" , grd_costhistinfo, "prodplce" ); //제조국
  23. rszfLMSComboList("BC", "", "", "cmb_lrgcd_search", "", "L", "Y", "Y");
  24. rszfLMSComboList("BC", "", "", "ipt_lrgcd", "", "L", "", "Y");
  25. model.refresh();
  26. }
  27. function fCheckAuth() {
  28. btn_search.disabled = !checkAuth("R") ;
  29. btn_save.disabled = !checkAuth("X") ;
  30. }
  31. function fDisabledControl(state)
  32. {
  33. if (state == "i"){
  34. btn_choidel.disabled = true;
  35. btn_save.disabled = false;
  36. btn_goodcdcopy.disabled = false;
  37. ipt_nonusetretdd.disabled = true;
  38. ipt_nonusetretresn.disabled = true;
  39. btn_maincustlastsuplplce.disabled = false
  40. btn_suppcustcd.disabled = false;
  41. btn_mngtdeptcd.disabled = false;
  42. ipt_lrgcd.disabled = false;
  43. ipt_mdlcd.disabled = false;
  44. ipt_smlcd.disabled = false;
  45. }
  46. if (state == "u"){
  47. btn_choidel.disabled = false;
  48. btn_save.disabled = false;
  49. btn_goodcdcopy.disabled = true;
  50. ipt_nonusetretdd.disabled = false;
  51. ipt_nonusetretresn.disabled = false;
  52. btn_maincustlastsuplplce.disabled = false
  53. btn_suppcustcd.disabled = false;
  54. btn_mngtdeptcd.disabled = false;
  55. ipt_lrgcd.disabled = true;
  56. ipt_mdlcd.disabled = true;
  57. ipt_smlcd.disabled = true;
  58. }
  59. if (state == "d"){
  60. btn_goodcdcopy.disabled = true;
  61. ipt_nonusetretdd.disabled = true;
  62. ipt_nonusetretresn.disabled = true;
  63. btn_choidel.disabled = false;
  64. btn_save.disabled = false;
  65. btn_goodcdcopy.disabled = true;
  66. ipt_nonusetretdd.disabled = true;
  67. ipt_nonusetretresn.disabled = true;
  68. btn_maincustlastsuplplce.disabled = true;
  69. btn_suppcustcd.disabled = true;
  70. btn_mngtdeptcd.disabled = true;
  71. ipt_lrgcd.disabled = true;
  72. ipt_mdlcd.disabled = true;
  73. ipt_smlcd.disabled = true;
  74. }
  75. if (state == "x" || state == "h"){
  76. btn_choidel.disabled = true;
  77. btn_save.disabled = true;
  78. btn_goodcdcopy.disabled = true;
  79. ipt_nonusetretdd.disabled = true;
  80. ipt_nonusetretresn.disabled = true;
  81. btn_maincustlastsuplplce.disabled = true;
  82. btn_suppcustcd.disabled = true;
  83. btn_mngtdeptcd.disabled = true;
  84. ipt_lrgcd.disabled = true;
  85. ipt_mdlcd.disabled = true;
  86. ipt_smlcd.disabled = true;
  87. }
  88. }
  89. function fGoodCdCopy()
  90. {
  91. if(model.getValue(cmb_goodflag_search.attribute("ref")).length== 0 )
  92. {
  93. messageBox("물품구분을 " ,"C002");
  94. model.setFocus("cmb_goodflag");
  95. return false;
  96. }
  97. if(model.getValue(ipt_lrgcd.attribute("ref")).length== 0 )
  98. {
  99. messageBox("대분류코드를 " ,"C002");
  100. model.setFocus("ipt_lrgcd");
  101. return false;
  102. }
  103. if(model.getValue(ipt_mdlcd.attribute("ref")).length== 0 )
  104. {
  105. messageBox("중분류코드를 " ,"C002");
  106. model.setFocus("ipt_mdlcd");
  107. return false;
  108. }
  109. model.setValue("/root/send/goodcopy/instcd" , model.getValue(cmb_instcd.attribute("ref")));
  110. model.setValue("/root/send/goodcopy/goodflag" , model.getValue(cmb_goodflag_search.attribute("ref")));
  111. model.setValue("/root/send/goodcopy/lrgcd" , model.getValue(ipt_lrgcd.attribute("ref")));
  112. model.setValue("/root/send/goodcopy/mdlcd" , model.getValue(ipt_mdlcd.attribute("ref")));
  113. model.setValue("/root/send/goodcopy/smlcd" , model.getValue(ipt_smlcd.attribute("ref")));
  114. submit("TRRFC00601");
  115. var goodcd = model.getValue("/root/main/goodcopy/goodlist/goodcd");
  116. //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";
  117. model.setValue(ipt_goodcd.attribute("ref"), goodcd);
  118. grp_detail.refresh();
  119. }
  120. function fSetDataSave() {
  121. var status = model.getValue(ipt_status.attribute("ref"));
  122. var instcd = model.getValue(cmb_instcd.attribute("ref"));
  123. var goodflag = model.getValue(cmb_goodflag_search.attribute("ref"));
  124. var fromdd = model.getValue(ipt_fromdd.attribute("ref"));
  125. var lrgcd = model.getValue(ipt_lrgcd.attribute("ref"));
  126. var mdlcd = model.getValue(ipt_mdlcd.attribute("ref"));
  127. var smlcd = model.getValue(ipt_smlcd.attribute("ref"));
  128. var goodcd = model.getValue(ipt_goodcd.attribute("ref"));
  129. var goodnm = model.getValue(ipt_goodnm.attribute("ref"));
  130. var goodhngnm = model.getValue(ipt_goodhngnm.attribute("ref"));
  131. var goodengnm = model.getValue(ipt_goodengnm.attribute("ref"));
  132. var goodspec = model.getValue(ipt_goodspec.attribute("ref"));
  133. var goodmodel = model.getValue(ipt_goodmodel.attribute("ref"));
  134. var maincustlastsuplplce = model.getValue(ipt_maincustlastsuplplce.attribute("ref"));
  135. var suppcustcd = model.getValue(ipt_suppcustcd.attribute("ref"));
  136. var deliveunit = model.getValue(cmb_deliveunit.attribute("ref"));
  137. var prodplce = model.getValue(cmb_prodplce.attribute("ref"));
  138. var winacnt = model.getValue(ipt_winacnt.attribute("ref"));
  139. var amtacnt = model.getValue(ipt_amtacnt.attribute("ref"));
  140. var goodunitcost = model.getValue(ipt_goodunitcost.attribute("ref"));
  141. var mainmngtdeptcd = model.getValue(ipt_mainmngtdeptcd.attribute("ref"));
  142. var prodcmpycd = model.getValue(ipt_prodcmpycd.attribute("ref"));
  143. var cmt = model.getValue(tar_cmt.attribute("ref"));
  144. var mdlcd = model.getValue(ipt_mdlcd.attribute("ref"));
  145. var smlcd = model.getValue(ipt_smlcd.attribute("ref"));
  146. var appfixasetcd = model.getValue(ipt_appfixasetcd.attribute("ref"));
  147. var todd = model.getValue(ipt_nonusetretdd.attribute("ref"));
  148. var nonusetretresn = model.getValue(ipt_nonusetretresn.attribute("ref"));
  149. goodhngnm = ( goodhngnm == null ) ? "-" : goodhngnm ;
  150. goodengnm = ( goodengnm == null ) ? "-" : goodengnm ;
  151. goodspec = ( goodspec == null ) ? "-" : goodspec ;
  152. goodmodel = ( goodmodel == null ) ? "-" : goodmodel ;
  153. mdlcd = ( mdlcd == null ) ? "-" : mdlcd ;
  154. smlcd = ( smlcd == null ) ? "-" : smlcd ;
  155. amtacnt = ( amtacnt == null ) ? "-" : amtacnt ;
  156. mainmngtdeptcd = ( mainmngtdeptcd == null ) ? "-" : mainmngtdeptcd ;
  157. prodplce = ( prodplce == null ) ? "-" : prodplce ;
  158. prodcmpycd = ( prodcmpycd == null ) ? "-" : prodcmpycd ;
  159. goodunitcost = ( goodunitcost == null ) ? "0" : goodunitcost ;
  160. maincustlastsuplplce = ( maincustlastsuplplce == null ) ? "-" : maincustlastsuplplce ;
  161. suppcustcd = ( suppcustcd == null ) ? "-" : suppcustcd ;
  162. cmt = ( cmt == null ) ? "-" : cmt ;
  163. todd = ( todd == null ) ? "-" : todd ;
  164. nonusetretresn = ( nonusetretresn == null ) ? "-" : nonusetretresn ;
  165. var save = "m" + "▦" // 타이틀 setting
  166. + "instcd" + "▦"
  167. + "goodflag" + "▦"
  168. + "fromdd" + "▦"
  169. + "lrgcd" + "▦"
  170. + "mdlcd" + "▦"
  171. + "smlcd" + "▦"
  172. + "goodcd" + "▦"
  173. + "goodnm" + "▦"
  174. + "goodhngnm" + "▦"
  175. + "goodengnm" + "▦"
  176. + "goodspec" + "▦"
  177. + "goodmodel" + "▦"
  178. + "maincustlastsuplplce" + "▦"
  179. + "suppcustcd" + "▦"
  180. + "deliveunit" + "▦"
  181. + "prodplce" + "▦"
  182. + "winacnt" + "▦"
  183. + "amtacnt" + "▦"
  184. + "goodunitcost" + "▦"
  185. + "mainmngtdeptcd" + "▦"
  186. + "prodcmpycd" + "▦"
  187. + "todd" + "▦"
  188. + "nonusetretresn" + "▦"
  189. + "appfixasetcd" + "▦"
  190. + "cmt" + "▩"
  191. + status + "▦" // 해당 값들 setting
  192. + instcd + "▦"
  193. + goodflag + "▦"
  194. + fromdd + "▦"
  195. + lrgcd + "▦"
  196. + mdlcd + "▦"
  197. + smlcd + "▦"
  198. + goodcd + "▦"
  199. + goodnm + "▦"
  200. + goodhngnm + "▦"
  201. + goodengnm + "▦"
  202. + goodspec + "▦"
  203. + goodmodel + "▦"
  204. + maincustlastsuplplce + "▦"
  205. + suppcustcd + "▦"
  206. + deliveunit + "▦"
  207. + prodplce + "▦"
  208. + winacnt + "▦"
  209. + amtacnt + "▦"
  210. + goodunitcost + "▦"
  211. + mainmngtdeptcd + "▦"
  212. + prodcmpycd + "▦"
  213. + todd + "▦"
  214. + nonusetretresn + "▦"
  215. + appfixasetcd + "▦"
  216. + cmt + "▩" ;
  217. model.makeValue("/root/send/save/goodlist", save);
  218. }
  219. // 부품 마스터 저장시 데이타 Validation 체크
  220. function fDataValiChk()
  221. {
  222. var smsg = "";
  223. if(ipt_goodcd.value.getTrim()=="") smsg += cap_goodcd.value.getTrim() +", ";
  224. //if(ipt_goodnm.value.getTrim()=="") smsg += cap_goodnm.value.getTrim() +", ";
  225. if(ipt_goodengnm.value.getTrim()=="") smsg += cap_goodengnm.value.getTrim() +", ";
  226. if(ipt_goodhngnm.value.getTrim()=="") smsg += cap_goodhngnm.value.getTrim() +", ";
  227. //if(ipt_goodmodel.value.getTrim()=="") smsg += cap_goodmodel.value.getTrim() +", ";
  228. if(ipt_goodspec.value.getTrim()=="") smsg += cap_goodspec.value.getTrim() +", ";
  229. if(ipt_fromdd.value.getTrim()=="") smsg += cap_fromdd.value.getTrim() +", ";
  230. if(ipt_lrgcd.value.getTrim()=="") smsg += cap_lrgcd.value.getTrim() +", ";
  231. if(ipt_mdlcd.value.getTrim()=="") smsg += cap_mdlcd.value.getTrim() +", ";
  232. //if(ipt_maincustlastsuplplce.value.getTrim() == "") smsg += cap_maincustlastsuplplce.value.getTrim() +", ";
  233. //if(ipt_winacnt.value.getTrim()=="") smsg += cap_winacnt.value.getTrim() +", ";
  234. //if(ipt_amtacnt.value.getTrim()=="") smsg += cap_amtacnt.value.getTrim() +", ";
  235. if(cmb_deliveunit.value.getTrim()=="") smsg += cap_deliveunit.value.getTrim() +", ";
  236. if (smsg == ""){
  237. return true;
  238. }else{
  239. messageBox(smsg.substr(0, smsg.length-2) + "은(는)","I003");
  240. return false;
  241. }
  242. }
  243. /* ------------------------------------------------- */
  244. /* ------End Of List ------------------------------- */
  245. /* -------------------------------------------------- */