SMLLF01400_사유코드관리.xfdl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMLLF01400" position="absolute 0 0 1256 805" titletext="사유코드관리" oninit="SMLLF01400_oninit" onload="SMLLF01400_onload">
  5. <Layouts>
  6. <Layout>
  7. <Button id="btn_save" taborder="3" text="저장" class="btn4" position="absolute 1200 0 1256 20" anchor="top right" positiontype="position" onclick="btn_save_onclick"/>
  8. <Static id="caption6" text="사유코드관리" class="tit_1" position="absolute 0 0 177 25" positiontype="position"/>
  9. <Static id="caption1" text="사유코드상세내역" class="tit_2" position="absolute 0 77 300 97" positiontype="position"/>
  10. <Edit id="input1" taborder="6" visible="false" position="absolute 127 74 277 94" oneditclick="input1_oneditclick" imemode="hangul" positiontype="position"/>
  11. <Grid id="grd_rsn" taborder="7" useinputpanel="false" position="absolute 0 97 1256 805" onmouseleave="grd_rsn_onmouseleave" anchor="all" autofittype="col" binddataset="ds_grid_grd_rsn" positiontype="position" autoenter="select" extendsizetype="row" autosizingtype="row">
  12. <Formats>
  13. <Format id="default">
  14. <Columns>
  15. <Column size="0"/>
  16. <Column size="30"/>
  17. <Column size="100"/>
  18. <Column size="130"/>
  19. <Column size="800"/>
  20. <Column size="60"/>
  21. <Column size="80"/>
  22. <Column size="0"/>
  23. </Columns>
  24. <Rows>
  25. <Row size="24" band="head"/>
  26. <Row size="24"/>
  27. </Rows>
  28. <Band id="head">
  29. <Cell/>
  30. <Cell col="1" text="상태"/>
  31. <Cell col="2" text="사유코드유형"/>
  32. <Cell col="3" text="사유코드"/>
  33. <Cell col="4" text="사유"/>
  34. <Cell col="5" text="사용여부"/>
  35. <Cell col="6" text="표시순서"/>
  36. <Cell col="7" text="숨길꺼seq"/>
  37. </Band>
  38. <Band id="body">
  39. <Cell celltype="head" text="expr:currow+1"/>
  40. <Cell col="1" celltype="head" displaytype="image"/>
  41. <Cell col="2" displaytype="text" edittype="expr:expr:getRowType(currow)==2?'text':'none'" style="align:middle;" text="bind:resncdkind" editlimit="2" editlengthunit="utf8"/>
  42. <Cell col="3" displaytype="text" edittype="expr:expr:getRowType(currow)==2?'text':'none'" style="align:middle;" text="bind:resncd" editlimit="5" editlengthunit="utf8"/>
  43. <Cell col="4" displaytype="text" edittype="expr:expr:getRowType(currow)==2?'textarea':'none'" text="bind:resndesc" wordwrap="word" editlimit="1000" editacceptsenter="true" editlengthunit="utf8" autosizerow="limitmin" autosizecol="default"/>
  44. <Cell col="5" displaytype="combo" edittype="combo" text="bind:resnuseyn" displayexpdec="-1" suppress="0" combodataset="ds_init_checkyn" combocodecol="cd" combodatacol="nm"/>
  45. <Cell col="6" displaytype="text" edittype="text" style="align:middle;" text="bind:resndispseq"/>
  46. <Cell col="7" text="bind:resndispseq"/>
  47. </Band>
  48. </Format>
  49. </Formats>
  50. </Grid>
  51. <Button id="btn_addrow" taborder="8" text="행추가" class="btn2" position="absolute 1200 74 1256 94" anchor="top right" positiontype="position" onclick="btn_addrow_onclick"/>
  52. <Div id="grp_sea" anchor="left top right" taborder="9" style="align:center top;" position="absolute 0 25 1256 67" class="div_SA">
  53. <Layouts>
  54. <Layout>
  55. <Static id="caption2" text="조회구분" class="search_name" position="absolute 8 10 98 30" positiontype="position"/>
  56. <Combo id="cmb_resn" taborder="15" class="combo_s_essential" position="absolute 81 10 261 30" positiontype="position" innerdataset="@ds_init_lb0117" codecolumn="cd" datacolumn="nm" onitemchanged="grp_sea_cmb_resn_onitemchanged"/>
  57. <Combo id="cmb_RefFlag" taborder="16" class="combo_s_essential" visible="false" position="absolute 264 10 414 30" positiontype="position" codecolumn="codecolumn" datacolumn="datacolumn"/>
  58. <Button id="btn_clear" taborder="17" text="초기화" class="btn1" position="absolute 1175 10 1244 30" anchor="top right" positiontype="position" onclick="grp_sea_btn_clear_onclick"/>
  59. <Button id="btn_Ref" taborder="18" text="조회" class="btn1" position="absolute 1116 10 1172 30" anchor="top right" positiontype="position" onclick="grp_sea_btn_Ref_onclick"/>
  60. </Layout>
  61. </Layouts>
  62. </Div>
  63. </Layout>
  64. </Layouts>
  65. <Objects>
  66. <Dataset id="ds_grid_grd_rsn" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false" cancolumnchange="ds_grid_grd_rsn_cancolumnchange">
  67. <ColumnInfo>
  68. <Column id="resncdkind" type="STRING"/>
  69. <Column id="resncd" type="STRING"/>
  70. <Column id="resndesc" type="STRING"/>
  71. <Column id="resnuseyn" type="STRING"/>
  72. <Column id="resndispseq" type="STRING"/>
  73. <Column id="resndispseq" type="STRING"/>
  74. </ColumnInfo>
  75. </Dataset>
  76. <Dataset id="ds_init_lb0117" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  77. <ColumnInfo>
  78. <Column id="cd" type="STRING" size="256"/>
  79. <Column id="nm" type="STRING" size="256"/>
  80. </ColumnInfo>
  81. </Dataset>
  82. <Dataset id="ds_init_checkyn" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
  83. <ColumnInfo>
  84. <Column id="cd" type="STRING"/>
  85. <Column id="nm" type="STRING"/>
  86. </ColumnInfo>
  87. <Rows>
  88. <Row>
  89. <Col id="cd">Y</Col>
  90. <Col id="nm">Y</Col>
  91. </Row>
  92. <Row>
  93. <Col id="cd">N</Col>
  94. <Col id="nm">N</Col>
  95. </Row>
  96. </Rows>
  97. </Dataset>
  98. <Dataset id="ds_print" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  99. <ColumnInfo>
  100. <Column id="able" type="STRING" size="256"/>
  101. </ColumnInfo>
  102. </Dataset>
  103. <Dataset id="ds_execute" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  104. <ColumnInfo>
  105. <Column id="able" type="STRING" size="256"/>
  106. </ColumnInfo>
  107. </Dataset>
  108. </Objects>
  109. <Bind>
  110. <BindItem id="item0" compid="btn_save" propid="enable" datasetid="ds_execute" columnid="able"/>
  111. <BindItem id="item1" compid="btn_addrow" propid="enable" datasetid="ds_execute" columnid="able"/>
  112. </Bind>
  113. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  114. * System Name :
  115. * Job Name :
  116. * Creator :
  117. * Make Date : 2015-11-09
  118. * Description :
  119. *---------------------------------------------------------------------------------------
  120. * Modify Date Modifier Modify Description
  121. *---------------------------------------------------------------------------------------
  122. * 2015-11-09 Live Converter TF->XP
  123. *
  124. *---------------------------------------------------------------------------------------
  125. ****************************************************************************************/
  126. include "com_commonxp::comm_main.xjs";
  127. include "lis_commonxp::LLZ001.xjs";
  128. function SMLLF01400_oninit(obj:Form, e:InitEventInfo)
  129. {
  130. frmf_initForm(obj);
  131. }
  132. function SMLLF01400_onload(obj:Form, e:LoadEventInfo)
  133. {
  134. //조회구분 콤보박스
  135. lf_initDataSet();
  136. //그리드 sort
  137. lf_menumaster();//메뉴권한
  138. grdf_setGridSort(grd_rsn);
  139. grdf_setRowTypeIcon(grd_rsn, 1);
  140. }
  141. function lf_initDataSet(){
  142. lf_getDbDeptcd("0117|","cbf_SMLLF01400");
  143. }
  144. //조회시 데이터 그리드에 가져오기
  145. function lf_GetRsnSearch(){
  146. var sInDsName = dsf_createDsRow("ds_cond_cond"
  147. , [{col:"resncdkind", val: grp_sea.cmb_resn.value}]);
  148. ds_grid_grd_rsn.clearData();
  149. var oParam = {};
  150. oParam.id = "TRLLF01401";
  151. oParam.service = "diagtestbaseinfomngtapp.GeneralTestBaseInfoMngt";
  152. oParam.method = "reqGetResnList";
  153. oParam.inds = "cond="+sInDsName;
  154. oParam.outds = "ds_grid_grd_rsn=resnlist";
  155. oParam.async = false;
  156. oParam.callback = "cbf_SMLLF01400";
  157. tranf_submit(oParam);
  158. }
  159. //데이터 저장
  160. function lf_saveRsnInfo(){
  161. // 서브밋호출
  162. var sInDsName = dsf_createDsRow("ds_temp_search"
  163. , [{col: "codeflag", val: ds_init_lb0117.getColumn(0,"nm")}]);
  164. var oParam = {};
  165. oParam.id = "TXLLF01401";
  166. oParam.service = "diagtestbaseinfomngtapp.GeneralTestBaseInfoMngt";
  167. oParam.method = "reqExeResn";
  168. oParam.inds = "cond=ds_grid_grd_rsn:U";
  169. oParam.async = false;
  170. oParam.callback = "cbf_SMLLF01400";
  171. tranf_submit(oParam);
  172. }
  173. //콜백함수
  174. function cbf_SMLLF01400(strSvcID, nErrorCode, strErrorMag){
  175. if(nErrorCode != 0) sysf_messageBox("ID: " + strSvcID + " Error: " + strErrorMag, "E009", "");
  176. if(strSvcID == "TRLLF01401" && nErrorCode==0){
  177. }
  178. if(strSvcID == "TRLZZ00101" && nErrorCode==0){
  179. grp_sea.cmb_resn.index=0;
  180. lf_GetRsnSearch();
  181. return true;
  182. }
  183. }
  184. // 그리드 필수값 체크
  185. function lf_ckeckNull()
  186. {
  187. var nRow = grd_rsn.rowcount -1; //현재 행
  188. var updateds = grdf_getGridUpdateData(grd_rsn);
  189. if(updateds.rowcount > 0 ){ //추가된 행에 대하여
  190. for (i=0; i < updateds.rowcount; i++) {
  191. if(utlf_isNull(updateds.getColumn(i,"resncdkind")) // 사유코드
  192. || utlf_isNull(updateds.getColumn(i,"resncd"))
  193. || utlf_isNull(updateds.getColumn(i,"resndesc"))
  194. || utlf_isNull(updateds.getColumn(i,"resndispseq"))){ // 사유가 빈값이면
  195. sysf_messageBox("빈값이 존재", "E001");
  196. }else{ // 추가된 행에 빈 값이 없으면 저장
  197. var rtn = sysf_messageBox("저장된 내역은 수정하실 수 없습니다.\n이대로 ", "Q002");
  198. if(rtn == 7){ // 아니오 누를때
  199. return;
  200. }else{ // 예(6) 누르면 저장
  201. lf_saveRsnInfo();
  202. }
  203. }
  204. }
  205. }else{ // 추가 된 행이 없으면
  206. sysf_messageBox("저장 할 내용이 없습니다. \n사유코드를 저장 ", "E001"); // 할 수 없습니다.
  207. return;
  208. }
  209. }
  210. //진검 사용자별 메뉴권한
  211. function lf_menumaster(){
  212. var edit = frmf_checkAuth("X");
  213. var print = frmf_checkAuth("P");
  214. var eRow = ds_execute.addRow();
  215. var pRow = ds_print.addRow();
  216. if(edit == true){
  217. ds_execute.setColumn(eRow,"able",true);
  218. }
  219. if(print == true){
  220. ds_print.setColumn(pRow,"able",true);
  221. }
  222. }
  223. //조회버튼 클릭시
  224. function grp_sea_btn_Ref_onclick(obj:Button, e:ClickEventInfo)
  225. {
  226. lf_GetRsnSearch();
  227. }
  228. //초기화 버튼 클릭시
  229. function grp_sea_btn_clear_onclick(obj:Button, e:ClickEventInfo)
  230. {
  231. grp_sea.cmb_resn.index=0; // 콤보박스 첫번째 항목 선택
  232. ds_grid_grd_rsn.clearData();
  233. }
  234. // 저장버튼 클릭시
  235. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  236. {
  237. lf_ckeckNull(); // 빈값 있는지 확인
  238. }
  239. //행 추가
  240. function btn_addrow_onclick(obj:Button, e:ClickEventInfo)
  241. {
  242. var nRow=ds_grid_grd_rsn.addRow();
  243. var iresncdkind=ds_grid_grd_rsn.getColumn(ds_grid_grd_rsn.row,"resncdkind"); //현재 사유코드유형번호
  244. ds_grid_grd_rsn.setColumn(nRow,"resncdkind",iresncdkind);
  245. var iresndispseq = ds_grid_grd_rsn.getColumn(nRow-1,"resndispseq")+1; // 표시순서번호
  246. ds_grid_grd_rsn.setColumn(nRow,"resndispseq",iresndispseq);
  247. ds_grid_grd_rsn.setColumn(nRow,"resnuseyn","Y"); //사용번호
  248. }
  249. //콤보박스에서 고르고나면
  250. function grp_sea_cmb_resn_onitemchanged(obj:Combo, e:ItemChangeEventInfo)
  251. {
  252. grp_sea_btn_Ref_onclick();
  253. }
  254. ]]></Script>
  255. </Form>
  256. </FDL>