123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://www.comsquare.co.kr/example" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:cs="http://www.comsquare.co.kr/xforms">
- <xhtml:head>
- <xhtml:title>화학물질 목록 통합 조회</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <condition>
- <deptcd/>
- <deptnm/>
- <matrcd/>
- <matrnm/>
- <basedd/>
- <sort/>
- <data/>
- <envinspyn/>
- <spcldiagyn/>
- </condition>
- <matrlist>
- <matrcd/>
- <matrnm/>
- <deptcd/>
- <deptnm/>
- <deptnm2/>
- <prodcmpynm/>
- <usge/>
- <useqtym/>
- <useqtyy/>
- <trethrd/>
- <tretmcnt/>
- <harmcomp/>
- <harmgrde/>
- <sgnl/>
- <harm/>
- <envinspyn/>
- <spcldiagyn/>
- </matrlist>
- </main>
- <send/>
- <init/>
- <temp>
- </temp>
- <popmatr>
- <matrcd/>
- <matrnm/>
- <deptcd/>
- <returntype/>
- <selectyn/>
- </popmatr>
- <popdata>
- <matrcd/>
- <matrnm/>
- <deptcd/>
- <deptnm/>
- <ym/>
- <popflag/>
- <confirmflag/>
- </popdata>
- </root>
- </instance>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
- <script type="javascript" src="../../../mis/miscommonweb/js/RAC001.js"/>
- <script type="javascript" src="../../../com/zipcodeweb/js/ZBP001.js"/>
- <script type="javascript" src="../../../mis/miscommonweb/js/RSZ001.js"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fOpenForm();
-
- ]]>
- </script>
- <script type="javascript">
- <![CDATA[
-
- //========================================================================================
- //화면 로드시 초기화 함수
- //========================================================================================
- function fOpenForm() {
-
- misfGridInit(grd_matrlist);
-
- ipt_basedd.value = getCurrentDate(); //기준일자
- rdo_sort.value = "dept"; //정렬기준 : 부서별
- rdo_data.value = "all"; //자료구분 : 전체
-
- cp_title.value = "부서별 화학물질 목록";
-
- }
- //========================================================================================
- //인스턴스 Copy 함수
- //========================================================================================
- function fCopyInstance() {
- //----model.copyNode("/root/hidden/matrinfo/detail", "/root/main/matrinfo/detail");
- model.copyNode("/root/hidden/matrinfo", "/root/main/matrinfo");
- model.refresh();
- }
- //========================================================================================
- //코드 목록 조회 함수
- //========================================================================================
- function fGetMatrList() {
-
- model.copyNode("/root/send", "/root/main/condition");
- if (submit("TRRSM00901") ) {
- model.refresh();
- }
- }
-
- //========================================================================================
- //화학물질 상세정보 및 조사표 조회
- //========================================================================================
- function fGetMatrInfo(pRow) {
- if ( pRow > 0 ) {
- model.resetInstanceNode("/root/send");
- model.copyNode("/root/send", "/root/main/matrlist["+ pRow + "]");
- submit("TRRSM00102");
- ipt_matrcd.disabled = true;
- fCopyInstance();
- }
- }
-
- //========================================================================================
- //신규 버턴 클릭시 인스턴스 초기화
- //========================================================================================
- function fSetMatrInfo() {
- ipt_matrcd.disabled = false;
- // 아래 두줄로 변경
- //model.resetInstanceNode("/root/main/matrinfo");
- model.resetInstanceNode("/root/main/matrinfo/detail");
- //model.resetInstanceNode("/root/main/matrinfo/deptlist");
- misfGridInit(grd_deptlist);
-
- //return;
-
- model.setFocus("ipt_matrcd");
- model.setValue("/root/main/matrinfo/detail/status", "i");
- model.setValue("/root/main/matrinfo/detail/msdsflag", "Y");
- // 서식에서 징수의무자 상호(법인명)으로 쓰임. 기본값으로 경북대학교병원장 셋팅.
- //model.setValue("/root/main/matrinfo/prntnm1" , "경북대학교병원장");
- fCopyInstance();
- }
-
- //========================================================================================
- // 저장버튼 클릭시 저장 수행 함수
- //========================================================================================
- function fClickSaveBtn() {
- if(!fIsValidForSave())//저장전 유효성 검사
- return;
-
- for(var i = 1; i <= grd_deptlist.rows; i++) {
- grd_deptlist.valueMatrix(i, grd_deptlist.colRef("matrcd")) = ipt_matrcd.value;
- }
-
- model.resetInstanceNode("/root/send");
-
- //model.makeNode("root/send/detail");
- model.copyNode("/root/send", "/root/main/matrinfo/detail");
-
- model.makeValue("/root/send/deptlist", grd_deptlist.getUpdateData());
-
- //return;
-
- if(submit("TXRSM00101")) {
- fGetMatrList();//코드 목록 재조회
- model.copyNode("/root/send", "/root/main/matrinfo/detail");
- submit("TRRSM00102"); //상세내역 및 조사표 재조회
- //model.setValue("/root/main/matrinfo/detail/status", "-");
- //grd_deptlist.clearStatus();
- //--model.makeNode("/root/hidden/matrinfo/detail");
- model.makeNode("/root/hidden/matrinfo");
- fCopyInstance();
-
- ipt_matrcd.disabled = true;
- }
- }
-
- //========================================================================================
- //저장전 유효성 검사
- //========================================================================================
- function fIsValidForSave() {
- //필수 입력 항목 체크(공통 ftHelper.js)
- if(!isRequiredControls("ipt_matrcd","ipt_matrnm")) { //,"ipt_prodcmpycd"
- return false;
- }
-
- var sStatus = model.getValue("/root/main/matrinfo/detail/status");
- var sNewData = fGetNodeText("/root/main/matrinfo/detail");
- var sOldData = fGetNodeText("/root/hidden/matrinfo/detail");
-
- //상세내역에 변경된 정보가 있는지 확인
- if(sNewData != sOldData && sStatus == "-") { // 데이터 수정일 경우
- model.setValue("/root/main/matrinfo/detail/status","u");
- return true;
- } else if(sNewData == sOldData && sStatus == "-" ) { //변경된 값이 없을경우
- //messageBox("변경된 정보가 ", "I004");
- //return false;
- return true;
- }else if(sStatus == "i") { //데이터 입력일 경우
- return true;
- }else if(sStatus = "d") { //데이터 삭제일 경우
- return true;
- }
- }
-
- //========================================================================================
- //엑셀입력(excel file을 그리드에 입력)
- //========================================================================================
- function fInputExcel(pGrid) {
- var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
- if(fileName != "") {
- pGrid.loadExcel(fileName, 1, true);
- pGrid.deleteRow(1);
- pGrid.refresh();
- }
- }
-
- //========================================================================================
- //동일한 Depth의 인스턴스의 값을 스트링형으로 변환
- //========================================================================================
- function fGetNodeText(pNode) {
- var trgNdoe = instance1.selectSingleNode(pNode);
- var trgNdoeList = trgNdoe.childNodes;
- var childNode;
- var allText = "";
- while( childNode = trgNdoeList.nextNode() ) {
-
- allText += childNode.text;
- }
- return allText;
- }
-
- function fOpenPopupDeptHelp(pControl, pInstance)
- {
- misfOpenPopUpList("02", pControl, "", pInstance);
- model.refresh();
- }
-
- function fdown(flag, irow){
- var filepath = "";
- var filenm = "";
-
- if(flag == "1") {
- filepath = model.getValue("/root/main/matrlist[" + (irow - 1) + "]/msdsfilepath");
- filenm = model.getValue("/root/main/matrlist[" + (irow - 1) + "]/msdsfilenm");
- } else if (flag == "2") {
- filepath = model.getValue("/root/main/matrlist[" + (irow - 1) + "]/workfilepath");
- filenm = model.getValue("/root/main/matrlist[" + (irow - 1) + "]/workfilenm");
- }
-
- //alert("filepath: " + filepath + ", filenm: " + filenm);
-
- var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
-
- if (localfile != "") {
-
- //2014.08.28 - fileDialog 사용하지 않고 바로 열어 보여주기 위해 수정
- //model.download(getActionURL("TRRWC03003")+"&filepath="+filepath, localfile);
- model.download(getActionURL("TRRWC03003")+"&filepath="+filepath, localfile, false);
-
- //2014.08.28 - 참고 : messageBox를 사용하지 않으면 열리는 경우도 있고, 안열리는 경우도 있음.
- var rtn = messageBox("파일을", "Q004");
- if( rtn == 6 ) {
- window.exec(localfile);
- }
- }
- }
-
-
- ]]>
- </script>
- <submission id="TRRSM00901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/matrlist"/>
- </model>
- </xhtml:head>
- <xhtml:body guideline="1,1193;" 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="caption6" class="tit_1" style="left:0px; top:0px; width:293px; height:14px; ">화학물질 목록 통합 조회</caption>
- <caption id="caption4" class="patient_text_black" style="left:922px; top:0px; width:272px; "/>
- </group>
- <group id="group3" scroll="auto" style="left:0px; top:40; width:1195px; height:744px; ">
- <group id="grp_sea" style="left:0px; top:10px; width:1194px; height:60px; vertical-align:top; ">
- <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1194px; height:60px; background-color:#fffbf2; border-color:#ffd799; "/>
- <caption id="caption7" class="search_name" style="left:432px; top:9px; width:76px; height:17px; ">물질코드</caption>
- <line id="line5" class="line_4" style="x1:1039px; y1:6px; x2:1039px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
- <button id="btn_search" class="btn1_letter2" navindex="5" style="left:1055px; top:7px; width:56px; height:22px; text-align:left; ">
- <caption>조회</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fGetMatrList();
- ]]>
- </script>
- </button>
- <caption id="caption1" class="search_name" style="left:50px; top:9px; width:76px; height:17px; ">부서코드</caption>
- <output id="opt_deptnm" ref="/root/main/condition/deptnm" class="output_fix" appearance="output" style="left:228px; top:8px; width:187px; height:19px; "/>
- <button id="btn_deptcd" class="icon_search" navindex="2" style="left:209px; top:9px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var vOrigDeptcd = ipt_deptcd.value; //popup을 열기전 부서 저장
-
- var recv_list = "deptcd,deptnm";
- misfOpenPopUpList("02", ipt_deptcd,"", recv_list) ;
- ipt_deptcd.refresh();
- opt_deptnm.refresh();
-
- if(vOrigDeptcd != ipt_deptcd.value) { //부서코드가 변경되었다면
- //조회조건 변경시 초기화 및 check
- //fSearchCondChanged("ipt_delivedeptcd");
- }
- ]]>
- </script>
- </button>
- <input id="ipt_deptcd" ref="/root/main/condition/deptcd" class="input_default" navindex="1" style="left:131px; top:8px; width:75px; height:19px; ">
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- //2013.02.26 박준범 : 부서코드 변경시 부서코드명을 먼저 지워준다.
- opt_deptnm.value = "";
-
- misfValidationCheck("02", "", "deptcd,deptnm" );
-
- ]]>
- </script>
- <script type="javascript" ev:event="onkeypress">
- <![CDATA[
- //if( event.keyCode == 13 ) {
- //btn_search.dispatch("DOMActivate");
- // --> 위의 코드를 사용하면 input에 입력된 값이 인식이 안됨. TrustForm bug 같습니다.
- // --> 대신, 아래 코드 사용하면 input의 값이 인식이 됨
-
- //input 에서 EnterKey 이벤트 인식시 아래 function을 사용하세요!!
- inputEnterKey("ipt_deptcd", "xforms-value-changed");
- //}
- ]]>
- </script>
- </input>
- <input id="ipt_matrcd" ref="/root/main/condition/matrcd" class="input_default" navindex="3" maxlength="12" style="left:512px; top:8px; width:45px; height:19px; ">
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- //조회조건 변경시 Grid 초기화
- //fSearchCondChanged();
- if(ipt_matrcd.value == ""){
- model.setValue("/root/main/condition/matrnm", "");
- opt_matrnm.refresh();
- }
- ]]>
- </script>
- </input>
- <button id="btn_matrcd" class="icon_search" navindex="4" style="left:561px; top:9px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- //popup 에 전달할 parameter를 setting한다.
- //model.setValue("/root/popmatr/returntype", "2"); //matrnm도 함께 return 받고자 할때, returntype을 "2" 로 설정.
- model.setValue("/root/popmatr/deptcd", ipt_deptcd.value);
- //selectyn(popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값) 을 초기화함
- model.setValue("/root/popmatr/selectyn", "");
-
- //popup 프로그램 호출
- window.load("SPRSM00100.xrw", "modal","", "", "/root/popmatr","/root/popdata");
- //popup에서 특정 물품코드를 선택한 경우, 해당 물품코드에 대한 상세 사항을 조회해서 그리드에 보여준다.
- if(model.getValue("/root/popmatr/selectyn") == "Y") { //popup 창에서 선택버튼을 click했는지 아닌지를 나타내는 구분값
- //조회조건 변경시 Grid 초기화
- //fSearchCondChanged();
- model.setValue("/root/main/condition/matrcd", model.getValue("/root/popmatr/matrcd"));
- model.setValue("/root/main/condition/matrnm", model.getValue("/root/popmatr/matrnm"));
- ipt_matrcd.refresh();
- opt_matrnm.refresh();
-
- }
-
- ]]>
- </script>
- </button>
- <output id="opt_matrnm" ref="/root/main/condition/matrnm" class="output_fix" appearance="output" style="left:580px; top:8px; width:242px; height:19px; "/>
- <caption id="caption3" class="search_name" style="left:841px; top:9px; width:76px; height:17px; ">기준일자</caption>
- <input id="ipt_basedd" ref="/root/main/condition/basedd" class="input_default" navindex="1" inputtype="date" style="left:922px; top:8px; width:90px; height:19px; text-align:center; "/>
- <caption id="caption5" class="search_name" style="left:432px; top:34px; width:79px; height:17px; ">정렬기준</caption>
- <caption id="caption8" class="search_name" style="left:50px; top:35px; width:79px; height:17px; ">자료구분</caption>
- <select1 id="rdo_data" ref="/root/main/condition/data" class="radio_default" appearance="full" cellspacing="3" cols="3" overflow="visible" style="left:131px; top:35px; width:240px; height:20px; border-style:none; ">
- <choices>
- <item>
- <label>전체</label>
- <value>all</value>
- </item>
- <item>
- <label>유해화학물질</label>
- <value>harm</value>
- </item>
- <item>
- <label>일반화학물질</label>
- <value>general</value>
- </item>
- </choices>
- </select1>
- <select1 id="rdo_sort" ref="/root/main/condition/sort" class="radio_default" appearance="full" cellspacing="3" cols="2" overflow="visible" style="left:513px; top:35px; width:125px; height:20px; border-style:none; ">
- <choices>
- <item>
- <label>부서별</label>
- <value>dept</value>
- </item>
- <item>
- <label>물질별</label>
- <value>matr</value>
- </item>
- </choices>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- if(rdo_sort.value == "dept") {
- cp_title.value = "부서별 화학물질 목록";
- grd_matrlist.visible = true; //부서별
- grd_matrlist2.visible = false; //물질별
- misfGridInit(grd_matrlist); //물질별
-
- } else {
- cp_title.value = "물질별 화학물질 목록";
- grd_matrlist2.visible = true; //물질별
- grd_matrlist.visible = false; //부서별
- misfGridInit(grd_matrlist2); //부서별
- }
- ]]>
- </script>
- </select1>
- <caption id="caption2" class="search_name" style="left:727px; top:34px; width:53px; height:17px; ">필터</caption>
- <select id="cbx_envinspyn" ref="/root/main/condition/envinspyn" class="combo_default" overflow="visible" appearance="full" style="left:780px; top:35px; width:115px; height:15px; border-style:none; ">
- <choices>
- <item>
- <label>작업환경측정물질</label>
- <value>Y</value>
- </item>
- </choices>
- </select>
- <select id="cbx_spcldiagyn" ref="/root/main/condition/spcldiagyn" class="combo_default" overflow="visible" appearance="full" style="left:899px; top:35px; width:116px; height:15px; border-style:none; ">
- <choices>
- <item>
- <label>특수건강진단물질</label>
- <value>Y</value>
- </item>
- </choices>
- </select>
- </group>
- <line id="line3" class="line_1" style="x1:0px; y1:100px; x2:1193px; y2:100px; "/>
- <datagrid id="grd_matrlist" nodeset="/root/main/matrlist" caption="부서명^물질명^제조사^용도^월사용량^연간사용량^1일취급시간^월 작업일수^취급근로자수^유해구성성분^유해등급^신호어^유해위험성분류^작업환경측정물질^특수건강진단물질" colsep="^" colwidth="128, 170, 100, 100, 72, 75, 79, 80, 81, 103, 66, 60, 358, 108, 108" explorerbar="sortshow" mergecells="byrestriccol" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="16" rowsep="|" navindex="6" style="left:0px; top:105px; width:1193px; height:605px; ">
- <col class="text_left" ref="deptnm"/>
- <col class="text_left" ref="matrnm"/>
- <col class="text_left" ref="prodcmpynm"/>
- <col class="text_left" ref="usge"/>
- <col class="text_center" ref="useqtym"/>
- <col class="text_center" ref="useqtyy"/>
- <col class="text_center" ref="trethrd"/>
- <col class="text_center" ref="workdcntm"/>
- <col class="text_center" ref="tretmcnt"/>
- <col class="text_left" ref="harmcomp"/>
- <col class="text_center" ref="harmgrde"/>
- <col class="text_center" ref="sgnl"/>
- <col class="text_left" ref="harm"/>
- <col class="text_center" ref="envinspyn"/>
- <col class="text_center" ref="spcldiagyn"/>
- <script type="javascript" ev:event="onaftersort">
- <![CDATA[
- grd_matrlist.gridToInstance();
- ]]>
- </script>
- </datagrid>
- <button id="btn_excel" class="btn2_letter4" navindex="7" style="left:1129px; top:80px; width:64px; height:19px; text-align:left; ">
- <caption>엑셀출력</caption>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- //radfSaveExcel(ipt_detailist);
-
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
-
- if (fileName != "") {
- if(rdo_sort.value == "dept") { //부서별
- grd_matrlist.saveExcel(fileName,"sheetname:savetype");
- } else {
- grd_matrlist2.saveExcel(fileName,"sheetname:savetype");
- }
- }
- ]]>
- </script>
- </button>
- <caption id="cp_title" class="tit_2" style="left:5px; top:85px; width:144px; height:13px; ">부서별 화학물질 목록</caption>
- <datagrid id="grd_matrlist2" nodeset="/root/main/matrlist" visibility="hidden" caption="물질명^부서명^제조사^용도^월사용량^연간사용량^1일취급시간^월 작업일수^취급근로자수^유해구성성분^유해등급^신호어^유해위험성분류^작업환경측정물질^특수건강진단물질" colsep="^" colwidth="170, 128, 100, 100, 72, 75, 79, 80, 81, 103, 57, 60, 358, 108, 108" explorerbar="sortshow" mergecells="byrestriccol" rowheader="seq" rowheight="16" rowsep="|" navindex="6" style="left:0px; top:105px; width:1193px; height:605px; ">
- <col class="text_left" ref="matrnm"/>
- <col class="text_left" ref="deptnm"/>
- <col class="text_left" ref="prodcmpynm"/>
- <col class="text_left" ref="usge"/>
- <col class="text_center" ref="useqtym"/>
- <col class="text_center" ref="useqtyy"/>
- <col class="text_center" ref="trethrd"/>
- <col class="text_center" ref="workdcntm"/>
- <col class="text_center" ref="tretmcnt"/>
- <col class="text_left" ref="harmcomp"/>
- <col class="text_center" ref="harmgrde"/>
- <col class="text_center" ref="sgnl"/>
- <col class="text_left" ref="harm"/>
- <col class="text_center" ref="envinspyn"/>
- <col class="text_center" ref="spcldiagyn"/>
- <script type="javascript" ev:event="onaftersort">
- <![CDATA[
- grd_matrlist2.gridToInstance();
- ]]>
- </script>
- </datagrid>
- </group>
- <group id="group4" scroll="auto" style="left:0px; top:13; width:1195px; height:27px; ">
- <line id="line2" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
- </group>
- </xhtml:body>
- </xhtml:html>
|