123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SMRSM00400" position="absolute 0 0 1199 786" titletext="특별관리물질취급일지 입력" oninit="SMRSM00400_oninit" onload="SMRSM00400_onload">
- <Layouts>
- <Layout>
- <Static id="caption6" text="특별관리물질취급일지(본원)" class="tit_1" position="absolute 0 0 206 25"/>
- <Shape id="line2" class="line_6" position="absolute 0 48 1194 54" anchor="left top right"/>
- <Button id="btn_prt" taborder="1" text="출력" class="btn6" position="absolute 0 27 56 49" onclick="btn_prt_onclick"/>
- <Button id="btn_save" taborder="2" text="저장" class="btn4" position="absolute 972 27 1028 49" anchor="top right" onclick="btn_save_onclick"/>
- <Button id="btn_cnfm" taborder="3" text="확정처리" class="btn4" position="absolute 1031 27 1111 49" anchor="top right" onclick="btn_cnfm_onclick"/>
- <Button id="btn_cancel" taborder="4" text="확정취소" class="btn4" enable="false" position="absolute 1114 27 1194 49" anchor="top right" onclick="btn_cancel_onclick"/>
- <Div id="grp_sea" taborder="5" class="div_SA2" position="absolute 0 52 1194 92" anchor="left top right">
- <Layouts>
- <Layout>
- <Shape id="line5" linetype="vertical" class="line_4" position="absolute 1021 9 1027 31" anchor="top right"/>
- <Button id="btn_search" taborder="14" text="조회" class="btn1" position="absolute 1040 10 1096 32" anchor="top right" onclick="grp_sea_btn_search_onclick"/>
- <Edit id="opt_deptnm" taborder="15" readonly="true" class="output" position="absolute 230 11 410 30"/>
- <Static id="caption1" text="부서코드" class="search_name" position="absolute 50 12 126 29"/>
- <Edit id="ipt_deptcd" taborder="16" autoselect="true" autoskip="true" class="input_default" position="absolute 131 11 206 30" onkeydown="grp_sea_ipt_deptcd_onkeydown"/>
- <Button id="btn_deptcd" taborder="17" class="icon_search" position="absolute 210 12 226 28" onclick="grp_sea_btn_deptcd_onclick"/>
- <Static id="caption9" text="입력년월" class="search_name" position="absolute 835 12 911 29"/>
- <Calendar id="ipt_ym" taborder="18" autoselect="true" autoskip="true" dateformat="yyyy-MM" editformat="yyyy-MM" class="input_default" position="absolute 915 11 991 30" mask="yyyy-mm" onchanged="grp_sea_ipt_ym_onchanged"/>
- <Edit id="opt_matrnm" taborder="19" readonly="true" class="output" position="absolute 578 11 810 30"/>
- <Button id="btn_matrcd" taborder="20" class="icon_search" position="absolute 559 12 575 28" onclick="grp_sea_btn_matrcd_onclick"/>
- <Edit id="ipt_matrcd" taborder="21" autoselect="true" autoskip="true" class="input_default" position="absolute 510 11 555 30"/>
- <Static id="caption7" text="물질코드" class="search_name" position="absolute 432 12 508 29"/>
- </Layout>
- </Layouts>
- </Div>
- <Static id="caption21" text="취급일지" class="tit_2" position="absolute 0 101 131 123"/>
- <Shape id="line3" class="line_10" position="absolute 0 117 1193 123" anchor="left top right"/>
- <Grid id="grd_matrlist" taborder="6" binddataset="ds_main_matrlist" autoenter="select" useinputpanel="false" cellsizingtype="col" position="absolute 0 122 1193 684" anchor="all" onkeyup="grd_matrlist_onkeyup" oncellclick="grd_matrlist_oncellclick">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="25" band="left"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="90"/>
- <Column size="80"/>
- <Column size="140"/>
- <Column size="80"/>
- <Column size="140"/>
- <Column size="250"/>
- <Column size="230"/>
- <Column size="77"/>
- <Column size="77"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell/>
- <Cell col="1" text="부서코드"/>
- <Cell col="2" text="물질코드"/>
- <Cell col="3" text="일자"/>
- <Cell col="4" text="*입고량"/>
- <Cell col="5" displaytype="normal" edittype="none" text="*사용량(개)"/>
- <Cell col="6" text="*반납량"/>
- <Cell col="7" text="*재고량"/>
- <Cell col="8" text="*작업내용(취급용도)"/>
- <Cell col="9" text="*비고(특이사항)"/>
- <Cell col="10" text="작성자"/>
- <Cell col="11" text="확인자"/>
- <Cell col="12" text="작성자id"/>
- <Cell col="13" text="전월재고"/>
- <Cell col="14" text="전일재고"/>
- <Cell col="15" text="예외"/>
- <Cell col="16" text="구분"/>
- </Band>
- <Band id="body">
- <Cell celltype="head"/>
- <Cell col="1" class="text_center" text="bind:deptcd"/>
- <Cell col="2" class="text_center" text="bind:matrcd"/>
- <Cell col="3" displaytype="date" class="text_center" text="bind:usedd" editautoselect="true" calendardisplaynulltype="nulltext"/>
- <Cell col="4" displaytype="number" edittype="none" style="align:center;" class="text_center" text="bind:winqty" mask="#,##0" editautoselect="false" editdisplay="edit" tooltiptype="mouse" tooltiptext="처음 수령한 수량"/>
- <Cell col="5" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:useqty" editautoselect="true" calendardisplaynulltype="none" tooltiptype="mouse" tooltiptext="부서 사용 수량"/>
- <Cell col="6" displaytype="number" edittype="none" style="align:center;" text="bind:restocqty" mask="#,##0" editdisplay="edit" tooltiptype="mouse" tooltiptext="병리과 등으로 반납한 수량"/>
- <Cell col="7" displaytype="text" edittype="none" style="align:center;" class="text_center" text="bind:stocqty" editautoselect="false" editdisplay="display" tooltiptype="mouse" tooltiptext="부서에 남아있는 수량"/>
- <Cell col="8" displaytype="text" edittype="text" style="align:left top;padding:5 2 1 2;" class="text_left" text="bind:workcnts" wordwrap="word" editautoselect="true" tooltiptext="bind:workcnts"/>
- <Cell col="9" displaytype="text" edittype="text" style="align:left top;" text="bind:cmt" tooltiptext="bind:cmt"/>
- <Cell col="10" class="text_center" text="bind:writnm" editautoselect="true"/>
- <Cell col="11" class="text_center" text="bind:cnfmnm" editautoselect="true"/>
- <Cell col="12" text="bind:writid"/>
- <Cell col="13" text="bind:bfstocqty"/>
- <Cell col="14" text="bind:bfddstocqty"/>
- <Cell col="15" text="bind:exqty"/>
- <Cell col="16" text="bind:gubun"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Button id="btn_rowdelete" taborder="7" text="행삭제" class="btn2" position="absolute 961 98 1014 117" anchor="top right" onclick="btn_rowdelete_onclick" visible="false"/>
- <Button id="btn_excel" taborder="8" text="엑셀출력" class="btn7" position="absolute 1113 98 1193 117" anchor="top right" onclick="btn_excel_onclick"/>
- <Static id="caption3" text="※ 1. 화학물질별 월별 확정처리 이후에는 데이터 수정이 불가하며, 출력은 확정처리 이후에 가능합니다." position="absolute 0 686 737 706" anchor="left bottom"/>
- <Static id="caption2" text="2. 입고량 : 처음 수령한 수량/ 사용량 : 부서 사용 수량/ 반납량 : 병리과 등으로 반납한 수량/ 재고량 : 부서에 남아있는 수량" position="absolute 16 706 768 726" anchor="left bottom"/>
- <Static id="caption5" text="4. 확정처리 이후 자료를 수정하기 위해 확정취소를 원하시는 경우에는 화학물질 담당자에게 연락주시기 바랍니다." position="absolute 16 743 724 763" anchor="left bottom"/>
- <Static id="caption8" text="5. 본인이 작성한 자료에 한해 수정 및 삭제가 가능합니다. " position="absolute 16 762 632 782" anchor="left bottom" style="color:#ff0000ff;"/>
- <Static id="caption00" text="3. 비고(특이사항) : 취급일지 작성시 취급상 문제점, 특이사항 발생시 처리내역 등을 기록 " position="absolute 16 724 724 744" anchor="left bottom"/>
- <Button id="btn_cal" taborder="9" text="계 산" class="btn5" position="absolute 1057 98 1110 117" anchor="top right" visible="false" onclick="btn_cal_onclick"/>
- <Static id="st_msg" text="사용량을 빠짐없이 입력하시고 계산버튼을 클릭하여 재고량을 계산 후 저장가능합니다." position="absolute 87 95 628 115" style="background:oldlace;color:hotpink;align:center;font:돋움,9,bold;" visible="false"/>
- <Grid id="grd_matrlist_before" taborder="10" binddataset="ds_main_matrlist" autoenter="select" useinputpanel="false" cellsizingtype="col" position="absolute 0 122 1193 684" anchor="all" visible="false">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="25" band="left"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="99"/>
- <Column size="85"/>
- <Column size="85"/>
- <Column size="85"/>
- <Column size="85"/>
- <Column size="270"/>
- <Column size="270"/>
- <Column size="77"/>
- <Column size="77"/>
- <Column size="0"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell/>
- <Cell col="1" text="부서코드"/>
- <Cell col="2" text="물질코드"/>
- <Cell col="3" text="일자"/>
- <Cell col="4" text="*입고량"/>
- <Cell col="5" displaytype="normal" edittype="none" text="*사용량"/>
- <Cell col="6" text="*반납량"/>
- <Cell col="7" text="*재고량"/>
- <Cell col="8" text="*작업내용(취급용도)"/>
- <Cell col="9" text="*비고(특이사항)"/>
- <Cell col="10" text="작성자"/>
- <Cell col="11" text="확인자"/>
- <Cell col="12" text="작성자id"/>
- </Band>
- <Band id="body">
- <Cell celltype="head"/>
- <Cell col="1" class="text_center" text="bind:deptcd"/>
- <Cell col="2" class="text_center" text="bind:matrcd"/>
- <Cell col="3" displaytype="date" class="text_center" text="bind:usedd" editautoselect="true" calendardisplaynulltype="nulltext"/>
- <Cell col="4" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:winqty" editautoselect="true" tooltiptype="mouse" tooltiptext="처음 수령한 수량"/>
- <Cell col="5" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:useqty" editautoselect="true" tooltiptype="mouse" tooltiptext="부서 사용 수량"/>
- <Cell col="6" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:restocqty" tooltiptype="mouse" tooltiptext="병리과 등으로 반납한 수량"/>
- <Cell col="7" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:stocqty" editautoselect="true" tooltiptype="mouse" tooltiptext="부서에 남아있는 수량"/>
- <Cell col="8" displaytype="text" edittype="text" style="align:left top;padding:5 2 1 2;" class="text_left" text="bind:workcnts" wordwrap="word" editautoselect="true"/>
- <Cell col="9" displaytype="text" edittype="text" style="align:left top;" text="bind:cmt"/>
- <Cell col="10" class="text_center" text="bind:writnm" editautoselect="true"/>
- <Cell col="11" class="text_center" text="bind:cnfmnm" editautoselect="true"/>
- <Cell col="12" text="bind:writid"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Static id="st_msg01" text="★ 전산문의 : T.4206" position="absolute 207 0 354 25" style="background:#edffceff;border:1 solid #808080ff ;color:midnightblue;align:center;font:돋움,9,bold;"/>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_main_condition" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_main_condition_oncolumnchanged">
- <ColumnInfo>
- <Column id="deptcd" type="STRING" size="256"/>
- <Column id="deptnm" type="STRING" size="256"/>
- <Column id="matrcd" type="STRING" size="256"/>
- <Column id="matrnm" type="STRING" size="256"/>
- <Column id="ym" type="STRING" size="256"/>
- <Column id="popflag" type="STRING" size="256"/>
- <Column id="confirmflag" type="STRING" size="256"/>
- <Column id="gubun" type="STRING" size="256"/>
- <Column id="chk" type="STRING" size="256"/>
- <Column id="ymchk" type="STRING" size="256"/>
- <Column id="lastindex" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row>
- <Col id="deptcd"/>
- <Col id="deptnm"/>
- <Col id="matrcd"/>
- <Col id="matrnm"/>
- <Col id="ym"/>
- <Col id="popflag"/>
- <Col id="confirmflag"/>
- </Row>
- </Rows>
- </Dataset>
- <Dataset id="ds_main_matrlist" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_main_matrlist_oncolumnchanged">
- <ColumnInfo>
- <Column id="deptcd" type="STRING" size="256" sumtext="부서코드"/>
- <Column id="deptnm" type="STRING" size="256" sumtext="부서명"/>
- <Column id="matrcd" type="STRING" size="256" sumtext="물질코드"/>
- <Column id="matrnm" type="STRING" size="256" sumtext="물질명"/>
- <Column id="usedd" type="STRING" size="256" sumtext="사용일자"/>
- <Column id="origusedd" type="STRING" size="256" sumtext="원사용일자"/>
- <Column id="winqty" type="STRING" size="256" sumtext="입고량"/>
- <Column id="useqty" type="STRING" size="256" sumtext="사용량"/>
- <Column id="stocqty" type="STRING" size="256" sumtext="재고량"/>
- <Column id="workcnts" type="STRING" size="256" sumtext="작업내용(취급용도)"/>
- <Column id="writid" type="STRING" size="256" sumtext="작성자id"/>
- <!-- column id="cnfmyn" type="cdata" desc="확정여부" ref="matrlist.cnfmyn"/ -->
- <Column id="writnm" type="STRING" size="256" sumtext="작성자명"/>
- <Column id="cnfmnm" type="STRING" size="256" sumtext="확정자명"/>
- <Column id="restocqty" type="STRING" size="256" sumtext="반납량"/>
- <Column id="cmt" type="STRING" size="256"/>
- <Column id="bfstocqty" type="STRING" size="256" sumtext="전월재고"/>
- <Column id="bfddstocqty" type="STRING" size="256" sumtext="전일재고"/>
- <Column id="exqty" type="STRING" size="256" sumtext="예외"/>
- <Column id="gubun" type="STRING" size="256" sumtext="구분"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="instcd" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row/>
- </Rows>
- </Dataset>
- <Dataset id="ds_init_prvg" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="cnt" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_popmatr" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="matrcd" type="STRING" size="256"/>
- <Column id="matrnm" type="STRING" size="256"/>
- <Column id="deptcd" type="STRING" size="256"/>
- <Column id="returntype" type="STRING" size="256"/>
- <Column id="selectyn" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row>
- <Col id="matrcd"/>
- <Col id="matrnm"/>
- <Col id="deptcd"/>
- <Col id="returntype"/>
- <Col id="selectyn"/>
- </Row>
- </Rows>
- </Dataset>
- <Dataset id="ds_main_prntlist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="usedd" type="STRING" size="256" sumtext="사용일자"/>
- <Column id="winqty" type="STRING" size="256" sumtext="입고량"/>
- <Column id="useqty" type="STRING" size="256" sumtext="사용량"/>
- <Column id="stocqty" type="STRING" size="256" sumtext="재고량"/>
- <Column id="workcnts" type="STRING" size="256" sumtext="작업내용(취급용도)"/>
- <Column id="writid" type="STRING" size="256" sumtext="작성자id"/>
- <Column id="writnm" type="STRING" size="256" sumtext="작성자명"/>
- <Column id="cnfmnm" type="STRING" size="256" sumtext="확정자명"/>
- <Column id="lastday" type="STRING" size="256" sumtext="월말일"/>
- <Column id="restocqty" type="STRING" size="256"/>
- <Column id="cmt" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_matrgood" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="goodcd" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row/>
- </Rows>
- </Dataset>
- </Objects>
- <Bind>
- <BindItem id="item0" compid="grp_sea.ipt_deptcd" propid="value" datasetid="ds_main_condition" columnid="deptcd"/>
- <BindItem id="item1" compid="grp_sea.opt_deptnm" propid="value" datasetid="ds_main_condition" columnid="deptnm"/>
- <BindItem id="item2" compid="grp_sea.ipt_matrcd" propid="value" datasetid="ds_main_condition" columnid="matrcd"/>
- <BindItem id="item3" compid="grp_sea.opt_matrnm" propid="value" datasetid="ds_main_condition" columnid="matrnm"/>
- <BindItem id="item4" compid="grp_sea.ipt_ym" propid="value" datasetid="ds_main_condition" columnid="ym"/>
- </Bind>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name :
- * Job Name :
- * Creator :
- * Make Date : 2017-06-19
- * Description :
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- * 2017-06-19 Live Converter TF->XP
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- include "com_commonxp::comm_main.xjs";
- include "mis_miscommonxp::MIS.xjs";
- function SMRSM00400_oninit(obj:Form, e:InitEventInfo)
- {
- frmf_initForm(obj);
- }
- function SMRSM00400_onload(obj:Form, e:LoadEventInfo)
- {
- //grdf_initGrid(grd_matrlist);
-
- var instcd = sysf_getUserInfo("dutplceinstcd");
- if(instcd == "031"){
- grdf_setRowTypeIcon(grd_matrlist, 0);
- fOpenForm();
- }else{
- sysf_messageBox("사용권한이 없습니다.", "E999", "");
- btn_save.enable = false;
- btn_cnfm.enable = false;
- grp_sea.btn_search.enable = false;
- }
- }
- function fOpenForm()
- {
- misfGridInit(grd_matrlist);
-
- var oParam = {};
- oParam.id = "TRRSM00403";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqGetMatrMngtPrvg";
- oParam.inds = "req=ds_send";
- oParam.outds = "ds_init_prvg=matrlist";
- oParam.async = false;
- oParam.callback = "cf_TRRSM00403";
- tranf_submit(oParam);
-
- try
- {
- ds_main_condition.copyData(arg_ds_main_condition);
- }
- catch(e)
- {
- }
-
- if(ds_main_condition.getColumn(0, "popflag") == "Y")
- {
- fGetMatrList();
- }
- else
- {
- ds_main_condition.setColumn(0, "ym", String(utlf_getCurrentDate()).substr(0,6));
- }
- }
- function cf_TRRSM00403(sSvcId, nErrorCode, sErrorMsg)
- {
- if(nErrorCode < 0)
- {
- return;
- }
- else
- {
- if( ds_init_prvg.getColumn(0, "cnt") == "1" )
- {
- btn_cancel.enable = true;
- }
- }
- }
- function fGetMatrList()
- {
- grp_sea.ipt_deptcd.value = grp_sea.ipt_deptcd.value.getTrim();
- grp_sea.ipt_matrcd.value = grp_sea.ipt_matrcd.value.getTrim();
-
- if(utlf_isNull(grp_sea.ipt_deptcd.value))
- {
- sysf_messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
- grp_sea.ipt_deptcd.setFocus();
- return;
- }
-
- if(utlf_isNull(grp_sea.ipt_matrcd.value))
- {
- sysf_messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
- grp_sea.ipt_matrcd.setFocus();
- return;
- }
-
- if(String(ds_main_condition.getColumn(0, "ym")).length != 6 )
- {
- sysf_messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
- grp_sea.ipt_ym.setFocus();
- return;
- }
-
- var tmpym = ds_main_condition.getColumn(0,"ym");
- if(tmpym > "201911"){
- ds_main_condition.setColumn(0,"ymchk","A"); //12월이후
- }else{
- ds_main_condition.setColumn(0,"ymchk","B"); //12월이전
- }
-
- //특별관리 물질코드여부 조회
- var oParam = {};
- oParam.id = "TRRSM00404";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqGetSpMatrFlag";
- oParam.inds = "req=ds_main_condition";
- oParam.outds = "ds_matrgood=matrflag";
- oParam.async = false;
- //oParam.callback = "cf_TRRSM00404";
- tranf_submit(oParam);
-
- ds_main_condition.setColumn(0,"chk",""); //초기화
-
- var flag = ds_matrgood.getColumn(0,"goodcd");
- var ymchk = ds_main_condition.getColumn(0,"ymchk");
-
- if(!utlf_isNull(flag)){
- ds_main_condition.setColumn(0,"gubun","S"); //특별관리되는 물질
- if(ymchk == "A"){
- btn_cal.visible = true; //계산버튼
- st_msg.visible = true;
- grd_matrlist_before.visible = false;
- grd_matrlist.visible = true;
- }else{
- btn_cal.visible = false; //계산버튼
- st_msg.visible = false;
- grd_matrlist_before.visible = true;
- grd_matrlist.visible = false;
- }
- }else{
- ds_main_condition.setColumn(0,"gubun","N"); //일반물질
- grd_matrlist_before.visible = true;
- grd_matrlist.visible = false;
- if(ymchk == "B"){
- btn_cal.visible = false; //계산버튼
- st_msg.visible = false;
- }
- }
-
- //조회 로직
- var oParam1 = {};
- oParam1.id = "TRRSM00401";
- oParam1.service = "purcbaseapp.PurcBaseMngt";
- oParam1.method = "reqGetMatrUseList";
- oParam1.inds = "req=ds_main_condition";
- oParam1.outds = "ds_main_matrlist=matrlist";
- oParam1.async = false;
- oParam1.callback = "cf_TRRSM00401";
- tranf_submit(oParam1);
-
- var gubun = ds_main_matrlist.getColumn(0,"gubun");
- var bfstocqty = ds_main_matrlist.getColumn(0,"bfstocqty"); //전월재고
- var ym = ds_main_condition.getColumn(0,"ym");
- if(bfstocqty == "N" && ym >"201911"){ //전월재고 없을경우
- //sysf_messageBox("전월 확정처리가 되지 않아 조회할 수 없습니다.", "E999", ""); *************12월 오픈이후 주석 풀어야함.
- sysf_messageBox("전월 마지막 재고가 없어 조회할 수 없습니다.", "E999", "");
- ds_main_matrlist.clearData();
- return;
- }else{
- if(gubun == "S" && bfstocqty != "N"){
- //조회 시 전월마감여부체크 및 제어
- //1일에 전월재고 가져오기
- var usedd = ds_main_matrlist.getColumn(0,"usedd");
- var winqty = ds_main_matrlist.getColumn(0,"winqty"); //입고
- //if(utlf_isNull(winqty)) winqty = 0;
- var newwinqty = Number(winqty) + Number(bfstocqty);
- ds_main_matrlist.setColumn(0,"winqty",newwinqty);
- }
- }
- }
- function cf_TRRSM00401(sSvcId, nErrorCode, sErrorMsg)
- {
- if(nErrorCode < 0)
- {
- return;
- }
- else
- {
- for(var i = 0; i < ds_main_matrlist.rowcount; i++)
- {
- var writid = ds_main_matrlist.getColumn(i, "writid");
-
- if(!utlf_isNull(writid) && writid != sysf_getUserInfo("userid"))
- {
- misfSetReadOnlyCol(grd_matrlist, "winqty,useqty,stocqty,workcnts,restocqty,cmt",true, i);
- }
- }
- }
- }
- // function misfSetReadOnlyCol(pGrid, pRefs, bYn)
- // {
- // var arrRefs = pRefs.split(",");
- //
- // if(arrRefs.length == 0)
- // {
- // return;
- // }
- //
- // for(var j = 0; j < arrRefs.length; j++)
- // {
- // if(bYn == "true")
- // {
- // pGrid.setCellProperty("Body", pGrid.getBindCellIndex("Body", arrRefs[j]), "edittype", "none");
- // }
- // else
- // {
- // pGrid.setCellProperty("Body", pGrid.getBindCellIndex("Body", arrRefs[j]), "edittype", "normal");
- // }
- // }
- // }
- function ds_main_condition_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
- {
- if(e.columnid == "deptcd")
- {
- var objFocus = this.getFocus();
- grp_sea.ipt_deptcd.setFocus();
- grp_sea.ipt_deptcd.value = e.newvalue;
-
- misfGridInit(grd_matrlist);
-
- grp_sea.opt_deptnm.value = "";
-
- misfValidationCheck("02", "", "deptcd,deptnm" );
- objFocus.setFocus();
- }
-
- if(e.columnid == "deptcd")
- {
- misfGridInit(grd_matrlist);
-
- grp_sea.opt_matrnm.value = "";
- }
- }
- function grp_sea_btn_search_onclick(obj:Button, e:ClickEventInfo)
- {
- fGetMatrList();
- }
- function grp_sea_ipt_deptcd_onkeydown(obj:Edit, e:KeyEventInfo)
- {
- if(e.keycode == 13)
- {
- obj.updateToDataset();
- }
- }
- function grp_sea_btn_deptcd_onclick(obj:Button, e:ClickEventInfo)
- {
- var vOrigDeptcd = grp_sea.ipt_deptcd.value;
-
- var recv_list = "deptcd,deptnm";
- misfOpenPopUpList("02", ds_main_condition,"", recv_list) ;
-
- if(vOrigDeptcd != grp_sea.ipt_deptcd.value)
- {
- misfGridInit(grd_matrlist);
- }
- }
- function grp_sea_btn_matrcd_onclick(obj:Button, e:ClickEventInfo)
- {
- ds_popmatr.setColumn(0, "deptcd", grp_sea.ipt_deptcd.value);
- ds_popmatr.setColumn(0, "selectyn", "");
-
- var objArg = new Object();
- objArg.arg_ds_popdata = ds_popmatr;
-
- frmf_modal("SPRSM00100", "SPRSM00100", objArg, "", "", "", "", "", "", "", "", "", "M");
-
- if(ds_popmatr.getColumn(0, "selectyn") == "Y")
- {
- ds_main_condition.setColumn(0, "matrcd", ds_popmatr.getColumn(0, "matrcd"));
- ds_main_condition.setColumn(0, "matrnm", ds_popmatr.getColumn(0, "matrnm"));
- }
- }
- function grp_sea_ipt_ym_onchanged(obj:Calendar, e:ChangeEventInfo)
- {
- var date = String(obj.value).substr(0,6);
- ds_main_condition.setColumn(0, "ym", date);
-
- misfGridInit(grd_matrlist);
- }
- function btn_prt_onclick(obj:Button, e:ClickEventInfo)
- {
- grp_sea.ipt_deptcd.value = grp_sea.ipt_deptcd.value.getTrim();
- grp_sea.ipt_matrcd.value = grp_sea.ipt_matrcd.value.getTrim();
- if(utlf_isNull(grp_sea.ipt_deptcd.value))
- {
- sysf_messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
- grp_sea.ipt_deptcd.setFocus();
- return;
- }
- if(utlf_isNull(grp_sea.ipt_matrcd.value))
- {
- sysf_messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
- grp_sea.ipt_matrcd.setFocus();
- return;
- }
-
- if(String(ds_main_condition.getColumn(0, "ym")).length != 6 )
- {
- sysf_messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
- grp_sea.ipt_ym.setFocus();
- return;
- }
- ds_main_prntlist.clearData();
-
- var oParam = {};
- oParam.id = "TRRSM00402";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqGetMatrUseCnfmList";
- oParam.inds = "req=ds_main_condition";
- oParam.outds = "ds_main_prntlist=matrlist";
- oParam.async = false;
- oParam.callback = "cf_TRRSM00402";
- tranf_submit(oParam);
- }
- function cf_TRRSM00402(sSvcId, nErrorCode, sErrorMsg)
- {
- if(nErrorCode < 0)
- {
- return;
- }
- else
- {
- var objDOM = rptf_createDOM();
- rptf_setNodeListToDOM(objDOM, "/root/main/prntlist", ds_main_prntlist);
- rptf_setNodeListToDOM(objDOM, "/root/main/condition", ds_main_condition);
- var objParam = new Object();
- objParam.xml_data_XML1 = objDOM.documentElement.source;
- var option = "";
- rptf_exeReportPreview30(["RPRSM00401"],[objParam], option);
- }
- }
- function btn_save_onclick(obj:Button, e:ClickEventInfo)
- {
- fClickSaveBtn();
- }
- function fClickSaveBtn()
- {
- ds_main_condition.setColumn(0,"lastindex","");
- // var flag = "";
- var gubun = ds_main_condition.getColumn(0, "gubun");
- var ymchk = ds_main_condition.getColumn(0, "ymchk");
- if(gubun == "S" && ymchk == "A" ){ //특별관리물질, 11월이후
-
- // btn_cal_onclick(); // 계산로직
- if (btn_cal_onclick() != false){
- //저장
- ds_main_matrlist.enableevent = false;
- ds_main_matrlist.updatecontrol = false;
-
- grdf_setStatusColumn(ds_main_matrlist, "status");
-
- ds_main_matrlist.updatecontrol = true;
- ds_main_matrlist.enableevent = true;
-
- var oParam = {};
- oParam.id = "TXRSM00401";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqExeSaveMatrUse";
- oParam.inds = "req=ds_main_condition matrlist=ds_main_matrlist:a";
- oParam.async = false;
- oParam.callback = "cf_TXRSM00401";
- tranf_submit(oParam);
- }
-
- }else{
-
- ds_main_matrlist.enableevent = false;
- ds_main_matrlist.updatecontrol = false;
-
- grdf_setStatusColumn(ds_main_matrlist, "status");
-
- ds_main_matrlist.updatecontrol = true;
- ds_main_matrlist.enableevent = true;
-
- var oParam = {};
- oParam.id = "TXRSM00401";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqExeSaveMatrUse";
- oParam.inds = "req=ds_main_condition matrlist=ds_main_matrlist:u";
- oParam.async = false;
- oParam.callback = "cf_TXRSM00401";
- tranf_submit(oParam);
- }
-
-
- }
- function cf_TXRSM00401(sSvcId, nErrorCode, sErrorMsg)
- {
- if(nErrorCode < 0)
- {
- return;
- }
- else
- {
- fGetMatrList();
- }
- }
- function btn_cnfm_onclick(obj:Button, e:ClickEventInfo)
- {
- if(ds_main_matrlist.rowcount == 0)
- {
- sysf_messageBox("조회된 자료가 없습니다. \n먼저 조회 후, 확정처리를 진행하시기 바랍니다. ", "I999", "");
- return;
- }
-
- if (sysf_messageBox("확정처리 후에는 데이터수정이 불가합니다. \n계속하시겠습니까?", "Q999", "") == 6)
- {
- ds_main_condition.setColumn(0, "confirmflag", "Y");
-
- var oParam = {};
- oParam.id = "TXRSM00402";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqExeConfirmMatrUse";
- oParam.inds = "req=ds_main_condition";
- oParam.async = false;
- oParam.callback = "cf_TXRSM00402";
- tranf_submit(oParam);
- }
- }
- function cf_TXRSM00402(sSvcId, nErrorCode, sErrorMsg)
- {
- if(nErrorCode < 0)
- {
- return;
- }
- else
- {
- grp_sea.btn_search.click();
- }
- }
- function btn_cancel_onclick(obj:Button, e:ClickEventInfo)
- {
- if(ds_main_matrlist.rowcount == 0)
- {
- sysf_messageBox("조회된 자료가 없습니다. \n먼저 조회 후, 확정취소를 진행하시기 바랍니다. ", "I999", "");
- return;
- }
- if (sysf_messageBox("조회된 자료의 확정을 취소하시겠습니까?", "Q999", "") == 6)
- {
- ds_main_condition.setColumn(0, "confirmflag", "N");
-
- var oParam = {};
- oParam.id = "TXRSM00402";
- oParam.service = "purcbaseapp.PurcBaseMngt";
- oParam.method = "reqExeConfirmMatrUse";
- oParam.inds = "req=ds_main_condition";
- oParam.async = false;
- oParam.callback = "cf_TXRSM00402";
- tranf_submit(oParam);
- }
- }
- function btn_rowdelete_onclick(obj:Button, e:ClickEventInfo)
- {
- if(ds_main_matrlist.rowposition < 0)
- {
- return;
- }
-
- if(sysf_getUserInfo("userid") != ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "writid"))
- {
- sysf_messageBox("본인이 작성한 자료만 행삭제가 가능합니다. ", "E999", "");
- return;
- }
-
- var status = ds_main_matrlist.getRowType(ds_main_matrlist.rowposition);
-
- if(status == 1)
- {
- ds_main_matrlist.updatecontrol = false;
- ds_main_matrlist.setRowType(ds_main_matrlist.rowposition, "d");
- ds_main_matrlist.updatecontrol = true;
- }
- else if(status == 2)
- {
- ds_main_matrlist.deleteRow(ds_main_matrlist.rowposition);
- }
- else if(status == 4)
- {
- ds_main_matrlist.updatecontrol = false;
- ds_main_matrlist.setRowType(ds_main_matrlist.rowposition, "d");
- ds_main_matrlist.updatecontrol = true;
- }
- else if(status == 8)
- {
- ds_main_matrlist.updatecontrol = false;
- ds_main_matrlist.setRowType(ds_main_matrlist.rowposition, "d");
- ds_main_matrlist.updatecontrol = true;
- }
- }
- function btn_excel_onclick(obj:Button, e:ClickEventInfo)
- {
- grdf_exportExcel(grd_matrlist, "excel", "savetype1", "false");
- }
- function ds_main_matrlist_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
- {
-
- if( e.columnid == "winqty" && e.columnid == "useqty"){
- //trace("here");
- var winqty = obj.getColumn(e.row, "winqty");
- var useqty = obj.getColumn(e.row, "useqty");
-
- var tmpstoc = parseFloat(winqty) - parseFloat(useqty);
- // trace(tmpstoc);
-
- obj.setColumn(e.row,"stocqty",tmpstoc);
-
-
- }
- }
- function grd_matrlist_onkeyup(obj:Grid, e:KeyEventInfo)
- {
- if( e.keycode == 13 ){
- var useqty = ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "useqty");
-
- if( utlf_isNull(useqty) ){
- if( utlf_isNull(ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "useqty")) ){
- // fv_tempFlag = true;
- ds_main_matrlist.setColumn(ds_main_matrlist.rowposition, "useqty", "0");
- ds_main_matrlist.rowposition = ds_main_matrlist.rowposition+1;
- }else{
- ds_main_matrlist.rowposition = ds_main_matrlist.rowposition+1;
- }
- }else{
- ds_main_matrlist.rowposition = ds_main_matrlist.rowposition+1;
- }
- }
- }
- function grd_matrlist_oncellclick(obj:Grid, e:GridClickEventInfo)
- {
- var firstuseqty = ds_main_matrlist.getColumn(0,"useqty");
- if( utlf_isNull(ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "useqty")) && e.row != 0 ){
- ds_main_matrlist.setColumn(ds_main_matrlist.rowposition, "useqty", "0");
- }
- }
- function btn_cal_onclick(obj, e)
- {
- for(var j = ds_main_matrlist.rowcount-1; j >=0; j--){
- // var nType = ds_main_matrlist.getRowType(j); 마지막 업데이트상태에서 사용량으로 변경
- var nuseqty = ds_main_matrlist.getColumn(j,"useqty");
- // if(nType == 4){
- // ds_main_condition.setColumn(0,"lastindex", j);
- // break;
- // }
-
- if(!utlf_isNull(nuseqty)){
- ds_main_condition.setColumn(0,"lastindex", j);
- break;
- }
- }
- var lastindex = ds_main_condition.getColumn(0,"lastindex");
- var winqty = ds_main_matrlist.getColumn(0, "winqty"); //입고량
- var restocqty = ds_main_matrlist.getColumn(0, "restocqty"); //반납량
- var useqty = ds_main_matrlist.getColumn(0, "useqty"); //사용량
- var exqty = ds_main_matrlist.getColumn(0, "exqty"); //예외량
-
- var tmpstocqty = parseFloat(winqty) - parseFloat(useqty) - parseFloat(restocqty) - parseFloat(exqty); //재고량 = 입고량-사용량-반납량-예외량
- //alert(tmpstocqty);
- ds_main_matrlist.setColumn(0,"stocqty",tmpstocqty); //재고량
-
- if(!utlf_isDigit(useqty)){// 숫자체크
- sysf_messageBox("첫번째 사용량 입력 시 숫자만 가능합니다.", "E999", "");
- grd_matrlist.setFocus();
- ds_main_matrlist.rowposition = 0;
- return false ;
- }
- if(!utlf_isNull(lastindex)){
- for(var i = 1; i <= lastindex ; i++){
- if(utlf_isNull(ds_main_matrlist.getColumn(i, "useqty"))){
- sysf_messageBox(ds_main_matrlist.getColumn(i,"usedd") +"일자 사용량이 입력되지 않았습니다. \n\n변경된 값 마지막을 기준으로 중간에 사용량이 없으면 재고량을 계산할 수 없습니다..", "E999", "");
- grd_matrlist.setFocus();
-
- ds_main_matrlist.rowposition = i;
- return false;
- }
- ds_main_matrlist.setColumn(i,"bfddstocqty",ds_main_matrlist.getColumn(i-1,"stocqty")); //전일재고
-
- var winqty = ds_main_matrlist.getColumn(i, "winqty"); //입고량
- var restocqty = ds_main_matrlist.getColumn(i, "restocqty"); //반납량
- var bfddstocqty = ds_main_matrlist.getColumn(i, "bfddstocqty"); //일재고량
- var useqty = ds_main_matrlist.getColumn(i, "useqty"); //사용량
- var exqty = ds_main_matrlist.getColumn(i, "exqty"); //예외량
- var tmpstocqty = parseFloat(bfddstocqty) + parseFloat(winqty) - parseFloat(useqty) - parseFloat(restocqty) - parseFloat(exqty); //재고량 = 전일재고량+입고량-사용량-반납량-예외량
- if(!utlf_isDigit(useqty)){// 숫자체크
- sysf_messageBox(parseInt(i+1)+"번째 사용량 입력 시 숫자만 가능합니다.", "E999", "");
- grd_matrlist.setFocus(i);
- ds_main_matrlist.rowposition = i;
- return false ;
- }
-
- if(tmpstocqty < 0){
- sysf_messageBox("재고량이 음수가 될 수 없습니다.", "E999", "");
- grd_matrlist.setFocus(i);
- ds_main_matrlist.rowposition = i;
- return false;
- }
-
- ds_main_matrlist.setColumn(i,"stocqty",tmpstocqty); //재고
- }
- }
- }
- ]]></Script>
- </Form>
- </FDL>
|