SMRSO20100_창고출고등록(경북대).xrw 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet ype="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://www.comsquare.co.kr/example" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:cs="http://www.comsquare.co.kr/xforms">
  4. <xhtml:head>
  5. <xhtml:title>창고 출고등록</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <delive>
  11. <delivelist>
  12. <instcd/>
  13. <delivedd/>
  14. <deliveno/>
  15. <deliveseq/>
  16. <wareflag/>
  17. <goodcd/>
  18. <goodnm/>
  19. <goodspec/>
  20. <deliveunit/>
  21. <deliveamt/>
  22. <deliveqty/>
  23. <exchqty/>
  24. <delivedeptcd/>
  25. <siqty/>
  26. <hunqty/>
  27. <deliveunitcost/>
  28. <reqqty/>
  29. <deliveflag/>
  30. <origsiqty/>
  31. <orighunqty/>
  32. <origdeliveqty/>
  33. </delivelist>
  34. </delive>
  35. <good>
  36. <gooddetail/>
  37. </good>
  38. <dupcheck>
  39. <dupyn/>
  40. </dupcheck>
  41. </main>
  42. <send>
  43. <search>
  44. <instcd/>
  45. <wareflag/>
  46. <delivedd/>
  47. <deliveno/>
  48. <delivedeptcd/>
  49. <delivedeptnm/>
  50. <deliveflag/>
  51. <barcode/>
  52. </search>
  53. <save/>
  54. </send>
  55. <init>
  56. </init>
  57. <hidden/>
  58. <temp>
  59. <deliveinfo>
  60. <deliveno/>
  61. </deliveinfo>
  62. </temp>
  63. <popdelive>
  64. <instcd/>
  65. <wareflag/>
  66. <wareflagnm/>
  67. <delivedd/>
  68. <selectyn/>
  69. </popdelive>
  70. <popgood>
  71. <instcd/>
  72. <wareflag/>
  73. <delivedd/>
  74. <basedd/>
  75. <selectyn/>
  76. <goodcd/>
  77. <goodlist>
  78. <goodcd/>
  79. </goodlist>
  80. </popgood>
  81. <popreq>
  82. <instcd/>
  83. <wareflag/>
  84. <wareflagnm/>
  85. <delivedd/>
  86. <reqdeptcd/>
  87. <reqdeptnm/>
  88. <saveyn/>
  89. <openflag/>
  90. <reqddbarcode/>
  91. <reqnobarcode/>
  92. </popreq>
  93. <chk_preyn/>
  94. </root>
  95. </instance>
  96. <script type="javascript" ev:event="xforms-ready">
  97. <![CDATA[
  98. //화면 Control을 초기화한다
  99. misfGridInit(grd_delive);
  100. misfMsterDetailSet(grd_delive, null, "TRRSO20103" ,"Y");
  101. //misfComboComCdListMulti("Z0007","cmb_instcd"); //기관코드
  102. misfComboInstCdListMulti("cmb_instcd",getCurrentDate(),"","N");
  103. misfComboComCdList("030M0001",cmb_wareflag); //창고
  104. misfComboComCdList("R0430",cmb_deliveflag); //출고유형
  105. model.setValue("/root/send/search/instcd", getUserInfo("dutplceinstcd")); //기관 설정
  106. if(model.getValue("/root/send/search/instcd") == "032")
  107. {
  108. btn_prcp.visible = true;
  109. }
  110. model.setValue("/root/send/search/delivedd" , getCurrentDate()); //출고일자 설정
  111. model.setValue("/root/send/search/deliveflag", "03"); //출고유형 설정 (03:구매청구)
  112. //test -> 향후 삭제할 것
  113. //model.setValue("/root/send/search/delivedd", "20110816");
  114. //model.setValue("/root/send/search/wareflag", "1");
  115. chk_preyn.value = "N";
  116. chk_preyn.disabled = false;
  117. model.refresh();
  118. model.setFocus("ipt_barcode");
  119. ]]>
  120. </script>
  121. <submission id="TRRSO20103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/search" resultref="/root/main/delive"/>
  122. <submission id="TRRSO20104" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/popgood" resultref="/root/main/good"/>
  123. <submission id="TRRSO20105" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/search" resultref="/root/main/dupcheck"/>
  124. <submission id="TXRSO20101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/save/send" resultref="/root/temp/deliveinfo">"</submission>
  125. <submission id="TXRSO20102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/search" resultref="/root/temp/deliveinfo"/>
  126. <submission id="TRRSO20106" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/search" resultref="/root/main/delive"/>
  127. </model>
  128. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  129. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  130. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  131. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  132. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  133. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  134. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  135. <script type="javascript">
  136. <![CDATA[
  137. //2012.02.28 박준범 추가
  138. //출고유형에 따라 Grid이 출고량컬럼, 행추가/삭제 버튼을 enable, disable 한다.
  139. function fEnableDisableGridInput() {
  140. //출고유형 02:처방 인 경우에는 data를 수정할 수 없도록 한다.
  141. if( model.getValue("/root/send/search/deliveflag") == "02" ) {
  142. grd_delive.colDisabled(grd_delive.colRef("deliveqty")) = true;
  143. btn_rowinsert.disabled = true;
  144. btn_rowdel.disabled = true;
  145. } else {
  146. grd_delive.colDisabled(grd_delive.colRef("deliveqty")) = false;
  147. btn_rowinsert.disabled = false;
  148. btn_rowdel.disabled = false;
  149. }
  150. }
  151. //조회조건 변경시 초기화 및 check
  152. function fSearchCondChanged(control_id){
  153. model.removeNodeset(grd_delive.nodeset); // 그리드 초기화
  154. model.setValue("/root/send/search/deliveno", ""); //출고번호 설정
  155. //2012.02.28 박준범 - 출고유형이 03, 04 가 아닌 경우에만 03으로 초기화하도록 변경 (03:구매청구, 04:출고조정)
  156. if( model.getValue("/root/send/search/deliveflag") != "03" && model.getValue("/root/send/search/deliveflag") != "04" ) {
  157. model.setValue("/root/send/search/deliveflag", "03"); //출고유형 설정 (03:구매청구)
  158. fEnableDisableGridInput();
  159. }
  160. if( cmb_wareflag.value != "" && ipt_delivedd.value != "" && ipt_delivedeptcd.value != "" ) {
  161. //같은날 같은 부서로 이미 불출한적이 있는지 확인
  162. if( submit("TRRSO20105") ) {
  163. if( model.getValue("/root/main/dupcheck/dupyn") == "Y" ) {
  164. messageBox("같은 날, 같은 부서로 이미 불출한 적이 있습니다.", "I999", "");
  165. model.setFocus(control_id); //function parameter
  166. }
  167. }
  168. }
  169. model.refresh();
  170. }
  171. //물품코드의 상세내역과 현재고를 조회하여 Grid에 보여줌
  172. function fGetGoodDetail() {
  173. for(var k = 1; k <= instance1.selectNodes("/root/popgood/goodlist").length; k++) {
  174. var bDup = false; //물품코드가 중복되었는지를 확인하기 위한 변수
  175. //popup에서 선택한 물품코드가 이미 grid에 존재하고 있는지를 check하여 이미 존재하면 message를 보여주고 return한다.
  176. for(var i = 1; i < grd_delive.rows; i++) {
  177. if( grd_delive.valueMatrix(i, grd_delive.colRef("goodcd")) == model.getValue("/root/popgood/goodlist[" + k + "]/goodcd") ) {
  178. messageBox("물품코드가 중복되었습니다. [" + grd_delive.valueMatrix(i, grd_delive.colRef("goodcd")) + "] ", "E999", ""); //E: 경고
  179. bDup = true;
  180. continue;
  181. }
  182. }
  183. if( bDup == false ) {
  184. // node 삭제
  185. //model.removenode("/root/main/gooddetail");
  186. //TRRSO20104를 위해 물품코드를 goodcd에 넣는다.
  187. model.setValue( "/root/popgood/goodcd", model.getValue("/root/popgood/goodlist[" + k + "]/goodcd") );
  188. if( submit("TRRSO20104") ) {
  189. /* model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/instcd", model.getValue("/root/send/search/instcd"));
  190. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/delivedd", model.getValue("/root/send/search/delivedd"));
  191. //model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveno", model.getValue("/root/send/search/deliveno"));
  192. //model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveseq", model.getValue("/root/send/search/deliveseq"));
  193. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/wareflag", model.getValue("/root/send/search/wareflag"));
  194. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/delivedeptcd", model.getValue("/root/send/search/delivedeptcd"));
  195. */
  196. //마직막 행에 물품코드가 등록되어 있으면 그 행에 바로 적용하고, 물품코드가 없으면 한 행을 추가한 뒤 적용한다.
  197. if( grd_delive.valueMatrix(grd_delive.rows-1, grd_delive.colRef("goodcd")) != "" ) {
  198. btn_rowinsert.dispatch("DOMActivate");
  199. }
  200. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/goodcd", model.getValue("/root/main/good/gooddetail/goodcd"));
  201. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/goodnm", model.getValue("/root/main/good/gooddetail/goodnm"));
  202. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/goodspec", model.getValue("/root/main/good/gooddetail/goodspec"));
  203. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/deliveunit", model.getValue("/root/main/good/gooddetail/deliveunit"));
  204. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/exchqty", model.getValue("/root/main/good/gooddetail/exchqty"));
  205. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/siqty", model.getValue("/root/main/good/gooddetail/siqty"));
  206. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/hunqty", model.getValue("/root/main/good/gooddetail/hunqty"));
  207. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/deliveunitcost", model.getValue("/root/main/good/gooddetail/goodunitcost"));
  208. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/origsiqty", model.getValue("/root/main/good/gooddetail/siqty")); //hunqty의 처음 값을 저장하기 위함.
  209. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/orighunqty", model.getValue("/root/main/good/gooddetail/hunqty")); //hunqty의 처음 값을 저장하기 위함.
  210. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/deliveqty", "");
  211. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/deliveamt", "");
  212. model.setValue(grd_delive.nodeset + "[" + (grd_delive.rows-1) + "]/origdeliveqty", "0");
  213. }
  214. } // if( bDup ...) end
  215. } // for(var k ...) end
  216. grd_delive.refresh();
  217. }
  218. ]]>
  219. </script>
  220. </xhtml:head>
  221. <xhtml:body pagewidth="1220px" pageheight="770px" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  222. <group id="grp_tle" style="left:0px; top:0px; width:1195px; height:13px; ">
  223. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:243px; height:14px; ">창고 출고등록</caption>
  224. </group>
  225. <group id="group1" style="left:0px; top:12; width:1195px; height:27px; ">
  226. <button id="btn_init" class="btn4_letter3" style="left:984px; top:3px; width:68px; height:22px; ">
  227. <caption>초기화</caption>
  228. <script type="javascript" ev:event="DOMActivate">
  229. <![CDATA[
  230. //misfGridInit : model.removeNodeset(grd_delive.nodeset); grid.refresh();
  231. misfGridInit(grd_delive);
  232. model.resetInstanceNode("/root/send/search");
  233. model.setValue("/root/send/search/instcd", getUserInfo("dutplceinstcd")); //기관 설정
  234. model.setValue("/root/send/search/delivedd" , getCurrentDate()); //출고일자 설정
  235. model.setValue("/root/send/search/deliveflag", "03"); //출고유형 설정 (03:구매청구)
  236. fEnableDisableGridInput();
  237. chk_preyn.value = "N";
  238. chk_preyn.disabled = false;
  239. model.refresh();
  240. ]]>
  241. </script>
  242. </button>
  243. <line id="line17" class="line_6" style="x1:0px; y1:25; x2:1195px; y2:25px; "/>
  244. <button id="btn_save" class="btn4_letter2" navindex="8" style="left:1138px; top:3px; width:56px; height:22px; ">
  245. <caption>저장</caption>
  246. <script type="javascript" ev:event="DOMActivate">
  247. <![CDATA[
  248. if(grd_delive.rows == 1) return;
  249. //alert(grd_delive.getUpdateData());
  250. //물품코드나 출고량을 입력하지 않은 Row가 있는지 확인한다.
  251. for(var i = 1; i < grd_delive.rows; i++) {
  252. if( grd_delive.valueMatrix(i, grd_delive.colRef("goodcd")).getTrim() == "" ) {
  253. messageBox("물품코드가 선택되지 않았습니다. \n\n먼저 물품코드를 선택하십시요.", "E999", ""); //E: 경고
  254. model.setFocus("grd_delive");
  255. grd_delive.row = i;
  256. return;
  257. }
  258. /*
  259. - 0 : read : 조회시
  260. - 1 : insert : 행추가시
  261. - 2 : update : 조회한 것을 수정시
  262. - 3 : update & insert : 행추가한 것을 수정시
  263. - 4 : delete
  264. - 5 : delete & insert
  265. - 6 : delete & update
  266. */
  267. var status = grd_delive.rowStatus(i) ;
  268. if( status < 4 ) {
  269. if( grd_delive.valueMatrix(i, grd_delive.colRef("deliveqty")) == "" ) {
  270. messageBox("출고량이 입력되지 않았습니다. \n\n먼저 출고량을 입력하십시요.", "E999", ""); //E: 경고
  271. model.setFocus("grd_delive");
  272. grd_delive.row = i;
  273. return;
  274. }
  275. }
  276. }
  277. //진료재료파트일경우 선납출고 여부 확인
  278. // if(model.getValue("/root/send/search/delivedeptcd") == "3080000000"){ //진료재료파트 3080000000
  279. // var req = messageBox("예를 누를 경우 선납출고로만 처리합니다. ", "Q003");
  280. // if(req == 6){
  281. // grd_delive.valueMatrix(1, grd_delive.colRef("predeliveyn")) = "Y";
  282. // }else{
  283. // }
  284. // }
  285. if(chk_preyn.value == "Y"){
  286. for(var i = 1; i < grd_delive.rows; i++) {
  287. grd_delive.valueMatrix(i, grd_delive.colRef("preyn")) = "Y";
  288. }
  289. }
  290. // misfSave : submit 후, grid.clearStatus() 함
  291. if( misfSave("TXRSO20101") ) {
  292. //신규추가의 경우 출고번호를 setting한 후 다시 조회한다.
  293. if( ipt_deliveno.value.length == 0 ) {
  294. model.setValue(ipt_deliveno.attribute("ref"), model.getValue("/root/temp/deliveinfo/deliveno"));
  295. model.refreshpart(ipt_deliveno.attribute("ref"));
  296. //2012.03.14 신규추가 뿐 아니라 수정때도 다시 조회할 수 있도록 if 문 밖으로 뺌 - 여기는 comment처리
  297. //btn_search.dispatch("DOMActivate");
  298. }
  299. //2012.03.14 신규추가 뿐 아니라 수정때도 다시 조회할 수 있도록 if 문 밖으로 뺌
  300. chk_preyn.value = "";
  301. btn_search.dispatch("DOMActivate");
  302. messageBox("저장되었습니다.", "I999", "");
  303. }
  304. ]]>
  305. </script>
  306. </button>
  307. <button id="btn_delivedtl" class="btn3_letter6" style="left:675px; top:3px; width:104px; height:22px; ">
  308. <caption>출고내역조회</caption>
  309. <script type="javascript" ev:event="DOMActivate">
  310. <![CDATA[
  311. //창고에 선택된 값이 없으면, 창고를 선택하라고 alert함
  312. if(cmb_wareflag.value == "") {
  313. messageBox("창고가 선택되지 않았습니다. \n\n먼저 창고를 선택하십시요.", "E999", "");
  314. model.setFocus("cmb_wareflag");
  315. return;
  316. }
  317. //popup 에 전달할 parameter를 setting한다.
  318. model.setValue("/root/popdelive/instcd", cmb_instcd.value);
  319. model.setValue("/root/popdelive/wareflag", cmb_wareflag.value);
  320. model.setValue("/root/popdelive/wareflagnm", cmb_wareflag.label);
  321. model.setValue("/root/popdelive/delivedd", ipt_delivedd.value);
  322. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  323. model.setValue("/root/popdelive/selectyn", "");
  324. //popup 프로그램 호출
  325. window.load("SPRSO20100.xrw", "modal","", "", "/root/popdelive","/root/popdata");
  326. //popup에서 특정 출고내역을 선택한 경우, 다시 조회한다.
  327. if(model.getValue("/root/popdelive/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  328. btn_search.dispatch("DOMActivate");
  329. }
  330. ]]>
  331. </script>
  332. </button>
  333. <button id="btn_req" class="btn3_letter5" style="left:782px; top:3px; width:92px; height:22px; ">
  334. <caption>청구 data</caption>
  335. <script type="javascript" ev:event="DOMActivate">
  336. <![CDATA[
  337. //창고에 선택된 값이 없으면, 창고를 선택하라고 alert함
  338. if(cmb_wareflag.value == "") {
  339. messageBox("창고가 선택되지 않았습니다. \n\n먼저 창고를 선택하십시요.", "E999", "");
  340. model.setFocus("cmb_wareflag");
  341. return;
  342. }
  343. //출고일자에 선택된 값이 없으면, 출고일자를 선택하라고 alert함
  344. if(ipt_delivedd.value.length < 8) {
  345. messageBox("출고일자가 올바로 선택되지 않았습니다. \n\n먼저 출고일자를 선택하십시요.", "E999", "");
  346. model.setFocus("ipt_delivedd");
  347. return;
  348. }
  349. //출고부서에 선택된 값이 없으면, 출고부서를 선택하라고 alert함
  350. if(ipt_delivedeptcd.value == "") {
  351. messageBox("출고부서가 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  352. model.setFocus("ipt_delivedeptcd");
  353. return;
  354. }
  355. //출고부서명에 값이 없으면, 출고부서를 선택하라고 alert함 - 2013.02.26 박준범
  356. if(opt_delivedeptnm.value == "") {
  357. messageBox("출고부서가 정확하게 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  358. model.setFocus("ipt_delivedeptcd");
  359. return;
  360. }
  361. //popup 에 전달할 parameter를 setting한다.
  362. model.setValue("/root/popreq/instcd", cmb_instcd.value);
  363. model.setValue("/root/popreq/wareflag", cmb_wareflag.value);
  364. model.setValue("/root/popreq/wareflagnm", cmb_wareflag.label);
  365. model.setValue("/root/popreq/delivedd", ipt_delivedd.value);
  366. model.setValue("/root/popreq/reqdeptcd", ipt_delivedeptcd.value);
  367. model.setValue("/root/popreq/reqdeptnm", opt_delivedeptnm.value);
  368. //saveyn(popup 창에서 저장버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  369. model.setValue("/root/popreq/saveyn", "");
  370. //popup 프로그램 호출
  371. window.load("SPRSO20200.xrw", "modal","", "", "/root/popreq","/root/popdata");
  372. //popup에서 저장버튼을 누른 경우, 다시 조회한다.
  373. if(model.getValue("/root/popreq/saveyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  374. btn_search.dispatch("DOMActivate");
  375. messageBox("출고처리되었습니다..", "I999", "");
  376. }
  377. ]]>
  378. </script>
  379. </button>
  380. <button id="btn_del_all" class="btn4_letter4" navindex="8" style="left:1055px; top:3px; width:80px; height:22px; ">
  381. <caption>전체삭제</caption>
  382. <script type="javascript" ev:event="DOMActivate">
  383. <![CDATA[
  384. if(model.getValue("/root/send/search/deliveno") == "") {
  385. messageBox("삭제할 자료가 없습니다.", "I999", "");
  386. return;
  387. }
  388. //2012.02.28 박준범 추가
  389. //출고유형 02:처방 인 경우에는 data를 삭제할 수 없도록 한다.
  390. if( model.getValue("/root/send/search/deliveflag") == "02" ) {
  391. messageBox("출고유형이 '처방'인 자료는 삭제할 수 없습니다. ", "I999", "");
  392. return;
  393. }
  394. if (messageBox("현재 출고건을 ", "Q001") == 6){
  395. if(misfSave("TXRSO20102")) {
  396. btn_init.dispatch("DOMActivate");
  397. messageBox("삭제되었습니다.", "I999", "");
  398. chk_preyn.value = "N";
  399. chk_preyn.disabled = false;
  400. }
  401. };
  402. ]]>
  403. </script>
  404. </button>
  405. <button id="btn_adj" class="btn4_letter6" style="left:877px; top:3px; width:104px; height:22px; ">
  406. <caption>처방출고등록</caption>
  407. <script type="javascript" ev:event="DOMActivate">
  408. <![CDATA[
  409. //-------------------- 2012.02.28 박준범 : 처방출고등록 기능 추가 -------------------
  410. // 이는 처방집계된 data(02:처방)와 직접 출고등록하는 것(04:처방출고)과 구분하기 위한 것임
  411. //misfGridInit : model.removeNodeset(grd_delive.nodeset); grid.refresh();
  412. misfGridInit(grd_delive);
  413. model.resetInstanceNode("/root/send/search");
  414. model.setValue("/root/send/search/instcd", getUserInfo("dutplceinstcd")); //기관 설정
  415. model.setValue("/root/send/search/delivedd" , getCurrentDate()); //출고일자 설정
  416. model.setValue("/root/send/search/deliveflag", "04"); //출고유형 설정 (04:처방출고)
  417. fEnableDisableGridInput();
  418. chk_preyn.value = "N";
  419. chk_preyn.disabled = false;
  420. model.refresh();
  421. ]]>
  422. </script>
  423. </button>
  424. <button id="btn_prcp" class="btn1_letter4" visibility="hidden" style="left:0px; top:3px; width:104px; height:22px; ">
  425. <caption>처방집계</caption>
  426. <script type="javascript" ev:event="DOMActivate">
  427. <![CDATA[
  428. if(cmb_instcd.value == "031") {
  429. messageBox("본 기능은 칠곡병원을 위한 기능입니다. 본원에는 해당 사항이 없습니다. ", "E999", "");
  430. return;
  431. }
  432. //창고에 선택된 값이 없으면, 창고를 선택하라고 alert함
  433. if(cmb_wareflag.value == "") {
  434. messageBox("창고가 선택되지 않았습니다. \n\n먼저 창고를 선택하십시요.", "E999", "");
  435. model.setFocus("cmb_wareflag");
  436. return;
  437. }
  438. //출고일자에 선택된 값이 없으면, 출고일자를 선택하라고 alert함
  439. if(ipt_delivedd.value.length < 8) {
  440. messageBox("출고일자가 올바로 선택되지 않았습니다. \n\n먼저 출고일자를 선택하십시요.", "E999", "");
  441. model.setFocus("ipt_delivedd");
  442. return;
  443. }
  444. //출고부서에 선택된 값이 없으면, 출고부서를 선택하라고 alert함
  445. if(ipt_delivedeptcd.value == "") {
  446. messageBox("출고부서가 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  447. model.setFocus("ipt_delivedeptcd");
  448. return;
  449. }
  450. //출고부서명에 값이 없으면, 출고부서를 선택하라고 alert함 - 2013.02.26 박준범
  451. if(opt_delivedeptnm.value == "") {
  452. messageBox("출고부서가 정확하게 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  453. model.setFocus("ipt_delivedeptcd");
  454. return;
  455. }
  456. //진행중이던 작업을 중단하고 처방집계를 실시할 것인지 confirm
  457. var dd = model.getValue("/root/send/search/delivedd");
  458. if (messageBox( dd.substr(0,4) + " 년 " + dd.substr(4,2) + " 월 처방을 대상으로 집계를 실시하시겠습니까? ", "Q999","") != 6){
  459. return;
  460. }
  461. //misfGridInit : model.removeNodeset(grd_delive.nodeset); grid.refresh();
  462. misfGridInit(grd_delive);
  463. model.setValue("/root/send/search/deliveno" , ""); //출고번호 null
  464. model.setValue("/root/send/search/deliveflag", "04"); //출고유형 설정 (04:처방출고)
  465. if(submit("TRRSO20106")) {
  466. for(var i = 1; i < grd_delive.rows; i++) {
  467. /*
  468. - 0 : read : 조회시
  469. - 1 : insert : 행추가시
  470. - 2 : update : 조회한 것을 수정시
  471. - 3 : update & insert : 행추가한 것을 수정시
  472. - 4 : delete
  473. - 5 : delete & insert
  474. - 6 : delete & update
  475. */
  476. grd_delive.rowStatus(i) = 1;
  477. }
  478. }
  479. fEnableDisableGridInput();
  480. model.refresh();
  481. ]]>
  482. </script>
  483. </button>
  484. <button id="button1" class="btn3_letter6" style="left:569px; top:3px; width:104px; height:22px; ">
  485. <caption>부서입고확인</caption>
  486. <script type="javascript" ev:event="DOMActivate">
  487. <![CDATA[
  488. //
  489. // //창고에 선택된 값이 없으면, 창고를 선택하라고 alert함
  490. // if(cmb_wareflag.value == "") {
  491. // messageBox("창고가 선택되지 않았습니다. \n\n먼저 창고를 선택하십시요.", "E999", "");
  492. // model.setFocus("cmb_wareflag");
  493. // return;
  494. // }
  495. //
  496. // //popup 에 전달할 parameter를 setting한다.
  497. // model.setValue("/root/popdelive/instcd", cmb_instcd.value);
  498. // model.setValue("/root/popdelive/wareflag", cmb_wareflag.value);
  499. // model.setValue("/root/popdelive/wareflagnm", cmb_wareflag.label);
  500. // model.setValue("/root/popdelive/delivedd", ipt_delivedd.value);
  501. //
  502. // //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  503. model.setValue("/root/popdelive/selectyn", "");
  504. //popup 프로그램 호출
  505. window.load("SMRSO23300.xrw", "modal","", "");//,"/root/popdelive","/root/popdata");
  506. //popup에서 특정 출고내역을 선택한 경우, 다시 조회한다.
  507. if(model.getValue("/root/popdelive/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  508. btn_search.dispatch("DOMActivate");
  509. }
  510. ]]>
  511. </script>
  512. </button>
  513. </group>
  514. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1195px; height:710px; ">
  515. <group id="grp_search" style="left:0px; top:9px; width:1195px; height:48px; vertical-align:top; ">
  516. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:40px; background-color:#fffbf2; border-color:#ffd799; "/>
  517. <button id="btn_search" class="btn1_letter2" navindex="7" style="left:1129px; top:9px; width:56px; height:22px; ">
  518. <caption>조회</caption>
  519. <script type="javascript" ev:event="DOMActivate">
  520. <![CDATA[
  521. chk_preyn.value = "N";
  522. chk_preyn.disabled = false;
  523. //창고에 선택된 값이 없으면, 창고를 선택하라고 alert함
  524. if(cmb_wareflag.value == "") {
  525. messageBox("창고가 선택되지 않았습니다. \n\n먼저 창고를 선택하십시요.", "E999", "");
  526. model.setFocus("cmb_wareflag");
  527. return;
  528. }
  529. //2012.03.16 박준범 - 입력모드에서 다시 조회버튼 click 시 Grid초기화 먼저 실행토록 추가
  530. misfGridInit(grd_delive);
  531. misfMsterDetailRetrieve();
  532. fEnableDisableGridInput();
  533. if(grd_delive.valueMatrix(2, grd_delive.colRef("predd")) != ""){
  534. chk_preyn.value = "Y";
  535. chk_preyn.disabled = true;
  536. }else{
  537. chk_preyn.value = "N";
  538. chk_preyn.disabled = false;
  539. }
  540. ]]>
  541. </script>
  542. </button>
  543. <select1 id="cmb_instcd" ref="/root/send/search/instcd" class="combo_default" disabled="true" navindex="1" appearance="minimal" style="left:87px; top:10px; width:136px; height:19px; ">
  544. <choices>
  545. <itemset nodeset="/root/main/init">
  546. <label ref="cnstnm"/>
  547. <value ref="cnstcd"/>
  548. </itemset>
  549. </choices>
  550. </select1>
  551. <caption id="cap_instcd" class="search_name" style="left:8px; top:10px; width:82px; height:17px; ">기관코드</caption>
  552. <input id="ipt_delivedd" ref="/root/send/search/delivedd" navindex="5" inputtype="date" style="left:481px; top:10px; width:89px; height:19px; ">
  553. <script type="javascript" ev:event="xforms-value-changed">
  554. <![CDATA[
  555. //조회조건 변경시 초기화 및 check
  556. fSearchCondChanged("ipt_delivedd");
  557. ]]>
  558. </script>
  559. </input>
  560. <caption id="caption20" class="search_name" style="left:612px; top:10px; width:102px; height:17px; vertical-align:middle; ">물품받는부서</caption>
  561. <line id="line30" class="line_4" style="x1:1115px; y1:3px; x2:1115px; y2:35px; "/>
  562. <caption id="caption2" class="search_name" style="left:235px; top:10px; width:55px; height:17px; ">창고</caption>
  563. <select1 id="cmb_wareflag" ref="/root/send/search/wareflag" class="combo_default" navindex="4" appearance="minimal" style="left:289px; top:10px; width:99px; height:19px; ">
  564. <choices>
  565. <itemset nodeset="/root/init/wareflag">
  566. <label ref="cdnm"/>
  567. <value ref="cdid"/>
  568. </itemset>
  569. </choices>
  570. <script type="javascript" ev:event="xforms-value-changed">
  571. <![CDATA[
  572. //조회조건 변경시 초기화 및 check
  573. fSearchCondChanged("cmb_wareflag");
  574. ]]>
  575. </script>
  576. </select1>
  577. <input id="ipt_deliveno" ref="/root/send/search/deliveno" class="input_default" disabled="true" navindex="6" maxbyte="4" style="left:571px; top:10px; width:32px; height:19px; text-align:center; ">
  578. <script type="javascript" ev:event="xforms-value-changed">
  579. <![CDATA[
  580. /* 출고번호를 disabled 했기 때문에 아래 script 수행되지 않기에 모두 comment처리
  581. var vDeliveno = model.getValue("/root/send/search/deliveno");
  582. //입력된 값이 없으면 return
  583. if( vDeliveno.length == 0 ) return;
  584. if (!vDeliveno.isNumber()) {
  585. messageBox("번호(숫자)를 " ,"C001");
  586. model.setFocus("ipt_deliveno");
  587. return;
  588. }
  589. //입력된 값이 숫자인 경우만 아래 실행
  590. //setInputNodeCurText(); //input의 ref 노드에 현재 label setValue (tfHelper.js)
  591. vDeliveno = model.getValue("/root/send/search/deliveno").getLeftPad(4,"0");
  592. model.setValue("/root/send/search/deliveno", vDeliveno);
  593. model.refreshpart("/root/send/search/deliveno");
  594. */
  595. ]]>
  596. </script>
  597. </input>
  598. <button id="btn_delivedeptcd" class="icon_search" navindex="3" style="left:788px; top:10px; width:16px; height:16px; ">
  599. <caption/>
  600. <script type="javascript" ev:event="DOMActivate">
  601. <![CDATA[
  602. var vOrigDeptcd = ipt_delivedeptcd.value; //popup을 열기전 부서 저장
  603. var recv_list = "delivedeptcd,delivedeptnm";
  604. misfOpenPopUpList("02", ipt_delivedeptcd,"", recv_list) ;
  605. ipt_delivedeptcd.refresh();
  606. opt_delivedeptnm.refresh();
  607. if(vOrigDeptcd != ipt_delivedeptcd.value) { //부서코드가 변경되었다면
  608. //조회조건 변경시 초기화 및 check
  609. fSearchCondChanged("ipt_delivedeptcd");
  610. }
  611. ]]>
  612. </script>
  613. </button>
  614. <input id="ipt_delivedeptcd" ref="/root/send/search/delivedeptcd" class="input_default" navindex="2" style="left:716px; top:10px; width:70px; height:19px; ">
  615. <script type="javascript" ev:event="xforms-value-changed">
  616. <![CDATA[
  617. //2013.02.26 박준범 : 부서코드 변경시 부서코드명을 먼저 지워준다.
  618. opt_delivedeptnm.value = "";
  619. misfValidationCheck("02", "", "delivedeptcd,delivedeptnm" );
  620. //조회조건 변경시 초기화 및 check
  621. fSearchCondChanged("ipt_delivedeptcd");
  622. ]]>
  623. </script>
  624. <script type="javascript" ev:event="onkeypress">
  625. <![CDATA[
  626. //if( event.keyCode == 13 ) {
  627. //btn_search.dispatch("DOMActivate");
  628. // --> 위의 코드를 사용하면 input에 입력된 값이 인식이 안됨. TrustForm bug 같습니다.
  629. // --> 대신, 아래 코드 사용하면 input의 값이 인식이 됨
  630. //input 에서 EnterKey 이벤트 인식시 아래 function을 사용하세요!!
  631. inputEnterKey("ipt_delivedeptcd", "xforms-value-changed");
  632. //}
  633. ]]>
  634. </script>
  635. </input>
  636. <output id="opt_delivedeptnm" ref="/root/send/search/delivedeptnm" class="output_fix" appearance="output" style="left:806px; top:10px; width:126px; height:19px; "/>
  637. <caption id="caption9" class="search_name" style="left:401px; top:10px; width:79px; height:17px; ">출고일자</caption>
  638. <caption id="caption3" class="search_name" style="left:940px; top:10px; width:80px; height:17px; vertical-align:middle; ">출고유형</caption>
  639. <select1 id="cmb_deliveflag" ref="/root/send/search/deliveflag" class="combo_default" disabled="true" appearance="minimal" style="left:1020px; top:10px; width:77px; height:19px; ">
  640. <choices>
  641. <itemset nodeset="/root/init/deliveflag">
  642. <label ref="cdnm"/>
  643. <value ref="cdid"/>
  644. </itemset>
  645. </choices>
  646. </select1>
  647. </group>
  648. <line id="line1" class="line_1" style="x1:0px; y1:78px; x2:1195px; y2:78px; "/>
  649. <caption id="caption1" class="tit_2" style="left:0px; top:63px; width:180px; height:13px; ">출고내역</caption>
  650. <button id="btn_rowinsert" class="btn2_letter3" navindex="20" style="left:1072px; top:57px; width:53px; height:19px; ">
  651. <caption>행추가</caption>
  652. <script type="javascript" ev:event="DOMActivate">
  653. <![CDATA[
  654. //창고에 선택된 값이 없으면, 창고를 선택하라고 alert함
  655. if(cmb_wareflag.value == "") {
  656. messageBox("창고가 선택되지 않았습니다. \n\n먼저 창고를 선택하십시요.", "E999", "");
  657. model.setFocus("cmb_wareflag");
  658. return;
  659. }
  660. //출고부서에 선택된 값이 없으면, 출고부서를 선택하라고 alert함
  661. if(ipt_delivedeptcd.value == "") {
  662. messageBox("출고부서가 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  663. model.setFocus("ipt_delivedeptcd");
  664. return;
  665. }
  666. //출고부서명에 값이 없으면, 출고부서를 선택하라고 alert함 - 2013.02.26 박준범
  667. if(opt_delivedeptnm.value == "") {
  668. messageBox("출고부서가 정확하게 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  669. model.setFocus("ipt_delivedeptcd");
  670. return;
  671. }
  672. // if (fDataValiChk() == false) return;
  673. //misfGridIUD : grd_delive.addRow() 한 후, 조회조건을 grd_delive 의 해당 컬럼에 setting하고, pGrid_id.refresh() 한다.
  674. misfGridIUD(grd_delive, "A");
  675. //추가한 행에 출고순번 부여
  676. if(grd_delive.rows == 2) {
  677. grd_delive.valueMatrix(grd_delive.rows-1, grd_delive.colRef("deliveseq")) = "001";
  678. }else{
  679. var vSeq = parseFloat( grd_delive.valueMatrix(grd_delive.rows-2, grd_delive.colRef("deliveseq")) ) + 1;
  680. vSeq = vSeq + "";
  681. grd_delive.valueMatrix(grd_delive.rows-1, grd_delive.colRef("deliveseq")) = vSeq.getLeftPad(3,"0");
  682. }
  683. ]]>
  684. </script>
  685. </button>
  686. <button id="btn_rowdel" class="btn2_letter3" navindex="21" style="left:1128px; top:57px; width:53px; height:19px; ">
  687. <caption>행삭제</caption>
  688. <script type="javascript" ev:event="DOMActivate">
  689. <![CDATA[
  690. /*
  691. - 0 : read : 조회시
  692. - 1 : insert : 행추가시
  693. - 2 : update : 조회한 것을 수정시
  694. - 3 : insert & new : 행추가한 것을 수정시
  695. - 4 : delete
  696. - 5 : delete & insert
  697. - 6 : delete & update
  698. */
  699. var status = grd_delive.rowStatus(grd_delive.row) ;
  700. if(status == 0) {
  701. grd_delive.addStatus(grd_delive.row, "delete");
  702. }else if(status == 1) {
  703. grd_delive.deleteRow(grd_delive.row);
  704. }else if(status == 2) {
  705. grd_delive.addStatus(grd_delive.row, "delete");
  706. }else if(status == 3) {
  707. grd_delive.deleteRow(grd_delive.row);
  708. }else if(status == 4) {
  709. grd_delive.removeStatus(grd_delive.row, "delete");
  710. }else if(status == 5) { // insert된 data는 삭제시 위에서 addStatus("delete")하지 않고, 바로 deleteRow했기 때문에 5의 경우는 발생하지 않음.
  711. grd_delive.removeStatus(grd_delive.row, "delete");
  712. }else if(status == 6) {
  713. grd_delive.removeStatus(grd_delive.row, "delete");
  714. }
  715. //misfGridIUD(grd_delive, "D");
  716. //grd_delive.deleteRow(grd_delive.row);
  717. /*
  718. //fDelSetting(grd_delive);
  719. if (grd_delive.selectedRows > 0) {
  720. var selectedRows = Array(grd_delive.selectedRows);
  721. for(i=0;i< grd_delive.selectedRows;i++) {
  722. selectedRows[i] = grd_delive.selectedRow(i);
  723. }
  724. }
  725. for ( var i= selectedRows.length; i >= 0; i--){
  726. rowIdx = selectedRows[i];
  727. if (grd_delive.rowstatus(rowIdx) == 0)
  728. {
  729. if (grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("purccnsttnno")) != ""){
  730. messageBox(grd_delive.row+"번째는 품의 처리된 건", "I009");
  731. }else{
  732. grd_delive.rowStatus(rowIdx) = "4";
  733. }
  734. }else{
  735. grd_delive.deleteRow(rowIdx);
  736. }
  737. }
  738. grd_delive.refresh();
  739. var nodelist = instance1.selectNodes("/root/main/list/purcdmndinfo/purcdmndsublist").length;
  740. if(nodelist > 0){
  741. cmb_wareflag.disabled = true;
  742. }else{
  743. cmb_wareflag.disabled = false;
  744. }
  745. */
  746. ]]>
  747. </script>
  748. </button>
  749. <datagrid id="grd_delive" nodeset="/root/main/delive/delivelist" caption="순번^물품코드^물품명^규격^단위^BOX수량^시점재고^현재고^출고량^단가^금액^기관코드^출고일자^출고번호^창고구분^출고부서^출고유형^orig시점재고^orig현재고^orig출고량" colsep="^" colwidth="43, 103, 283, 130, 71, 72, 80, 80, 80, 100, 112, 61, 59, 56, 57, 55, 67, 68, 65, 69" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:0px; top:83px; width:1195px; height:622px; ">
  750. <col ref="deliveseq" style="text-align:center; "/>
  751. <col ref="goodcd" type="inputbutton" style="text-align:center; "/>
  752. <col ref="goodnm"/>
  753. <col ref="goodspec"/>
  754. <col ref="deliveunit" style="text-align:center; "/>
  755. <col ref="exchqty" format="#,###.##" style="text-align:right; "/>
  756. <col ref="siqty" format="(-)#,###.##" style="text-align:right; "/>
  757. <col ref="hunqty" format="(-)#,###.##" style="text-align:right; "/>
  758. <col ref="deliveqty" type="input" format="(-)#,###.##" style="text-align:right; "/>
  759. <col ref="deliveunitcost" format="#,###.##" style="left:855px; top:23px; width:100px; height:23px; text-align:right; "/>
  760. <col ref="deliveamt" format="(-)#,###.##" style="text-align:right; "/>
  761. <col ref="instcd" visibility="hidden" style="left:1160px; top:23px; width:61px; height:23px; "/>
  762. <col ref="delivedd" visibility="hidden"/>
  763. <col ref="deliveno" visibility="hidden"/>
  764. <col ref="wareflag" visibility="hidden"/>
  765. <col ref="delivedeptcd" visibility="hidden"/>
  766. <col ref="deliveflag" visibility="hidden"/>
  767. <col ref="origsiqty" visibility="hidden"/>
  768. <col ref="orighunqty" visibility="hidden"/>
  769. <col ref="origdeliveqty" visibility="hidden"/>
  770. <col ref="predeliveyn" visibility="hidden"/>
  771. <col ref="preyn" visibility="hidden"/>
  772. <col ref="predd" visibility="hidden"/>
  773. <script type="javascript" ev:event="onbuttonclick">
  774. <![CDATA[
  775. //조회된 data 의 경우에는 물품코드를 변경할 수 없다.
  776. if(grd_delive.rowStatus(grd_delive.row) == 0 || grd_delive.rowStatus(grd_delive.row) == 2) { //0:read, 1:insert, 2:update, 3:update after insert
  777. //alert("onentercell");
  778. return;
  779. }
  780. //popup 에 전달할 parameter를 setting한다.
  781. model.setValue("/root/popgood/instcd", cmb_instcd.value);
  782. model.setValue("/root/popgood/wareflag", cmb_wareflag.value);
  783. model.setValue("/root/popgood/delivedd", ipt_delivedd.value ); //향후 시점재고 조회를 위해 출고일자를 set
  784. //2012.09.17 박준범 - SPRSO20700.xrw 에서 사용하기 위해 basedd를 추가 함
  785. model.setValue("/root/popgood/basedd", ipt_delivedd.value ); //물품코드 popup 에서 출고일자 기준으로 물품 Master 조회하기 위해서
  786. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  787. model.setValue("/root/popgood/selectyn", "");
  788. //popup 프로그램 호출
  789. //window.load("SPRSO20300.xrw", "modal","", "", "/root/popgood","/root/popdata"); //단일선택창
  790. window.load("SPRSO20700.xrw", "modal","", "", "/root/popgood","/root/popdata"); //다중선택창
  791. //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 조회해서 그리드에 보여준다.
  792. if(model.getValue("/root/popgood/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  793. fGetGoodDetail(); //물품코드의 상세내역과 현재고를 조회하여 Grid에 보여줌
  794. //출고량을 입력하도록 focus이동
  795. grd_delive.col = grd_delive.colRef("deliveqty");
  796. }
  797. ]]>
  798. </script>
  799. <script type="javascript" ev:event="xforms-value-changed">
  800. <![CDATA[
  801. if (grd_delive.colAttribute(grd_delive.col,"ref") == "deliveqty" ) { //출고량 컬럼
  802. //출고량 컬럼의 입력값을 확인하여 적절히 변경한다.
  803. // ("." 만 입력한 경우 계산 오류 방지를 위해 null 로 변경한다.)
  804. if( grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveqty")) == "." ) {
  805. grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveqty")) = "";
  806. }
  807. grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("siqty")) = //시점재고량
  808. parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("origsiqty")).getLeftPad(1,"0"))
  809. - parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveqty")).getLeftPad(1,"0"))
  810. + parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("origdeliveqty")).getLeftPad(1,"0"));
  811. grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("hunqty")) = //현재고량
  812. parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("orighunqty")).getLeftPad(1,"0"))
  813. - parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveqty")).getLeftPad(1,"0"))
  814. + parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("origdeliveqty")).getLeftPad(1,"0"));
  815. /* var fHunqty = parseFloat(model.getValue(grd_delive.nodeset + "[" + grd_delive.row + "]/orighunqty").getLeftPad(1,"0"))
  816. - parseFloat(model.getValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveqty").getLeftPad(1,"0"))
  817. + parseFloat(model.getValue(grd_delive.nodeset + "[" + grd_delive.row + "]/origdeliveqty").getLeftPad(1,"0"));
  818. model.setValue(grd_delive.nodeset + "[" + grd_delive.row+ "]/hunty", fHunqty);
  819. */
  820. if(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveunitcost")) == "") { //단가
  821. grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveamt")) = ""; //금액
  822. }else{
  823. grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveamt")) = //금액
  824. parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveunitcost")).getLeftPad(1,"0"))
  825. * parseFloat(grd_delive.valueMatrix(grd_delive.row, grd_delive.colRef("deliveqty")).getLeftPad(1,"0"));
  826. }
  827. }
  828. ]]>
  829. </script>
  830. <script type="javascript" ev:event="onentercell">
  831. <![CDATA[
  832. //조회된 data 의 경우에는 물품코드를 변경할 수 없다.
  833. if(grd_delive.colAttribute(grd_delive.col,"ref") == "goodcd") { //물품코드
  834. /* 2012.03.20 박준범 - 물품코드를 popup에서만 등록토록 하기 위해서 아래 comment처리하고 무조건 return처리함
  835. if(grd_delive.rowStatus(grd_delive.row) == 0 || grd_delive.rowStatus(grd_delive.row) == 2) { //0:read, 1:insert, 2:update, 3:update after insert
  836. grd_delive.col = 1; //focus를 강제로 옮김
  837. return;
  838. }
  839. */
  840. grd_delive.col = 1; //focus를 강제로 옮김
  841. return;
  842. }
  843. ]]>
  844. </script>
  845. <script type="javascript" ev:event="ondblclick">
  846. <![CDATA[
  847. //조회한 data 의 경우에는 물품코드를 변경할 수 없도록 한다.
  848. if(grd_delive.colAttribute(grd_delive.col,"ref") == "goodcd") { //물품코드
  849. /* 2012.03.20 박준범 - 물품코드를 popup에서만 등록토록 하기 위해서 아래 comment처리하고 무조건 return처리함
  850. if(grd_delive.rowStatus(grd_delive.row) == 0 || grd_delive.rowStatus(grd_delive.row) == 2) { //0:read, 1:insert, 2:update, 3:update after insert
  851. grd_delive.col = 1; //focus를 강제로 옮김
  852. return;
  853. }
  854. */
  855. grd_delive.col = 1; //focus를 강제로 옮김
  856. return;
  857. }
  858. ]]>
  859. </script>
  860. <script type="javascript" ev:event="onkeypress">
  861. <![CDATA[
  862. //Grid 에서 엔터 입력시 다음행 수정
  863. misfNextRow(grd_delive);
  864. ]]>
  865. </script>
  866. </datagrid>
  867. <select id="chk_preyn" ref="/root/chk_preyn" overflow="visible" appearance="full" style="left:1000px; top:59px; width:75px; height:20px; border-style:none; ">
  868. <choices>
  869. <item>
  870. <label>선납출고</label>
  871. <value>Y</value>
  872. </item>
  873. </choices>
  874. </select>
  875. <caption id="caption4" style="left:659px; top:57px; width:102px; height:20px; ">청구출급증 바코드</caption>
  876. <input id="ipt_barcode" ref="/root/send/search/barcode" class="input_default" style="left:765px; top:57px; width:190px; height:19px; ">
  877. <script type="javascript" ev:event="xforms-value-changed">
  878. <![CDATA[
  879. /* 2013.11.22 박준범 - 최동익샘 요청
  880. - 청구출급증의 바코드를 읽어 청구data를 출고하는 업무에 편의 제공키 위한 코딩
  881. - 바코드의 구성: 기관코드(3자리) + 창고코드(2) + 청구부서(=물품받는부서)(10)
  882. + 청구일자(8) + 청구번호(4)
  883. - 여기서 창고코드는 무조건 2자리로 넘어오는 것에 유의할 것.
  884. */
  885. if(ipt_barcode.value == "") return;
  886. var allData = ipt_barcode.value;
  887. //var cellData = allData.split("|");
  888. if(cmb_instcd.value != allData.substr(0,3)) { //기관코드
  889. messageBox("청구출급증의 기관코드가 일치하지 않아 처리할 수 없습니다. ", "I999", "");
  890. return;
  891. }
  892. cmb_wareflag.value = parseInt(allData.substr(3,2), 10); //창고코드: 2자리 형식으로 바코드에 포함되어 있으므로 변경해야 함.
  893. ipt_delivedeptcd.value = allData.substr(5,10); //청구부서(=물품받는부서)
  894. ipt_delivedeptcd.dispatch("xforms-value-changed");
  895. //청구 data popup 에 전달할 parameter를 미리 setting한다.
  896. model.setValue("/root/popreq/reqddbarcode", allData.substr(15,8)); //청구일자
  897. model.setValue("/root/popreq/reqnobarcode", allData.substr(23,4)); //청구번호
  898. btn_req.dispatch("DOMActivate");
  899. model.setValue("/root/popreq/reqddbarcode", ""); //청구일자 지우기
  900. model.setValue("/root/popreq/reqnobarcode", ""); //청구번호 지우기
  901. model.setFocus("ipt_barcode");
  902. /*
  903. var kyymd = model.getValue("/root/send/retrparam/barcode").substr(0, 8);
  904. var kyseq = model.getValue("/root/send/retrparam/barcode").substr(8, 5);
  905. for(barcnt = 1; barcnt < datagrid1.rows; barcnt++) {
  906. if(model.getValue("/root/main/evidenceinfo/evidencelist["+ barcnt +"]/kygubun") == 'Y' &&
  907. model.getValue("/root/main/evidenceinfo/evidencelist["+ barcnt +"]/kyymd") == kyymd &&
  908. parseFloat(model.getValue("/root/main/evidenceinfo/evidencelist["+ barcnt +"]/kyseq")) == parseFloat(kyseq)){
  909. datagrid1.topRow = barcnt;
  910. datagrid1.select(barcnt+1, 0, barcnt+1, 0) = true;
  911. if(model.getValue("/root/main/evidenceinfo/evidencelist["+ barcnt +"]/flag") == "Y"){
  912. alert("이전에 등록된 자료입니다.");
  913. model.setFocus("input4");
  914. return;
  915. }
  916. }
  917. }
  918. alert("등록된 자료가 없습니다.");
  919. model.setFocus("input4");
  920. */
  921. ]]>
  922. </script>
  923. <script type="javascript" ev:event="onkeyup">
  924. <![CDATA[
  925. inputEnterKey("ipt_barcode", "xforms-value-changed");
  926. ]]>
  927. </script>
  928. </input>
  929. </group>
  930. </xhtml:body>
  931. </xhtml:html>