SMRSC03801.js 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040
  1. /* ---------------------------------------------------------------------
  2. SMRSC03801_물품코드 Master Excel등록.xrw (SMRSC03801.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Francis Choi
  6. : 2015.05.02
  7. ---------------------------------------------------------------------- */
  8. // --------------------------------------------------
  9. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  10. // --------------------------------------------------
  11. function fInitialize()
  12. {
  13. model.resetInstanceNode("/root/send");
  14. misfGridInit(grd_instexcellist);
  15. // misfGridInit(grd_excelmaplist);
  16. // misfGridInit(grd_rscdexcellist);
  17. // Spec 일괄 변경에서 사용하는 기존 명칭과 현 명칭을 비교하기 위한 구분으로
  18. // premodel 등.. 기존 데이터를 갖고 있는 변수 설정이 반드시 필요하다.
  19. model.makeNode("/root/send/save/setautoins/setyn");
  20. model.setValue("/root/send/save/setautoins/setyn","N");
  21. // rszfUserGoodFlagList(cmb_goodflag,getUserInfo("userid"));
  22. rszfGoodFlagListByPgmGubn(cmb_goodflag,"2","N");
  23. rszfUserInstList(cmb_instcd,getUserInfo("userid"));
  24. //기관코드 읽어오는 부분 넣기
  25. var instcd = getUserInfo("dutplceinstcd");
  26. var instnm = getUserInfo("dutplceinstnm");
  27. if(instcd.length > 0)model.setValue(cmb_instcd.attribute("ref"), instcd);
  28. else
  29. {
  30. if(cmb_instcd.length> 0) cmb_instcd.selectedindex= 0;
  31. }
  32. //물품구분일 경우 첫번째 index 자동 설정
  33. if(cmb_goodflag.length> 0) cmb_goodflag.selectedindex= 0;
  34. // 초기 저장구분 : 2 (미저장)
  35. rdo_saveyn.selectedindex = 2;
  36. // misfMsterDetailSet(grd_excelmaplist,null, "TRRSC00601" ,"Y");
  37. /**********************************
  38. * GOODFLAG 물품구분 R0025
  39. * ASETFLAG 자산구분 R0043
  40. * PRODDRUGSETFLAG 제제약 SET 구분 R0068
  41. * STOCMNGTFLAG 재고관리기준 R0069
  42. * REQMTHD 청구방법 R0092
  43. * REQPRID 청구주기 R0093
  44. * PRODPLCE 제조국 R0035
  45. * CONFLAG 계약구분 R0095
  46. * CURNCYUNIT 화폐단위 R0047
  47. * PURCFLAG 구매구분 R0111
  48. * SETPLCEORDFLAG SET 발주구분 R0110
  49. * PLCEORDBASE 발주기준 R0107
  50. * PLCEORDQTYCRETFLAG 발주량생성구분 R0106
  51. * MNGTFLAG 관리구분 R0094
  52. * IOPSNFLAG 내외자구분
  53. * KEEPMTHD 보관방법 1:실온 2:냉소 3:냉장 4:냉동
  54. * GNRLSPCL 일반-전문 1:전문 2:일반 3:공산품 4:의약외품 5:기타
  55. ***********************************/
  56. misfComboComCdListMulti("Z0007,R0025,R0043,R0068,R0069,R0092,R0093,R0035,R0095,R0047,R0111,R0110,R0107,R0106,R0094",
  57. "grd_excelmaplist.instcd,grd_excelmaplist.goodflag,grd_excelmaplist.asetflag,grd_excelmaplist.proddrugsetflag,grd_excelmaplist.stocmngtflag,grd_excelmaplist.reqmthd,grd_excelmaplist.reqprid,grd_excelmaplist.prodplce,grd_excelmaplist.conflag,grd_excelmaplist.curncyunit,grd_excelmaplist.purcflag,grd_excelmaplist.setplceordflag,grd_excelmaplist.plceordbase,grd_excelmaplist.plceordqtycretflag,grd_excelmaplist.mngtflag");
  58. rszfComboUnitList (cmb_purcunit, model.getValue(cmb_instcd.attribute("ref")), model.getValue(cmb_goodflag.attribute("ref"))); // 포장단위
  59. misfComboCopyItemSet(cmb_purcunit, "", grd_rscdexcellist, "purcunit" ); //규격단위
  60. misfComboCopyItemSet(cmb_purcunit, "", grd_rscdexcellist, "specunit" ); //규격단위
  61. misfComboCopyItemSet(cmb_purcunit, "", grd_rscdexcellist, "cntsunit" ); //함량단위
  62. misfComboCopyItemSet(cmb_purcunit, "", grd_rscdexcellist, "deliveunit" ); //수불단위
  63. misfComboCopyItemSet(cmb_purcunit, "", grd_excelmaplist, "purcunit" ); //규격단위
  64. misfComboCopyItemSet(cmb_purcunit, "", grd_excelmaplist, "specunit" ); //규격단위
  65. misfComboCopyItemSet(cmb_purcunit, "", grd_excelmaplist, "cntsunit" ); //함량단위
  66. misfComboCopyItemSet(cmb_purcunit, "", grd_excelmaplist, "deliveunit" ); //수불단위
  67. rszfComboUnitList (cmb_prcpunit,model.getValue(cmb_instcd.attribute("ref")),"D"); // 처방단위
  68. misfComboCopyItemSet(cmb_purcunit, "", grd_rscdexcellist, "prcpunit" ); //처방단위
  69. misfComboCopyItemSet(cmb_purcunit, "", grd_excelmaplist, "prcpunit" ); //처방단위
  70. // misfMsterDetailSet(grd_rscdexcellist,null, "TRRSC03801" ,"Y");
  71. misfMsterDetailSet(grd_excelmaplist,null, "TRRSC03801" ,"Y");
  72. // fSetGoodFlagAuth();
  73. grd_excelmaplist.explorerbar = "sortshow";
  74. grd_excelmaplist.selectionmode = "list";
  75. model.setFocus("ipt_lrgcd_search");
  76. model.refresh();
  77. }
  78. // --------------------------------------------------
  79. // Excel 자료와 입력 자료 비교
  80. // --------------------------------------------------
  81. function fGoodDataCampare(pIdx){
  82. var sPath = "/root/main/ExlMasterLists/exlmasterlist";
  83. var tPath = "/root/init/CompareData";
  84. model.setValue(tPath + "/goodcd" , model.getValue(sPath + "["+pIdx+"]/goodcd" ));
  85. model.setValue(tPath + "/goodflag" , model.getValue(sPath + "["+pIdx+"]/goodflag" ));
  86. model.setValue(tPath + "/goodnm" , model.getValue(sPath + "["+pIdx+"]/goodnm" ));
  87. model.setValue(tPath + "/goodhngnm" , model.getValue(sPath + "["+pIdx+"]/goodhngnm" ));
  88. model.setValue(tPath + "/goodengnm" , model.getValue(sPath + "["+pIdx+"]/goodengnm" ));
  89. model.setValue(tPath + "/goodspec" , model.getValue(sPath + "["+pIdx+"]/goodspec" ));
  90. model.setValue(tPath + "/goodmodel" , model.getValue(sPath + "["+pIdx+"]/goodmodel" ));
  91. model.setValue(tPath + "/asetflag" , model.getValue(sPath + "["+pIdx+"]/asetflag" ));
  92. model.setValue(tPath + "/lrgcd" , model.getValue(sPath + "["+pIdx+"]/lrgcd" ));
  93. model.setValue(tPath + "/lrgnm" , model.getValue(sPath + "["+pIdx+"]/lrgnm" ));
  94. model.setValue(tPath + "/mdlcd" , model.getValue(sPath + "["+pIdx+"]/mdlcd" ));
  95. model.setValue(tPath + "/mdlnm" , model.getValue(sPath + "["+pIdx+"]/mdlnm" ));
  96. model.setValue(tPath + "/smlcd" , model.getValue(sPath + "["+pIdx+"]/smlcd" ));
  97. model.setValue(tPath + "/smlnm" , model.getValue(sPath + "["+pIdx+"]/smlnm" ));
  98. model.setValue(tPath + "/edicd" , model.getValue(sPath + "["+pIdx+"]/edicd" ));
  99. model.setValue(tPath + "/prodcmpycd" , model.getValue(sPath + "["+pIdx+"]/prodcmpycd" ));
  100. model.setValue(tPath + "/prodcmpynm" , model.getValue(sPath + "["+pIdx+"]/prodcmpynm" ));
  101. model.setValue(tPath + "/cmt" , model.getValue(sPath + "["+pIdx+"]/cmt" ));
  102. model.setValue(tPath + "/goodcd_2" , model.getValue(sPath + "["+pIdx+"]/goodcd_2" ));
  103. model.setValue(tPath + "/goodflag_2" , model.getValue(sPath + "["+pIdx+"]/goodflag_2" ));
  104. model.setValue(tPath + "/goodnm_2" , model.getValue(sPath + "["+pIdx+"]/goodnm_2" ));
  105. model.setValue(tPath + "/goodhngnm_2" , model.getValue(sPath + "["+pIdx+"]/goodhngnm_2" ));
  106. model.setValue(tPath + "/goodengnm_2" , model.getValue(sPath + "["+pIdx+"]/goodengnm_2" ));
  107. model.setValue(tPath + "/goodspec_2" , model.getValue(sPath + "["+pIdx+"]/goodspec_2" ));
  108. model.setValue(tPath + "/goodmodel_2" , model.getValue(sPath + "["+pIdx+"]/goodmodel_2" ));
  109. model.setValue(tPath + "/asetflag_2" , model.getValue(sPath + "["+pIdx+"]/asetflag_2" ));
  110. model.setValue(tPath + "/lrgcd_2" , model.getValue(sPath + "["+pIdx+"]/lrgcd_2" ));
  111. model.setValue(tPath + "/lrgnm_2" , model.getValue(sPath + "["+pIdx+"]/lrgnm_2" ));
  112. model.setValue(tPath + "/mdlcd_2" , model.getValue(sPath + "["+pIdx+"]/mdlcd_2" ));
  113. model.setValue(tPath + "/mdlnm_2" , model.getValue(sPath + "["+pIdx+"]/mdlnm_2" ));
  114. model.setValue(tPath + "/smlcd_2" , model.getValue(sPath + "["+pIdx+"]/smlcd_2" ));
  115. model.setValue(tPath + "/smlnm_2" , model.getValue(sPath + "["+pIdx+"]/smlnm_2" ));
  116. model.setValue(tPath + "/edicd_2" , model.getValue(sPath + "["+pIdx+"]/edicd_2" ));
  117. model.setValue(tPath + "/prodcmpycd_2" , model.getValue(sPath + "["+pIdx+"]/prodcmpycd_2" ));
  118. model.setValue(tPath + "/prodcmpynm_2" , model.getValue(sPath + "["+pIdx+"]/prodcmpynm_2" ));
  119. model.setValue(tPath + "/cmt_2" , model.getValue(sPath + "["+pIdx+"]/cmt_2" ));
  120. grp_disp.attribute("visibility") ="visible" ;
  121. opt_goodcd.dispatch("xforms-value-changed");
  122. grp_disp.refresh();
  123. }
  124. // --------------------------------------------------
  125. // Excel File를 Load한다.
  126. // --------------------------------------------------
  127. function fOldCodeAllSizeRead()
  128. {
  129. if (grd_ogoodcd.attribute("visibility") == "visible") {
  130. grd_ogoodcd.attribute("visibility") ="hidden" ;
  131. grd_allsize.attribute("visibility") ="hidden" ;
  132. return;
  133. }
  134. model.setValue("/root/send/selectcond/goodcd",model.getValue(opt_goodcd.attribute("ref")));
  135. model.setValue("/root/send/selectcond/instcd",model.getValue(cmb_instcd.attribute("ref")));
  136. submit("TRRSC03805");
  137. submit("TRRSC03806");
  138. grd_ogoodcd.attribute("visibility") ="visible" ;
  139. grd_ogoodcd.refresh();
  140. // grd_allsize.refresh();
  141. if (grd_allsize.rows < 2) {
  142. grd_allsize.attribute("visibility") ="hidden" ;
  143. } else {
  144. grd_allsize.attribute("visibility") ="visible" ;
  145. }
  146. grd_allsize.refresh();
  147. }
  148. // --------------------------------------------------
  149. // Excel File를 Load한다.
  150. // --------------------------------------------------
  151. function fLoadExcel(pCls)
  152. {
  153. if (model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  154. {
  155. messageBox("기관코드를 " ,"C002");
  156. model.setFocus("cmb_instcd");
  157. return false;
  158. }
  159. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  160. if (pCls == "1") {
  161. grd_instexcellist.loadExcel(fileName, 1);
  162. //misfGridIUD(grd_instexcellist, "D");
  163. //misfGridIUD(grd_instexcellist, "D");
  164. } else {
  165. grd_rscdexcellist.loadExcel(fileName, 1);
  166. // fGridInsertChanged();
  167. //misfGridIUD(grd_rscdexcellist, "D");
  168. //misfGridIUD(grd_instexcellist, "D");
  169. }
  170. model.refresh();
  171. }
  172. // --------------------------------------------------
  173. // Excel 자료를 임시 물품 Master에 생성한다.
  174. // --------------------------------------------------
  175. var CondData = "" ;
  176. var OldnewData = "" ;
  177. var MasterData = "" ;
  178. var AllsizeData = "" ;
  179. // var CondHeader = "" ;
  180. // var OldnewHeader = "" ;
  181. // var MasterHeader = "" ;
  182. // var AllsizeHeader = "" ;
  183. function fExcel2GoodMasterSave()
  184. {
  185. var cPath = "/root/init/CopyGoodList";
  186. var sPath = "/root/main/ExcelLists/ExcelList";
  187. var tPath = "/root/CopyData/CopyGoodLists/CopyGoodList";
  188. var mPath = "/root/init/CopySizeList";
  189. var aPath = "/root/CopyData/CopySizeLists/CopySizeList";
  190. var oPath = "/root/init/CopyMapList";
  191. var nPath = "/root/CopyData/CopyMapLists/CopyMapList";
  192. var pRow = 1 ;
  193. var aRow = 1 ;
  194. var nRow = 1 ;
  195. var GoodCd = "";
  196. var sRowCnt = grd_rscdexcellist.rows - grd_rscdexcellist.fixedrows;
  197. fExcelGoodHeader();
  198. var vInstcd = model.getValue("/root/send/searchlist/instcd" );
  199. CondData += model.getValue("/root/send/searchlist/instcd" ) + "▦" // 01 기관코드
  200. + model.getValue("/root/CopyData/CopyCond/mastercls" ) + "▦" // 02 Master 생성 구분
  201. + model.getValue("/root/CopyData/CopyCond/allsizecls") + "▦" // 03 All Size 생성 구분
  202. + model.getValue("/root/CopyData/CopyCond/oldnewcls" ) + "▩"; // 04 신구코드 생성
  203. model.removeNode(tPath);
  204. model.removeNode(aPath);
  205. model.removeNode(nPath);
  206. for (var i=1; i<= sRowCnt; i++) {
  207. GoodCd = model.getValue(sPath + "["+i+"]/ngood");
  208. if (model.getValue(tPath +"[goodcd='"+ GoodCd + "']/goodcd") == "") {
  209. vGoodFlag = model.getValue(sPath + "["+i+"]/ngood").substr(0,1) ;
  210. model.setValue(cPath+ "/goodcd" , model.getValue(sPath + "["+i+"]/ngood" ));
  211. model.setValue(cPath+ "/goodflag" , vGoodFlag );
  212. model.setValue(cPath+ "/goodnm" , model.getValue(sPath + "["+i+"]/goodnm" ));
  213. model.setValue(cPath+ "/goodspec" , model.getValue(sPath + "["+i+"]/goodspec" ));
  214. model.setValue(cPath+ "/goodmodel" , model.getValue(sPath + "["+i+"]/goodmodel" ));
  215. model.setValue(cPath+ "/asetflag" , "1" );
  216. model.setValue(cPath+ "/lrgcd" , model.getValue(sPath + "["+i+"]/lrgcd" ));
  217. model.setValue(cPath+ "/mdlcd" , model.getValue(sPath + "["+i+"]/mdlcd" ));
  218. model.setValue(cPath+ "/smlcd" , "" );
  219. model.setValue(cPath+ "/edicd" , model.getValue(sPath + "["+i+"]/edicode" ));
  220. model.setValue(cPath+ "/prodcmpycd", "" );
  221. model.setValue(cPath+ "/prodcmpynm", model.getValue(sPath + "["+i+"]/prodcmpycd"));
  222. model.makeNode(tPath + "["+pRow+"]" );
  223. model.copyNode(tPath + "["+pRow+"]", cPath );
  224. MasterData += model.getValue(sPath + "["+i+"]/ngood" ) + "▦" // 01 물품코드
  225. + vGoodFlag + "▦" // 02 물품구분
  226. + model.getValue(sPath + "["+i+"]/goodnm" ) + "▦" // 03 물품명
  227. + model.getValue(sPath + "["+i+"]/goodspec" ) + "▦" // 04 물품규격
  228. + model.getValue(sPath + "["+i+"]/goodmodel" ) + "▦" // 05 모델
  229. + "1" + "▦" // 06 자산구분
  230. + model.getValue(sPath + "["+i+"]/lrgcd" ) + "▦" // 07 대분류코드
  231. + model.getValue(sPath + "["+i+"]/mdlcd" ) + "▦" // 08 중분류코드
  232. + "" + "▦" // 09 소분류코드
  233. + model.getValue(sPath + "["+i+"]/edicode" ) + "▦" // 10 EDI코드
  234. + "" + "▦" // 11 제조회사코드
  235. + model.getValue(sPath + "["+i+"]/prodcmpycd") + "▩"; // 12 제조회사명칭
  236. pRow++;
  237. }
  238. if (model.getValue(sPath + "["+i+"]/allsizeid")!="") {
  239. model.setValue(mPath+ "/goodcd" , model.getValue(sPath + "["+i+"]/ngood" ));
  240. model.setValue(mPath+ "/goodnm" , model.getValue(sPath + "["+i+"]/goodnm" ));
  241. model.setValue(mPath+ "/allsizespecid" , model.getValue(sPath + "["+i+"]/allsizeid" ));
  242. model.setValue(mPath+ "/goodspec" , model.getValue(sPath + "["+i+"]/goodspec" ));
  243. model.makeNode(aPath + "["+aRow+"]" );
  244. model.copyNode(aPath + "["+aRow+"]", mPath );
  245. AllsizeData += vInstcd + "▦" // 01 기관코드
  246. + model.getValue(sPath + "["+i+"]/ngood" ) + "▦" // 02 물품코드
  247. + model.getValue(sPath + "["+i+"]/goodnm" ) + "▦" // 03 물품명
  248. + model.getValue(sPath + "["+i+"]/allsizeid" ) + "▦" // 04 규격ID
  249. + model.getValue(sPath + "["+i+"]/goodspec" ) + "▩"; // 05 물품규격
  250. aRow++;
  251. }
  252. oGoodCd = model.getValue(sPath + "["+i+"]/ogood");
  253. if ((model.getValue(sPath + "["+i+"]/ogood") != "") &&
  254. (model.getValue(nPath +"[ogoodcd='"+ oGoodCd + "']/ogoodcd") == "")) {
  255. model.setValue(oPath+ "/ngoodcd" , model.getValue(sPath + "["+i+"]/ngood" ));
  256. model.setValue(oPath+ "/ogoodcd" , model.getValue(sPath + "["+i+"]/ogood" ));
  257. model.setValue(oPath+ "/goodnm" , model.getValue(sPath + "["+i+"]/goodnm" ));
  258. model.makeNode(nPath + "["+nRow+"]" );
  259. model.copyNode(nPath + "["+nRow+"]", oPath );
  260. OldnewData += model.getValue(sPath + "["+i+"]/ngood" ) + "▦" // 01 물품코드
  261. + model.getValue(sPath + "["+i+"]/ogood" ) + "▦" // 02 물품코드
  262. + model.getValue(sPath + "["+i+"]/goodnm" ) + "▩"; // 03 물품명
  263. nRow++;
  264. }
  265. }
  266. goodoldnew.refresh();
  267. allsizecopy.refresh();
  268. mgoodcopy.refresh();
  269. model.removenode("/root/send/copydata" ); // 조건자료
  270. model.makeValue("/root/send/copydata/copycond" ,CondData ); // 조건자료
  271. model.makeValue("/root/send/copydata/exlmasterlist" ,MasterData ); // 물품마스터
  272. model.makeValue("/root/send/copydata/exlallsizelist",AllsizeData); // All Size
  273. model.makeValue("/root/send/copydata/exloldnewlist" ,OldnewData ); // 신구물품
  274. submit("TXRSC03804");
  275. // if (model.getValue(gvErrorMsgPath + "/type") != "error")
  276. // {
  277. // misfGridInit(grd_rscdexcellist);
  278. // btn_cost.dispatch("DOMActivate");
  279. // btn_cost.selected="true";
  280. // btn_search.dispatch("DOMActivate");
  281. // }
  282. }
  283. // --------------------------------------------------
  284. // Excel 자료 Header 구성
  285. // --------------------------------------------------
  286. function fExcelGoodHeader(){
  287. CondData = "instcd" + "▦" // 01 기관코드
  288. + "mastercls" + "▦" // 02 Master 생성 구분
  289. + "allsizecls" + "▦" // 03 All Size 생성 구분
  290. + "oldnewcls" + "▩"; // 04 신구코드 생성
  291. MasterData = "goodcd" + "▦" // 01 물품코드
  292. + "goodflag" + "▦" // 02 물품구분
  293. + "goodnm" + "▦" // 03 물품명
  294. + "goodspec" + "▦" // 04 물품규격
  295. + "goodmodel" + "▦" // 05 모델
  296. + "asetflag" + "▦" // 06 자산구분
  297. + "lrgcd" + "▦" // 07 대분류코드
  298. + "mdlcd" + "▦" // 08 중분류코드
  299. + "smlcd" + "▦" // 09 소분류코드
  300. + "edicd" + "▦" // 10 EDI코드
  301. + "prodcmpycd" + "▦" // 11 제조회사코드
  302. + "prodcmpynm" + "▩"; // 12 제조회사명칭
  303. AllsizeData = "instcd" + "▦" // 01 기관코드
  304. + "goodcd" + "▦" // 02 물품코드
  305. + "goodnm" + "▦" // 03 물품명
  306. + "allsizespecid" + "▦" // 04 규격ID
  307. + "goodspec" + "▩"; // 05 물품규격
  308. OldnewData = "ngoodcd" + "▦" // 01 물품코드
  309. + "ogoodcd" + "▦" // 02 물품코드
  310. + "goodnm" + "▩"; // 03 물품명
  311. }
  312. // --------------------------------------------------
  313. // Excel File를 Load한다.
  314. // --------------------------------------------------
  315. function fGridInsertChanged()
  316. {
  317. for(var fRow = grd_rscdexcellist.fixedRows; fRow < grd_rscdexcellist.rows; fRow++)
  318. {
  319. grd_rscdexcellist.addStatus(fRow, "insert");
  320. grd_rscdexcellist.valueMatrix(fRow, grd_rscdexcellist.colRef("instcd")) = model.getValue(cmb_instcd.attribute("ref"));
  321. grd_rscdexcellist.valueMatrix(fRow, grd_rscdexcellist.colRef("goodflag")) = model.getValue(cmb_goodflag.attribute("ref"));
  322. grd_rscdexcellist.valueMatrix(fRow, grd_rscdexcellist.colRef("ifflag")) = "E"; // Interface 구분 : E (excel 입력)
  323. }
  324. }
  325. function fSetGoodSpec()
  326. {
  327. model.setValue(opt_poptitle.attribute("ref"), "물품 규격을 입력해 주세요");
  328. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title","opt_poptitle");
  329. model.refresh();
  330. fSetAllApply(grd_excelmaplist,"goodspec", model.getValue(opt_popinputcd.attribute("ref")));
  331. }
  332. function fSetGoodModel()
  333. {
  334. model.setValue(opt_poptitle.attribute("ref"), "물품 모델을 입력해 주세요");
  335. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title","opt_poptitle");
  336. model.refresh();
  337. fSetAllApply(grd_excelmaplist,"goodmodel", model.getValue(opt_popinputcd.attribute("ref")));
  338. }
  339. function fSetGoodnm()
  340. {
  341. model.setValue(opt_poptitle.attribute("ref"), "물품명 입력해 주세요");
  342. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title","opt_poptitle");
  343. model.refresh();
  344. fSetAllApply(grd_excelmaplist,"goodnm", model.getValue(opt_popinputcd.attribute("ref")));
  345. }
  346. function fSetGoodUnitCost()
  347. {
  348. model.setValue(opt_poptitle.attribute("ref"), "제품 단가를 입력해 주세요");
  349. model.setValue(opt_popformat.attribute("ref"), "#,###");
  350. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title,format","opt_poptitle,opt_popformat");
  351. model.refresh();
  352. fSetAllApply(grd_excelmaplist,"goodunitcost", model.getValue(opt_popinputcd.attribute("ref")));
  353. }
  354. function fSetExchQty()
  355. {
  356. model.setValue(opt_poptitle.attribute("ref"), "환산수량을 입력해 주세요");
  357. model.setValue(opt_popformat.attribute("ref"), "#,###");
  358. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title,format","opt_poptitle,opt_popformat");
  359. model.refresh();
  360. fSetAllApply(grd_excelmaplist,"exchqty", model.getValue(opt_popinputcd.attribute("ref")));
  361. }
  362. function fSetMainCustLastSuplplce()
  363. {
  364. model.setValue(opt_popcond.attribute("ref"),"custom");
  365. model.setValue(opt_poptitle.attribute("ref"), "주거래처를 선택해 주세요");
  366. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRSC03801" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
  367. model.refresh();
  368. fSetAllApply(grd_excelmaplist,"maincustlastsuplplce,maincustlastsuplplcenm", model.getValue(opt_popinputcd.attribute("ref")));
  369. }
  370. function fSetSuppCustCd()
  371. {
  372. model.setValue(opt_popcond.attribute("ref"),"custom");
  373. model.setValue(opt_poptitle.attribute("ref"), "보조 거래처를 선택해 주세요");
  374. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRSC03801" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
  375. model.refresh();
  376. fSetAllApply(grd_excelmaplist,"suppcustcd,suppcustnm", model.getValue(opt_popinputcd.attribute("ref")));
  377. }
  378. function fSetGoodProdCmpy()
  379. {
  380. model.setValue(opt_popcond.attribute("ref"),"prodcmpy");
  381. model.setValue(opt_poptitle.attribute("ref"), "제조회사를 선택해 주세요");
  382. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRSC03801" ,"title,cond,instcd","opt_poptitle,opt_popcond,cmb_instcd");
  383. model.refresh();
  384. fSetAllApply(grd_excelmaplist,"prodcmpycd,prodcmpynm", model.getValue(opt_popinputcd.attribute("ref")));
  385. }
  386. function fSetPurcUnit()
  387. {
  388. model.setValue(opt_popcond.attribute("ref"),"purcunit");
  389. model.setValue(opt_poptitle.attribute("ref"), "포장단위를 선택해 주세요");
  390. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title,cond","opt_poptitle,opt_popcond");
  391. model.refresh();
  392. fSetAllApply(grd_excelmaplist,"purcunit", model.getValue(opt_popinputcd.attribute("ref")));
  393. }
  394. function fSetDeliveUnit()
  395. {
  396. model.setValue(opt_popcond.attribute("ref"),"deliveunit");
  397. model.setValue(opt_poptitle.attribute("ref"), "수불단위를 선택해 주세요");
  398. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd","SMRSC03801" ,"title,cond","opt_poptitle,opt_popcond");
  399. model.refresh();
  400. fSetAllApply(grd_excelmaplist,"deliveunit", model.getValue(opt_popinputcd.attribute("ref")));
  401. }
  402. function fSetLargeCd()
  403. {
  404. model.setValue(opt_popcond.attribute("ref"),"lrgnm");
  405. model.setValue(opt_poptitle.attribute("ref"), "분류코드를 선택해 주세요");
  406. rszfOpenPopUpListByWndName(opt_popinputcd,"","popinputcd,popinputnm","SMRSC03801" ,"title,cond,instcd,goodflag","opt_poptitle,opt_popcond,cmb_instcd,cmb_goodflag");
  407. fSetAllApply(grd_excelmaplist,"lrgcd,lrgnm,mdlcd,mdlnm,smlcd,smlnm", model.getValue(opt_popinputcd.attribute("ref")));
  408. }
  409. function fSetAllApply(f_grid, f_id , f_value)
  410. {
  411. if(f_id == null || f_id.length == 0 || f_value == null || f_value.length == 0 )return;
  412. var f_selid = f_id.split(",");
  413. var f_selvalue = f_value.split(",");
  414. for(currow = 0 ; currow < f_grid.selectedRows; currow++)
  415. {
  416. for (var k = 0; k < f_selid.length; k++)
  417. {
  418. if(f_grid.colRef(f_selid[k]) != -1)
  419. {
  420. if(model.getValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + f_selid[k]) != f_selvalue[k])
  421. {
  422. if(f_grid.valueMatrix( (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) , f_grid.colRef("saveyn")) == "N")
  423. {
  424. // alert ( currow + " 번째 행의 " + f_grid.colRef("saveyn") + "번째 항목의 값 " + f_grid.valueMatrix( , f_grid.colRef("saveyn")) );
  425. model.setValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + f_selid[k] ,f_selvalue[k]);
  426. if(f_grid.rowStatus(f_grid.selectedRow(currow)) == "0")
  427. {
  428. f_grid.rowStatus(f_grid.selectedRow(currow)) = "2"; // Update
  429. }
  430. if ( f_selid[k] == "lrgcd" || f_selid[k] == "lrgnm" || f_selid[k] == "mdlcd" || f_selid[k] == "mdlnm" || f_selid[k] == "smlcd" || f_selid[k] == "smlnm") { // 분류코드 변경시만 변경
  431. model.setValue(f_grid.nodeset + "[" + (f_grid.selectedRow(currow)- f_grid.fixedRows + 1) + "]/" + "getgubunchk", "0*0*0"); // 대, 중, 소분류 값이 수정이 되면 오류 값을 수정처리 한다.
  432. fMapListValid(f_grid, (f_grid.selectedRow(currow)- f_grid.fixedRows), (f_grid.selectedRow(currow)- f_grid.fixedRows +1) ); // 오류 수정에 따른 색상 수정
  433. }
  434. }
  435. }
  436. }
  437. }
  438. }
  439. }
  440. function fCheckRetrieveData()
  441. {
  442. if(model.getValue(cmb_instcd.attribute("ref")).length== 0 )
  443. {
  444. messageBox("기관코드를 " ,"C002");
  445. model.setFocus("cmb_instcd");
  446. return false;
  447. }
  448. if(model.getValue(cmb_goodflag.attribute("ref")).length== 0 )
  449. {
  450. messageBox("물품구분을 " ,"C002");
  451. model.setFocus("cmb_goodflag");
  452. return false;
  453. }
  454. /*
  455. if(model.getValue(ipt_lrgcd_search.attribute("ref")).length== 0 )
  456. {
  457. messageBox("대분류코드를 " ,"C002");
  458. model.setFocus("ipt_lrgcd_search");
  459. return false;
  460. }
  461. if(model.getValue(ipt_goodcd.attribute("ref")).length < 3 && model.getValue(ipt_goodnm.attribute("ref")).length < 3)
  462. {
  463. messageBox("물품코드 또는 물품명에 최소 2자리를" ,"C001");
  464. model.setFocus("ipt_goodcd_search");
  465. return false;
  466. }
  467. */
  468. return true;
  469. }
  470. // 물품구분별 권한체크.
  471. function fSetGoodFlagAuth()
  472. {
  473. btn_save.disabled=true;
  474. rszfGetPurcGoodFlagAuthInfo(cmb_instcd.value , cmb_goodflag.value, getUserInfo("userid"), "%");
  475. if(rszfGetGoodFlagAuthInfoByCond("goodflagauth") =="Y")
  476. {
  477. btn_save.disabled=false;
  478. }
  479. }
  480. /******************************************
  481. * 대, 중, 소분류에 대한 valid check에 대한 err 시 색상 변화
  482. * pGrd = 대상이 되는 테이블
  483. * pFromRow = Grid 시작 위치
  484. * pToRow = Grid 종료 위치
  485. * getgubunchk 항목에서 유효성 값 반환 = 0 : 이상 없음, 9 : 에러
  486. * ex) 0*0*0 : 대, 중, 소분류 유효한 값
  487. * 0*9*9 : 중, 소분류 오류
  488. * 상위 분류 에러 발생시 하위 분류에 대한 유효성은 보장 할 수 없기 때문에 err 처리
  489. ******************************************/
  490. function fMapListValid(pGrd, pFromRow, pToRow)
  491. {
  492. var temValidItem = new Array("lrgcd","mdlcd","smlcd");
  493. var rowcnt = 0;
  494. if(pFromRow != "" || pFromRow != null) {
  495. rowcnt = pGrd.fixedRows;
  496. } else {
  497. rowcnt = pFromRow;
  498. }
  499. if(pToRow != "" || pToRow != null) {
  500. grdRow = pGrd.rows;
  501. } else {
  502. grdRow = pToRow;
  503. }
  504. for ( rowcnt ; rowcnt<grdRow; rowcnt++ )
  505. {
  506. var tmp_getgubunchk = pGrd.valueMatrix(rowcnt , pGrd.colRef("getgubunchk")).split("*");
  507. // if(pGrd.valueMatrix(rowcnt, pGrd.colRef("saveyn")) != "Y")
  508. // {
  509. for( colcnt = 0; colcnt < tmp_getgubunchk.length; colcnt++ )
  510. {
  511. if( tmp_getgubunchk[colcnt] == "9" )
  512. {
  513. pGrd.cellstyle("background-color", rowcnt, pGrd.colRef(temValidItem[colcnt]), rowcnt, pGrd.colRef(temValidItem[colcnt])+1 ) = "yellow";
  514. }
  515. else
  516. {
  517. if ( tmp_getgubunchk[colcnt] != "9" && pGrd.cellstyle("background-color", rowcnt, pGrd.colRef(temValidItem[colcnt]), rowcnt, pGrd.colRef(temValidItem[colcnt]) ) != "white" )
  518. pGrd.cellstyle("background-color", rowcnt, pGrd.colRef(temValidItem[colcnt]), rowcnt, pGrd.colRef(temValidItem[colcnt])+1 ) = "white";
  519. }
  520. }
  521. // }
  522. }
  523. // pGrd.editCell();
  524. }
  525. function fCheckSaveData( grd_id )
  526. {
  527. if( grd_id.rows - grd_id.fixedRows > 0 )
  528. {
  529. var currow = 0;
  530. for(currow = grd_id.fixedRows ; currow < grd_id.rows ; currow++)
  531. {
  532. if ( grd_id.colRef("getgubunchk") != -1 )
  533. {
  534. // var temValidItem = new Array("대분류","중분류","소분류","lgrnm","mdlnm","smlnm");
  535. var temValidItem = new Array("대분류","중분류","소분류");
  536. var tmp_getgubunchk = grd_id.valueMatrix(currow , grd_id.colRef("getgubunchk")).split("*");
  537. for( cnt = 0; cnt < tmp_getgubunchk.length; cnt++ )
  538. {
  539. if ( tmp_getgubunchk[cnt] != "0" )
  540. {
  541. messageBox( grd_id.valueMatrix(currow , grd_id.colRef("no")) + " 번째 " + temValidItem[cnt] + "가 유효하지", "I004");
  542. grd_id.row = currow;
  543. return false;
  544. // grd_id.col = grd_id.colRef( temValidItem[cnt+3] );
  545. }
  546. }
  547. }
  548. if(grd_id.valueMatrix(currow, grd_id.colRef("lrgcd")).length == 0)
  549. {
  550. messageBox(currow + " 번째 대분류코드를 " ,"C001");
  551. grd_id.row = currow;
  552. grd_id.col = grd_id.colRef("lrgcd");
  553. grd_id.editCell();
  554. return false;
  555. }
  556. if(grd_id.valueMatrix(currow, grd_id.colRef("mdlcd")).length == 0)
  557. {
  558. messageBox(currow + " 번째 중분류코드를 " ,"C001");
  559. grd_id.row = currow;
  560. grd_id.col = grd_id.colRef("mdlcd");
  561. grd_id.editCell();
  562. return false;
  563. }
  564. if(grd_id.valueMatrix(currow, grd_id.colRef("smlcd")).length == 0)
  565. {
  566. messageBox(currow + " 번째 소분류코드를 " ,"C001");
  567. grd_id.row = currow;
  568. grd_id.col = grd_id.colRef("smlcd");
  569. grd_id.editCell();
  570. return false;
  571. }
  572. if(grd_id.valueMatrix(currow, grd_id.colRef("welfprt")).length == 0)
  573. {
  574. messageBox(currow + " 번째 복지부분류코드를 " ,"C001");
  575. grd_id.row = currow;
  576. grd_id.col = grd_id.colRef("welfprt");
  577. grd_id.editCell();
  578. return false;
  579. }
  580. if(grd_id.valueMatrix(currow, grd_id.colRef("goodcd")).length == 0)
  581. {
  582. messageBox(currow + " 번째 신약품코드를 " ,"C001");
  583. grd_id.row = currow;
  584. grd_id.col = grd_id.colRef("goodcd");
  585. grd_id.editCell();
  586. return false;
  587. }
  588. else
  589. {
  590. for(srcrow = currow + 1 ; srcrow < grd_id.rows ; srcrow++)
  591. {
  592. if(grd_id.valueMatrix(currow , grd_id.colRef("goodcd")) == grd_id.valueMatrix(srcrow , grd_id.colRef("goodcd")) )
  593. {
  594. messageBox("동일 물품코드가 [" + grd_id.valueMatrix(currow , grd_id.colRef("no")) + ", " + grd_id.valueMatrix(srcrow , grd_id.colRef("no")) + "->" + grd_id.valueMatrix(currow , grd_id.colRef("goodcd")) + "] 존재하여 저장 " ,"E001");
  595. return false;
  596. }
  597. }
  598. }
  599. if(grd_id.valueMatrix(currow, grd_id.colRef("oldcd")).length == 0)
  600. {
  601. messageBox(currow + " 번째 구코드를 " ,"C001");
  602. grd_id.row = currow;
  603. grd_id.col = grd_id.colRef("oldcd");
  604. grd_id.editCell();
  605. return false;
  606. }
  607. if(grd_id.valueMatrix(currow, grd_id.colRef("bnscd")).length == 0)
  608. {
  609. messageBox(currow + " 번째 보나에스코드를 " ,"C001");
  610. grd_id.row = currow;
  611. grd_id.col = grd_id.colRef("bnscd");
  612. grd_id.editCell();
  613. return false;
  614. }
  615. if(grd_id.valueMatrix(currow, grd_id.colRef("edicd")).length == 0)
  616. {
  617. messageBox(currow + " 번째 EDI코드를 " ,"C001");
  618. grd_id.row = currow;
  619. grd_id.col = grd_id.colRef("edicd");
  620. grd_id.editCell();
  621. return false;
  622. }
  623. if(grd_id.valueMatrix(currow, grd_id.colRef("prodcmpycd")).length == 0)
  624. {
  625. messageBox(currow + " 번째 제조회사코드를 " ,"C001");
  626. grd_id.row = currow;
  627. grd_id.col = grd_id.colRef("prodcmpycd");
  628. grd_id.editCell();
  629. return false;
  630. }
  631. if(grd_id.valueMatrix(currow, grd_id.colRef("suppcustcd")).length == 0)
  632. {
  633. messageBox(currow + " 번째 판매회사코드를 " ,"C001");
  634. grd_id.row = currow;
  635. grd_id.col = grd_id.colRef("suppcustcd");
  636. grd_id.editCell();
  637. return false;
  638. }
  639. if(grd_id.valueMatrix(currow, grd_id.colRef("goodnm")).length == 0)
  640. {
  641. messageBox(currow + " 번째 품명을 " ,"C001");
  642. grd_id.row = currow;
  643. grd_id.col = grd_id.colRef("goodnm ");
  644. grd_id.editCell();
  645. return false;
  646. }
  647. if(grd_id.valueMatrix(currow, grd_id.colRef("com")).length == 0)
  648. {
  649. messageBox(currow + " 번째 성분(코드)를 " ,"C001");
  650. grd_id.row = currow;
  651. grd_id.col = grd_id.colRef("com");
  652. grd_id.editCell();
  653. return false;
  654. }
  655. if(grd_id.valueMatrix(currow, grd_id.colRef("comnm")).length == 0)
  656. {
  657. messageBox(currow + " 번째 성분(명)을 " ,"C001");
  658. grd_id.row = currow;
  659. grd_id.col = grd_id.colRef("comnm");
  660. grd_id.editCell();
  661. return false;
  662. }
  663. if(grd_id.valueMatrix(currow, grd_id.colRef("cntsqty")).length == 0)
  664. {
  665. messageBox(currow + " 번째 함량을 " ,"C001");
  666. grd_id.row = currow;
  667. grd_id.col = grd_id.colRef("cntsqty");
  668. grd_id.editCell();
  669. return false;
  670. }
  671. if(grd_id.valueMatrix(currow, grd_id.colRef("cntsunit")).length == 0)
  672. {
  673. messageBox(currow + " 번째 함량단위를 " ,"C001");
  674. grd_id.row = currow;
  675. grd_id.col = grd_id.colRef("cntsunit");
  676. grd_id.editCell();
  677. return false;
  678. }
  679. if(grd_id.valueMatrix(currow, grd_id.colRef("specvol")).length == 0)
  680. {
  681. messageBox(currow + " 번째 규격을 " ,"C001");
  682. grd_id.row = currow;
  683. grd_id.col = grd_id.colRef("specvol");
  684. grd_id.editCell();
  685. return false;
  686. }
  687. if(grd_id.valueMatrix(currow, grd_id.colRef("specunit")).length == 0)
  688. {
  689. messageBox(currow + " 번째 규격단위를 " ,"C001");
  690. grd_id.row = currow;
  691. grd_id.col = grd_id.colRef("specunit");
  692. grd_id.editCell();
  693. return false;
  694. }
  695. if(grd_id.valueMatrix(currow, grd_id.colRef("prcpqty")).length == 0)
  696. {
  697. messageBox(currow + " 번째 처방수량을 " ,"C001");
  698. grd_id.row = currow;
  699. grd_id.col = grd_id.colRef("prcpqty");
  700. grd_id.editCell();
  701. return false;
  702. }
  703. if(grd_id.valueMatrix(currow, grd_id.colRef("prcpunit")).length == 0)
  704. {
  705. messageBox(currow + " 번째 처방단위를 " ,"C001");
  706. grd_id.row = currow;
  707. grd_id.col = grd_id.colRef("prcpunit");
  708. grd_id.editCell();
  709. return false;
  710. }
  711. if(grd_id.valueMatrix(currow, grd_id.colRef("prcpexchqty")).length == 0)
  712. {
  713. messageBox(currow + " 번째 처방환산을 " ,"C001");
  714. grd_id.row = currow;
  715. grd_id.col = grd_id.colRef("prcpexchqty ");
  716. grd_id.editCell();
  717. return false;
  718. }
  719. if(grd_id.valueMatrix(currow, grd_id.colRef("exchqty")).length == 0)
  720. {
  721. messageBox(currow + " 번째 포장환산을 " ,"C001");
  722. grd_id.row = currow;
  723. grd_id.col = grd_id.colRef("exchqty");
  724. grd_id.editCell();
  725. return false;
  726. }
  727. if(grd_id.valueMatrix(currow, grd_id.colRef("deliveunit")).length == 0)
  728. {
  729. messageBox(currow + " 번째 낱개단위를 " ,"C001");
  730. grd_id.row = currow;
  731. grd_id.col = grd_id.colRef("deliveunit");
  732. grd_id.editCell();
  733. return false;
  734. }
  735. if(grd_id.valueMatrix(currow, grd_id.colRef("purcunit")).length == 0)
  736. {
  737. messageBox(currow + " 번째 포장단위를 " ,"C001");
  738. grd_id.row = currow;
  739. grd_id.col = grd_id.colRef("purcunit");
  740. grd_id.editCell();
  741. return false;
  742. }
  743. if(grd_id.valueMatrix(currow, grd_id.colRef("gnrlspcl")).length == 0)
  744. {
  745. messageBox(currow + " 번째 일반/전문코드를 " ,"C001");
  746. grd_id.row = currow;
  747. grd_id.col = grd_id.colRef("gnrlspcl");
  748. grd_id.editCell();
  749. return false;
  750. }
  751. if(grd_id.valueMatrix(currow, grd_id.colRef("winacnt")).length == 0)
  752. {
  753. messageBox(currow + " 번째 입고계정코드를 " ,"C001");
  754. grd_id.row = currow;
  755. grd_id.col = grd_id.colRef("winacnt");
  756. grd_id.editCell();
  757. return false;
  758. }
  759. if(grd_id.valueMatrix(currow, grd_id.colRef("amtacnt")).length == 0)
  760. {
  761. messageBox(currow + " 번째 비용계정코드를 " ,"C001");
  762. grd_id.row = currow;
  763. grd_id.col = grd_id.colRef("amtacnt ");
  764. grd_id.editCell();
  765. return false;
  766. }
  767. if(grd_id.valueMatrix(currow, grd_id.colRef("keepmthd")).length == 0)
  768. {
  769. messageBox(currow + " 번째 보관법을 " ,"C001");
  770. grd_id.row = currow;
  771. grd_id.col = grd_id.colRef("keepmthd");
  772. grd_id.editCell();
  773. return false;
  774. }
  775. if(grd_id.valueMatrix(currow, grd_id.colRef("pemtkeepmthd")).length == 0)
  776. {
  777. messageBox(currow + " 번째 보관법 설명을 " ,"C001");
  778. grd_id.row = currow;
  779. grd_id.col = grd_id.colRef("pemtkeepmthd");
  780. grd_id.editCell();
  781. return false;
  782. }
  783. if(grd_id.valueMatrix(currow, grd_id.colRef("fromdd")).length == 0)
  784. {
  785. messageBox(currow + " 번째 적용일자를 " ,"C001");
  786. grd_id.row = currow;
  787. grd_id.col = grd_id.colRef("fromdd");
  788. grd_id.editCell();
  789. return false;
  790. }
  791. if(grd_id.valueMatrix(currow, grd_id.colRef("insucost")).length == 0)
  792. {
  793. messageBox(currow + " 번째 보험단가를 " ,"C001");
  794. grd_id.row = currow;
  795. grd_id.col = grd_id.colRef("insucost");
  796. grd_id.editCell();
  797. return false;
  798. }
  799. if(grd_id.valueMatrix(currow, grd_id.colRef("estmamt")).length == 0)
  800. {
  801. messageBox(currow + " 번째 처방단가를 " ,"C001");
  802. grd_id.row = currow;
  803. grd_id.col = grd_id.colRef("estmamt");
  804. grd_id.editCell();
  805. return false;
  806. }
  807. if(grd_id.valueMatrix(currow, grd_id.colRef("goodunitcost")).length == 0)
  808. {
  809. messageBox(currow + " 번째 구입단가를 " ,"C001");
  810. grd_id.row = currow;
  811. grd_id.col = grd_id.colRef("goodunitcost");
  812. grd_id.editCell();
  813. return false;
  814. }
  815. if(grd_id.valueMatrix(currow, grd_id.colRef("goodpurccost")).length == 0)
  816. {
  817. messageBox(currow + " 번째 구입가를 " ,"C001");
  818. grd_id.row = currow;
  819. grd_id.col = grd_id.colRef("goodpurccost");
  820. grd_id.editCell();
  821. return false;
  822. }
  823. if(grd_id.valueMatrix(currow, grd_id.colRef("reqflag")).length == 0)
  824. {
  825. messageBox(currow + " 번째 청구구분을 " ,"C001");
  826. grd_id.row = currow;
  827. grd_id.col = grd_id.colRef("reqflag");
  828. grd_id.editCell();
  829. return false;
  830. }
  831. if(grd_id.valueMatrix(currow, grd_id.colRef("workvalid")) == "N")
  832. {
  833. messageBox(currow + " 번째 신규/변경 구분이","E016");
  834. grd_id.row = currow;
  835. grd_id.col = grd_id.colRef("workflag");
  836. grd_id.editCell();
  837. return false;
  838. }
  839. if(grd_id.valueMatrix(currow, grd_id.colRef("fromdd")) < grd_id.valueMatrix(currow, grd_id.colRef("prefromdd")))
  840. {
  841. messageBox(currow + " 번째 적용일자가","E016");
  842. grd_id.row = currow;
  843. grd_id.col = grd_id.colRef("fromdd");
  844. grd_id.editCell();
  845. return false;
  846. }
  847. }
  848. }
  849. else
  850. {
  851. messageBox("저장 데이터가","I004");
  852. return false;
  853. }
  854. }
  855. function fSetSaveData( grd_id )
  856. {
  857. if ( getGridUpdateData(grd_id) != "" )
  858. {
  859. messageBox("변경 데이터 저장 후 Master 적용이","I006");
  860. return false;
  861. }
  862. var currow = 0;
  863. for(currow = grd_id.fixedRows ; currow < grd_id.rows ; currow++)
  864. {
  865. if(grd_id.valueMatrix(currow, grd_id.colRef("saveyn")) == "N")
  866. {
  867. if(grd_id.valueMatrix(currow, grd_id.colRef("workflag")) == "I")
  868. grd_id.rowStatus(currow) = "1";
  869. else if (grd_id.valueMatrix(currow, grd_id.colRef("workflag")) == "U")
  870. grd_id.rowStatus(currow) = "2";
  871. }
  872. }
  873. }
  874. /* ------------------------------------------------- */
  875. /* ------End Of List ------------------------------- */
  876. /* -------------------------------------------------- */