SMRSO21400_출고등록(부서재고)(경북대).xrw 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  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. <cond>
  10. <instcd/>
  11. <delivedd/>
  12. <outkind/>
  13. <reqdeptcd/>
  14. <reqdeptnm/>
  15. <delivedeptcd/>
  16. <delivedeptnm/>
  17. <winkind/>
  18. </cond>
  19. <main>
  20. <list>
  21. <deptoutinfo>
  22. <deptoutlist/>
  23. </deptoutinfo>
  24. </list>
  25. <good>
  26. <gooddetail/>
  27. </good>
  28. <dupcheck>
  29. <dupyn/>
  30. </dupcheck>
  31. </main>
  32. <send>
  33. </send>
  34. <init>
  35. </init>
  36. <hidden/>
  37. <temp>
  38. </temp>
  39. <popdata>
  40. <srchdd/>
  41. </popdata>
  42. <popdelive>
  43. <instcd/>
  44. <delivedd/>
  45. <delivedeptcd/>
  46. <delivedeptnm/>
  47. <opener/>
  48. </popdelive>
  49. <popreq>
  50. <count/>
  51. </popreq>
  52. <popsubdata/>
  53. <popgood>
  54. <instcd/>
  55. <wareflag/>
  56. <delivedd/>
  57. <basedd/>
  58. <selectyn/>
  59. <goodcd/>
  60. <goodlist>
  61. <goodcd/>
  62. </goodlist>
  63. </popgood>
  64. <magam/>
  65. <magamsearch>
  66. <instcd/>
  67. <dd/>
  68. <deptcd/>
  69. </magamsearch>
  70. <distrimagam/>
  71. </root>
  72. </instance>
  73. <script type="javascript" ev:event="xforms-ready">
  74. <![CDATA[
  75. //화면 Control을 초기화한다
  76. misfGridInit(grd_deptoutlist);
  77. misfGetAndSetUserInfo(); //접속자기본정보
  78. // misfComboComCdList("Z0007",cmb_instcd);
  79. // misfComboComCdList("030R0020",cmb_outkind);
  80. misfComboComCdListMulti("Z0007,030R0020,030R0019,030R0019","cmb_instcd,cmb_outkind,grd_deptoutlist.winkind,cmb_winkind");
  81. addComboItem( "cmb_winkind", "전체", "", "above");
  82. model.setValue(cmb_winkind.attribute("ref"), "");
  83. addComboItem( "cmb_outkind", "전체", "", "above");
  84. model.setValue(cmb_outkind.attribute("ref"), "");
  85. model.setValue("/root/cond/reqdeptcd", DUT_PLCEDEPT_CD);
  86. model.setValue("/root/cond/reqdeptnm", DUT_PLCEDEPT_NM);
  87. model.setValue("/root/cond/delivedeptcd", DUT_PLCEDEPT_CD);
  88. model.setValue("/root/cond/delivedeptnm", DUT_PLCEDEPT_NM);
  89. model.setValue("/root/cond/instcd", getUserInfo("dutplceinstcd")); //기관 설정
  90. model.setValue("/root/cond/delivedd" , getCurrentDate()); //출고일자 설정
  91. //model.setValue("/root/cond/outkind", ""); //출고유형 설정 (03:구매청구)
  92. model.refresh();
  93. ]]>
  94. </script>
  95. <submission id="TRRSO21401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/cond" resultref="/root/main/list"/>
  96. <submission id="TXRSO21401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/savedata" resultref="/root/temp"/>
  97. <submission id="TRRSO20104" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/popgood" resultref="/root/main/good"/>
  98. <submission id="TRRSO21002" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/magamsearch" resultref="/root/magam"/>
  99. <submission id="TRRSO21003" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/magamsearch" resultref="/root/distrimagam"/>
  100. </model>
  101. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  102. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  103. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  104. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  105. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  106. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  107. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  108. <script type="javascript">
  109. <![CDATA[
  110. /**
  111. * @ver : 2011-10-10
  112. * @desc : Popup창에서 해당정보 받기
  113. * @param :
  114. * @return :
  115. * @---------------------------------------------------
  116. */
  117. function fGetGoodInfo(getRCVS){
  118. var params = getRCVS.split("▩");
  119. for(var i = 1; i <(params.length-1); i++){
  120. var sGoodcd = params[i].split("▦")[0]; //물품코드
  121. var sEdicd = params[i].split("▦")[1] ; //edicd
  122. var sGoodnm = params[i].split("▦")[2]; //물품명
  123. var sGoodspec = params[i].split("▦")[3]; //물품규격
  124. var sDeliveunit = params[i].split("▦")[4]; //슈불단위
  125. var sPurcunit = params[i].split("▦")[5]; //구매단위
  126. var sAcntcd = params[i].split("▦")[6]; //계정코드
  127. var sAcntnm = params[i].split("▦")[7]; //계정명
  128. var compGoodcd;
  129. var k;
  130. for( k =grd_deptoutlist.fixedRows;k <grd_deptoutlist.rows;k++){
  131. compGoodcd = grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("goodcd"));
  132. if(sGoodcd ==compGoodcd){
  133. duplFlag = true;
  134. break;
  135. }else{
  136. duplFlag = false;
  137. }
  138. }
  139. if(duplFlag == true){
  140. messageBox(sGoodcd+"은(는) 이미 등록하신 코드","I009");
  141. }else{
  142. //grd_deptoutlist.addRow(false);
  143. model.makeValue("/root/main/list/deptoutinfo/deptoutlist["+grd_deptoutlist.row+"]/goodcd" ,sGoodcd);
  144. model.makeValue("/root/main/list/deptoutinfo/deptoutlist["+grd_deptoutlist.row+"]/goodnm" ,sGoodnm);
  145. model.makeValue("/root/main/list/deptoutinfo/deptoutlist["+grd_deptoutlist.row+"]/deliveunit" ,sDeliveunit);
  146. model.makeValue("/root/main/list/deptoutinfo/deptoutlist["+grd_deptoutlist.row+"]/goodspec" ,sGoodspec);
  147. }
  148. }
  149. grd_deptoutlist.refresh();
  150. }
  151. function fGetGoodDetail() {
  152. for(var k = 1; k <= instance1.selectNodes("/root/popgood/goodlist").length; k++) {
  153. var bDup = false; //물품코드가 중복되었는지를 확인하기 위한 변수
  154. //popup에서 선택한 물품코드가 이미 grid에 존재하고 있는지를 check하여 이미 존재하면 message를 보여주고 return한다.
  155. // for(var i = 1; i < grd_deptoutlist.rows; i++) {
  156. // if( grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("goodcd")) == model.getValue("/root/popgood/goodlist[" + k + "]/goodcd") ) {
  157. // messageBox("물품코드가 중복되었습니다. [" + grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("goodcd")) + "] ", "E999", ""); //E: 경고
  158. // bDup = true;
  159. // continue;
  160. // }
  161. // }
  162. if( bDup == false ) {
  163. // node 삭제
  164. //model.removenode("/root/main/gooddetail");
  165. //TRRSO20104를 위해 물품코드를 goodcd에 넣는다.
  166. model.setValue( "/root/popgood/goodcd", model.getValue("/root/popgood/goodlist[" + k + "]/goodcd") );
  167. if( submit("TRRSO20104") ) {
  168. /* model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/instcd", model.getValue("/root/send/search/instcd"));
  169. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/delivedd", model.getValue("/root/send/search/delivedd"));
  170. //model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveno", model.getValue("/root/send/search/deliveno"));
  171. //model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/deliveseq", model.getValue("/root/send/search/deliveseq"));
  172. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/wareflag", model.getValue("/root/send/search/wareflag"));
  173. model.setValue(grd_delive.nodeset + "[" + grd_delive.row + "]/delivedeptcd", model.getValue("/root/send/search/delivedeptcd"));
  174. */
  175. //마직막 행에 물품코드가 등록되어 있으면 그 행에 바로 적용하고, 물품코드가 없으면 한 행을 추가한 뒤 적용한다.
  176. if( grd_deptoutlist.valueMatrix(grd_deptoutlist.rows-1, grd_deptoutlist.colRef("goodcd")) != "" ) {
  177. btn_rowinsert.dispatch("DOMActivate");
  178. }
  179. model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/goodcd", model.getValue("/root/main/good/gooddetail/goodcd"));
  180. model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/goodnm", model.getValue("/root/main/good/gooddetail/goodnm"));
  181. model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/goodspec", model.getValue("/root/main/good/gooddetail/goodspec"));
  182. model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/deliveunit", model.getValue("/root/main/good/gooddetail/deliveunit"));
  183. model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/wareflag", model.getValue("/root/main/good/gooddetail/wareflag"));
  184. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/exchqty", model.getValue("/root/main/good/gooddetail/exchqty"));
  185. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/siqty", model.getValue("/root/main/good/gooddetail/siqty"));
  186. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/hunqty", model.getValue("/root/main/good/gooddetail/hunqty"));
  187. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/origsiqty", model.getValue("/root/main/good/gooddetail/siqty")); //hunqty의 처음 값을 저장하기 위함.
  188. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/orighunqty", model.getValue("/root/main/good/gooddetail/hunqty")); //hunqty의 처음 값을 저장하기 위함.
  189. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/deliveqty", "");
  190. // model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/deliveamt", "");
  191. model.setValue(grd_deptoutlist.nodeset + "[" + (grd_deptoutlist.rows-1) + "]/deliveqty", "0"); //입고수량
  192. }
  193. } // if( bDup ...) end
  194. } // for(var k ...) end
  195. grd_deptoutlist.refresh();
  196. }
  197. ]]>
  198. </script>
  199. </xhtml:head>
  200. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  201. <group id="grp_tle" style="left:0px; top:0px; width:1195px; height:13px; ">
  202. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:243px; height:14px; ">출고등록(부서재고)</caption>
  203. </group>
  204. <group id="group1" style="left:0px; top:12; width:1195px; height:27px; ">
  205. <line id="line17" class="line_6" style="x1:0px; y1:25; x2:1195px; y2:25px; "/>
  206. <button id="btn_save" class="btn4_letter2" navindex="8" style="left:1138px; top:3px; width:56px; height:22px; ">
  207. <caption>저장</caption>
  208. <script type="javascript" ev:event="DOMActivate">
  209. <![CDATA[
  210. if(grd_deptoutlist.rows != 1){
  211. var instcd = grd_deptoutlist.valueMatrix(1, grd_deptoutlist.colRef("instcd"));
  212. var dd = grd_deptoutlist.valueMatrix(1, grd_deptoutlist.colRef("delivedd"));
  213. var deptcd = grd_deptoutlist.valueMatrix(1, grd_deptoutlist.colRef("delivedeptcd"));
  214. if(instcd == ""){
  215. model.setValue("/root/magamsearch/instcd", model.getValue("/root/cond/instcd"));
  216. model.setValue("/root/magamsearch/dd", model.getValue("/root/cond/delivedd"));
  217. model.setValue("/root/magamsearch/deptcd", model.getValue("/root/cond/delivedeptcd"));
  218. }else{
  219. model.setValue("/root/magamsearch/instcd", instcd);
  220. model.setValue("/root/magamsearch/dd", dd);
  221. model.setValue("/root/magamsearch/deptcd", deptcd);
  222. }
  223. cap_magam.value = "";
  224. if(submit("TRRSO21003")){
  225. var endyn = model.getValue("/root/distrimagam/endyn");
  226. if(endyn == "Y"){
  227. cap_magam.value = "물류마감이 되어있습니다.";
  228. messageBox("물류마감이 되어 저장이 불가능합니다.", "E999", "");
  229. return;
  230. }else{
  231. cap_magam.value = "";
  232. if(submit("TRRSO21002")){
  233. var magamyn = model.getValue("/root/magam/magamyn");
  234. if(magamyn == "Y"){
  235. cap_magam.value = "해당부서는 현재 마감되어있습니다.";
  236. messageBox("해당부서는 마감이 되어 저장이 불가능합니다.", "E999", "");
  237. return;
  238. }else{
  239. cap_magam.value = "";
  240. }
  241. }else{
  242. return;
  243. }//if(submit("TRRSO21002")){
  244. }//if(endyn == "Y"){
  245. }else{
  246. return;
  247. }//if(submit("TRRSO21003")){
  248. }else{
  249. return;
  250. }//if(grd_deptoutlist.r
  251. //당일출고수량이 0일경우 저장 및 수정대상에서 제외
  252. //변경재고량이 빈칸일 경우에도 저장 및 수정대상에서 제외
  253. for(var j = grd_deptoutlist.rows ; j >= 0 ; j-- ){
  254. var deliveqty = grd_deptoutlist.valueMatrix(j, grd_deptoutlist.colRef("deliveqty"));
  255. var realjaego = grd_deptoutlist.valueMatrix(j, grd_deptoutlist.colRef("realjaego"));
  256. var deliveno = grd_deptoutlist.valueMatrix(j, grd_deptoutlist.colRef("deliveno"));
  257. if((deliveqty == "" || deliveqty == 0) && deliveno == ""){
  258. grd_deptoutlist.deleteRow(j, false);
  259. }else if(realjaego == "" && deliveno == ""){
  260. grd_deptoutlist.deleteRow(j, false);
  261. }
  262. }
  263. grd_deptoutlist.refresh();
  264. if(cmb_outkind.value == ""){ //출고유형이 전체일경우 무작정 사용으로 변경
  265. cmb_outkind.value = "01";
  266. }
  267. if(cmb_outkind.value == "10"){ //출고유형이 보정일경우
  268. for(var j = grd_deptoutlist.rows ; j >= 0 ; j-- ){
  269. var reason = grd_deptoutlist.valueMatrix(j, grd_deptoutlist.colRef("reason"));
  270. var deliveno = grd_deptoutlist.valueMatrix(j, grd_deptoutlist.colRef("deliveno"));
  271. if(reason == "" && deliveno == ""){
  272. grd_deptoutlist.deleteRow(j, false);
  273. }
  274. }
  275. }
  276. for(var k =grd_deptoutlist.fixedRows;k < grd_deptoutlist.rows;k++ ){
  277. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("instcd")) = model.getValue("/root/cond/instcd"); //입고등록내역(기관코드)
  278. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("delivedd")) = model.getValue("/root/cond/delivedd"); //입고등록내역(입고일자)
  279. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("outkind")) = model.getValue("/root/cond/outkind"); //출고유형
  280. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("reqdeptcd")) = model.getValue("/root/cond/reqdeptcd"); //입고등록내역(입고부서)
  281. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("delivedeptcd")) = model.getValue("/root/cond/delivedeptcd");
  282. //2012.03.07 박준범 - 저장시 모든 행의 컬럼값이 null인 경우에는 행을 삭제한 후 저장한다.
  283. if( grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("goodcd")) == "" &&
  284. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("goodnm")) == "" &&
  285. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("deliveqty")) == "" ) {
  286. grd_deptoutlist.deleteRow(k); //행삭제
  287. k--; //삭제 후 총건수가 줄어들므로
  288. };
  289. }
  290. //2012.03.07 박준범 - 물품코드와 출고수량이 정상적으로 입력되었는지 확인한다.
  291. for(var k =grd_deptoutlist.fixedRows;k < grd_deptoutlist.rows;k++ ){
  292. if ( grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("goodcd")) == "" ||
  293. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("goodnm")) == "" ||
  294. grd_deptoutlist.valueMatrix(k,grd_deptoutlist.colRef("deliveqty")) == "" ) {
  295. messageBox("내역이 정상적으로 입력되지 않았습니다. \n\n입력한 값을 확인하십시요. ", "E999", "");
  296. model.setFocus("grd_deptoutlist");
  297. grd_deptoutlist.row = k;
  298. return;
  299. };
  300. }
  301. var minuscnt = 0;
  302. //출고수량이 (-)인 경우는 저장하지않고 출고유형을 '보정'으로 변경후에 다시 저장을 유도한다.
  303. if(cmb_outkind.value != "10"){ //출고유형이 보정이 아닐경우
  304. for(var i = 1 ; i < grd_deptoutlist.rows ; i++ ){
  305. var deliveqty = grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("deliveqty"));
  306. var deliveno = grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("deliveno"));
  307. if(parseFloat(deliveqty) < 0 && deliveno == ""){
  308. grd_deptoutlist.rowStatus(i) = 0;
  309. minuscnt++;
  310. }
  311. }
  312. }
  313. //Flag가 deptwin일경우 입고등록내역 업데이트를 한다.
  314. model.makeValue("/root/send/savedata/deptoutlist",grd_deptoutlist.getUpdateData())
  315. if(minuscnt == 0){
  316. if( submit("TXRSO21401") ) {
  317. model.removeNodeset("/root/send/savedata");
  318. btn_search.dispatch("DOMActivate");
  319. }
  320. }else{
  321. if( submit("TXRSO21401") ) {
  322. for(var i = grd_deptoutlist.rows ; i >= 0 ; i-- ){
  323. var rowStatus = grd_deptoutlist.rowStatus(i);
  324. var deliveno = grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("deliveno"));
  325. var realjaego = grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("realjaego"));
  326. if(rowStatus == 0 &&realjaego != ""){
  327. if(deliveno == ""){
  328. grd_deptoutlist.rowStatus(i) = 1;
  329. }else{
  330. grd_deptoutlist.rowStatus(i) = 2;
  331. }
  332. }else{
  333. if(deliveno == ""){
  334. grd_deptoutlist.deleteRow(i, false);
  335. }
  336. }
  337. }
  338. grd_deptoutlist.refresh();
  339. }
  340. cmb_outkind.value = "10"; //출고유형을 보정으로 변경
  341. grd_deptoutlist.colHidden(grd_deptoutlist.colRef("reason")) = false;
  342. messageBox("출고수량이 (-)인 물품들은 출고유형을 보정으로 저장하시기 바랍니다.", "I999", "");
  343. }
  344. ]]>
  345. </script>
  346. </button>
  347. <button id="btn_help" class="btn4_letter3" navindex="12" style="left:1070px; top:3px; width:68px; height:22px; ">
  348. <caption>도움말</caption>
  349. <script type="javascript" ev:event="DOMActivate">
  350. <![CDATA[
  351. window.load("SMRSO21401.xrw", "modeless","", "", "","");
  352. ]]>
  353. </script>
  354. </button>
  355. </group>
  356. <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
  357. <group id="grp_search" style="left:0px; top:9px; width:1195px; height:66px; vertical-align:top; ">
  358. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:60px; background-color:#fffbf2; border-color:#ffd799; "/>
  359. <button id="btn_search" class="btn1_letter2" navindex="7" style="left:1121px; top:19px; width:56px; height:22px; ">
  360. <caption>조회</caption>
  361. <script type="javascript" ev:event="DOMActivate">
  362. <![CDATA[
  363. if(ipt_reqdeptcd.value == "") {
  364. messageBox("요구부서가 선택되지 않았습니다. \n\n먼저 요구부서를 선택하십시요.", "E999", "");
  365. model.setFocus("ipt_reqdeptcd");
  366. return;
  367. };
  368. if(ipt_delivedeptcd.value == "") {
  369. messageBox("출고부서가 선택되지 않았습니다. \n\n먼저 출고부서를 선택하십시요.", "E999", "");
  370. model.setFocus("ipt_delivedeptcd");
  371. return;
  372. };
  373. if(submit("TRRSO21401")){
  374. if(cmb_outkind.value == "10"){ //출고유형-보정 선택시 사유를 보여준다.
  375. grd_deptoutlist.colHidden(grd_deptoutlist.colRef("reason")) = false;
  376. }else{
  377. grd_deptoutlist.colHidden(grd_deptoutlist.colRef("reason")) = true;
  378. }
  379. model.setValue("/root/magamsearch/instcd", model.getValue("/root/cond/instcd"));
  380. model.setValue("/root/magamsearch/dd", model.getValue("/root/cond/delivedd"));
  381. model.setValue("/root/magamsearch/deptcd", model.getValue("/root/cond/delivedeptcd"));
  382. cap_magam.visible = "";
  383. if(submit("TRRSO21003")){
  384. var endyn = model.getValue("/root/distrimagam/endyn");
  385. if(endyn == "Y"){
  386. cap_magam.value = "물류마감이 되어있습니다.";
  387. }else{
  388. cap_magam.value = "";
  389. if(submit("TRRSO21002")){
  390. var magamyn = model.getValue("/root/magam/magamyn");
  391. if(magamyn == "Y"){
  392. cap_magam.value = "해당부서는 현재 마감되어있습니다.";
  393. }else{
  394. cap_magam.value = "";
  395. }
  396. }else{
  397. return;
  398. }
  399. }
  400. }else{
  401. return;
  402. }
  403. }
  404. ]]>
  405. </script>
  406. </button>
  407. <select1 id="cmb_instcd" ref="/root/cond/instcd" class="combo_default" disabled="true" navindex="1" appearance="minimal" style="left:117px; top:10px; width:136px; height:19px; text-align:center; ">
  408. <choices>
  409. <itemset nodeset="/root/main/init">
  410. <label ref="cnstnm"/>
  411. <value ref="cnstcd"/>
  412. </itemset>
  413. </choices>
  414. </select1>
  415. <caption id="cap_instcd" class="search_name" style="left:33px; top:10px; width:86px; height:17px; ">기관코드:</caption>
  416. <input id="ipt_delivedd" ref="/root/cond/delivedd" inputtype="date" format="yyyy-mm-dd" style="left:422px; top:10px; width:139px; height:19px; text-align:center; ">
  417. <script type="javascript" ev:event="xforms-value-changed">
  418. <![CDATA[
  419. //2012.04.05 박준범 : 조회조건 변경시 Grid를 지워준다.
  420. if(grd_deptoutlist.rows > grd_deptoutlist.fixedRows) {
  421. misfGridInit(grd_deptoutlist);
  422. }
  423. ]]>
  424. </script>
  425. </input>
  426. <caption id="caption20" class="search_name" style="left:661px; top:10px; width:81px; height:17px; vertical-align:middle; ">요구부서:</caption>
  427. <line id="line30" class="line_4" style="x1:1100px; y1:15px; x2:1100px; y2:47px; "/>
  428. <button id="btn_delivedeptcd" class="icon_search" navindex="3" style="left:853px; top:10px; width:16px; height:16px; ">
  429. <caption/>
  430. <script type="javascript" ev:event="DOMActivate">
  431. <![CDATA[
  432. var vOrigDeptcd = ipt_reqdeptcd.value; //popup을 열기전 부서 저장
  433. var recv_list = "reqdeptcd,reqdeptnm";
  434. misfOpenPopUpList("02", ipt_reqdeptcd,"", recv_list) ;
  435. model.setValue("/root/cond/delivedeptcd", model.getValue("/root/cond/reqdeptcd"));
  436. model.setValue("/root/cond/delivedeptnm", model.getValue("/root/cond/reqdeptnm"));
  437. ipt_reqdeptcd.refresh();
  438. opt_reqdeptnm.refresh();
  439. ipt_delivedeptcd.refresh();
  440. opt_delivedeptnm.refresh();
  441. ]]>
  442. </script>
  443. </button>
  444. <input id="ipt_reqdeptcd" ref="/root/cond/reqdeptcd" class="input_default" navindex="2" style="left:746px; top:10px; width:105px; height:19px; ">
  445. <script type="javascript" ev:event="xforms-value-changed">
  446. <![CDATA[
  447. misfValidationCheck("02", "", "reqdeptcd,reqdeptnm" );
  448. model.setValue("/root/cond/delivedeptcd", model.getValue("/root/cond/reqdeptcd"));
  449. model.setValue("/root/cond/delivedeptnm", model.getValue("/root/cond/reqdeptnm"));
  450. //2012.04.05 박준범 : 조회조건 변경시 Grid를 지워준다.
  451. if(grd_deptoutlist.rows > grd_deptoutlist.fixedRows) {
  452. misfGridInit(grd_deptoutlist);
  453. }
  454. ipt_reqdeptcd.refresh();
  455. opt_reqdeptnm.refresh();
  456. ipt_delivedeptcd.refresh();
  457. opt_delivedeptnm.refresh();
  458. ]]>
  459. </script>
  460. <script type="javascript" ev:event="onkeypress">
  461. <![CDATA[
  462. //2012.04.05 박준범 추가
  463. inputEnterKey("ipt_reqdeptcd", "xforms-value-changed");
  464. ]]>
  465. </script>
  466. </input>
  467. <output id="opt_reqdeptnm" ref="/root/cond/reqdeptnm" class="output_fix" appearance="output" style="left:871px; top:10px; width:156px; height:19px; "/>
  468. <caption id="caption9" class="search_name" style="left:336px; top:10px; width:86px; height:17px; ">출고일자:</caption>
  469. <caption id="caption3" class="search_name" style="left:33px; top:35px; width:132px; height:17px; vertical-align:middle; ">출고유형:</caption>
  470. <select1 id="cmb_outkind" ref="/root/cond/outkind" class="combo_default" appearance="minimal" style="left:117px; top:35px; width:136px; height:19px; text-align:center; ">
  471. <choices>
  472. <itemset>
  473. <label/>
  474. <value/>
  475. </itemset>
  476. </choices>
  477. <script type="javascript" ev:event="xforms-value-changed">
  478. <![CDATA[
  479. //2012.04.05 박준범 : 조회조건 변경시 Grid를 지워준다.
  480. if(grd_deptoutlist.rows > grd_deptoutlist.fixedRows) {
  481. misfGridInit(grd_deptoutlist);
  482. }
  483. if(cmb_outkind.value == "10"){ //출고유형-보정 선택시 사유를 보여준다.
  484. grd_deptoutlist.colHidden(grd_deptoutlist.colRef("reason")) = false;
  485. }else{
  486. grd_deptoutlist.colHidden(grd_deptoutlist.colRef("reason")) = true;
  487. }
  488. ]]>
  489. </script>
  490. </select1>
  491. <input id="ipt_delivedeptcd" ref="/root/cond/delivedeptcd" class="input_default" navindex="2" style="left:745px; top:35px; width:105px; height:19px; ">
  492. <script type="javascript" ev:event="xforms-value-changed">
  493. <![CDATA[
  494. misfValidationCheck("02", "", "delivedeptcd,delivedeptnm" );
  495. //2012.04.05 박준범 : 조회조건 변경시 Grid를 지워준다.
  496. if(grd_deptoutlist.rows > grd_deptoutlist.fixedRows) {
  497. misfGridInit(grd_deptoutlist);
  498. }
  499. ipt_reqdeptcd.refresh();
  500. opt_reqdeptnm.refresh();
  501. ipt_delivedeptcd.refresh();
  502. opt_delivedeptnm.refresh();
  503. ]]>
  504. </script>
  505. <script type="javascript" ev:event="onkeypress">
  506. <![CDATA[
  507. //2012.04.05 박준범 추가
  508. inputEnterKey("ipt_delivedeptcd", "xforms-value-changed");
  509. ]]>
  510. </script>
  511. </input>
  512. <button id="button1" class="icon_search" navindex="3" style="left:852px; top:35px; width:16px; height:16px; ">
  513. <caption/>
  514. <script type="javascript" ev:event="DOMActivate">
  515. <![CDATA[
  516. var recv_list = "delivedeptcd,delivedeptnm";
  517. misfOpenPopUpList("02", ipt_delivedeptcd,"", recv_list) ;
  518. ipt_reqdeptcd.refresh();
  519. opt_reqdeptnm.refresh();
  520. ipt_delivedeptcd.refresh();
  521. opt_delivedeptnm.refresh();
  522. ]]>
  523. </script>
  524. </button>
  525. <output id="opt_delivedeptnm" ref="/root/cond/delivedeptnm" class="output_fix" appearance="output" style="left:870px; top:35px; width:156px; height:19px; "/>
  526. <caption id="caption2" class="search_name" style="left:661px; top:35px; width:81px; height:17px; vertical-align:middle; ">출고부서:</caption>
  527. <select1 id="cmb_winkind" ref="/root/cond/winkind" class="combo_default" navindex="3" appearance="minimal" style="left:422px; top:35px; width:139px; height:19px; text-align:center; ">
  528. <choices>
  529. <itemset>
  530. <label/>
  531. <value/>
  532. </itemset>
  533. </choices>
  534. <script type="javascript" ev:event="xforms-value-changed">
  535. <![CDATA[
  536. ]]>
  537. </script>
  538. </select1>
  539. <caption id="caption4" class="search_name" style="left:336px; top:35px; width:80px; height:17px; vertical-align:middle; ">입고유형:</caption>
  540. </group>
  541. <line id="line1" class="line_1" style="x1:0px; y1:108px; x2:1195px; y2:108px; "/>
  542. <caption id="caption1" class="tit_2" style="left:0px; top:93px; width:180px; height:14px; ">출고내역</caption>
  543. <button id="btn_rowinsert" class="btn2_letter3" navindex="20" style="left:1084px; top:87px; width:53px; height:19px; ">
  544. <caption>행추가</caption>
  545. <script type="javascript" ev:event="DOMActivate">
  546. <![CDATA[
  547. if(ipt_reqdeptcd.value == "") {
  548. messageBox("요구부서가 선택되지 않았습니다. \n\n먼저 요구부서를 선택하십시요.", "E999", "");
  549. model.setFocus("ipt_reqdeptcd");
  550. return;
  551. };
  552. if(ipt_delivedeptcd.value == "") {
  553. messageBox("입고부서가 선택되지 않았습니다. \n\n먼저 입고부서를 선택하십시요.", "E999", "");
  554. model.setFocus("ipt_delivedeptcd");
  555. return;
  556. };
  557. misfGridIUD(grd_deptoutlist, "A");
  558. grd_deptoutlist.cellAttribute("disabled", grd_deptoutlist.row, grd_deptoutlist.colRef("winkind"), grd_deptoutlist.row, grd_deptoutlist.colRef("winkind")) = "true";
  559. ]]>
  560. </script>
  561. </button>
  562. <datagrid id="grd_deptoutlist" nodeset="/root/main/list/deptoutinfo/deptoutlist" class="datagrid2" caption="순번^출고번호^출고유형^입고유형^품목코드^품목명^규격^단위^당일&#xA;출고수량^현재고량^변경재고량^사유^기관코드^요구부서^출고부서^마감여부^출고일자^출고유형" colsep="^" colwidth="46, 56, 70, 84, 103, 206, 174, 69, 70, 70, 70, 235, 61, 52, 53, 54, 100, 100, 100, 100, 100, 100" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:0px; top:113px; width:1195px; height:612px; ">
  563. <col ref="row_num" style="text-align:center; "/>
  564. <col disabled="true" ref="deliveno" style="text-align:center; "/>
  565. <col ref="outkindnm" type="output" style="text-align:center; "/>
  566. <col disabled="true" ref="winkind" type="combo" style="text-align:center; ">
  567. <choices>
  568. <itemset>
  569. <label/>
  570. <value/>
  571. </itemset>
  572. </choices>
  573. </col>
  574. <col ref="goodcd" type="inputbutton" style="text-align:center; "/>
  575. <col ref="goodnm"/>
  576. <col ref="goodspec"/>
  577. <col ref="deliveunit" style="text-align:center; "/>
  578. <col ref="deliveqty" type="input" format="(-)#,###" style="text-align:right; "/>
  579. <col ref="hun_jaego" format="(-)#,##0" style="text-align:right; "/>
  580. <col ref="realjaego" type="input" format="(-)#,###" style="text-align:right; "/>
  581. <col ref="reason" type="input" visibility="hidden"/>
  582. <col ref="instcd" visibility="hidden"/>
  583. <col ref="reqdeptcd" visibility="hidden"/>
  584. <col ref="delivedeptcd" visibility="hidden"/>
  585. <col ref="endyn" visibility="hidden"/>
  586. <col ref="delivedd" visibility="hidden"/>
  587. <col ref="outkind" visibility="hidden"/>
  588. <col ref="wareflag" visibility="hidden"/>
  589. <col ref="flag" visibility="hidden"/>
  590. <col ref="freeflag" visibility="hidden"/>
  591. <col ref="windd" visibility="hidden"/>
  592. <script type="javascript" ev:event="onbuttonclick">
  593. <![CDATA[
  594. //조회된 data 의 경우에는 물품코드를 변경할 수 없다.
  595. if(grd_deptoutlist.rowStatus(grd_deptoutlist.row) == 0 || grd_deptoutlist.rowStatus(grd_deptoutlist.row) == 2) { //0:read, 1:insert, 2:update, 3:update after insert
  596. //alert("onentercell");
  597. return;
  598. }
  599. //2012.04.05 박준범 - 출고일자를 popup 에 넘겨주도록 수정
  600. //modal("SPRSO20600");
  601. // model.setValue("/root/popdata/srchdd", ipt_delivedd.value);
  602. // window.load("SPRSO20600.xrw", "modal","", "", "/root/popdata","/root/popdata");
  603. //popup 에 전달할 parameter를 setting한다.
  604. model.setValue("/root/popgood/instcd", cmb_instcd.value);
  605. model.setValue("/root/popgood/delivedd", ipt_delivedd.value ); //향후 시점재고 조회를 위해 출고일자를 set
  606. //2012.09.17 박준범 - SPRSO20700.xrw 에서 사용하기 위해 basedd를 추가 함
  607. model.setValue("/root/popgood/basedd", ipt_delivedd.value ); //물품코드 popup 에서 출고일자 기준으로 물품 Master 조회하기 위해서
  608. //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
  609. model.setValue("/root/popgood/selectyn", "");
  610. //popup 프로그램 호출
  611. //window.load("SPRSO20300.xrw", "modal","", "", "/root/popgood","/root/popdata"); //단일선택창
  612. window.load("SPRSO20700.xrw", "modal","", "", "/root/popgood","/root/popdata"); //다중선택창
  613. //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 조회해서 그리드에 보여준다.
  614. if(model.getValue("/root/popgood/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
  615. fGetGoodDetail(); //물품코드의 상세내역과 현재고를 조회하여 Grid에 보여줌
  616. //출고량을 입력하도록 focus이동
  617. grd_deptoutlist.col = grd_deptoutlist.colRef("deliveqty");
  618. }
  619. ]]>
  620. </script>
  621. <script type="javascript" ev:event="xforms-value-changed">
  622. <![CDATA[
  623. /* 2012.03.06 박준범 추가 */
  624. if( grd_deptoutlist.col == grd_deptoutlist.colRef("deliveqty") ){
  625. if( grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) == "" ||
  626. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) == "." ||
  627. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) == "-" ||
  628. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) == "-." ){
  629. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) = "0";
  630. } else {
  631. /* DB의 컬럼이 소수점 2자리 이므로, 이와 통일하기 위해 화면에서 소수 2자리까지만 입력 받도록 처리 */
  632. var sBef = grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty"));
  633. var iIndex = sBef.indexOf(".");
  634. if (iIndex >= 0 ) { // 소수점이 있으면~
  635. var sAft = sBef.substring(0, iIndex + 3); //소수점 2자리까지 잘라내기 위해 소수점 포함 3자리를 더함
  636. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) = sAft;
  637. }
  638. }
  639. var hun_jaego = grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("hun_jaego"));
  640. if(hun_jaego == "") return;
  641. var deliveqty = grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty"));
  642. var realjaego = parseFloat(hun_jaego) - parseFloat(deliveqty);
  643. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("realjaego")) = realjaego;
  644. }else if( grd_deptoutlist.col == grd_deptoutlist.colRef("realjaego") ){
  645. var hun_jaego = grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("hun_jaego"));
  646. if(hun_jaego == "") return;
  647. var realjaego = grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("realjaego"));
  648. var deliveqty_bf = grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty"));
  649. if(deliveqty_bf == "") deliveqty_bf = 0;
  650. if(realjaego == "") realjaego = 0;
  651. if(grd_deptoutlist.rowStatus(grd_deptoutlist.row) == "1" || grd_deptoutlist.rowStatus(grd_deptoutlist.row) == "3"){
  652. var deliveqty = parseFloat(hun_jaego) - parseFloat(realjaego);
  653. }else{
  654. var deliveqty = parseFloat(hun_jaego) - parseFloat(realjaego) + parseFloat(deliveqty_bf);
  655. }
  656. grd_deptoutlist.valueMatrix(grd_deptoutlist.row, grd_deptoutlist.colRef("deliveqty")) = deliveqty;
  657. }
  658. ]]>
  659. </script>
  660. <script type="javascript" ev:event="ondblclick">
  661. <![CDATA[
  662. if(grd_deptoutlist.row == "0"){
  663. if(grd_deptoutlist.col == grd_deptoutlist.colRef("hun_jaego")){
  664. for(var i = 1 ; i < grd_deptoutlist.rows ; i++){
  665. grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("deliveqty")) = grd_deptoutlist.valueMatrix(i, grd_deptoutlist.colRef("hun_jaego"));
  666. if(!(grd_deptoutlist.rowStatus(i) == 1 || grd_deptoutlist.rowStatus(i) == 3)){
  667. grd_deptoutlist.rowStatus(i) = 2;
  668. }
  669. }
  670. }
  671. }
  672. ]]>
  673. </script>
  674. <script type="javascript" ev:event="onkeypress">
  675. <![CDATA[
  676. //Grid 에서 엔터 입력시 다음행 수정
  677. misfNextRow(grd_deptoutlist);
  678. ]]>
  679. </script>
  680. </datagrid>
  681. <button id="btn_chulpop" class="btn2_letter6" navindex="10" visibility="hidden" style="left:740px; top:80px; width:86px; height:19px; ">
  682. <caption>입고내역조회</caption>
  683. <script type="javascript" ev:event="DOMActivate">
  684. <![CDATA[
  685. if(ipt_reqdeptcd.value == "") {
  686. messageBox("요구부서가 선택되지 않았습니다. \n\n먼저 요구부서를 선택하십시요.", "E999", "");
  687. model.setFocus("ipt_reqdeptcd");
  688. return;
  689. };
  690. //popup 에 전달할 parameter를 setting한다.
  691. model.setValue("/root/popdelive/instcd", cmb_instcd.value);
  692. model.setValue("/root/popdelive/delivedd", ipt_delivedd.value);
  693. model.setValue("/root/popdelive/delivedeptcd", ipt_reqdeptcd.value);
  694. model.setValue("/root/popdelive/delivedeptnm", opt_reqdeptnm.value);
  695. model.setValue("/root/popdelive/opener", "out");
  696. //갯수초기화
  697. model.setValue("/root/popreq/count", 0);
  698. //popup 프로그램 호출
  699. window.load("SMRSO21050.xrw", "modal","", "", "/root/popdelive","/root/popdata");
  700. var cnt = model.getValue("/root/popreq/count");
  701. var mrows = grd_deptoutlist.rows;
  702. var mcnt = parseInt(mrows)+parseInt(cnt);
  703. var j = 1;
  704. for(i = mrows ; i <= mcnt-1 ; i++){
  705. misfGridIUD(grd_deptoutlist, "A");
  706. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodcd", model.getValue("/root/popsubdata/copylist["+j+"]/goodcd")); //물품코드
  707. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodnm", model.getValue("/root/popsubdata/copylist["+j+"]/goodnm")); //물품명
  708. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/deliveunit", model.getValue("/root/popsubdata/copylist["+j+"]/deliveunit")); //단위
  709. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodspec", model.getValue("/root/popsubdata/copylist["+j+"]/goodspec")); //규격
  710. //model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/winunitcost", model.getValue("/root/popsubdata/delivedtllist["+j+"]/goodunitcost")); //입고단가
  711. //model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/wareflag", model.getValue("/root/popsubdata/copylist["+j+"]/wareflag")); //창고구분
  712. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/deliveqty", model.getValue("/root/popsubdata/copylist["+j+"]/deliveqty")); //출고수량
  713. j++;
  714. }
  715. grd_deptoutlist.refresh();
  716. ]]>
  717. </script>
  718. </button>
  719. <button id="button2" class="btn2_letter4" navindex="11" visibility="visible" style="left:889px; top:87px; width:64px; height:19px; ">
  720. <caption>전체삭제</caption>
  721. <script type="javascript" ev:event="DOMActivate">
  722. <![CDATA[
  723. var req = messageBox("출고내역이 전체삭제됩니다.", "Q003");
  724. if(req == 6){
  725. if(grd_deptoutlist.rows == "1") return;
  726. //misfGridIUD(grd_deptoutlist, "D");
  727. //2012.03.07 박준범 - 위의 1줄 comment처리하고 아래와 같이 변경
  728. /*
  729. - 0 : read : 조회시
  730. - 1 : insert : 행추가시
  731. - 2 : update : 조회한 것을 수정시
  732. - 3 : insert & new : 행추가한 것을 수정시
  733. - 4 : delete
  734. - 5 : delete & insert
  735. - 6 : delete & update
  736. */
  737. // var status = grd_deptoutlist.rowStatus(grd_deptoutlist.row) ;
  738. //
  739. // if(status == 0) {
  740. // grd_deptoutlist.addStatus(grd_deptoutlist.row, "delete");
  741. // }else if(status == 1) {
  742. // grd_deptoutlist.deleteRow(grd_deptoutlist.row);
  743. // }else if(status == 2) {
  744. // grd_deptoutlist.addStatus(grd_deptoutlist.row, "delete");
  745. // }else if(status == 3) {
  746. // grd_deptoutlist.deleteRow(grd_deptoutlist.row);
  747. // }else if(status == 4) {
  748. // grd_deptoutlist.removeStatus(grd_deptoutlist.row, "delete");
  749. // }else if(status == 5) { // insert된 data는 삭제시 위에서 addStatus("delete")하지 않고, 바로 deleteRow했기 때문에 5의 경우는 발생하지 않음.
  750. // grd_deptoutlist.removeStatus(grd_deptoutlist.row, "delete");
  751. // }else if(status == 6) {
  752. // grd_deptoutlist.removeStatus(grd_deptoutlist.row, "delete");
  753. // }
  754. for(i = 1 ; i < grd_deptoutlist.rows ; i++){
  755. grd_deptoutlist.row = i;
  756. misfGridIUD(grd_deptoutlist, "D");
  757. }
  758. btn_save.dispatch("DOMActivate");
  759. }else{
  760. return;
  761. }
  762. ]]>
  763. </script>
  764. </button>
  765. <button id="btn_choidel" class="btn2_letter3" navindex="21" style="left:1138px; top:87px; width:53px; height:19px; ">
  766. <caption>행삭제</caption>
  767. <script type="javascript" ev:event="DOMActivate">
  768. <![CDATA[
  769. misfGridIUD(grd_deptoutlist, "D");
  770. ]]>
  771. </script>
  772. </button>
  773. <button id="btn_jaego" class="btn2_letter4" navindex="10" visibility="visible" style="left:954px; top:87px; width:64px; height:19px; ">
  774. <caption>부서재고</caption>
  775. <script type="javascript" ev:event="DOMActivate">
  776. <![CDATA[
  777. if(ipt_reqdeptcd.value == "") {
  778. messageBox("요구부서가 선택되지 않았습니다. \n\n먼저 요구부서를 선택하십시요.", "E999", "");
  779. model.setFocus("ipt_reqdeptcd");
  780. return;
  781. };
  782. //popup 에 전달할 parameter를 setting한다.
  783. model.setValue("/root/popdelive/instcd", cmb_instcd.value);
  784. model.setValue("/root/popdelive/delivedd", ipt_delivedd.value);
  785. model.setValue("/root/popdelive/delivedeptcd", ipt_reqdeptcd.value);
  786. model.setValue("/root/popdelive/delivedeptnm", opt_reqdeptnm.value);
  787. model.setValue("/root/popdelive/opener", "jaego");
  788. //갯수초기화
  789. model.setValue("/root/popreq/count", 0);
  790. //popup 프로그램 호출
  791. window.load("SMRSO21450.xrw", "modal","", "", "/root/popdelive","/root/popdata");
  792. var cnt = model.getValue("/root/popreq/count");
  793. var mrows = grd_deptoutlist.rows;
  794. var mcnt = parseInt(mrows)+parseInt(cnt);
  795. var j = 1;
  796. for(i = mrows ; i <= mcnt-1 ; i++){
  797. misfGridIUD(grd_deptoutlist, "A");
  798. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodcd", model.getValue("/root/popsubdata/stocklist["+j+"]/goodcd")); //물품코드
  799. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodnm", model.getValue("/root/popsubdata/stocklist["+j+"]/goodnm")); //물품명
  800. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/deliveunit", model.getValue("/root/popsubdata/stocklist["+j+"]/purcunit")); //단위
  801. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodspec", model.getValue("/root/popsubdata/stocklist["+j+"]/goodspec")); //규격
  802. //model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/winunitcost", model.getValue("/root/popsubdata/delivedtllist["+j+"]/goodunitcost")); //입고단가
  803. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/wareflag", model.getValue("/root/popsubdata/stocklist["+j+"]/wareflag")); //창고구분
  804. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/hun_jaego", model.getValue("/root/popsubdata/stocklist["+j+"]/hun_jaego")); //현재고수량
  805. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/winkind", model.getValue("/root/popsubdata/stocklist["+j+"]/winkind")); //입고유형
  806. grd_deptoutlist.cellAttribute("disabled", j, grd_deptoutlist.colRef("winkind"), j, grd_deptoutlist.colRef("winkind")) = "true";
  807. j++;
  808. }
  809. grd_deptoutlist.refresh();
  810. ]]>
  811. </script>
  812. </button>
  813. <button id="btn_prcpsum" class="btn2_letter4" navindex="10" visibility="hidden" style="left:825px; top:75px; width:64px; height:19px; ">
  814. <caption>처방집계</caption>
  815. <script type="javascript" ev:event="DOMActivate">
  816. <![CDATA[
  817. if(ipt_reqdeptcd.value == "") {
  818. messageBox("요구부서가 선택되지 않았습니다. \n\n먼저 요구부서를 선택하십시요.", "E999", "");
  819. model.setFocus("ipt_reqdeptcd");
  820. return;
  821. };
  822. //popup 에 전달할 parameter를 setting한다.
  823. model.setValue("/root/popdelive/instcd", cmb_instcd.value);
  824. model.setValue("/root/popdelive/delivedd", ipt_delivedd.value);
  825. model.setValue("/root/popdelive/delivedeptcd", ipt_reqdeptcd.value);
  826. model.setValue("/root/popdelive/delivedeptnm", opt_reqdeptnm.value);
  827. model.setValue("/root/popdelive/opener", "jaego");
  828. //갯수초기화
  829. model.setValue("/root/popreq/count", 0);
  830. //popup 프로그램 호출
  831. window.load("SMRSO21460.xrw", "modal","", "", "/root/popdelive","/root/popdata");
  832. var cnt = model.getValue("/root/popreq/count");
  833. var mrows = grd_deptoutlist.rows;
  834. var mcnt = parseInt(mrows)+parseInt(cnt);
  835. var j = 1;
  836. for(i = mrows ; i <= mcnt-1 ; i++){
  837. misfGridIUD(grd_deptoutlist, "A");
  838. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodcd", model.getValue("/root/popsubdata/prcpsum["+j+"]/goodcd")); //물품코드
  839. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodnm", model.getValue("/root/popsubdata/prcpsum["+j+"]/goodnm")); //물품명
  840. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/deliveunit", model.getValue("/root/popsubdata/prcpsum["+j+"]/purcunit")); //단위
  841. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodspec", model.getValue("/root/popsubdata/prcpsum["+j+"]/goodspec")); //규격
  842. //model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/winunitcost", model.getValue("/root/popsubdata/delivedtllist["+j+"]/goodunitcost")); //입고단가
  843. //model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/wareflag", model.getValue("/root/popsubdata/delivedtllist["+j+"]/wareflag")); //창고구분
  844. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/hun_jaego", model.getValue("/root/popsubdata/prcpsum["+j+"]/deliveqty")); //현재고수량
  845. j++;
  846. }
  847. grd_deptoutlist.refresh();
  848. ]]>
  849. </script>
  850. </button>
  851. <button id="btn_deptwin" class="btn2_letter4" navindex="10" visibility="visible" style="left:1019px; top:87px; width:64px; height:19px; ">
  852. <caption>처방출고</caption>
  853. <script type="javascript" ev:event="DOMActivate">
  854. <![CDATA[
  855. if(ipt_reqdeptcd.value == "") {
  856. messageBox("요구부서가 선택되지 않았습니다. \n\n먼저 요구부서를 선택하십시요.", "E999", "");
  857. model.setFocus("ipt_reqdeptcd");
  858. return;
  859. };
  860. //popup 에 전달할 parameter를 setting한다.
  861. model.setValue("/root/popdelive/instcd", cmb_instcd.value);
  862. model.setValue("/root/popdelive/delivedd", ipt_delivedd.value);
  863. model.setValue("/root/popdelive/delivedeptcd", ipt_reqdeptcd.value);
  864. model.setValue("/root/popdelive/delivedeptnm", opt_reqdeptnm.value);
  865. model.setValue("/root/popdelive/opener", "out");
  866. //갯수초기화
  867. model.setValue("/root/popreq/count", 0);
  868. //popup 프로그램 호출
  869. window.load("SMRSO21470.xrw", "modal","", "", "/root/popdelive","/root/popdata");
  870. var cnt = model.getValue("/root/popreq/count");
  871. var mrows = grd_deptoutlist.rows;
  872. var mcnt = parseInt(mrows)+parseInt(cnt);
  873. var j = 1;
  874. for(i = mrows ; i <= mcnt-1 ; i++){
  875. misfGridIUD(grd_deptoutlist, "A");
  876. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodcd", model.getValue("/root/popsubdata/copylist["+j+"]/goodcd")); //물품코드
  877. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodnm", model.getValue("/root/popsubdata/copylist["+j+"]/goodnm")); //물품명
  878. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/deliveunit", model.getValue("/root/popsubdata/copylist["+j+"]/deliveunit")); //단위
  879. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/goodspec", model.getValue("/root/popsubdata/copylist["+j+"]/goodspec")); //규격
  880. //model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/winunitcost", model.getValue("/root/popsubdata/delivedtllist["+j+"]/goodunitcost")); //입고단가
  881. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/wareflag", model.getValue("/root/popsubdata/copylist["+j+"]/wareflag")); //창고구분
  882. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/deliveqty", model.getValue("/root/popsubdata/copylist["+j+"]/deliveqty")); //출고수량
  883. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/realjaego", model.getValue("/root/popsubdata/copylist["+j+"]/deliveqty")); //변경재고량
  884. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/flag", model.getValue("/root/popsubdata/copylist["+j+"]/flag")); //구분값
  885. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/winkind", model.getValue("/root/popsubdata/copylist["+j+"]/winkind")); //입고유형
  886. model.setValue("/root/main/list/deptoutinfo/deptoutlist["+i+"]/windd", model.getValue("/root/popsubdata/copylist["+j+"]/windd")); //입고일자
  887. grd_deptoutlist.cellAttribute("disabled", j, grd_deptoutlist.colRef("winkind"), j, grd_deptoutlist.colRef("winkind")) = "true";
  888. j++;
  889. }
  890. grd_deptoutlist.refresh();
  891. ]]>
  892. </script>
  893. </button>
  894. <caption id="cap_magam" style="left:240px; top:80px; width:395px; height:20px; font-size:12pt; font-weight:bold; color:#ff0000; text-align:center; "/>
  895. </group>
  896. </xhtml:body>
  897. </xhtml:html>