SMLMF10200_통합항균제코드관리.xfdl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMLMF10200" position="absolute 0 0 1256 805" titletext="New Form" onload="SMLMF10200_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption6" text="항균제코드관리" class="tit_1" position="absolute 0 0 155 25" positiontype="position"/>
  8. <Button id="btn_save" taborder="1" text="저장" class="btn4" position="absolute 1200 0 1256 20" anchor="top right" positiontype="position" onclick="btn_save_onclick"/>
  9. <Grid id="grd_antibiocddetl" taborder="3" useinputpanel="false" position="absolute 0 97 1256 805" autofittype="col" anchor="all" binddataset="ds_grid_grd_antibiocddetl" positiontype="position" autoenter="select" class="CSS::lis.css">
  10. <Formats>
  11. <Format id="default">
  12. <Columns>
  13. <Column size="30"/>
  14. <Column size="0"/>
  15. <Column size="110"/>
  16. <Column size="110"/>
  17. <Column size="130"/>
  18. <Column size="210"/>
  19. <Column size="200"/>
  20. <Column size="200"/>
  21. <Column size="210"/>
  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="항균제명(화면)"/>
  37. <Cell col="8" text="항균제명(출력)"/>
  38. <Cell col="9" text="checkcolor"/>
  39. </Band>
  40. <Band id="body">
  41. <Cell celltype="head" expr="expr:currow+1"/>
  42. <Cell col="1" displaytype="image" expr="expr:getRowType(currow) == 2 ?'theme://images/ico_i.png' : (getRowType(currow) == 4 ? 'theme://images/ico_u.png' : (getRowType(currow) == 8 ? 'theme://images/ico_d.png' : 'theme://images/ico_e.png'))"/>
  43. <Cell col="2" displaytype="date" edittype="date" text="bind:antibiofromdd"/>
  44. <Cell col="3" displaytype="date" edittype="date" text="bind:antibiotodd"/>
  45. <Cell col="4" displaytype="text" edittype="text" text="bind:antibiocd" editlimit="10" editlengthunit="utf8"/>
  46. <Cell col="5" displaytype="text" edittype="text" text="bind:antibionm" editlimit="50" editlengthunit="utf8"/>
  47. <Cell col="6" displaytype="text" edittype="text" text="bind:antibioabbrnm" editlimit="20" editlengthunit="utf8"/>
  48. <Cell col="7" displaytype="text" edittype="text" text="bind:antibioscrnnm" editlimit="50" editlengthunit="utf8"/>
  49. <Cell col="8" displaytype="text" edittype="text" text="bind:antibioprntnm" editlimit="10" editlengthunit="utf8"/>
  50. <Cell col="9" text="bind:checkcolor"/>
  51. </Band>
  52. </Format>
  53. </Formats>
  54. </Grid>
  55. <Button id="btn_addrow" taborder="4" text="행추가" class="btn2" position="absolute 1200 74 1256 94" anchor="top right" positiontype="position" onclick="btn_addrow_onclick"/>
  56. <Static id="caption2" text="항균제코드상세내역" class="tit_2" position="absolute 0 77 142 97" positiontype="position"/>
  57. <Div id="group1" taborder="5" position="absolute 0 25 1256 67" anchor="left top right" positiontype="position" class="div_SA">
  58. <Layouts>
  59. <Layout>
  60. <Shape id="line3" linetype="vertical" class="line_4" position="absolute 1108 7 1108 29" anchor="default" positiontype="position"/>
  61. <Static id="caption1" text="조회구분" class="search_name" position="absolute 8 10 82 30" anchor="default" positiontype="position"/>
  62. <Static id="caption4" text="검색구분" class="search_name" position="absolute 776 10 850 30" anchor="top right" positiontype="position"/>
  63. <Shape id="line2" linetype="vertical" class="line_4" position="absolute 273 7 273 29" anchor="default" positiontype="position"/>
  64. <Combo id="cmb_refflag" taborder="1" class="combo_search" position="absolute 81 10 231 30" anchor="default" positiontype="position" codecolumn="codecolumn" datacolumn="datacolumn" index="0" value="1" text="사용가능자료">
  65. <Dataset id="innerdataset">
  66. <ColumnInfo>
  67. <Column id="codecolumn" size="256"/>
  68. <Column id="datacolumn" size="256"/>
  69. </ColumnInfo>
  70. <Rows>
  71. <Row>
  72. <Col id="codecolumn">1</Col>
  73. <Col id="datacolumn">사용가능자료</Col>
  74. </Row>
  75. <Row>
  76. <Col id="codecolumn">2</Col>
  77. <Col id="datacolumn">전체자료</Col>
  78. </Row>
  79. </Rows>
  80. </Dataset>
  81. </Combo>
  82. <Button id="btn_ref" taborder="2" text="조회" class="btn1" position="absolute 234 10 290 30" anchor="left top" positiontype="position" onclick="btn_ref_onclick"/>
  83. <Combo id="cmb_search" taborder="3" class="combo_search" position="absolute 850 10 1000 30" anchor="top right" positiontype="position" codecolumn="codecolumn" datacolumn="datacolumn" index="0" value="1" text="코드">
  84. <Dataset id="innerdataset">
  85. <ColumnInfo>
  86. <Column id="codecolumn" size="256"/>
  87. <Column id="datacolumn" size="256"/>
  88. </ColumnInfo>
  89. <Rows>
  90. <Row>
  91. <Col id="codecolumn">1</Col>
  92. <Col id="datacolumn">코드</Col>
  93. </Row>
  94. <Row>
  95. <Col id="codecolumn">2</Col>
  96. <Col id="datacolumn">코드명</Col>
  97. </Row>
  98. </Rows>
  99. </Dataset>
  100. </Combo>
  101. <Edit id="ipt_searchtext" taborder="4" class="input_search" position="absolute 1003 10 1113 30" anchor="top right" imemode="hangul" positiontype="position" onkeydown="group1_ipt_searchtext_onkeydown"/>
  102. <Button id="btn_reset" taborder="5" text="초기화" class="btn1" position="absolute 1175 10 1244 30" anchor="top right" positiontype="position" onclick="btn_reset_onclick"/>
  103. <Button id="btn_search" taborder="6" text="검색" onclick="group1_btn_search_onclick" class="btn1" position="absolute 1116 10 1172 30" anchor="top right"/>
  104. </Layout>
  105. </Layouts>
  106. </Div>
  107. </Layout>
  108. </Layouts>
  109. <Objects>
  110. <Dataset id="ds_grid_grd_antibiocddetl" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false" oncolumnchanged="ds_grid_grd_antibiocddetl_oncolumnchanged">
  111. <ColumnInfo>
  112. <Column id="antibiofromdd" type="STRING"/>
  113. <Column id="antibiotodd" type="STRING"/>
  114. <Column id="antibiocd" type="STRING"/>
  115. <Column id="antibionm" type="STRING"/>
  116. <Column id="antibioabbrnm" type="STRING"/>
  117. <Column id="antibioscrnnm" type="STRING"/>
  118. <Column id="antibioprntnm" type="STRING"/>
  119. <Column id="checkcolor" type="STRING" size="256"/>
  120. </ColumnInfo>
  121. </Dataset>
  122. <Dataset id="ds_database_instcd" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  123. </Objects>
  124. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  125. * System Name :
  126. * Job Name :
  127. * Creator :
  128. * Make Date : 2015-11-09
  129. * Description :
  130. *---------------------------------------------------------------------------------------
  131. * Modify Date Modifier Modify Description
  132. *---------------------------------------------------------------------------------------
  133. * 2015-11-09 Live Converter TF->XP
  134. *
  135. *---------------------------------------------------------------------------------------
  136. ****************************************************************************************/
  137. include "com_commonxp::comm_main.xjs";
  138. include "lis_commonxp::LLZ001.xjs";
  139. include "lis_commonxp::LZZ001.xjs";
  140. var lgv_sInstCd = sysf_getUserInfo("dutplceinstcd");
  141. var lgv_sTargetDb = "";
  142. function SMLMF10200_onload(obj:Form, e:LoadEventInfo)
  143. {
  144. frmf_initForm(obj);
  145. lf_getDbDeptcd("0000|0011|");
  146. //조회
  147. lf_GetAntibiocd("1");
  148. grd_antibiocddetl.setFormatColProperty(9,"size",0);
  149. // 그리드 sort
  150. grdf_setGridSort(grd_antibiocddetl);
  151. }
  152. function lf_GetAntibiocd(btnf){
  153. var sInDsName = dsf_createDsRow("in_ds_search"
  154. , [{col: "refgbn", val: group1.cmb_refflag.value}
  155. , {col: "searchgbn", val: group1.cmb_search.value}
  156. , {col: "searchnm", val: group1.ipt_searchtext.value}
  157. , {col: "btnflag", val: btnf}
  158. , {col: "targetdb", val: lgv_sTargetDb}
  159. , {col: "instcd", val: lgv_sInstCd}]);
  160. ds_grid_grd_antibiocddetl.clearData();
  161. var oParam = {};
  162. oParam.id = "TRLMF00201";
  163. oParam.service = "diagtestbaseinfomngtapp.MicroTestBaseInfoMngt";
  164. oParam.method = "reqGetUnityAntibioList";
  165. oParam.inds = "cond="+sInDsName;
  166. oParam.outds = "ds_grid_grd_antibiocddetl=getUnityAntibioList";
  167. oParam.async = false;
  168. oParam.callback = "cbf_SMLMF10200";
  169. tranf_submit(oParam);
  170. }
  171. //저장
  172. function lf_saveAntibio(){
  173. var sInDsName2 = dsf_createDsRow("in_ds_search2"
  174. , [{col: "targetdb", val: lgv_sTargetDb}
  175. , {col: "instcd", val: lgv_sInstCd}]);
  176. var oParam = {};
  177. oParam.id = "TXLMF00301";
  178. oParam.service = "diagtestbaseinfomngtapp.MicroTestBaseInfoMngt";
  179. oParam.method = "reqExeUnityAntibioList";
  180. oParam.inds = "cond=ds_grid_grd_antibiocddetl:U";
  181. oParam.outds = "ds_grid_grd_antibiocddetl=antibiolist";
  182. oParam.async = false;
  183. oParam.callback = "cbf_SMLMF10200";
  184. tranf_submit(oParam);
  185. }
  186. //콜백함수
  187. function cbf_SMLMF10200(strSvcID, nErrorCode, strErrorMag){
  188. if(strSvcID == "TXLMF10201" && nErrorCode==0){
  189. sysf_messageBox("","I001","");
  190. }
  191. //종료된 데이타 색깔표시
  192. lf_changeColor();
  193. }
  194. // 필수값체크
  195. function lf_ckeckNull()
  196. {
  197. var bChkValue= frmf_chkMdtGrid(grd_antibiocddetl,[2,3,4],["사용시작일자","사용종료일자","향균제코드"]);
  198. if(bChkValue==true) lf_saveAntibio();
  199. }
  200. //종료된 데이타 색깔 바꾸기
  201. function lf_changeColor(){
  202. var i =0;
  203. var j =0;
  204. if (ds_grid_grd_antibiocddetl.rowcount == 0) return;
  205. var sExpr = "EXPR(checkcolor)";
  206. //Row색깔 투입
  207. ds_grid_grd_antibiocddetl.updatecontrol = false ;
  208. for(j=0; j < ds_grid_grd_antibiocddetl.rowcount; j++){
  209. if (ds_grid_grd_antibiocddetl.getColumn(j,"antibiotodd") < utlf_getCurrentDate()) {
  210. ds_grid_grd_antibiocddetl.setColumn(j, "checkcolor", "yellow");
  211. } else {
  212. ds_grid_grd_antibiocddetl.setColumn(j, "checkcolor", "default");
  213. }
  214. ds_grid_grd_antibiocddetl.setRowType(j,"1");
  215. }
  216. ds_grid_grd_antibiocddetl.updatecontrol = true ;
  217. //색깔변경
  218. for (i=0; i < grd_antibiocddetl.getCellCount('Head'); i++ ) {
  219. grd_antibiocddetl.setCellProperty("Body",i,"background", sExpr);
  220. grd_antibiocddetl.setCellProperty("Body",i,"background2", sExpr);
  221. }
  222. }
  223. //조회
  224. function btn_ref_onclick(obj:Button, e:ClickEventInfo)
  225. {
  226. lf_GetAntibiocd("1");
  227. }
  228. //검색
  229. function group1_btn_search_onclick(obj:Button, e:ClickEventInfo)
  230. {
  231. lf_GetAntibiocd("2");
  232. }
  233. //초기화
  234. function btn_reset_onclick(obj:Button, e:ClickEventInfo)
  235. {
  236. ds_grid_grd_antibiocddetl.clearData();
  237. }
  238. //행추가
  239. function btn_addrow_onclick(obj:Button, e:ClickEventInfo)
  240. {
  241. var nRow = ds_grid_grd_antibiocddetl.addRow();
  242. ds_grid_grd_antibiocddetl.setColumn(nRow,"antibiofromdd",utlf_getCurrentDate());
  243. ds_grid_grd_antibiocddetl.setColumn(nRow,"antibiotodd","99991231");
  244. }
  245. //저장
  246. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  247. {
  248. var retVal = lf_dupKeyCheckAll(new Array("antibiocd"), ds_grid_grd_antibiocddetl);
  249. if (retVal > -1)
  250. {
  251. sysf_messageBox("항균제코드가 중복됩니다.","I","");
  252. ds_grid_grd_antibiocddetl.selectRow(retVal);
  253. return;
  254. }
  255. lf_ckeckNull();
  256. }
  257. // 검색어 입력 후 엔터키
  258. function group1_ipt_searchtext_onkeydown(obj:Edit, e:KeyEventInfo)
  259. {
  260. if(e.keycode=="13") lf_GetAntibiocd("2");
  261. }
  262. // 시작일자 종료일자 체크
  263. function ds_grid_grd_antibiocddetl_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  264. {
  265. var fromdd = ds_grid_grd_antibiocddetl.getColumn(e.row,"antibiofromdd");
  266. var todd = ds_grid_grd_antibiocddetl.getColumn(e.row,"antibiotodd");
  267. // 종료일자체크
  268. if((e.columnid == "antibiotodd") || (e.columnid == "antibiofromdd")){
  269. if(fromdd != "" && todd != "") {
  270. if(fromdd > todd){
  271. sysf_messageBox("종료일자가 시작일자보다 이전 날짜입니다.", "I","");
  272. ds_grid_grd_antibiocddetl.setColumn(e.row,"baccdtodd",ds_grid_grd_antibiocddetl.getOrgColumn(e.row,"antibiotodd"));
  273. }
  274. }
  275. }
  276. }
  277. function lf_dupKeyCheckAll(keyArr, dsParam:Dataset)
  278. {
  279. if (keyArr.length == 0) return false;
  280. for(var i=0;i<dsParam.getRowCount();i++)
  281. {
  282. if(!(dsParam.getRowType(i) == Dataset.ROWTYPE_INSERT || dsParam.getRowType(i) == Dataset.ROWTYPE_UPDATE))
  283. {
  284. //수정된 데이터하고만 비교 (속도문제)
  285. continue;
  286. }
  287. var keyValue = "";
  288. for(var colcnt=0; colcnt < keyArr.length; colcnt++)
  289. {
  290. if (colcnt == 0)
  291. {
  292. keyValue = keyArr[colcnt] +"=='"+ dsParam.getColumn(i, keyArr[colcnt]) +"'";
  293. }
  294. else
  295. {
  296. keyValue += " && "+ keyArr[colcnt] +"=='"+ dsParam.getColumn(i, keyArr[colcnt]) +"'";
  297. }
  298. }
  299. var keycheck = dsParam.findRowExpr(keyValue);
  300. if (keycheck == i)
  301. {
  302. keycheck = dsParam.findRowExpr(keyValue, i+1);
  303. }
  304. if (keycheck > -1)
  305. {
  306. return i;
  307. }
  308. }
  309. return -1;
  310. }]]></Script>
  311. </Form>
  312. </FDL>