123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>식품재고관리</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <foodlist>
- <item>
- <goodcd/>
- <goodnm/>
- <purcunit/>
- <junil/>
- <junilamt/>
- <receive/>
- <reunitcost/>
- <outgo/>
- <outunitcost/>
- <agomonqty/>
- <hyunqty/>
- <agoqty/>
- <agounitcost/>
- <hyunjae/>
- <hyunjaeamt/>
- <outgomon/>
- <rem/>
- <stockflag/>
- <iodd/>
- <pat_emp/>
- <magamflag/>
- <goodspec/>
- </item>
- </foodlist>
- </main>
- <send>
- <iodd/>
- <pat_emp>P</pat_emp>
- <req/>
- <stockflag>S</stockflag>
- <cnclflag/>
- <ricecd/>
- </send>
- <temp>
- <ret>
- <retmsg/>
- </ret>
- </temp>
- <init>
- <basecode>
- <meal>
- <A0055>
- <cdid/>
- <cdnm/>
- </A0055>
- </meal>
- <ward>
- <dept>
- <deptcd/>
- <depthngnm/>
- </dept>
- </ward>
- <aprvrslt>
- <A0433>
- <cdid/>
- <cdnm/>
- </A0433>
- </aprvrslt>
- </basecode>
- </init>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- finit();
-
- var auth_id = getUserInfo("userid");
- if ( auth_id == "99262" || auth_id == "99207" ) {
- btn_magam.visible = true; //마감버튼 보이도록
- btn_magamcncl.visible = true; //마감취소버튼 보이도록
- }else {
- btn_magam.visible = false; //마감버튼 안보이도록
- btn_magamcncl.visible = false; //마감취소버튼 안보이도록
- }
-
- // btn_search.disabled = !checkAuth("R");
- // btn_save.disabled = !checkAuth("X");
- // btn_aprv.disabled = !checkAuth("X");
- // btn_excel.disabled = !checkAuth("P");
- // btn_updtsum.disabled = !checkAuth("X");
- // model.setValue("/root/send/searchitem/instcd", getUserInfo("dutplceinstcd"));
- // model.setValue("/root/send/searchitem/userid", getUserInfo("userid"));
- //var posdeptcd = getUserInfo("posdeptcd"); //소속부서코드
- // var dutplcecd = getUserInfo("dutplcecd"); //소속부서코드
- ]]>
- </script>
- <script type="javascript">
- <![CDATA[
- function finit() {
- var instcd = getUserInfo("dutplceinstcd");
- // 화면open시 공통코드 setting
- //zbcfGetCodeList( new Array( "A0055", "A0433" ), new Array( "/root/init/basecode/meal", "/root/init/basecode/aprvrslt" ) );
- //zbcfGetDeptCodeList( instcd, 'orduseyn', 'W', '/root/init/basecode/ward');
- //zsdfGetWardDeptList(instcd, '/root/init/basecode/ward', 'depthngnm', 'asc', new Date().getDateFormat("YYYYMMDD"), 'after');
- model.setValue("/root/send/iodd", getCurrentDate());
- model.removeNodeset("/root/main/data");
-
- var userid = getUserInfo("userid");
- if(userid != "AST"){
- grd_data.colAttribute(10,"visibility") = "hidden";
- grd_data.colAttribute(11,"visibility") = "hidden";
- grd_data.colAttribute(12,"visibility") = "hidden";
- grd_data.rebuild();
- button1.visible = false;
- }
-
- model.refresh();
- }
-
- //전월 단가가 다르게 되면 전월재고량 부터 처리후 현재월 단가로 처리한다.
- function frealqtycalc() {
- var agomonqty = 0; //이월된재고량
- var hyunqty = 0; //
- var agoqty = 0; //
- var agounitcost = 0; //전월단가
- var outgo = 0; //출고량
- var outgomon = 0; //당월 출고량
- var realqty = 0; //이월된 재고량이 남은량
-
- for(var i = 1 ; i <= grd_data.rows-grd_data.fixedRows ; i++ ){
- agomonqty = model.getValue("/root/main/foodlist/item[" + i + "]/agomonqty");
- outgo = model.getValue("/root/main/foodlist/item[" + i + "]/outgo");
- outgomon = model.getValue("/root/main/foodlist/item[" + i + "]/outgomon");
- //var goodnm = model.getValue("/root/main/foodlist/item[" + i + "]/goodnm");
- //alert(goodnm + "=>"+outgo);
- //현재시점 전월재고
- realqty = agomonqty - outgomon;
-
- //현재시점 전월재고가 남아 있다면
- if(realqty > 0 ){
- //전월재고 보다 출고량이 작다면
- if(realqty > outgo){
- model.setValue("root/main/foodlist/item[" + i + "]/agoqty",outgo);
- model.setValue("root/main/foodlist/item[" + i + "]/hyunqty",0);
- }else {
- model.setValue("root/main/foodlist/item[" + i + "]/agoqty",realqty);
- model.setValue("root/main/foodlist/item[" + i + "]/hyunqty",outgo - realqty);
- }
- }else{
- model.setValue("root/main/foodlist/item[" + i + "]/agoqty",0);
- model.setValue("root/main/foodlist/item[" + i + "]/hyunqty",outgo);
- }
- }
-
- model.refresh();
- }
-
- ]]>
- </script>
- <submission id="TRZBC00101"/>
- <submission id="TRANB00800" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/foodlist"/>
- <submission id="TXANB00801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/hidden"/>
- <submission id="TXANB00802" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/hidden"/>
- <submission id="TXANB00803" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/hidden"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
- <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
- <script type="javascript" src="../../../ast/commonweb/js/AST.js"/>
- </xhtml:head>
- <xhtml:body guideline="1,1194;2,755;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
- <caption id="caption1" class="tit_1" style="left:0px; top:0px; width:189px; height:14px; ">
- <![CDATA[식품재고관리]]>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- frealqtycalc();
- ]]>
- </script>
- </caption>
- </group>
- <group id="group3" scroll="auto" style="left:0px; top:13px; width:1195px; height:744px; ">
- <group id="group2" style="left:0px; top:10px; width:1194px; height:35px; vertical-align:top; ">
- <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1194px; height:35px; background-color:#fffbf2; "/>
- <button id="btn_search" class="btn1_letter2" style="left:1122px; top:7px; width:56px; height:22px; ">
- <caption>조회</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if (submit("TRANB00800")) {
- if(model.getValue("/root/main/foodlist/item[1]/stockflag") == "I" ){
- for(var i = 1 ; i <= grd_data.rows ; i++ ){
- grd_data.addStatus( i ,"insert");
- }
- }
-
- // 2011.04.22 식품재고 조회시 마감여부 파악해서 버튼 활성화해주기. - cyw
- if(model.getValue("/root/main/foodlist/item[1]/magamflag") == "Y" ){
- btn_magamcncl.disabled = false;
- btn_magam.disabled = true;
- }else if(model.getValue("/root/main/foodlist/item[1]/magamflag") == "N" ){
- btn_magamcncl.disabled = true;
- btn_magam.disabled = false;
- }else{
- btn_magamcncl.disabled = true;
- btn_magam.disabled = true;
- }
- model.setValue("/root/send/ricecd","");
- model.refresh();
- }
- ]]>
- </script>
- </button>
- <line id="line13" style="x1:1106px; y1:7px; x2:1106px; y2:29px; "/>
- <caption id="caption3" class="search_name" style="left:11px; top:8px; width:86px; height:17px; ">재고일자 :</caption>
- <input id="ipt_reqfromdd" ref="/root/send/iodd" class="input_s_essential" inputtype="date" style="left:105px; top:7px; width:90px; height:19px; "/>
- <caption id="caption4" class="search_name" style="left:291px; top:8px; width:64px; height:17px; ">구분 :</caption>
- <select1 id="rdo_diet" ref="/root/send/pat_emp" class="radio_search" appearance="full" cellspacing="2" cols="4" rows="1" overflow="visible" style="left:351px; top:8px; width:134px; height:19px; ">
- <choices>
- <item>
- <label>환자식</label>
- <value>P</value>
- </item>
- <item>
- <label>직원식</label>
- <value>E</value>
- </item>
- </choices>
- </select1>
- <button id="button1" visibility="hidden" style="left:845px; top:5px; width:100px; height:20px; ">
- <caption>button1</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- frealqtycalc();
- ]]>
- </script>
- </button>
- </group>
- <line id="line1" class="line_1" style="x1:0px; y1:70px; x2:1194px; y2:70px; "/>
- <button id="btn_excel" class="btn2_letter2" style="left:1145px; top:49px; width:42px; height:19px; ">
- <caption>엑셀</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var filename = window.fileDialog("save", ",", false, "식품재고관리", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (filename != "") {
- grd_data.saveExcel(filename, "grd_data", true, false, "", "", "");
- }
- ]]>
- </script>
- </button>
- </group>
- <datagrid id="grd_data" nodeset="/root/main/foodlist/item" caption="식품코드^식품명^단위^전일재고^전일재고^입고량^입고량^출고량^출고량^출고단가계산^출고단가계산^출고단가계산^전월단가^현재고량^현재고량^당월출고량^비고^마감^입출고일자^환자직원식^선택^h_등록번호^병동^병실^환자명^처방일자^끼니^수정전^특이사항^수정후^수정요청시간^요청구분^요청횟수^요청자^처리결과^처리담당자^처리시간^보호자식구분^요청취소|식품코드^식품명^단위^총재고^총금액^입고^입고단가^출고^출고단가^전월재고량^당월처리량^전월처리량^전월단가^현재고^현재고금액^당월출고량^비고^마감^입출고일자^환자직원식^선택^h_등록번호^병동^병실^환자명^처방일자^끼니^수정전^특이사항^수정후^수정요청시간^요청구분^요청횟수^요청자^처리결과^처리담당자^처리시간^보호자식구분^요청취소^규격" colsep="^" colwidth="75, 140, 30, 75, 75, 75, 75, 75, 75, 65, 65, 65, 65, 75, 75, 75, 170, 100, 100, 100,100" dataheight="25" explorerbar="sort" mergecellsfixedrows="bycolrec" rowheader="update" rowsep="|" style="left:0px; top:88px; width:1194px; height:665px; text-align:center; ">
- <col ref="goodcd"/>
- <col ref="goodnm" style="text-align:left; "/>
- <col ref="purcunit" style="text-align:right; "/>
- <col ref="junil" style="text-align:right; "/>
- <col ref="junilamt" style="text-align:right; "/>
- <col ref="receive" style="text-align:right; "/>
- <col ref="reunitcost" format="#,##0" style="text-align:right; "/>
- <col ref="outgo" type="input" style="text-align:right; "/>
- <col ref="outunitcost" format="#,##0.#" style="text-align:right; "/>
- <col ref="agomonqty" visibility="visible"/>
- <col ref="hyunqty" visibility="visible"/>
- <col ref="agoqty" visibility="visible"/>
- <col ref="agounitcost" visibility="visible"/>
- <col ref="hyunjae" style="text-align:right; "/>
- <col ref="hyunjaeamt" style="text-align:right; "/>
- <col ref="outgomon" style="text-align:right; "/>
- <col ref="rem" type="input" style="text-align:left; "/>
- <col ref="stockflag" visibility="hidden"/>
- <col ref="iodd" visibility="hidden"/>
- <col ref="pat_emp" visibility="hidden"/>
- <col ref="goodspec" visibility="visible"/>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- //
- // for( var i = 0 ; i < grd_data.selectedRows ; i++ ){
- // if(grd_data.col == grd_data.colRef("reunitcost") || grd_data.col == grd_data.colRef("outunitcost") ){
- // var goodcd = grd_data.valueMatrix(grd_data.row, grd_data.colRef("goodcd"));
- // var outunitcost = grd_data.valueMatrix(grd_data.row, grd_data.colRef("outunitcost"));
- // if (goodcd == "S01101000"){
- // alert("수정가능");
- // }else{
- // messageBox("백미 이외의 식품코드는 수정할 수", "I004", "");
- // if(model.getValue("/root/main/prprtystoc/prprtystoclist[" + grd_prprtystoclist.selectedRow(i) + "]/status") == "1" || model.getValue("/root/main/prprtystoc/prprtystoclist[" + grd_prprtystoclist.selectedRow(i) + "]/status") == "5"){
- // grd_data.row
- // return;
- // model.setValue(
- // }
- // }
- ]]>
- </script>
- </datagrid>
- <group id="group4" scroll="auto" style="left:0px; top:757px; width:1195px; height:27px; ">
- <button id="btn_save" class="btn4_letter2" style="left:1077px; top:3px; width:56px; height:22px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if(model.getValue("/root/main/foodlist/item[1]/magamflag") == "S" ){
- messageBox("마감데이터는 수정할수 없습니다.", "I");
- }else{
- if ( messageBox("식품재고정보를", "Q002") == 6 ) {
- //재계산
- frealqtycalc();
- var update = getGridUpdateData(grd_data);
- if (update == "" ) {
- messageBox("업데이트 정보가 없습니다.", "I");
- }
- else {
- model.setValue("/root/send/cnclflag", "S");
- model.setValue("/root/send/req", update);
- submit("TXANB00801");
- btn_search.dispatch("DOMActivate");
- }
- }
- }
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_magam" class="btn4_letter2" style="left:939px; top:3px; width:56px; height:22px; ">
- <caption>마감</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if(model.getValue("/root/main/foodlist/item[1]/stockflag") == "S" ){
- if ( messageBox("마감을", "Q002") == 6 ) {
- model.setValue("/root/send/cnclflag", "N");
- model.setValue("/root/send/stockflag", "S");
- if(submit("TXANB00802")){
- btn_search.dispatch("DOMActivate");
- }
- }
-
- }else{
- messageBox("출고되지 않은 데이터는 마감할수 없습니다.", "I");
- }
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_magamcncl" class="btn4_letter4" style="left:996px; top:3px; width:80px; height:22px; ">
- <caption>마감취소</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // 2011.04.18 cyw 마감취소기능 추가.
- if(model.getValue("/root/main/foodlist/item[1]/stockflag") == "S" ){
- if ( messageBox("마감취소를", "Q002") == 6 ) {
- model.setValue("/root/send/cnclflag", "Y");
- model.setValue("root/send/stockflag", "S");
- if(submit("TXANB00802")){
- btn_search.dispatch("DOMActivate");
- }
- }
-
- }else{
- messageBox("출고되지 않은 데이터는 마감할수 없습니다.", "I");
- }
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="btn_del" class="btn4_letter2" style="left:1134px; top:3px; width:56px; height:22px; ">
- <caption>삭제</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if(model.getValue("/root/main/foodlist/item[1]/magamflag") == "Y" ){
- messageBox("마감취소 후에 삭제 가능합니다.", "I");
- }else{
- var siodd = model.getValue("/root/main/foodlist/item[1]/iodd");
- var spat_emp = model.getValue("/root/main/foodlist/item[1]/pat_emp");
-
- model.setValue("/root/send/iodd", siodd );
- model.setValue("/root/send/pat_emp", spat_emp);
-
- if (siodd == "" || spat_emp == ""){
- messageBox("삭제할 리스트를 다시 조회하세요.","I");
- return;
- }
-
- for(var i = 1 ; i <= grd_data.rows ; i++ ){
- grd_data.addStatus( i,"delete");
- }
- var update = getGridUpdateData(grd_data);
- if (update == "" ) {
- messageBox("업데이트 정보가 없습니다.", "I");
- }
- else {
- model.setValue("/root/send/cnclflag", "S");
- model.setValue("/root/send/req", update);
- submit("TXANB00801");
- messageBox(siodd +"일 재고 삭제가", "I001")
- btn_search.dispatch("DOMActivate");
- }
- }
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="button3" class="btn6_letter2" style="left:0px; top:3px; width:56px; height:22px; ">
- <caption>재고</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // 2011.09.14_By 김금련 재고목록 출력기능 추가.
- model.removenode("/root/rexprnt/foodlist");
-
- model.makeValue("/root/rexprnt/foodlist/iodd", ipt_reqfromdd.label );
- model.makeValue("/root/rexprnt/foodlist/patemp", rdo_diet.label );
-
- var cnt = getNodesetCount("/root/main/foodlist/item");
- for( var i = 1; i <= cnt ; i++ ){
- model.makeNode("/root/rexprnt/foodlist");
- model.makeNode("/root/rexprnt/foodlist/item[" + i + "]");
- model.copyNode("/root/rexprnt/foodlist/item[" + i + "]", "/root/main/foodlist/item[" + i + "]");
- if( i % 3 == 0 ){
- model.makeValue("/root/rexprnt/foodlist/item[" + i + "]/styleflag", "Y");
- }else{
- model.makeValue("/root/rexprnt/foodlist/item[" + i + "]/styleflag", "N");
- }
- }
- exeReportPreview("RPANB00801", "XMLSTR" , "" , "" , "false" , "", "", "", "", "false");
- model.refresh();
- ]]>
- </script>
- </button>
- <button id="button2" class="btn6_letter3" style="left:57px; top:3px; width:68px; height:22px; ">
- <caption>입·출고</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
-
- // 2011.04.18 cyw 출력기능 추가.
- model.removenode("/root/rexprnt/foodlist");
-
- model.makeValue("/root/rexprnt/foodlist/iodd", ipt_reqfromdd.label );
- model.makeValue("/root/rexprnt/foodlist/patemp", rdo_diet.label );
-
- var cnt = getNodesetCount("/root/main/foodlist/item");
- for( var i = 1; i <= cnt ; i++ ){
- model.makeNode("/root/rexprnt/foodlist");
- model.makeNode("/root/rexprnt/foodlist/item[" + i + "]");
- model.copyNode("/root/rexprnt/foodlist/item[" + i + "]", "/root/main/foodlist/item[" + i + "]");
- if( i % 3 == 0 ){
- model.makeValue("/root/rexprnt/foodlist/item[" + i + "]/styleflag", "Y");
- }else{
- model.makeValue("/root/rexprnt/foodlist/item[" + i + "]/styleflag", "N");
- }
- }
- exeReportPreview("RPANB00802", "XMLSTR" , "" , "" , "false" , "", "", "", "", "false");
- model.refresh();
- ]]>
- </script>
- </button>
- <input id="ipt_ricecd" ref="/root/send/ricecd" format="#,##0.0" style="left:756px; top:2px; width:105px; height:19px; "/>
- <button id="btn_rice" class="btn2_letter4" style="left:866px; top:2px; width:42px; height:19px; ">
- <caption>일괄적용</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var ricecd = model.getValue("/root/send/ricecd");
- if(ricecd != ""){
- var btnchk = messageBox("변경된 백미단가를 일괄", "Q009", "");
- if(btnchk == "6"){
- if(model.getValue("/root/main/foodlist/item[1]/magamflag") == "S" ){
- messageBox("마감데이터는 수정할수 없습니다.", "I");
- }else{
- submit("TXANB00803");
- }
- }else{
- return;
- }
- // for(var i = 1; i < grd_data.rows ; i++ ){
- // var goodcd = model.getValue("/root/main/foodlist/item[" + i + "]/goodcd");
- // if(goodcd == "S01101000"){
- // model.setValue("/root/main/foodlist/item[" + i + "]/reunitcost",ricecd);
- // model.setValue("/root/main/foodlist/item[" + i + "]/outunitcost",ricecd);
- // grd_data.addStatus( i+1 ,"update");
- // //재계산
- // frealqtycalc();
- // }
- // }
- }else{
- messageBox("변경된 백미단가를", "C001", "");
- model.setFocus("ipt_ricecd");
- }
- model.refresh();
- ]]>
- </script>
- </button>
- </group>
- </xhtml:body>
- </xhtml:html>
|