SMMNG04200_SET기구 처방 집계현황.xrw 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" 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">
  4. <xhtml:head>
  5. <xhtml:title>SET기구 처방 집계현황</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <cond>
  11. <fromdd/>
  12. <todd/>
  13. <flag/>
  14. <deptcd/>
  15. <deptflag/>
  16. </cond>
  17. <suminfo>
  18. <sumlist/>
  19. </suminfo>
  20. </main>
  21. <send>
  22. <grupid/>
  23. </send>
  24. <init>
  25. <R0435list/>
  26. <deptinfo>
  27. <deptlist/>
  28. </deptinfo>
  29. </init>
  30. <hidden>
  31. </hidden>
  32. <temp>
  33. <suminfo>
  34. <sumlist/>
  35. </suminfo>
  36. </temp>
  37. <tmp>
  38. <codeinfo/>
  39. </tmp>
  40. </root>
  41. </instance>
  42. <script type="javascript">
  43. <![CDATA[
  44. var length;
  45. var userdutplcecd;
  46. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  47. function fInitialize() {
  48. submit("TRMNG04202");
  49. //fromdd, todd를 당일자로 setting.
  50. var curdd = getCurrentDate();
  51. model.makeValue("/root/send/plandd", curdd);
  52. model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
  53. submit("TRMNB01208");
  54. model.setValue(ipt_fromdd.attribute("ref"), getCurrentDate());
  55. model.setValue(ipt_todd.attribute("ref"), getCurrentDate());
  56. ipt_fromdd.refresh();
  57. ipt_todd.refresh();
  58. model.makeValue("/root/send/cdgrupid", "'160', 'T17', '002'");
  59. model.makeValue("/root/send/srchdd", getCurrentDate());
  60. submit("TRMNW00001")
  61. var erdeptcd = model.getValue("/root/tmp/codeinfo/codelist[cdgrupid='002' and cdid = '"+getUserInfo("dutplcecd")+"']/cdid");
  62. userdutplcecd = model.getValue("/root/tmp/codeinfo/codelist[cdgrupid='160' and cdid = '"+getUserInfo("dutplcecd")+"']/cdid");
  63. if (!isNull(userdutplcecd)) {
  64. btn_sav.visible = true;
  65. } else {
  66. if(getUserInfo("userid")=="ENR") {
  67. btn_sav.visible = true;
  68. } else {
  69. btn_sav.visible = false;
  70. if(!isNull(erdeptcd)) {
  71. cmb_deptcd.value = model.getValue("/root/init/dutinfo/userinfo[userid='" + getUserInfo("userid") + "']/deptcd");
  72. } else {
  73. cmb_deptcd.value = getUserInfo("dutplcecd");
  74. }
  75. cmb_deptcd.disabled = true;
  76. rdo_deptflag.disabled = true;
  77. }
  78. }
  79. zbcfGetCodeList( new Array ( "R0435"), new Array ( "/root/init/R0435list" ), false);
  80. rdo_flag.value="1";
  81. grd_sumlist.colHidden(grd_sumlist.colRef("reqdeptnm")) = true;
  82. var node = instance1.selectNodes("/root/init/R0435list/R0435");
  83. length = node.length;
  84. var caption = "구분^일자^부서코드^부서명";
  85. var colName = "";
  86. for(var i = 1; i <= node.length; i++) {
  87. grd_sumlist.addColumn("ref:a1qty" + i + "; type:output; text-align:center; format:(-)#,#### ");
  88. grd_sumlist.colWidth(grd_sumlist.cols - 1) = 55;
  89. grd_sumlist.addColumn("ref:a2qty" + i + "; type:input; text-align:center; format:(-)#,#### ");
  90. grd_sumlist.colWidth(grd_sumlist.cols - 1) = 55;
  91. grd_sumlist.addColumn("ref:sumqty" + i + "; type:output; font-weight:bold; background-color:#eeffee; text-align:center; format:(-)#,#### ");
  92. grd_sumlist.colstyle(grd_sumlist.cols - 1, "data", "border-right-color") = "#FFF000";
  93. grd_sumlist.colWidth(grd_sumlist.cols - 1) = 55;
  94. grd_sumlist2.addColumn("ref:a1qty" + i + "; type:output; text-align:center; format:(-)#,#### ");
  95. grd_sumlist2.colWidth(grd_sumlist2.cols - 1) = 55;
  96. grd_sumlist2.addColumn("ref:a2qty" + i + "; type:input; text-align:center; format:(-)#,#### ");
  97. grd_sumlist2.colWidth(grd_sumlist2.cols - 1) = 55;
  98. grd_sumlist2.addColumn("ref:sumqty" + i + "; type:output; border-right-color:#000000; text-align:center; format:(-)#,#### ");
  99. grd_sumlist2.colWidth(grd_sumlist2.cols - 1) = 55;
  100. colName = model.getValue("/root/init/R0435list/R0435[" + i + "]/cdnm");
  101. caption += "^" + colName + "^" + colName + "^" + colName;
  102. }
  103. caption += "|구분^일자^부서코드^부서명";
  104. for(var i = 1; i <= node.length; i++) {
  105. caption += "^처방^불출^합계";
  106. }
  107. grd_sumlist.caption = caption;
  108. grd_sumlist2.caption = caption;
  109. //일자^1^1^1|일자^멸균^처방^합계
  110. addComboItem("cmb_deptcd", "전체", "", "above");
  111. tar_hidden.visible = false;
  112. grd_sumlist.rowstyle(0, "fixed", "font-weight") = "bold";
  113. grd_sumlist.cellStyle("font-weight", 0, grd_sumlist.colRef("a1qty1"), 0, grd_sumlist.cols-1) = "bold";
  114. }
  115. function fSearch(){
  116. grd_sumlist.subtotal("clear", -1, i, "#,###.##", "background-color:#99ff99; font-weight:bold", 0, cmb_deptcd.label);
  117. var flag = model.getValue(rdo_flag.attribute("ref"));
  118. if(flag == "1") {
  119. var deptcd = model.getValue(cmb_deptcd.attribute("ref"));
  120. if(deptcd == "" || deptcd == null) {
  121. messageBox("부서를 선택하십시오.", "E");
  122. return;
  123. }
  124. model.makeValue("/root/send/reqdata/fromdd", model.getValue(ipt_fromdd.attribute("ref")));
  125. model.makeValue("/root/send/reqdata/todd", model.getValue(ipt_todd.attribute("ref")));
  126. model.makeValue("/root/send/reqdata/deptcd", model.getValue(cmb_deptcd.attribute("ref")));
  127. model.makeValue("/root/send/reqdata/deptflag", model.getValue(rdo_deptflag.attribute("ref")));
  128. submit("TRMNG04201"); //일자별 조회
  129. grd_sumlist.subtotalPosition="below";
  130. var cellflag;
  131. for(var i = grd_sumlist.colRef("delivedd") + 1; i < grd_sumlist.cols; i++) {
  132. cellflag = grd_sumlist.valueMatrix(i, grd_sumlist.colRef("flag"));
  133. grd_sumlist.rowstyle(i, "data", "background-color") = "#ffffff";
  134. grd_sumlist.subtotal("sum", -1, i, "#,###.##", "background-color:#eeffee; font-weight:bold", grd_sumlist.colRef("delivedd"), "합계");
  135. }
  136. } else {
  137. model.makeValue("/root/send/reqdata/fromdd", model.getValue(ipt_fromdd.attribute("ref")));
  138. model.makeValue("/root/send/reqdata/todd", model.getValue(ipt_todd.attribute("ref")));
  139. model.makeValue("/root/send/reqdata/deptcd", model.getValue(cmb_deptcd.attribute("ref")));
  140. model.makeValue("/root/send/reqdata/deptflag", model.getValue(rdo_deptflag.attribute("ref")));
  141. submit("TRMNG04203"); //부서별 조회
  142. copyNodesetType("/root/temp/suminfo", "/root/main/suminfo");
  143. grd_sumlist2.refresh();
  144. grd_sumlist.subtotalPosition="below";
  145. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++) {
  146. grd_sumlist.rowstyle(i, "data", "background-color") = "#ffffff";
  147. }
  148. for(var i = grd_sumlist.colRef("reqdeptnm") + 1; i < grd_sumlist.cols; i++) {
  149. grd_sumlist.subtotal("sum", grd_sumlist.colRef("reqdeptcd"), i, "#,###.##", "background-color:#eeffee; font-weight:bold", grd_sumlist.colRef("reqdeptnm"), "합계");
  150. }
  151. var deptcd;
  152. var fstdeptcd =grd_sumlist.valueMatrix(1, grd_sumlist.colRef("reqdeptcd"));
  153. }
  154. }
  155. ]]>
  156. </script>
  157. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  158. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  159. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  160. <script type="javascript" src="../../../emr/carecomweb/js/CareCom.js"/>
  161. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  162. <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
  163. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  164. <script type="javascript" ev:event="xforms-ready">
  165. <![CDATA[
  166. fInitialize();
  167. ]]>
  168. </script>
  169. <submission id="TRMNG04201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/suminfo"/>
  170. <submission id="TRMNG04202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/init/deptinfo"/>
  171. <submission id="TRMNG04203" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/suminfo"/>
  172. <submission id="TRZBC00102" mediatype="application/x-www-form-urlencoded" method="post"/>
  173. <submission id="TXMNG04201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/savedata" resultref="/root/temp"/>
  174. <submission id="TRMNW00001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/tmp/codeinfo"/>
  175. <submission id="TRMNB01208" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/init/dutinfo"/>
  176. </model>
  177. </xhtml:head>
  178. <xhtml:body pagewidth="1211" pageheight="784" style="font-family:돋움체; margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  179. <group id="grp_tle" style="left:0px; top:0px; width:1195px; height:13px; ">
  180. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:186px; height:14px; font-family:돋움체; ">SET기구 처방 집계현황</caption>
  181. </group>
  182. <group id="grp_biz" scroll="auto" style="left:0px; top:13px; width:1195px; height:744px; font-family:돋움체; ">
  183. <datagrid id="grd_sumlist2" nodeset="/root/temp/suminfo/sumlist" visibility="hidden" caption="구분^일자^부서코드^부서명|구분^일자^부서코드^부서명" colsep="^" colwidth="100, 85, 0, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:150px; width:645px; height:456px; font-family:돋움체; ">
  184. <col ref="flag" visibility="hidden"/>
  185. <col ref="delivedd" format="yyyy-mm-dd" style="text-align:center; "/>
  186. <col ref="reqdeptcd" visibility="hidden"/>
  187. <col ref="reqdeptnm"/>
  188. <script type="javascript" ev:event="ondblclick">
  189. <![CDATA[
  190. var flag = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("flag"));
  191. if(flag == "1") {
  192. return;
  193. }
  194. var colNm = grd_sumlist.colAttribute(grd_sumlist.col, "ref"); //현재선택한 컬럼의 참조명을 들고온다.
  195. var col = parseInt(((grd_sumlist.col + 2) % 3));
  196. var seq;
  197. if(grd_sumlist.col > 2) {
  198. if(col == 0) {
  199. seq = colNm.substr(5);
  200. } else if(col == 1) {
  201. seq = colNm.substr(5);
  202. } else if(col == 2) {
  203. seq = colNm.substr(6);
  204. }
  205. }
  206. //선택한 컬럼의 순번을 가져온다.
  207. var goodcd = model.getValue("/root/init/R0435list/R0435[dispseq='" + seq + "']/cdid");
  208. var reqdeptcd = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("reqdeptcd"));
  209. var reqdeptnm = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("reqdeptnm"));
  210. var fromdd = "";
  211. var todd = "";
  212. var delivedd = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("delivedd"));
  213. if(rdo_flag.value == "1") {
  214. if(delivedd == cmb_deptcd.label) {
  215. fromdd = ipt_fromdd.value;
  216. todd = ipt_todd.value;
  217. } else {
  218. fromdd = delivedd;
  219. todd = delivedd;
  220. }
  221. reqdeptcd = cmb_deptcd.value;
  222. } else {
  223. fromdd = model.getValue(ipt_fromdd.attribute("ref"));
  224. todd = model.getValue(ipt_todd.attribute("ref"));
  225. if(reqdeptnm == "합계") {
  226. reqdeptcd = grd_sumlist.valueMatrix(grd_sumlist.row-1, grd_sumlist.colRef("reqdeptcd"));
  227. }
  228. }
  229. setParameter("fromdd", fromdd) ;
  230. setParameter("todd", todd) ;
  231. setParameter("goodcd", goodcd);
  232. setParameter("deptcd", reqdeptcd);
  233. open("SPMNG04200");
  234. ]]>
  235. </script>
  236. </datagrid>
  237. <group id="grp_sea" style="left:0px; top:10px; width:1195px; height:35px; font-family:돋움체; vertical-align:top; ">
  238. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1195px; height:35px; font-family:돋움체; background-color:#fffbf2; border-color:#ffd799; ">.,m</shape>
  239. <caption id="cap_instcd" class="search_name" style="left:15px; top:10px; width:91px; height:17px; font-family:돋움체; ">조회일자:</caption>
  240. <line id="line13" class="line_4" style="x1:1055px; y1:5px; x2:1055px; y2:30px; font-family:돋움체; border-color:#ffe4bb; border-left-style:solid; "/>
  241. <button id="btn_search" class="btn1_letter2" navindex="2" style="left:1070px; top:8px; width:56px; height:22px; font-family:돋움체; ">
  242. <caption>조회</caption>
  243. <script type="javascript" ev:event="DOMActivate">
  244. <![CDATA[
  245. fSearch();
  246. ]]>
  247. </script>
  248. </button>
  249. <input id="ipt_fromdd" ref="/root/main/cond/fromdd" inputtype="date" style="left:100px; top:10px; width:85px; height:19px; font-family:돋움체; ">
  250. <script type="javascript" ev:event="xforms-value-changed">
  251. <![CDATA[
  252. if(model.getValue(rdo_flag.attribute("ref")) == "2") {
  253. model.setValue(ipt_todd.attribute("ref"), model.getValue(ipt_fromdd.attribute("ref")));
  254. ipt_todd.refresh();
  255. }
  256. ]]>
  257. </script>
  258. </input>
  259. <input id="ipt_todd" ref="/root/main/cond/todd" inputtype="date" style="left:195px; top:10px; width:85px; height:19px; font-family:돋움체; "/>
  260. <caption id="caption1" style="left:185px; top:12px; width:16px; height:18px; font-family:돋움체; font-weight:bold; ">~</caption>
  261. <select1 id="rdo_deptflag" ref="/root/main/cond/deptflag" appearance="full" cols="4" overflow="visible" style="left:285px; top:11px; width:180px; height:15px; font-family:돋움체; background-color:transparent; border-style:none; ">
  262. <choices>
  263. <item>
  264. <label>전체</label>
  265. <value/>
  266. </item>
  267. <item>
  268. <label>외래</label>
  269. <value>O</value>
  270. </item>
  271. <item>
  272. <label>병동</label>
  273. <value>I</value>
  274. </item>
  275. <item>
  276. <label>행정</label>
  277. <value>T</value>
  278. </item>
  279. </choices>
  280. <script type="javascript" ev:event="xforms-value-changed">
  281. <![CDATA[
  282. var val = rdo_deptflag.value;
  283. if(val == "" || val == null) {
  284. cmb_deptcd.choices.itemset.attribute("nodeset") = "/root/init/deptinfo/deptlist";
  285. } else {
  286. cmb_deptcd.choices.itemset.attribute("nodeset") = "/root/init/deptinfo/deptlist[deptcd='' or deptflag='" + val + "']";
  287. cmb_deptcd.value="";
  288. }
  289. cmb_deptcd.refresh();
  290. ]]>
  291. </script>
  292. </select1>
  293. <select1 id="cmb_deptcd" ref="/root/main/cond/deptcd" appearance="minimal" style="left:470px; top:10px; width:145px; height:19px; font-family:돋움체; ">
  294. <choices>
  295. <itemset nodeset="/root/init/deptinfo/deptlist">
  296. <label ref="deptnm"/>
  297. <value ref="deptcd"/>
  298. </itemset>
  299. </choices>
  300. <script type="javascript" ev:event="xforms-value-changed">
  301. <![CDATA[
  302. fSearch();
  303. ]]>
  304. </script>
  305. </select1>
  306. <button id="button1" class="btn1_letter2" navindex="2" style="left:1130px; top:8px; width:56px; height:22px; font-family:돋움체; ">
  307. <caption>엑셀</caption>
  308. <script type="javascript" ev:event="DOMActivate">
  309. <![CDATA[
  310. var fileName = window.fileDialog("save", ",", false, "SET기구 처방 집계현황", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  311. if (fileName != "")
  312. {
  313. grd_sumlist.saveExcel(fileName, "SheetName", false, false, "", "", "false");
  314. }
  315. ]]>
  316. </script>
  317. </button>
  318. <select1 id="rdo_flag" ref="/root/main/cond/flag" appearance="full" cols="2" overflow="visible" style="left:620px; top:10px; width:115px; height:20px; background-color:transparent; ">
  319. <choices>
  320. <item>
  321. <label>일자별</label>
  322. <value>1</value>
  323. </item>
  324. <item>
  325. <label>부서별</label>
  326. <value>2</value>
  327. </item>
  328. </choices>
  329. <script type="javascript" ev:event="xforms-value-changed">
  330. <![CDATA[
  331. model.removeNodeset(grd_sumlist.nodeset);
  332. grd_sumlist.refresh();
  333. var flag = model.getValue(rdo_flag.attribute("ref"));
  334. if(flag == "1") {
  335. grd_sumlist.colHidden(grd_sumlist.colRef("reqdeptnm")) = true;
  336. grd_sumlist.colHidden(grd_sumlist.colRef("delivedd")) = false;
  337. ipt_todd.visible = true;
  338. caption1.visible = true;
  339. } else {
  340. ipt_todd.visible = false; //부서별일경우에는 종료일자 숨김.
  341. model.setValue(ipt_todd.attribute("ref"), model.getValue(ipt_fromdd.attribute("ref")));
  342. ipt_todd.refresh();
  343. caption1.visible = false;
  344. grd_sumlist.colHidden(grd_sumlist.colRef("reqdeptnm")) = false;;
  345. grd_sumlist.colHidden(grd_sumlist.colRef("delivedd")) = true;
  346. if (!isNull(userdutplcecd)) {
  347. cmb_deptcd.value = "";
  348. }
  349. fSearch();
  350. }
  351. ]]>
  352. </script>
  353. </select1>
  354. </group>
  355. <caption id="caption8" class="tit_2" style="left:5px; top:59px; width:182px; height:14px; font-family:돋움체; ">SET기구 처방 집계현황</caption>
  356. <line id="line1" class="line_1" style="x1:0px; y1:74px; x2:1195px; y2:74px; font-family:돋움체; "/>
  357. <datagrid id="grd_sumlist" nodeset="/root/main/suminfo/sumlist" caption="구분^일자^부서코드^부서명|구분^일자^부서코드^부서명" colsep="^" colwidth="100, 85, 0, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:79px; width:1195px; height:656px; font-family:돋움체; ">
  358. <col ref="flag" visibility="hidden"/>
  359. <col ref="delivedd" format="yyyy-mm-dd" style="text-align:center; "/>
  360. <col ref="reqdeptcd" visibility="hidden"/>
  361. <col ref="reqdeptnm" style="border-right-color:#000000; "/>
  362. <script type="javascript" ev:event="ondblclick">
  363. <![CDATA[
  364. var flag = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("flag"));
  365. if(flag == "1") {
  366. return;
  367. }
  368. var colNm = grd_sumlist.colAttribute(grd_sumlist.col, "ref"); //현재선택한 컬럼의 참조명을 들고온다.
  369. var col = parseInt(((grd_sumlist.col + 2) % 3));
  370. var seq;
  371. if(grd_sumlist.col > 2) {
  372. if(col == 0) {
  373. seq = colNm.substr(5);
  374. } else if(col == 1) {
  375. seq = colNm.substr(5);
  376. } else if(col == 2) {
  377. seq = colNm.substr(6);
  378. }
  379. }
  380. //선택한 컬럼의 순번을 가져온다.
  381. var goodcd = model.getValue("/root/init/R0435list/R0435[dispseq='" + seq + "']/cdid");
  382. var reqdeptcd = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("reqdeptcd"));
  383. var reqdeptnm = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("reqdeptnm"));
  384. var fromdd = "";
  385. var todd = "";
  386. var delivedd = grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.colRef("delivedd"));
  387. if(col != 1) {
  388. if(rdo_flag.value == "1") {
  389. if(delivedd = "합계") {
  390. fromdd = ipt_fromdd.value;
  391. todd = ipt_todd.value;
  392. } else {
  393. fromdd = delivedd;
  394. todd = delivedd;
  395. }
  396. reqdeptcd = cmb_deptcd.value;
  397. } else {
  398. fromdd = model.getValue(ipt_fromdd.attribute("ref"));
  399. todd = model.getValue(ipt_todd.attribute("ref"));
  400. if(reqdeptnm == "합계") {
  401. reqdeptcd = grd_sumlist.valueMatrix(grd_sumlist.row-1, grd_sumlist.colRef("reqdeptcd"));
  402. }
  403. }
  404. setParameter("fromdd", fromdd) ;
  405. setParameter("todd", todd) ;
  406. setParameter("goodcd", goodcd);
  407. setParameter("deptcd", reqdeptcd);
  408. if(col == 0 && grd_sumlist.valueMatrix(grd_sumlist.row, grd_sumlist.col) == "") {
  409. } else {
  410. open("SPMNG04200");
  411. }
  412. }
  413. ]]>
  414. </script>
  415. <script type="javascript" ev:event="onclick">
  416. <![CDATA[
  417. var fromdd = model.getValue(ipt_fromdd.attribute("ref"));
  418. var curdd = getCurrentDate();
  419. var flag = model.getValue(rdo_flag.attribute("ref"));
  420. if(flag == "1") {
  421. grd_sumlist.isReadOnly(grd_sumlist.row, grd_sumlist.col, grd_sumlist.row, grd_sumlist.col) = true;
  422. } else {
  423. if(fromdd != curdd) {
  424. grd_sumlist.isReadOnly(grd_sumlist.row, grd_sumlist.col, grd_sumlist.row, grd_sumlist.col) = true;
  425. } else {
  426. grd_sumlist.isReadOnly(grd_sumlist.row, grd_sumlist.col, grd_sumlist.row, grd_sumlist.col) = false;
  427. }
  428. }
  429. ]]>
  430. </script>
  431. </datagrid>
  432. <button id="btn_sav" class="btn5_letter4" style="left:1129px; top:54px; width:64px; height:19px; ">
  433. <caption>불출저장</caption>
  434. <script type="javascript" ev:event="DOMActivate">
  435. <![CDATA[
  436. var delivedd;
  437. var reqdeptcd;
  438. var orgqty;
  439. var cmpqty;
  440. var header = "delivedd▦reqdeptcd▦goodcd▦dlvqty▦updtflag▩"
  441. var data = "";
  442. var updtdata = getGridUpdateData(grd_sumlist);
  443. if(updtdata == null || updtdata == "") {
  444. messageBox("변경된 내역이 존재하지 않습니다.", "E");
  445. return;
  446. }
  447. var updtflag;
  448. //수정된 데이터만 저장하기 위한 로직
  449. for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++) {
  450. delivedd = grd_sumlist.valueMatrix(i, grd_sumlist.colRef("delivedd"));
  451. reqdeptcd = grd_sumlist.valueMatrix(i, grd_sumlist.colRef("reqdeptcd"));
  452. updtflag = grd_sumlist.valueMatrix(i, grd_sumlist.colRef("flag"));
  453. if(delivedd != "") { //subtotal로 만들어진 데이터인 경우에는. delivedd가 존재하지 않는다.
  454. if(grd_sumlist.rowStatus(i) == "2") { //데이터 수정을 위해 변경한 경우에는. 그리드 상태가 update이다.
  455. //length : 전역변수, set물품 리스트의 건수이다.(건수별로 앞에서 dynamic컬럼으로 생성.)
  456. //조회시 기존에 가져온 값을 grd_sumlist2에 복사해서 내부적으로 가지고있다.
  457. for(var j = 1; j <= length; j++) {
  458. cmpqty= grd_sumlist.valueMatrix(i, grd_sumlist.colRef("a2qty" + j)); //현재 SET기구 현황 조회 그리드의 값
  459. orgqty = model.getValue(grd_sumlist2.nodeset + "[delivedd='" + delivedd + "' and reqdeptcd='" + reqdeptcd + "']/a2qty" + j); //현재바뀐것도 같은 물품의 원래값.
  460. //두개를 비교해서 다르면.(처음 조회시 가져왔던 정보에서 변경이 되었을 경우에는 저장을 위해 담는다.)
  461. if(orgqty != cmpqty ) {
  462. data += grd_sumlist.valueMatrix(i, grd_sumlist.colRef("delivedd")) + "▦"
  463. + grd_sumlist.valueMatrix(i, grd_sumlist.colRef("reqdeptcd")) + "▦"
  464. + model.getValue("/root/init/R0435list/R0435[dispseq='" + j+ "']/cdid") + "▦"
  465. + cmpqty + "▦"
  466. + updtflag + "▩"
  467. ;
  468. }
  469. }
  470. }
  471. }
  472. }
  473. model.makeValue("/root/send/savedata/sumlist", header + data);
  474. submit("TXMNG04201");
  475. fSearch();
  476. ]]>
  477. </script>
  478. </button>
  479. <caption id="caption2" visibility="hidden" style="left:555px; top:53px; width:532px; height:20px; ">뒤에 새로운 그리드가 숨겨져있음(수정된 내역을 기존과 비교해서 그것만 따로 저장하게 하기위해)</caption>
  480. <textarea id="tar_hidden" scroll="auto" style="left:0px; top:80px; width:1195px; height:655px; background-color:#eeffee; "/>
  481. </group>
  482. </xhtml:body>
  483. </xhtml:html>