SMANT01600_환자식급식실천표.xrw 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078
  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>환자식급식실천표</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <gnrldish>
  11. <appdd/>
  12. <mealflag/>
  13. <menuflag/>
  14. <dishtableflag/>
  15. <dishtablenm/>
  16. <dishcd/>
  17. <dishnm/>
  18. <foodcd/>
  19. <foodnm/>
  20. <plceordexchbase/>
  21. <foodqty/>
  22. <h_foodqty/>
  23. <psnno1/>
  24. <h_psnno1/>
  25. <totalqty/>
  26. <foodunit/>
  27. <dishrem/>
  28. <psnnor1/>
  29. </gnrldish>
  30. <gnrlfood>
  31. <appdd/>
  32. <mealflag/>
  33. <menuflag/>
  34. <foodcd/>
  35. <foodnm/>
  36. <plceordexchbase/>
  37. <dishcd/>
  38. <dishnm/>
  39. <foodqty/>
  40. <h_foodqty/>
  41. <psnno1/>
  42. <h_psnno1/>
  43. <totalqty/>
  44. <foodunit/>
  45. <dishrem/>
  46. <psnnor1/>
  47. </gnrlfood>
  48. <curedish>
  49. <appdd/>
  50. <mealflag/>
  51. <menuflag/>
  52. <dishtableflag/>
  53. <dishtablenm/>
  54. <dishcd/>
  55. <dishnm/>
  56. <foodcd/>
  57. <foodnm/>
  58. <plceordexchbase/>
  59. <foodqty/>
  60. <h_foodqty/>
  61. <psnno1/>
  62. <h_psnno1/>
  63. <psnno2/>
  64. <h_psnno2/>
  65. <psnno3/>
  66. <h_psnno3/>
  67. <totalqty/>
  68. <foodunit/>
  69. <dishrem/>
  70. <psnnor1/>
  71. <psnnor2/>
  72. <psnnor3/>
  73. </curedish>
  74. <curefood>
  75. <appdd/>
  76. <mealflag/>
  77. <menuflag/>
  78. <foodcd/>
  79. <foodnm/>
  80. <plceordexchbase/>
  81. <dishcd/>
  82. <dishnm/>
  83. <foodqty/>
  84. <h_foodqty/>
  85. <psnno1/>
  86. <h_psnno1/>
  87. <psnno2/>
  88. <h_psnno2/>
  89. <psnno3/>
  90. <h_psnno3/>
  91. <totalqty/>
  92. <foodunit/>
  93. <dishrem/>
  94. <psnnor1/>
  95. <psnnor2/>
  96. <psnnor3/>
  97. </curefood>
  98. </main>
  99. <send>
  100. <searchitem>
  101. <appdd/>
  102. <menuflag/>
  103. <mealflag/>
  104. <psnnodd/>
  105. <pastyn/>
  106. </searchitem>
  107. <req>
  108. <dish/>
  109. </req>
  110. </send>
  111. <temp>
  112. <ret>
  113. <count/>
  114. </ret>
  115. </temp>
  116. <init>
  117. <basecode>
  118. <meal>
  119. <A0055>
  120. <cdid/>
  121. <cdnm/>
  122. </A0055>
  123. </meal>
  124. <diettable>
  125. <A0417>
  126. <cdid/>
  127. <cdnm/>
  128. </A0417>
  129. </diettable>
  130. </basecode>
  131. <miscode>
  132. <plceordunit>
  133. <cdid/>
  134. <cdnm/>
  135. </plceordunit>
  136. </miscode>
  137. <baseinfo>
  138. <inithalf/>
  139. </baseinfo>
  140. </init>
  141. </root>
  142. </instance>
  143. <script type="javascript" ev:event="xforms-ready">
  144. <![CDATA[
  145. finit();
  146. submit("TRANT02503"); //식재료 발주단위 조회
  147. astGetComboList( new Array("A170"), new Array("/root/init/baseinfo/inithalf") );
  148. submit("TRAAA00001", false);
  149. model.removeNode("/root/init/baseinfo/inithalf/A170[" + 1 + "]");
  150. btn_search.disabled = !checkAuth("R");
  151. btn_save.disabled = !checkAuth("X");
  152. //btn_excel.disabled = !checkAuth("P");
  153. // 2010.12.29 c y w 과거데이터조회여부에 따라 예정식수일자 조회조건 visible 셋팅.
  154. if( model.getValue("/root/send/searchitem/pastyn" ) == "Y"){
  155. caption1.visible = false;
  156. ipt_psnnodd.visible = false;
  157. btn_beforedd2.visible = false;
  158. btn_nextdd2.visible = false;
  159. }else{
  160. caption1.visible = true;
  161. ipt_psnnodd.visible = true;
  162. btn_beforedd2.visible = true;
  163. btn_nextdd2.visible = true;
  164. }
  165. ]]>
  166. </script>
  167. <script type="javascript">
  168. <![CDATA[
  169. function finit() {
  170. // 화면open시 공통코드 setting
  171. zbcfGetCodeList( new Array( "A0055", "A0417" ), new Array("/root/init/basecode/meal", "/root/init/basecode/diettable") );
  172. //끼니에 '전체' 추가
  173. addComboItem("cmb_mealflag","전체","0","init");
  174. model.resetInstanceNode("/root/main");
  175. model.resetInstanceNode("/root/send");
  176. model.removeNodeset("/root/main");
  177. //model.setFocus("ipt_pid");
  178. model.setValue("/root/send/searchitem/appdd", getCurrentDate());
  179. model.setValue("/root/send/searchitem/psnnodd", getCurrentDate());
  180. model.setValue("/root/send/searchitem/menuflag", "Q1");
  181. model.setValue("/root/send/searchitem/mealflag", "0");
  182. btn_dish.dispatch("DOMActivate");
  183. model.refresh();
  184. }
  185. //일반식 - 식단명별로 식수인원,비고 컬럼 셀병합
  186. function fmerge1() {
  187. if ( grd_gnrldish.rows <= grd_gnrldish.fixedRows + 1)
  188. return;
  189. var dishnmColNum = grd_gnrldish.colRef("dishnm");
  190. var psnnoColNum = grd_gnrldish.colRef("psnno1");
  191. var psnnorColNum = grd_gnrldish.colRef("psnnor1");
  192. var dishremColNum = grd_gnrldish.colRef("dishrem");
  193. var sflag = grd_gnrldish.colRef("dishtableflag");
  194. var tmpStr1 = grd_gnrldish.valueMatrix(grd_gnrldish.fixedRows, dishnmColNum);
  195. var tmpStr2 = "";
  196. var tmpStr11 = grd_gnrldish.valueMatrix(grd_gnrldish.fixedRows, sflag);
  197. var tmpStr21 = "";
  198. var tmpNum = grd_gnrldish.fixedRows;
  199. for ( i = grd_gnrldish.fixedRows; i < grd_gnrldish.rows; i++ ) {
  200. if ( i + 1 <= grd_gnrldish.rows ) {
  201. tmpStr2 = grd_gnrldish.valueMatrix(i + 1, dishnmColNum);
  202. tmpStr21 = grd_gnrldish.valueMatrix(i + 1, sflag);
  203. } else if ( i + 1 == grd_gnrldish.rows ) {
  204. tmpStr2 = "";
  205. tmpStr21 = "";
  206. }
  207. if ( (tmpStr11 != tmpStr21) || (tmpStr1 != tmpStr2 && tmpStr11 == tmpStr21) ) {
  208. grd_gnrldish.mergeByFree(tmpNum, psnnoColNum, i, psnnoColNum);
  209. grd_gnrldish.mergeByFree(tmpNum, psnnorColNum, i, psnnorColNum);
  210. grd_gnrldish.mergeByFree(tmpNum, dishremColNum, i, dishremColNum);
  211. tmpStr1 = tmpStr2;
  212. tmpStr11 = tmpStr21;
  213. tmpNum = i + 1;
  214. }
  215. }
  216. }
  217. //치료식 - 식단명별로 식수인원,비고 컬럼 셀병합
  218. function fmerge2() {
  219. if ( grd_curedish.rows <= grd_curedish.fixedRows + 1)
  220. return;
  221. var dishnmColNum = grd_curedish.colRef("dishnm");
  222. var psnno1ColNum = grd_curedish.colRef("psnno1");
  223. var psnno2ColNum = grd_curedish.colRef("psnno2");
  224. var psnno3ColNum = grd_curedish.colRef("psnno3");
  225. var psnnor1ColNum = grd_curedish.colRef("psnnor1");
  226. var psnnor2ColNum = grd_curedish.colRef("psnnor2");
  227. var psnnor3ColNum = grd_curedish.colRef("psnnor3");
  228. var dishremColNum = grd_curedish.colRef("dishrem");
  229. var sflag = grd_curedish.colRef("dishtableflag");
  230. var tmpStr1 = grd_curedish.valueMatrix(grd_curedish.fixedRows, dishnmColNum);
  231. var tmpStr2 = "";
  232. var tmpStr11 = grd_curedish.valueMatrix(grd_curedish.fixedRows, sflag);
  233. var tmpStr21 = "";
  234. var tmpNum = grd_curedish.fixedRows;
  235. for ( i = grd_curedish.fixedRows; i < grd_curedish.rows; i++ ) {
  236. if ( i + 1 <= grd_curedish.rows ) {
  237. tmpStr2 = grd_curedish.valueMatrix(i + 1, dishnmColNum);
  238. tmpStr21 = grd_curedish.valueMatrix(i + 1, sflag);
  239. } else if ( i + 1 == grd_curedish.rows ) {
  240. tmpStr2 = "";
  241. tmpStr21 = "";
  242. }
  243. if ( (tmpStr11 != tmpStr21) || (tmpStr1 != tmpStr2 && tmpStr11 == tmpStr21) ) {
  244. grd_curedish.mergeByFree(tmpNum, psnno1ColNum, i, psnno1ColNum);
  245. grd_curedish.mergeByFree(tmpNum, psnno2ColNum, i, psnno2ColNum);
  246. grd_curedish.mergeByFree(tmpNum, psnno3ColNum, i, psnno3ColNum);
  247. grd_curedish.mergeByFree(tmpNum, psnnor1ColNum, i, psnnor1ColNum);
  248. grd_curedish.mergeByFree(tmpNum, psnnor2ColNum, i, psnnor2ColNum);
  249. grd_curedish.mergeByFree(tmpNum, psnnor3ColNum, i, psnnor3ColNum);
  250. grd_curedish.mergeByFree(tmpNum, dishremColNum, i, dishremColNum);
  251. tmpStr1 = tmpStr2;
  252. tmpStr11 = tmpStr21;
  253. tmpNum = i + 1;
  254. }
  255. }
  256. }
  257. ]]>
  258. </script>
  259. <submission id="TRZBC00101"/>
  260. <submission id="TRANT01601" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/searchitem" resultref="/root/main"/>
  261. <submission id="TRANT01602" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/searchitem" resultref="/root/temp"/>
  262. <submission id="TXANT01601" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/req"/>
  263. <submission id="TRANT02503" mediatype="application/x-www-form-urlencoded" method="post" replace="instance" resultref="/root/init/miscode"/>
  264. <submission id="TRAAA00001"/>
  265. </model>
  266. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  267. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  268. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  269. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  270. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  271. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  272. <script type="javascript" src="../../../ast/examcureweb/js/combolist.js"/>
  273. </xhtml:head>
  274. <xhtml:body guideline="1,1195;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  275. <group id="grp_tle" style="left:0px; top:0px; width:1195px; height:13px; ">
  276. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:150px; height:14px; ">환자식급식실천표</caption>
  277. </group>
  278. <group id="grp_biz" scroll="auto" style="left:0px; top:13px; width:1195px; height:744px; ">
  279. <group id="grp_sea" style="left:0px; top:10px; width:1194px; height:35px; vertical-align:top; ">
  280. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1194px; height:35px; background-color:#fffbf2; "/>
  281. <caption id="caption2" class="search_name" style="left:555px; top:9px; width:130px; height:17px; ">급식실천표일자 :</caption>
  282. <caption id="caption3" class="search_name" style="left:16px; top:9px; width:89px; height:17px; ">식단구분 :</caption>
  283. <line id="line13" class="line_4" style="x1:1100px; y1:6px; x2:1100px; y2:28px; "/>
  284. <button id="btn_beforedd1" class="icon_pre" style="left:778px; top:10px; width:13px; height:15px; ">
  285. <caption/>
  286. <script type="javascript" ev:event="onclick">
  287. <![CDATA[
  288. var dd = model.getValue("/root/send/searchitem/appdd");
  289. dd = dd.toDate().getAddDate(-1, "D");
  290. dd = dd.getDateFormat();
  291. model.setValue("/root/send/searchitem/appdd", dd);
  292. model.refresh();
  293. ]]>
  294. </script>
  295. </button>
  296. <button id="btn_nextdd1" class="icon_next" style="left:791px; top:10px; width:13px; height:15px; ">
  297. <caption/>
  298. <script type="javascript" ev:event="onclick">
  299. <![CDATA[
  300. var dd = model.getValue("/root/send/searchitem/appdd");
  301. dd = dd.toDate().getAddDate(1, "D");
  302. dd = dd.getDateFormat();
  303. model.setValue("/root/send/searchitem/appdd", dd);
  304. model.refresh();
  305. ]]>
  306. </script>
  307. </button>
  308. <input id="ipt_appdd" ref="/root/send/searchitem/appdd" class="input_search" inputtype="date" style="left:682px; top:8px; width:90px; height:19px; "/>
  309. <select1 id="rdo_menuflag" ref="/root/send/searchitem/menuflag" class="radio_search" appearance="full" cellspacing="3" cols="2" rows="1" overflow="visible" style="left:105px; top:10px; width:120px; height:20px; border-style:none; ">
  310. <choices>
  311. <item>
  312. <label>일반식</label>
  313. <value>Q1</value>
  314. </item>
  315. <item>
  316. <label>치료식</label>
  317. <value>Q2</value>
  318. </item>
  319. </choices>
  320. </select1>
  321. <button id="btn_search" class="btn1_letter2" style="left:1118px; top:7px; width:56px; height:22px; ">
  322. <caption>조회</caption>
  323. <script type="javascript" ev:event="DOMActivate">
  324. <![CDATA[
  325. submit("TRANT01601");
  326. model.removeNodeset("/root/send/req/savemealflag");
  327. //식단명별로 식수인원,비고 컬럼 셀병합
  328. if ( model.getValue("/root/send/searchitem/menuflag") == "Q1" ) { //일반식일 경우
  329. fmerge1();
  330. btn_dish.selected = true;
  331. model.toggle("case1");
  332. } else { //치료식일 경우
  333. fmerge2();
  334. btn_dish.selected = true;
  335. model.toggle("case3");
  336. }
  337. //과거데이터조회가 아닐경우 row status가 null이기 때문에 무조건 'insert'로 초기화한다.
  338. //if ( model.getValue("/root/send/searchitem/pastyn") == "" ) {
  339. for ( i=1; i<grd_gnrldish.rows; i++) {
  340. grd_gnrldish.addStatus(i, "insert");
  341. }
  342. for ( i=2; i<grd_curedish.rows; i++) {
  343. grd_curedish.addStatus(i, "insert");
  344. }
  345. //}
  346. ]]>
  347. </script>
  348. </button>
  349. <caption id="caption4" class="search_name" style="left:236px; top:9px; width:60px; height:17px; ">끼니 :</caption>
  350. <select1 id="cmb_mealflag" ref="/root/send/searchitem/mealflag" class="combo_s_essential" appearance="minimal" style="left:298px; top:8px; width:57px; height:19px; ">
  351. <choices>
  352. <itemset nodeset="/root/init/basecode/meal/A0055">
  353. <label ref="cdnm"/>
  354. <value ref="cdid"/>
  355. </itemset>
  356. </choices>
  357. </select1>
  358. <button id="btn_beforedd2" class="icon_pre" style="left:1053px; top:10px; width:13px; height:15px; ">
  359. <caption/>
  360. <script type="javascript" ev:event="onclick">
  361. <![CDATA[
  362. var dd = model.getValue("/root/send/searchitem/psnnodd");
  363. dd = dd.toDate().getAddDate(-1, "D");
  364. dd = dd.getDateFormat();
  365. model.setValue("/root/send/searchitem/psnnodd", dd);
  366. model.refresh();
  367. ]]>
  368. </script>
  369. </button>
  370. <caption id="caption1" class="search_name" style="left:841px; top:9px; width:114px; height:17px; ">예정식수일자 :</caption>
  371. <button id="btn_nextdd2" class="icon_next" style="left:1066px; top:10px; width:13px; height:15px; ">
  372. <caption/>
  373. <script type="javascript" ev:event="onclick">
  374. <![CDATA[
  375. var dd = model.getValue("/root/send/searchitem/psnnodd");
  376. dd = dd.toDate().getAddDate(1, "D");
  377. dd = dd.getDateFormat();
  378. model.setValue("/root/send/searchitem/psnnodd", dd);
  379. model.refresh();
  380. ]]>
  381. </script>
  382. </button>
  383. <input id="ipt_psnnodd" ref="/root/send/searchitem/psnnodd" class="input_search" inputtype="date" style="left:957px; top:8px; width:90px; height:19px; "/>
  384. <select id="chk_pastyn" ref="/root/send/searchitem/pastyn" class="checkbox_search" overflow="visible" appearance="full" style="left:395px; top:9px; width:135px; height:20px; ">
  385. <choices>
  386. <item>
  387. <label>과거데이터조회여부</label>
  388. <value>Y</value>
  389. </item>
  390. </choices>
  391. <script type="javascript" ev:event="xforms-value-changed">
  392. <![CDATA[
  393. // 2010.12.29 c y w 과거데이터조회여부에 따라 예정식수일자 조회조건 visible 셋팅.
  394. if( model.getValue("/root/send/searchitem/pastyn" ) == "Y"){
  395. caption1.visible = false;
  396. ipt_psnnodd.visible = false;
  397. btn_beforedd2.visible = false;
  398. btn_nextdd2.visible = false;
  399. }else{
  400. caption1.visible = true;
  401. ipt_psnnodd.visible = true;
  402. btn_beforedd2.visible = true;
  403. btn_nextdd2.visible = true;
  404. }
  405. ]]>
  406. </script>
  407. </select>
  408. </group>
  409. <button id="btn_dish" class="btn_sw" group="tab" selected="true" style="left:0px; top:49px; width:80px; height:22px; ">
  410. <caption>식단별</caption>
  411. <script type="javascript" ev:event="DOMActivate">
  412. <![CDATA[
  413. if ( model.getValue("/root/send/searchitem/menuflag")=='Q1' ) {
  414. model.toggle("case1");
  415. } else {
  416. model.toggle("case3");
  417. }
  418. ]]>
  419. </script>
  420. </button>
  421. <button id="btn_food" class="btn_sw" group="tab" style="left:80px; top:49px; width:95px; height:22px; ">
  422. <caption>식품(재료)별</caption>
  423. <script type="javascript" ev:event="DOMActivate">
  424. <![CDATA[
  425. if ( model.getValue("/root/send/searchitem/menuflag")=='Q1' ) {
  426. model.toggle("case2");
  427. } else {
  428. model.toggle("case4");
  429. }
  430. ]]>
  431. </script>
  432. </button>
  433. <switch id="switch2" style="left:0px; top:70px; width:1194px; height:670px; ">
  434. <case id="case1">
  435. <datagrid id="grd_gnrldish" nodeset="/root/main/gnrldish" caption="적용일자^끼니^식단구분^분류^분류명^식단코드^식단명^재료코드^재료명(식품명)^1인량^h_1인량^식수(명) 계산량^식수(명) 조절량^h_식수(명)^발주량^단위^비고" colsep="^" colwidth="10, 10, 10, 100, 10, 10, 100, 10, 110, 70, 10, 100, 100, 10, 70, 60, 150" dataheight="25" mergecells="byrestriccol" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:0px; top:0px; width:1192px; height:668px; ">
  436. <col ref="appdd" visibility="hidden"/>
  437. <col ref="mealflag" visibility="hidden"/>
  438. <col ref="menuflag" visibility="hidden"/>
  439. <col disabled="true" ref="dishtableflag" type="combo">
  440. <choices>
  441. <itemset nodeset="/root/init/basecode/diettable/A0417">
  442. <label ref="cdnm"/>
  443. <value ref="cdid"/>
  444. </itemset>
  445. </choices>
  446. </col>
  447. <col ref="dishtablenm" visibility="hidden"/>
  448. <col ref="dishcd" visibility="hidden"/>
  449. <col ref="dishnm"/>
  450. <col ref="foodcd" visibility="hidden"/>
  451. <col ref="foodnm"/>
  452. <col ref="foodqty" type="input" style="text-align:right; "/>
  453. <col ref="h_foodqty" visibility="hidden"/>
  454. <col ref="psnnor1" format="#,###" style="text-align:right; "/>
  455. <col ref="psnno1" type="input" format="#,###" style="text-align:right; "/>
  456. <col ref="h_psnno1" visibility="hidden"/>
  457. <col ref="totalqty" type="input" style="text-align:right; "/>
  458. <col disabled="true" ref="foodunit" type="combo" style="text-align:center; ">
  459. <choices>
  460. <itemset nodeset="/root/init/miscode/plceordunit">
  461. <label ref="cdnm"/>
  462. <value ref="cdid"/>
  463. </itemset>
  464. </choices>
  465. </col>
  466. <col ref="dishrem" type="input">
  467. <script type="javascript" ev:event="onendedit">
  468. <![CDATA[
  469. var dishrem = model.getValue("/root/main/gnrldish[" + grd_gnrldish.row + "]/dishrem");
  470. for ( k=grd_gnrldish.row; k<grd_gnrldish.rows; k++) {
  471. var dishtableflag = model.getValue("/root/main/gnrldish[" + k + "]/dishtableflag");
  472. var dishcd = model.getValue("/root/main/gnrldish[" + k + "]/dishcd");
  473. var dishtableflag2 = model.getValue("/root/main/gnrldish[" + (k+1) + "]/dishtableflag");
  474. var dishcd2 = model.getValue("/root/main/gnrldish[" + (k+1) + "]/dishcd");
  475. if ( (dishtableflag != dishtableflag2) || (dishcd != dishcd2) ) {
  476. break;
  477. } else {
  478. model.setValue("/root/main/gnrldish[" + (k+1) + "]/dishrem", dishrem);
  479. }
  480. }
  481. ]]>
  482. </script>
  483. </col>
  484. <script type="javascript" ev:event="onfixedbuttonclick">
  485. <![CDATA[
  486. /**
  487. * ast_31
  488. *개발일시: 2010.05.17
  489. *개발내용: 그리드(id:grd_gnrldish)의 버튼을 클릭하면 식수를 모두 마지막에 선택된 값으로 변경된다.
  490. */
  491. for(var i = 1; i <= grd_gnrldish.rows;i++)
  492. {
  493. grd_gnrldish.valueMatrix(i, 12) = grd_gnrldish.valueMatrix(grd_gnrldish_row, grd_gnrldish_col);
  494. }
  495. ]]>
  496. </script>
  497. <script type="javascript" ev:event="onclick">
  498. <![CDATA[
  499. /**
  500. * ast_31
  501. *개발일시: 2010.05.17
  502. *개발내용: 그리드(id:grd_gnrldish)를 클릭하면, 해당 그리드의 row와 col을 저장할 변수
  503. */
  504. if(grd_gnrldish.row == 0)
  505. {
  506. return;
  507. }
  508. grd_gnrldish_row = grd_gnrldish.row;
  509. //grd_gnrldish_col = grd_gnrldish.col;
  510. ]]>
  511. </script>
  512. </datagrid>
  513. <button id="btn_recalc1" class="btn2_letter3" style="left:1080px; top:4px; width:53px; height:19px; ">
  514. <caption>재계산</caption>
  515. <script type="javascript" ev:event="DOMActivate">
  516. <![CDATA[
  517. var shalf = model.getValue("/root/init/baseinfo/inithalf/A170[" + 1 + "]/cdid");
  518. shalf = (parseInt(shalf) * -1) - 1;
  519. //alert(shalf);
  520. for ( i=1; i<grd_gnrldish.rows; i++) {
  521. var i_foodqty = model.getValue("/root/main/gnrldish[" + i + "]/foodqty");
  522. var i_hfoodqty = model.getValue("/root/main/gnrldish[" + i + "]/h_foodqty");
  523. var i_psnno = model.getValue("/root/main/gnrldish[" + i + "]/psnno1");
  524. var i_hpsnno = model.getValue("/root/main/gnrldish[" + i + "]/h_psnno1");
  525. var totalqty;
  526. //1인량만 수정된 경우
  527. if ( (i_foodqty != i_hfoodqty) && (i_psnno == i_hpsnno) ) {
  528. var i_plceordexchbase = model.getValue("/root/main/gnrldish[" + i + "]/plceordexchbase");
  529. totalqty = parseFloat(i_foodqty) * parseInt(i_psnno) / parseFloat(i_plceordexchbase);
  530. //totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  531. totalqty = totalqty.toString().getRound(shalf, "HALF_UP");
  532. model.setValue("/root/main/gnrldish[" + i + "]/totalqty", parseFloat(totalqty));
  533. model.setValue("/root/main/gnrldish[" + i + "]/h_foodqty", parseFloat(i_foodqty));
  534. }
  535. //식수가 수정된 경우
  536. else if ( i_psnno != i_hpsnno ) {
  537. for ( k=i; k<grd_gnrldish.rows; k++) {
  538. var k_foodqty = model.getValue("/root/main/gnrldish[" + k + "]/foodqty");
  539. var k_plceordexchbase = model.getValue("/root/main/gnrldish[" + k + "]/plceordexchbase");
  540. totalqty = parseFloat(k_foodqty) * parseInt(i_psnno) / parseFloat(k_plceordexchbase);
  541. //totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  542. totalqty = totalqty.toString().getRound(shalf, "HALF_UP");
  543. model.setValue("/root/main/gnrldish[" + k + "]/totalqty", parseFloat(totalqty));
  544. model.setValue("/root/main/gnrldish[" + k + "]/h_foodqty", parseFloat(k_foodqty));
  545. model.setValue("/root/main/gnrldish[" + k + "]/psnno1", parseInt(i_psnno));
  546. model.setValue("/root/main/gnrldish[" + k + "]/h_psnno1", parseInt(i_psnno));
  547. var dishtableflag = model.getValue("/root/main/gnrldish[" + k + "]/dishtableflag");
  548. var dishcd = model.getValue("/root/main/gnrldish[" + k + "]/dishcd");
  549. var dishtableflag2 = model.getValue("/root/main/gnrldish[" + (k+1) + "]/dishtableflag");
  550. var dishcd2 = model.getValue("/root/main/gnrldish[" + (k+1) + "]/dishcd");
  551. if ( (dishtableflag != dishtableflag2) || (dishcd != dishcd2) ) {
  552. break;
  553. }
  554. }
  555. }
  556. }
  557. model.refresh();
  558. ]]>
  559. </script>
  560. </button>
  561. </case>
  562. <case id="case2">
  563. <datagrid id="grd_gnrlfood" nodeset="/root/main/gnrlfood" caption="적용일자^끼니^식단구분^재료코드^재료명(식품명)^식단코드^식단명^1인량^h_1인량^식수(명) 계산량^식수(명) 조절량^h_식수(명)^발주량^단위^비고" colsep="^" colwidth="10, 10, 10, 10, 100, 10, 110, 70, 10, 100,100, 10, 70, 60, 150" dataheight="25" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:0px; top:0px; width:1192px; height:668px; ">
  564. <col ref="appdd" visibility="hidden"/>
  565. <col ref="mealflag" visibility="hidden"/>
  566. <col ref="menuflag" visibility="hidden"/>
  567. <col ref="foodcd" visibility="hidden"/>
  568. <col ref="foodnm"/>
  569. <col ref="dishcd" visibility="hidden"/>
  570. <col ref="dishnm"/>
  571. <col ref="foodqty" type="input" style="text-align:right; "/>
  572. <col ref="h_foodqty" visibility="hidden"/>
  573. <col ref="psnnor1" format="#,###" style="text-align:right; "/>
  574. <col ref="psnno1" type="input" format="#,###" style="text-align:right; "/>
  575. <col ref="h_psnno1" visibility="hidden"/>
  576. <col ref="totalqty" type="input" style="text-align:right; "/>
  577. <col disabled="true" ref="foodunit" type="combo" style="text-align:center; ">
  578. <choices>
  579. <itemset nodeset="/root/init/miscode/plceordunit">
  580. <label ref="cdnm"/>
  581. <value ref="cdid"/>
  582. </itemset>
  583. </choices>
  584. </col>
  585. <col ref="dishrem"/>
  586. </datagrid>
  587. <button id="btn_recalc2" class="btn2_letter3" style="left:1080px; top:4px; width:53px; height:19px; ">
  588. <caption>재계산</caption>
  589. <script type="javascript" ev:event="DOMActivate">
  590. <![CDATA[
  591. var shalf = model.getValue("/root/init/baseinfo/inithalf/A170[" + 1 + "]/cdid");
  592. shalf = (parseInt(shalf) * -1) - 1;
  593. for ( i=1; i<grd_gnrlfood.rows; i++) {
  594. var foodqty = model.getValue("/root/main/gnrlfood[" + i + "]/foodqty");
  595. var hfoodqty = model.getValue("/root/main/gnrlfood[" + i + "]/h_foodqty");
  596. var psnno1 = model.getValue("/root/main/gnrlfood[" + i + "]/psnno1");
  597. var hpsnno1 = model.getValue("/root/main/gnrlfood[" + i + "]/h_psnno1");
  598. var plceordexchbase = model.getValue("/root/main/gnrlfood[" + i + "]/plceordexchbase");
  599. if ( (foodqty != hfoodqty) || (psnno1 != hpsnno1) ) {
  600. var totalqty = parseFloat(foodqty) * parseInt(psnno1) / parseFloat(plceordexchbase);
  601. //totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  602. totalqty = totalqty.toString().getRound(shalf, "HALF_UP");
  603. model.setValue("/root/main/gnrlfood[" + i + "]/totalqty", parseFloat(totalqty));
  604. model.setValue("/root/main/gnrlfood[" + i + "]/h_foodqty", parseFloat(foodqty));
  605. model.setValue("/root/main/gnrlfood[" + i + "]/h_psnno1", parseInt(psnno1));
  606. }
  607. }
  608. model.refresh();
  609. ]]>
  610. </script>
  611. </button>
  612. </case>
  613. <case id="case3" selected="true">
  614. <datagrid id="grd_curedish" nodeset="/root/main/curedish" caption="적용일자^끼니^식단구분^1분류^분류명^식단코드^식단명^재료코드^재료명(식품명)^1인량^h_1인량^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^발주량^단위^비고|적용일자^끼니^식단구분^분류^분류명^식단코드^식단명^재료코드^재료명(식품명)^1인량^h_1인량^당뇨 계산^당뇨 조절^h_당뇨^경저염 계산^경저염 조절^h_경저염^저염 계산^저염 조절^h_저염^발주량^단위^비고" colsep="^" colwidth="10, 10, 10, 100, 10, 10, 48, 10, 110, 70, 10, 70, 70, 10, 70, 70, 10, 70, 70, 10, 70, 60, 150" dataheight="25" mergecells="byrestriccol" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:0px; top:0px; width:1192px; height:668px; ">
  615. <col ref="appdd" visibility="hidden"/>
  616. <col ref="mealflag" visibility="hidden"/>
  617. <col ref="menuflag" visibility="hidden"/>
  618. <col disabled="true" ref="dishtableflag" type="combo">
  619. <choices>
  620. <itemset nodeset="/root/init/basecode/diettable/A0417">
  621. <label ref="cdnm"/>
  622. <value ref="cdid"/>
  623. </itemset>
  624. </choices>
  625. </col>
  626. <col ref="dishtablenm" visibility="hidden"/>
  627. <col ref="dishcd" visibility="hidden"/>
  628. <col ref="dishnm"/>
  629. <col ref="foodcd" visibility="hidden"/>
  630. <col ref="foodnm"/>
  631. <col ref="foodqty" type="input" style="text-align:right; "/>
  632. <col ref="h_foodqty" visibility="hidden"/>
  633. <col ref="psnnor1" format="#,###" style="text-align:right; "/>
  634. <col ref="psnno1" type="input" format="#,###" style="text-align:right; "/>
  635. <col ref="h_psnno1" visibility="hidden"/>
  636. <col ref="psnnor2" format="#,###" style="text-align:right; "/>
  637. <col ref="psnno2" type="input" format="#,###" style="text-align:right; "/>
  638. <col ref="h_psnno2" visibility="hidden"/>
  639. <col ref="psnnor3" format="#,###" style="text-align:right; "/>
  640. <col ref="psnno3" type="input" format="#,###" style="text-align:right; "/>
  641. <col ref="h_psnno3" visibility="hidden"/>
  642. <col ref="totalqty" type="input" style="text-align:right; "/>
  643. <col disabled="true" ref="foodunit" type="combo" style="text-align:center; ">
  644. <choices>
  645. <itemset nodeset="/root/init/miscode/plceordunit">
  646. <label ref="cdnm"/>
  647. <value ref="cdid"/>
  648. </itemset>
  649. </choices>
  650. </col>
  651. <col ref="dishrem" type="input">
  652. <script type="javascript" ev:event="onendedit">
  653. <![CDATA[
  654. var dishrem = model.getValue("/root/main/curedish[" + (grd_curedish.row-1) + "]/dishrem");
  655. for ( k=grd_curedish.row; k<grd_curedish.rows-1; k++) {
  656. var dishtableflag = model.getValue("/root/main/curedish[" + (k-1) + "]/dishtableflag");
  657. var dishcd = model.getValue("/root/main/curedish[" + (k-1) + "]/dishcd");
  658. var dishtableflag2 = model.getValue("/root/main/curedish[" + k + "]/dishtableflag");
  659. var dishcd2 = model.getValue("/root/main/curedish[" + k + "]/dishcd");
  660. if ( (dishtableflag != dishtableflag2) || (dishcd != dishcd2) ) {
  661. break;
  662. } else {
  663. model.setValue("/root/main/curedish[" + k + "]/dishrem", dishrem);
  664. }
  665. }
  666. ]]>
  667. </script>
  668. </col>
  669. <script type="javascript" ev:event="onendedit">
  670. <![CDATA[
  671. // 현재 선택된 그리드의 행을 지정
  672. var s = grd_curedish.row;
  673. // alert("선택된 그리드 행 인덱스 : "+ s);
  674. // 비교조건에 사용하기 위한 그룹핑용 기준코드 값 가져오기
  675. var dishtableflag = model.getValue("/root/main/curedish[" + (s-1) + "]/dishtableflag");
  676. var dishcd = model.getValue("/root/main/curedish[" + (s-1) + "]/dishcd");
  677. // var dishnm = model.getValue("/root/main/curedish[" + (s-1) + "]/dishnm");
  678. // var foodnm = model.getValue("/root/main/curedish[" + (s-1) + "]/foodnm");
  679. // alert("dishtableflag : " + dishtableflag);
  680. // alert("dishcd : " + dishcd);
  681. // alert("dishnm : " + dishnm);
  682. // alert("foodnm : " + foodnm);
  683. var t_psnno1 = model.getValue("/root/main/curedish[" + (s-1) + "]/psnno1");
  684. // alert("psnno1 : " + h_psnno1);
  685. var t_psnno2 = model.getValue("/root/main/curedish[" + (s-1) + "]/psnno2");
  686. var t_psnno3 = model.getValue("/root/main/curedish[" + (s-1) + "]/psnno3");
  687. for ( k=grd_curedish.row; k<grd_curedish.rows-1; k++) {
  688. var dishtableflag2 = model.getValue("/root/main/curedish[" + (k -1)+ "]/dishtableflag");
  689. var dishcd2 = model.getValue("/root/main/curedish[" + (k-1) + "]/dishcd");
  690. if ( (dishtableflag != dishtableflag2) || (dishcd != dishcd2) ) {
  691. break;
  692. } else {
  693. // 실제 인스턴스 값
  694. model.setValue("/root/main/curedish[" + (k-1) + "]/psnno1", t_psnno1);
  695. model.setValue("/root/main/curedish[" + (k-1) + "]/psnno2", t_psnno2);
  696. model.setValue("/root/main/curedish[" + (k-1) + "]/psnno3", t_psnno3);
  697. // 히든으로
  698. model.setValue("/root/main/curedish[" + (k-1) + "]/h_psnno1", t_psnno1);
  699. model.setValue("/root/main/curedish[" + (k-1) + "]/h_psnno2", t_psnno2);
  700. model.setValue("/root/main/curedish[" + (k-1) + "]/h_psnno3", t_psnno3);
  701. }
  702. }
  703. ]]>
  704. </script>
  705. </datagrid>
  706. <button id="btn_recalc3" class="btn2_letter3" style="left:1080px; top:4px; width:53px; height:19px; ">
  707. <caption>재계산</caption>
  708. <script type="javascript" ev:event="DOMActivate">
  709. <![CDATA[
  710. var shalf = model.getValue("/root/init/baseinfo/inithalf/A170[" + 1 + "]/cdid");
  711. shalf = (parseInt(shalf) * -1) - 1;
  712. for ( i=1; i<grd_curedish.rows-1; i++) {
  713. var i_foodqty = model.getValue("/root/main/curedish[" + i + "]/foodqty");
  714. var i_hfoodqty = model.getValue("/root/main/curedish[" + i + "]/h_foodqty");
  715. var i_psnno1 = model.getValue("/root/main/curedish[" + i + "]/psnno1");
  716. var i_hpsnno1 = model.getValue("/root/main/curedish[" + i + "]/h_psnno1");
  717. var i_psnno2 = model.getValue("/root/main/curedish[" + i + "]/psnno2");
  718. var i_hpsnno2 = model.getValue("/root/main/curedish[" + i + "]/h_psnno2");
  719. var i_psnno3 = model.getValue("/root/main/curedish[" + i + "]/psnno3");
  720. var i_hpsnno3 = model.getValue("/root/main/curedish[" + i + "]/h_psnno3");
  721. var totalqty;
  722. //1인량만 수정된 경우
  723. if ( (i_foodqty != i_hfoodqty) && (i_psnno1 == i_hpsnno1) && (i_psnno2 == i_hpsnno2) && (i_psnno3 == i_hpsnno3) ) {
  724. if ( i_psnno1 == "" ) { i_psnno1 = 0; }
  725. if ( i_psnno2 == "" ) { i_psnno2 = 0; }
  726. if ( i_psnno3 == "" ) { i_psnno3 = 0; }
  727. var i_plceordexchbase = model.getValue("/root/main/curedish[" + i + "]/plceordexchbase");
  728. totalqty = parseFloat(i_foodqty) * (parseInt(i_psnno1)+parseInt(i_psnno2)+parseInt(i_psnno3)) / parseFloat(i_plceordexchbase);
  729. //totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  730. totalqty = totalqty.toString().getRound(shalf, "HALF_UP");
  731. model.setValue("/root/main/curedish[" + i + "]/totalqty", parseFloat(totalqty));
  732. model.setValue("/root/main/curedish[" + i + "]/h_foodqty", parseFloat(i_foodqty));
  733. }
  734. //식수가 수정된 경우
  735. else if ( (i_psnno1 != i_hpsnno1) || (i_psnno2 != i_hpsnno2) || (i_psnno3 != i_hpsnno3) ) {
  736. for ( k=i; k<grd_curedish.rows-1; k++) {
  737. if ( i_psnno1 == "" ) { i_psnno1 = 0; }
  738. if ( i_psnno2 == "" ) { i_psnno2 = 0; }
  739. if ( i_psnno3 == "" ) { i_psnno3 = 0; }
  740. var k_foodqty = model.getValue("/root/main/curedish[" + k + "]/foodqty");
  741. var k_plceordexchbase = model.getValue("/root/main/curedish[" + k + "]/plceordexchbase");
  742. totalqty = parseFloat(k_foodqty) * (parseInt(i_psnno1)+parseInt(i_psnno2)+parseInt(i_psnno3)) / parseFloat(k_plceordexchbase);
  743. //totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  744. totalqty = totalqty.toString().getRound(shalf, "HALF_UP");
  745. model.setValue("/root/main/curedish[" + k + "]/totalqty", parseFloat(totalqty));
  746. // if ( i_psnno1 == "" || i_psnno1 == 0 ) { i_psnno1 = ""; }
  747. // if ( i_psnno2 == "" || i_psnno2 == 0 ) { i_psnno2 = ""; }
  748. // if ( i_psnno3 == "" || i_psnno3 == 0 ) { i_psnno3 = ""; }
  749. model.setValue("/root/main/curedish[" + k + "]/h_foodqty", parseFloat(k_foodqty));
  750. model.setValue("/root/main/curedish[" + k + "]/psnno1", parseInt(i_psnno1));
  751. model.setValue("/root/main/curedish[" + k + "]/h_psnno1", parseInt(i_psnno1));
  752. model.setValue("/root/main/curedish[" + k + "]/psnno2", parseInt(i_psnno2));
  753. model.setValue("/root/main/curedish[" + k + "]/h_psnno2", parseInt(i_psnno2));
  754. model.setValue("/root/main/curedish[" + k + "]/psnno3", parseInt(i_psnno3));
  755. model.setValue("/root/main/curedish[" + k + "]/h_psnno3", parseInt(i_psnno3));
  756. var dishtableflag = model.getValue("/root/main/curedish[" + k + "]/dishtableflag");
  757. var dishcd = model.getValue("/root/main/curedish[" + k + "]/dishcd");
  758. var dishtableflag2 = model.getValue("/root/main/curedish[" + (k+1) + "]/dishtableflag");
  759. var dishcd2 = model.getValue("/root/main/curedish[" + (k+1) + "]/dishcd");
  760. if ( (dishtableflag != dishtableflag2) || (dishcd != dishcd2) ) {
  761. break;
  762. }
  763. }
  764. }
  765. }
  766. // for ( i=1; i<grd_curedish.rows-1; i++) {
  767. // var foodqty = model.getValue("/root/main/curedish[" + i + "]/foodqty");
  768. // var hfoodqty = model.getValue("/root/main/curedish[" + i + "]/h_foodqty");
  769. // var psnno1 = model.getValue("/root/main/curedish[" + i + "]/psnno1");
  770. // var hpsnno1 = model.getValue("/root/main/curedish[" + i + "]/h_psnno1");
  771. // var psnno2 = model.getValue("/root/main/curedish[" + i + "]/psnno2");
  772. // var hpsnno2 = model.getValue("/root/main/curedish[" + i + "]/h_psnno2");
  773. // var psnno3 = model.getValue("/root/main/curedish[" + i + "]/psnno3");
  774. // var hpsnno3 = model.getValue("/root/main/curedish[" + i + "]/h_psnno3");
  775. // var plceordexchbase = model.getValue("/root/main/curedish[" + i + "]/plceordexchbase");
  776. // if ( (foodqty != hfoodqty) || (psnno1 != hpsnno1) || (psnno2 != hpsnno2) || (psnno3 != hpsnno3) ) {
  777. // var totalqty = parseFloat(foodqty) * (parseInt(psnno1) + parseInt(psnno2) + parseInt(psnno3)) / parseFloat(plceordexchbase);
  778. // totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  779. // model.setValue("/root/main/curedish[" + i + "]/totalqty", parseFloat(totalqty));
  780. // model.setValue("/root/main/curedish[" + i + "]/h_foodqty", parseFloat(foodqty));
  781. // model.setValue("/root/main/curedish[" + i + "]/h_psnno1", parseInt(psnno1));
  782. // model.setValue("/root/main/curedish[" + i + "]/h_psnno2", parseInt(psnno2));
  783. // model.setValue("/root/main/curedish[" + i + "]/h_psnno3", parseInt(psnno3));
  784. // }
  785. // }
  786. model.refresh();
  787. ]]>
  788. </script>
  789. </button>
  790. </case>
  791. <case id="case4">
  792. <datagrid id="grd_curefood" nodeset="/root/main/curefood" caption="적용일자^끼니^식단구분^재료코드^재료명(식품명)^식단코드^식단명^1인량^h_1인량^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^염분기준식수(명)^발주량^단위^비고|적용일자^끼니^식단구분^재료코드^재료명(식품명)^식단코드^식단명^1인량^h_1인량^당뇨 계산^당뇨 조절^h_당뇨^경저염 계산^경저염 조절^h_경저염^저염 계산^저염 조절^h_저염^발주량^단위^비고" colsep="^" colwidth="10, 10, 10, 10, 100, 10, 110, 70, 10, 70, 70, 10, 70, 70, 10, 70, 70, 10, 70, 60, 150" dataheight="25" mergecells="byrestriccol" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:0px; top:0px; width:1192px; height:668px; ">
  793. <col ref="appdd" visibility="hidden"/>
  794. <col ref="mealflag" visibility="hidden"/>
  795. <col ref="menuflag" visibility="hidden"/>
  796. <col ref="foodcd" visibility="hidden"/>
  797. <col ref="foodnm"/>
  798. <col ref="dishcd" visibility="hidden"/>
  799. <col ref="dishnm"/>
  800. <col ref="foodqty" type="input" style="text-align:right; "/>
  801. <col ref="h_foodqty" visibility="hidden"/>
  802. <col ref="psnnor1" format="#,###" style="text-align:right; "/>
  803. <col ref="psnno1" type="input" format="#,###" style="text-align:right; "/>
  804. <col ref="h_psnno1" visibility="hidden"/>
  805. <col ref="psnnor2" format="#,###" style="text-align:right; "/>
  806. <col ref="psnno2" type="input" format="#,###" style="text-align:right; "/>
  807. <col ref="h_psnno2" visibility="hidden"/>
  808. <col ref="psnnor3" format="#,###" style="text-align:right; "/>
  809. <col ref="psnno3" type="input" format="#,###" style="text-align:right; "/>
  810. <col ref="h_psnno3" visibility="hidden"/>
  811. <col ref="totalqty" type="input" style="text-align:right; "/>
  812. <col disabled="true" ref="foodunit" type="combo" style="text-align:center; ">
  813. <choices>
  814. <itemset nodeset="/root/init/miscode/plceordunit">
  815. <label ref="cdnm"/>
  816. <value ref="cdid"/>
  817. </itemset>
  818. </choices>
  819. </col>
  820. <col ref="dishrem"/>
  821. </datagrid>
  822. <button id="btn_recalc4" class="btn2_letter3" style="left:1080px; top:4px; width:53px; height:19px; ">
  823. <caption>재계산</caption>
  824. <script type="javascript" ev:event="DOMActivate">
  825. <![CDATA[
  826. for ( i=1; i<grd_curefood.rows-1; i++) {
  827. var foodqty = model.getValue("/root/main/curefood[" + i + "]/foodqty");
  828. var hfoodqty = model.getValue("/root/main/curefood[" + i + "]/h_foodqty");
  829. var psnno1 = model.getValue("/root/main/curefood[" + i + "]/psnno1");
  830. var hpsnno1 = model.getValue("/root/main/curefood[" + i + "]/h_psnno1");
  831. var psnno2 = model.getValue("/root/main/curefood[" + i + "]/psnno2");
  832. var hpsnno2 = model.getValue("/root/main/curefood[" + i + "]/h_psnno2");
  833. var psnno3 = model.getValue("/root/main/curefood[" + i + "]/psnno3");
  834. var hpsnno3 = model.getValue("/root/main/curefood[" + i + "]/h_psnno3");
  835. var plceordexchbase = model.getValue("/root/main/curefood[" + i + "]/plceordexchbase");
  836. if ( (foodqty != hfoodqty) || (psnno1 != hpsnno1) || (psnno2 != hpsnno2) || (psnno3 != hpsnno3) ) {
  837. if ( psnno1 == "" ) { psnno1 = 0; }
  838. if ( psnno2 == "" ) { psnno2 = 0; }
  839. if ( psnno3 == "" ) { psnno3 = 0; }
  840. var totalqty = parseFloat(foodqty) * (parseInt(psnno1) + parseInt(psnno2) + parseInt(psnno3)) / parseFloat(plceordexchbase);
  841. totalqty = totalqty.toString().getRound(-2, "HALF_UP");
  842. model.setValue("/root/main/curefood[" + i + "]/totalqty", parseFloat(totalqty));
  843. model.setValue("/root/main/curefood[" + i + "]/h_foodqty", parseFloat(foodqty));
  844. model.setValue("/root/main/curefood[" + i + "]/h_psnno1", parseInt(psnno1));
  845. model.setValue("/root/main/curefood[" + i + "]/h_psnno2", parseInt(psnno2));
  846. model.setValue("/root/main/curefood[" + i + "]/h_psnno3", parseInt(psnno3));
  847. }
  848. }
  849. model.refresh();
  850. ]]>
  851. </script>
  852. </button>
  853. </case>
  854. </switch>
  855. </group>
  856. <group id="grp_btn" style="left:0px; top:757px; width:1195px; height:27px; ">
  857. <button id="btn_print" class="btn6_letter2" style="left:5px; top:5px; width:56px; height:22px; ">
  858. <caption>출력</caption>
  859. <script type="javascript" ev:event="DOMActivate">
  860. <![CDATA[
  861. var appdd = model.getValue("/root/send/searchitem/appdd");
  862. //var menu = model.getValue("/root/send/searchitem/menuflag");
  863. var menu = rdo_menuflag.label;
  864. var meal = cmb_mealflag.label;
  865. var yy = appdd.substr(0,4);
  866. var mm = appdd.substr(4,2);
  867. var dd = appdd.substr(6,2);
  868. var dw = getDateTime(appdd.toDate(), 'W');
  869. // if (menu=='Q1') {
  870. // menu = '일반식';
  871. // } else if (menu=='Q2') {
  872. // menu = '치료식';
  873. // }
  874. //식단별 탭화면일때
  875. if ( btn_dish.selected ) {
  876. if ( grd_gnrldish.rows-1 > 0 || grd_curedish.rows-2 > 0 ) {
  877. if ( messageBox(menu+" "+dd+"일 "+meal+" 입니다.", "Q003") == 6 ) {
  878. if ( grd_gnrldish.rows-1 > 0 ) { //일반식일 경우
  879. //분류항목 코드를 코드명으로 전환
  880. for ( i = 1; i < grd_gnrldish.rows; i++ ) {
  881. var dishtableflag = model.getValue("/root/main/gnrldish["+ i +"]/dishtableflag");
  882. var dishtablenm = model.getValue("/root/init/basecode/diettable/A0417[cdid='"+ dishtableflag +"']/cdnm");
  883. model.setValue("/root/main/gnrldish["+ i +"]/dishtablenm", dishtablenm);
  884. }
  885. model.makeNode("/root/main/gnrldish[1]/menu");
  886. model.setValue("/root/main/gnrldish[1]/menu", menu);
  887. //model.makeNode("/root/main/dish[1]/mealflag");
  888. model.setValue("/root/main/gnrldish[1]/mealflag", meal);
  889. //model.makeNode("/root/main/dish[1]/appdd");
  890. model.setValue("/root/main/gnrldish[1]/appdd", yy+"년 "+mm+"월 "+dd+"일 "+dw+"요일");
  891. exeReportPreview("RPANT01601", "XMLSTR", "/root/main/gnrldish");
  892. }
  893. else if ( grd_curedish.rows-2 > 0 ) { //치료식일 경우
  894. //분류항목 코드를 코드명으로 전환
  895. for ( i = 1; i < grd_curedish.rows-1; i++ ) {
  896. var dishtableflag = model.getValue("/root/main/curedish["+ i +"]/dishtableflag");
  897. var dishtablenm = model.getValue("/root/init/basecode/diettable/A0417[cdid='"+ dishtableflag +"']/cdnm");
  898. model.setValue("/root/main/curedish["+ i +"]/dishtablenm", dishtablenm);
  899. }
  900. model.makeNode("/root/main/curedish[1]/menu");
  901. model.setValue("/root/main/curedish[1]/menu", menu);
  902. model.setValue("/root/main/curedish[1]/mealflag", meal);
  903. model.setValue("/root/main/curedish[1]/appdd", yy+"년 "+mm+"월 "+dd+"일 "+dw+"요일");
  904. exeReportPreview("RPANT01603", "XMLSTR", "/root/main/curedish");
  905. }
  906. } else { return; }
  907. } else {
  908. messageBox("출력할 데이터가", "I004")
  909. return;
  910. }
  911. }
  912. //식품(재료)별 탭화면일때
  913. else if ( btn_food.selected ) {
  914. if ( grd_gnrlfood.rows-1 > 0 || grd_curefood.rows-2 > 0 ) {
  915. if ( messageBox(menu+" "+dd+"일 "+meal+" 입니다.", "Q003") == 6 ) {
  916. if ( grd_gnrlfood.rows-1 > 0 ) { //일반식일 경우
  917. model.makeNode("/root/main/gnrlfood[1]/menu");
  918. model.setValue("/root/main/gnrlfood[1]/menu", menu);
  919. //model.makeNode("/root/main/food[1]/mealflag");
  920. model.setValue("/root/main/gnrlfood[1]/mealflag", meal);
  921. //model.makeNode("/root/main/food[1]/appdd");
  922. model.setValue("/root/main/gnrlfood[1]/appdd", yy+"년 "+mm+"월 "+dd+"일 "+dw+"요일");
  923. exeReportPreview("RPANT01602", "XMLSTR", "/root/main/gnrlfood");
  924. }
  925. else if ( grd_curefood.rows-2 > 0 ) { //치료식일 경우
  926. model.makeNode("/root/main/curefood[1]/menu");
  927. model.setValue("/root/main/curefood[1]/menu", menu);
  928. model.setValue("/root/main/curefood[1]/mealflag", meal);
  929. model.setValue("/root/main/curefood[1]/appdd", yy+"년 "+mm+"월 "+dd+"일 "+dw+"요일");
  930. exeReportPreview("RPANT01604", "XMLSTR", "/root/main/curefood");
  931. }
  932. } else { return; }
  933. } else {
  934. messageBox("출력할 데이터가", "I004")
  935. return;
  936. }
  937. }
  938. ]]>
  939. </script>
  940. </button>
  941. <button id="btn_reset" class="btn4_letter3" style="left:1060px; top:5px; width:68px; height:22px; ">
  942. <caption>초기화</caption>
  943. <script type="javascript" ev:event="DOMActivate">
  944. <![CDATA[
  945. finit();
  946. ]]>
  947. </script>
  948. </button>
  949. <button id="btn_save" class="btn4_letter2" style="left:1133px; top:5px; width:56px; height:22px; ">
  950. <caption>저장</caption>
  951. <script type="javascript" ev:event="DOMActivate">
  952. <![CDATA[
  953. var appdd = model.getValue("/root/send/searchitem/appdd");
  954. var menu = rdo_menuflag.label;
  955. var meal = cmb_mealflag.label;
  956. var yy = appdd.substr(0,4);
  957. var mm = appdd.substr(4,2);
  958. var dd = appdd.substr(6,2);
  959. if ( grd_gnrldish.rows-1 > 0 || grd_curedish.rows-2 > 0 ) {
  960. //if ( messageBox("", "Q002") == 6 ) {
  961. if ( messageBox(menu+" "+mm+"월 "+dd+"일 "+meal+" 급식실천표를", "Q002") == 6 ) {
  962. var appdd = model.getValue("/root/send/searchitem/appdd");
  963. //일반식일 경우
  964. if ( model.getValue("/root/send/searchitem/menuflag")=='Q1' ) {
  965. //필수입력항목 체크
  966. for ( i=1; i<grd_gnrldish.rows; i++) {
  967. if ( (model.getValue("/root/main/gnrldish[" + i + "]/foodqty") == "") ||
  968. (model.getValue("/root/main/gnrldish[" + i + "]/psnno1") == "") ||
  969. (model.getValue("/root/main/gnrldish[" + i + "]/psnnor1") == "") ||
  970. (model.getValue("/root/main/gnrldish[" + i + "]/totalqty") == "") ) {
  971. messageBox("1인량,식수,발주량 항목은", "I003");
  972. return;
  973. }
  974. //저장할 날짜를 급식실천표일자로 setting
  975. model.setValue("/root/main/gnrldish[" + i + "]/appdd", appdd);
  976. }
  977. model.setValue("/root/send/req/dish", grd_gnrldish.getUpdateData());
  978. }
  979. //치료식일 경우
  980. else if ( model.getValue("/root/send/searchitem/menuflag")=='Q2' ) {
  981. //필수입력항목 체크
  982. for ( i=1; i<grd_curedish.rows-1; i++) {
  983. if ( (model.getValue("/root/main/curedish[" + i + "]/foodqty") == "") ||
  984. ( (model.getValue("/root/main/curedish[" + i + "]/psnno1") == "") &&
  985. (model.getValue("/root/main/curedish[" + i + "]/psnno2") == "") &&
  986. (model.getValue("/root/main/curedish[" + i + "]/psnno3") == "") ) ||
  987. ( (model.getValue("/root/main/curedish[" + i + "]/psnnor1") == "") &&
  988. (model.getValue("/root/main/curedish[" + i + "]/psnnor2") == "") &&
  989. (model.getValue("/root/main/curedish[" + i + "]/psnnor3") == "") ) ||
  990. (model.getValue("/root/main/curedish[" + i + "]/totalqty") == "") ) {
  991. messageBox("1인량,염분기준식수,발주량 항목은", "I003");
  992. return;
  993. }
  994. //저장할 날짜를 급식실천표일자로 setting
  995. model.setValue("/root/main/curedish[" + i + "]/appdd", appdd);
  996. }
  997. model.setValue("/root/send/req/dish", grd_curedish.getUpdateData());
  998. }
  999. // 데이터 존재여부 체크
  1000. submit("TRANT01602");
  1001. model.makeValue("/root/send/req/savemealflag", cmb_mealflag.value);
  1002. if ( model.getValue("/root/temp/ret/count") > 0 ) {
  1003. // messageBox(menu+" "+mm+"월 "+dd+"일 "+meal+" 급식실천표가 이미 존재하여 재저장", "E001");
  1004. // return;
  1005. if ( messageBox("데이터가 이미 존재합니다. 다시", "Q002") == 6 ) {
  1006. submit("TXANT01601");
  1007. btn_search.dispatch("DOMActivate"); //저장후 재조회
  1008. } else { return; }
  1009. } else {
  1010. submit("TXANT01601");
  1011. btn_search.dispatch("DOMActivate"); //저장후 재조회
  1012. }
  1013. } else { return; }
  1014. } else {
  1015. messageBox("저장할 데이터가", "I004");
  1016. return;
  1017. }
  1018. ]]>
  1019. </script>
  1020. </button>
  1021. </group>
  1022. </xhtml:body>
  1023. </xhtml:html>