SMLMF10100_통합배양균코드관리.xfdl 14 KB

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