SMLLF00400_용기코드관리.xfdl 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMLLF00400" position="absolute 0 0 1253 808" titletext="용기코드관리" oninit="model1_oninit" onload="SMLLF00400_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption2" text="용기코드상세내역" class="tit_2" position="absolute 1 78 125 98" positiontype="position" anchor="default"/>
  8. <Button id="btn_grdadd" taborder="3" text="행추가" class="btn2" position="absolute 925 75 981 95" anchor="top right" positiontype="position" onclick="btn_grdadd_onclick"/>
  9. <Static id="caption5" text="용기 실제 이미지" class="tit_2" position="absolute 990 78 1114 96" anchor="top right" positiontype="position"/>
  10. <Button id="saveExcel" taborder="11" text="엑셀" class="btn7" position="absolute 870 75 922 95" anchor="top right" positiontype="position" onclick="saveExcel_onclick"/>
  11. <Static id="caption6" text="용기코드관리" class="tit_1" position="absolute 1 1 107 26" positiontype="position" anchor="default"/>
  12. <ImageViewer id="img3" taborder="22" position="absolute 1065 101 1085 121" anchor="top right" positiontype="position" stretch="fit"/>
  13. <Static id="caption3" text="아이콘" class="cell_1" position="absolute 990 99 1062 123" style="align:left middle;" anchor="top right" positiontype="position"/>
  14. <Button id="btn_imgsave" taborder="24" text="이미지등록" class="btn2" position="absolute 1165 151 1245 171" anchor="top right" positiontype="position" onclick="btn_imgsave_onclick"/>
  15. <Static id="caption8" text="실제이미지" class="cell_1" position="absolute 990 124 1062 148" style="align:left middle;" anchor="top right" positiontype="position"/>
  16. <Edit id="opt_icon" taborder="26" position="absolute 1088 101 1228 121" anchor="top right" imemode="hangul" positiontype="position" autoselect="true"/>
  17. <Edit id="opt_org" taborder="27" position="absolute 1065 126 1228 146" anchor="top right" imemode="hangul" positiontype="position" autoselect="true"/>
  18. <Button id="icon_search1" taborder="28" class="icon_search" position="absolute 1225 101 1245 121" anchor="top right" text="" positiontype="position" onclick="icon_search1_onclick"/>
  19. <Button id="icon_search2" taborder="29" class="icon_search" position="absolute 1226 126 1246 146" anchor="top right" text="" positiontype="position" onclick="icon_search2_onclick"/>
  20. <Button id="btn_save" taborder="31" text="저장" class="btn4" position="absolute 1192 1 1248 21" anchor="top right" positiontype="position" onclick="btn_save_onclick"/>
  21. <ImageViewer id="img1" taborder="32" position="absolute 988 174 1246 501" onclick="img1_onclick" anchor="top right" visible="true" positiontype="position" stretch="fit"/>
  22. <Static id="caption00" text="용기 상세 설명" class="tit_2" position="absolute 988 506 1101 523" anchor="top right"/>
  23. <TextArea id="tube_detail" taborder="33" position="absolute 988 524 1247 801" anchor="top right" autoselect="true"/>
  24. <Div id="group2" anchor="left top right" taborder="34" position="absolute 1 26 1249 68" class="div_SA">
  25. <Layouts>
  26. <Layout>
  27. <Static id="caption1" text="조회구분" class="search_name" position="absolute 8 10 82 30" anchor="default"/>
  28. <Combo id="cmb_refgbn" taborder="61" value="1" text="사용코드" codecolumn="codecolumn" datacolumn="datacolumn" index="0" onitemchanged="group2_cmb_refgbn_onitemchanged" class="combo_search" position="absolute 82 10 232 30" anchor="default">
  29. <Dataset id="innerdataset">
  30. <ColumnInfo>
  31. <Column id="codecolumn" size="256"/>
  32. <Column id="datacolumn" size="256"/>
  33. </ColumnInfo>
  34. <Rows>
  35. <Row>
  36. <Col id="codecolumn">1</Col>
  37. <Col id="datacolumn">사용코드</Col>
  38. </Row>
  39. <Row>
  40. <Col id="codecolumn">2</Col>
  41. <Col id="datacolumn">전체코드</Col>
  42. </Row>
  43. </Rows>
  44. </Dataset>
  45. </Combo>
  46. <Button id="btn_search" taborder="62" text="조회" onclick="btn_search_onclick" class="btn1" position="absolute 256 10 312 30" anchor="default"/>
  47. <Button id="btn_ref" taborder="63" text="검색" onclick="btn_ref_onclick" class="btn1" position="absolute 1108 10 1164 30" anchor="top right"/>
  48. <Edit id="ipt_text" taborder="64" imemode="hangul" class="input_search" position="absolute 982 10 1092 30" anchor="top right" autoselect="true"/>
  49. <Combo id="cmb_searchgbn" taborder="65" value="1" text="용기코드" codecolumn="codecolumn" datacolumn="datacolumn" index="0" class="combo_search" position="absolute 829 10 979 30" anchor="top right">
  50. <Dataset id="innerdataset">
  51. <ColumnInfo>
  52. <Column id="codecolumn" size="256"/>
  53. <Column id="datacolumn" size="256"/>
  54. </ColumnInfo>
  55. <Rows>
  56. <Row>
  57. <Col id="codecolumn">1</Col>
  58. <Col id="datacolumn">용기코드</Col>
  59. </Row>
  60. <Row>
  61. <Col id="codecolumn">2</Col>
  62. <Col id="datacolumn">용기명</Col>
  63. </Row>
  64. </Rows>
  65. </Dataset>
  66. </Combo>
  67. <Static id="caption4" text="검색구분" class="search_name" position="absolute 755 10 829 30" anchor="top right"/>
  68. <Button id="btn_reset" taborder="66" text="초기화" onclick="btn_reset_onclick" class="btn1" position="absolute 1167 10 1236 30" anchor="top right"/>
  69. </Layout>
  70. </Layouts>
  71. </Div>
  72. <Grid id="grd_tube" taborder="35" binddataset="ds_grid_grd_tube" autoenter="select" useinputpanel="false" autofittype="col" oncellclick="grd_tube_oncellclick" onheadclick="grdf_setEventGrid" position="absolute 1 98 981 806" onclick="grd_tube_onclick" anchor="all">
  73. <Formats>
  74. <Format id="default">
  75. <Columns>
  76. <Column size="30"/>
  77. <Column size="90"/>
  78. <Column size="90"/>
  79. <Column size="60"/>
  80. <Column size="120"/>
  81. <Column size="80"/>
  82. <Column size="80"/>
  83. <Column size="80"/>
  84. <Column size="80"/>
  85. <Column size="50"/>
  86. <Column size="50"/>
  87. <Column size="60"/>
  88. <Column size="140"/>
  89. </Columns>
  90. <Rows>
  91. <Row size="24" band="head"/>
  92. <Row size="20"/>
  93. </Rows>
  94. <Band id="head">
  95. <Cell/>
  96. <Cell col="1" text="사용시작일자"/>
  97. <Cell col="2" text="사용종료일자"/>
  98. <Cell col="3" text="용기코드"/>
  99. <Cell col="4" text="용기명"/>
  100. <Cell col="5" text="용기명(화면)"/>
  101. <Cell col="6" text="용기명(약어)"/>
  102. <Cell col="7" text="용기명(출력)"/>
  103. <Cell col="8" text="용기명(라벨)"/>
  104. <Cell col="9" text="용량"/>
  105. <Cell col="10" text="단위"/>
  106. <Cell col="11" text="표시순서"/>
  107. <Cell col="12" text="용기아이콘"/>
  108. </Band>
  109. <Band id="body">
  110. <Cell celltype="head" displaytype="image"/>
  111. <Cell col="1" displaytype="date" edittype="date" text="bind:tubefromdd"/>
  112. <Cell col="2" displaytype="date" edittype="date" text="bind:tubetodd"/>
  113. <Cell col="3" displaytype="expr:ds_grid_grd_tube.getRowType(currow) == '2' ? 'text' : 'normal'" text="bind:tubecd"/>
  114. <Cell col="4" displaytype="text" text="bind:tubenm" editlimit="30" editlengthunit="utf8"/>
  115. <Cell col="5" displaytype="text" edittype="text" text="bind:tubescrnnm" editlimit="30" editlengthunit="utf8"/>
  116. <Cell col="6" displaytype="text" edittype="text" text="bind:tubeabbrnm" editlimit="20" editlengthunit="utf8"/>
  117. <Cell col="7" displaytype="text" edittype="text" text="bind:tubeprntnm" editlimit="20" editlengthunit="utf8"/>
  118. <Cell col="8" displaytype="text" edittype="text" text="bind:tubelblnm" editlimit="30" editlengthunit="utf8"/>
  119. <Cell col="9" displaytype="text" edittype="text" style="align:right middle;" text="bind:tubevol" editlimit="10" editlengthunit="utf8"/>
  120. <Cell col="10" displaytype="combo" edittype="combo" style="align:left middle;" text="bind:tubeunit" editlimit="10" editlengthunit="utf8" combodataset="ds_init_lb1140" combocodecol="cd" combodatacol="nm"/>
  121. <Cell col="11" displaytype="text" edittype="text" text="bind:tubedispseq" editlimit="10" editlengthunit="utf8"/>
  122. <Cell col="12" displaytype="image" edittype="none" style="align:center middle;" text="bind:tubeiconimg"/>
  123. </Band>
  124. </Format>
  125. </Formats>
  126. </Grid>
  127. <Static id="cap_tube" position="absolute 992 174 1240 501" anchor="top right"/>
  128. </Layout>
  129. </Layouts>
  130. <Objects>
  131. <Dataset id="ds_grid_grd_tube" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false" onvaluechanged="ds_grid_grd_tube_onvaluechanged">
  132. <ColumnInfo>
  133. <Column id="tubefromdd" type="STRING"/>
  134. <Column id="tubetodd" type="STRING"/>
  135. <Column id="tubecd" type="STRING"/>
  136. <Column id="tubenm" type="STRING"/>
  137. <Column id="tubescrnnm" type="STRING"/>
  138. <Column id="tubeabbrnm" type="STRING"/>
  139. <Column id="tubeprntnm" type="STRING"/>
  140. <Column id="tubelblnm" type="STRING"/>
  141. <Column id="tubevol" type="STRING"/>
  142. <Column id="tubeunit" type="STRING"/>
  143. <Column id="tubedispseq" type="STRING"/>
  144. <Column id="tubeiconimg" type="BLOB"/>
  145. <Column id="tubeiconimgnm" type="STRING"/>
  146. <Column id="tubeorgimgnm" type="STRING"/>
  147. <Column id="tubeorgimg" type="BLOB"/>
  148. <Column id="tubedetail" type="STRING" size="0"/>
  149. </ColumnInfo>
  150. </Dataset>
  151. <Dataset id="ds_cond" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  152. <ColumnInfo>
  153. <Column id="searchgbn" type="STRING" size="256"/>
  154. <Column id="text" type="STRING" size="256"/>
  155. <Column id="deptflag" type="STRING" size="256"/>
  156. <Column id="codeflag" type="STRING" size="256"/>
  157. <Column id="refgbn" type="STRING" size="256"/>
  158. <Column id="grdtube" type="STRING" size="256"/>
  159. </ColumnInfo>
  160. <Rows>
  161. <Row>
  162. <Col id="deptflag">L</Col>
  163. </Row>
  164. </Rows>
  165. </Dataset>
  166. <Dataset id="ds_init_lb0000" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  167. <ColumnInfo>
  168. <Column id="cd" type="STRING" size="256"/>
  169. <Column id="nm" type="STRING" size="256"/>
  170. <Column id="chk" type="STRING" size="256"/>
  171. <Column id="etc01" type="STRING" size="256"/>
  172. <Column id="etc02" type="STRING" size="256"/>
  173. <Column id="etc03" type="STRING" size="256"/>
  174. <Column id="etc04" type="STRING" size="256"/>
  175. <Column id="etc05" type="STRING" size="256"/>
  176. </ColumnInfo>
  177. </Dataset>
  178. <Dataset id="ds_init_tubeunit" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  179. <ColumnInfo>
  180. <Column id="cd" type="STRING" size="256"/>
  181. <Column id="nm" type="STRING" size="256"/>
  182. </ColumnInfo>
  183. <Rows>
  184. <Row>
  185. <Col id="cd">1</Col>
  186. <Col id="nm">ml</Col>
  187. </Row>
  188. <Row>
  189. <Col id="cd">2</Col>
  190. <Col id="nm">EA</Col>
  191. </Row>
  192. <Row>
  193. <Col id="cd">3</Col>
  194. <Col id="nm">mg</Col>
  195. </Row>
  196. <Row>
  197. <Col id="cd">4</Col>
  198. <Col id="nm">cc</Col>
  199. </Row>
  200. </Rows>
  201. </Dataset>
  202. <Dataset id="ds_grid_grd_select" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  203. <Dataset id="ds_imginfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  204. <ColumnInfo>
  205. <column id="imgrslt" type="byte"/>
  206. <column id="imgwidt" type="int"/>
  207. <column id="imght" type="int"/>
  208. <column id="orgimg" type="byte"/>
  209. <column id="orgwidt" type="int"/>
  210. <column id="orght" type="int"/>
  211. </ColumnInfo>
  212. </Dataset>
  213. <Dataset id="ds_grd_imageLoad" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  214. <ColumnInfo>
  215. <Column type="String" id="image1" size="255"/>
  216. <Column type="String" id="image2" size="255"/>
  217. <Column id="imgdata1" type="BLOB" size="256"/>
  218. <Column id="imgdata2" type="BLOB" size="256"/>
  219. </ColumnInfo>
  220. </Dataset>
  221. <Dataset id="ds_init_lb1140" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  222. <ColumnInfo>
  223. <Column id="cd" type="STRING" size="256"/>
  224. <Column id="nm" type="STRING" size="256"/>
  225. <Column id="etc01" type="STRING" size="256"/>
  226. </ColumnInfo>
  227. </Dataset>
  228. <Dataset id="ds_database_instcd" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  229. <Dataset id="ds_print" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  230. <ColumnInfo>
  231. <Column id="able" type="STRING" size="256"/>
  232. </ColumnInfo>
  233. </Dataset>
  234. <Dataset id="ds_execute" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  235. <ColumnInfo>
  236. <Column id="able" type="STRING" size="256"/>
  237. </ColumnInfo>
  238. </Dataset>
  239. </Objects>
  240. <Bind>
  241. <BindItem id="item0" compid="saveExcel" propid="enable" datasetid="ds_print" columnid="able"/>
  242. <BindItem id="item1" compid="btn_grdadd" propid="enable" datasetid="ds_execute" columnid="able"/>
  243. <BindItem id="item2" compid="btn_save" propid="enable" datasetid="ds_execute" columnid="able"/>
  244. <BindItem id="item3" compid="btn_imgsave" propid="enable" datasetid="ds_execute" columnid="able"/>
  245. <BindItem id="item4" compid="tube_detail" propid="value" datasetid="ds_grid_grd_tube" columnid="tubedetail"/>
  246. </Bind>
  247. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  248. * System Name :
  249. * Job Name :
  250. * Creator :
  251. * Make Date : 2015-11-09
  252. * Description :
  253. *---------------------------------------------------------------------------------------
  254. * Modify Date Modifier Modify Description
  255. *---------------------------------------------------------------------------------------
  256. * 2015-11-09 Live Converter TF->XP
  257. *
  258. *---------------------------------------------------------------------------------------
  259. ****************************************************************************************/
  260. include "com_commonxp::comm_main.xjs";
  261. include "lis_commonxp::LLZ001.xjs";
  262. function SMLLF00400_onload(obj:Form, e:LoadEventInfo)
  263. {
  264. //lgv_sTargetDb = "hisdb"; //테스트 환경설정
  265. frmf_initForm(obj); // 화면공통
  266. grdf_setRowTypeIcon(grd_tube, 0);
  267. lf_exeInitialize();
  268. lf_commoduleDataSetShow(); //DataSet 조회;
  269. //lf_getTubeList();
  270. lf_setTubeTodd();
  271. lf_settodd();
  272. lf_menumaster();//메뉴권한
  273. }
  274. //조회구분에따라 사용종료일자 숨기기
  275. function lf_settodd(){
  276. if(group2.cmb_refgbn.value == "1"){
  277. grd_tube.setFormatColProperty(2,"size",0);
  278. } else {
  279. grd_tube.setFormatColProperty(2,"size",90);
  280. }
  281. }
  282. function lf_exeInitialize(){
  283. lf_getDbDeptcd("0000|");
  284. }
  285. function lf_getTubeList()
  286. {
  287. //리스트 조회(조회버튼 클릭시)
  288. var sInDsName = dsf_createDsRow("ds_temp_search"
  289. , [{col: "refgbn", val:group2.cmb_refgbn.value }
  290. , {col: "deptflag", val:lgv_sUserdeptflagcd}]);
  291. var oParam = {};
  292. oParam.id = "TRLLF00401";
  293. oParam.service = "diagtestbaseinfomngtapp.GeneralTestBaseInfoMngt";
  294. oParam.method = "reqGetTubeList";
  295. oParam.inds = "cond="+sInDsName;
  296. oParam.outds = "ds_grid_grd_tube=gettube";
  297. oParam.async = false;
  298. tranf_submit(oParam);
  299. }
  300. //화면 초기화
  301. function lf_initForm(){
  302. ds_grid_grd_tube.clearData();
  303. grd_tube.setFormatColProperty(3,"size",0);
  304. group2.cmb_refgbn.value="1";
  305. group2.cmb_searchgbn.value="1";
  306. }
  307. //널값 체크 (그리드 필수값 체크)
  308. function lf_ckeckNull(){
  309. var bChkValue= frmf_chkMdtGrid(grd_tube,[2,3,4,5,6,12],["용기사용시작일","용기사용종료일","용기코드","용기명","용기화면명","표시순서"]);
  310. var sTubeCd = "";
  311. trace("bChkValue = " + bChkValue );
  312. if(bChkValue==true) {
  313. if(lgv_sUserdeptflagcd=="N"){
  314. for(var i=0; i<ds_grid_grd_tube.rowcount; i++){
  315. if(ds_grid_grd_tube.getRowType(i) == "2" || ds_grid_grd_tube.getRowType(i) == "4"){
  316. sTubeCd = ds_grid_grd_tube.getColumn(i,"tubecd"); ;
  317. sTubeCd = sTubeCd.substr(0, 1);
  318. if(sTubeCd != "N"){
  319. sysf_messageBox("방사면역 용기코드는 첫 문자가 N으로 시작해야지만 등록 가능합니다.", "I");
  320. return;
  321. }
  322. }
  323. }
  324. }else{
  325. for(var i=0; i<ds_grid_grd_tube.rowcount; i++){
  326. if(ds_grid_grd_tube.getRowType(i) == "2" || ds_grid_grd_tube.getRowType(i) == "4"){
  327. sTubeCd= ds_grid_grd_tube.getColumn(i,"tubecd"); ;
  328. sTubeCd=sTubeCd.substr(0, 1);
  329. if(sTubeCd=="N"){
  330. sysf_messageBox("첫 문자가 N인 용기코드는 방사면역에서만 사용 가능합니다.","I");
  331. return;
  332. }
  333. }
  334. }
  335. }
  336. lf_saveTubeInfo();
  337. }
  338. }
  339. //데이터 저장
  340. function lf_saveTubeInfo(){
  341. // 서브밋호출
  342. var sInDsName = dsf_createDsRow("ds_temp_search"
  343. , [{col: "deptflag", val: lgv_sUserdeptflagcd }]);
  344. var oParam = {};
  345. oParam.id = "TXLLF00401";
  346. oParam.service = "diagtestbaseinfomngtapp.GeneralTestBaseInfoMngt";
  347. oParam.method = "reqExeSaveTubeInfo";
  348. oParam.inds = "tubedt=ds_grid_grd_tube:U flist="+sInDsName;
  349. oParam.async = false;
  350. oParam.callback = "CBF_SMLLF00400";
  351. tranf_submit(oParam);
  352. }
  353. //콜백함수
  354. function CBF_SMLLF00400(strSvcID, nErrorCode, strErrorMag)
  355. {
  356. if(strSvcID == "TXLLF00401" && nErrorCode==0){
  357. lf_getTubeList();
  358. sysf_messageBox("","I001","");
  359. }
  360. }
  361. function lf_getTubeSrch(){
  362. //용기코드 및 용기명 별 검색 (검색버튼 클릭시)
  363. var sInDsName = dsf_createDsRow("ds_temp_search"
  364. , [{col: "searchgbn", val:group2.cmb_searchgbn.value }
  365. , {col: "text", val:group2.ipt_text.value}
  366. , {col: "deptflag", val:lgv_sUserdeptflagcd}]);
  367. var oParam = {};
  368. oParam.id = "TRLLF00402";
  369. oParam.service = "diagtestbaseinfomngtapp.GeneralTestBaseInfoMngt";
  370. oParam.method = "reqGetTubeListRef";
  371. oParam.inds = "cond="+sInDsName;
  372. oParam.outds = "ds_grid_grd_tube=gettuberef";
  373. oParam.async = false;
  374. tranf_submit(oParam);
  375. }
  376. //엑셀저장
  377. function lf_savegrdexcel(){
  378. grdf_exportExcel(grd_tube,lf_lisGetTitle(this) + "_" + "용기코드상세내역", "sheet1", false);
  379. }
  380. function lf_getTubeOrgImg(){
  381. var aRow = ds_grid_grd_tube.rowposition;
  382. if(ds_grid_grd_tube.getColumn(aRow,"tubeorgimg")==""){
  383. img1.visible="false";
  384. cap_tube.visible="true";
  385. } else {
  386. img1.visible = "true";
  387. cap_tube.visible = "false";
  388. img1.image = ds_grid_grd_tube.getColumn(aRow,"tubeorgimg");
  389. img3.image = ds_grid_grd_tube.getColumn(aRow,"tubeiconimg");
  390. }
  391. }
  392. function fn_imageChange(sImage, sImageDb){
  393. var fd = new FileDialog;
  394. //fd.filter = "비트맵(*.bmp)|*.bmp|PNG(*.png)|*.png|";
  395. fd.filter = "이미지 파일 (*.jpg;*.png;*.gif;*.bmp)|*.jpg;*.png;*.gif;*.bmp|";
  396. var vFile = utlf_transNull(fd.open("FileOpen", FileDialog.LOAD),"");
  397. var cRow = ds_grid_grd_tube.rowposition;
  398. if(sImage == "image1"){
  399. //방법1.
  400. //이미지 BLOB 형식으로 write 한다
  401. //trace("==== : "+ vFile +" / "+ vFile.length);
  402. var rtn = vFile.open(VirtualFile.openRead | VirtualFile.openBinary);
  403. vFile.seek(0,VirtualFile.seekBegin);
  404. var bData = new Buffer(vFile.read(vFile.getFileSize()));
  405. if( ds_grd_imageLoad.getRowCount() <= 0 ) {
  406. ds_grd_imageLoad.addRow();
  407. }
  408. ds_grd_imageLoad.setColumn(0, sImage, bData.data); //Display 칼럼 : image1 / image2
  409. ds_grd_imageLoad.setColumn(0, sImageDb, bData.data); //DB저장 칼럼 : imgdata / imgdata2
  410. ds_grid_grd_tube.setColumn(cRow,"tubeiconimg",bData.data); //그리드 데이터셋에 이미지정보 저장
  411. img3.image = ds_grd_imageLoad.getColumn(0,"imgdata1");
  412. //이미지 경로 받아오기
  413. var addr = vFile.fullpath;
  414. opt_icon.value=addr;
  415. if(img3.imageheight>20 || img3.imagewidth>20){
  416. sysf_messageBox("아이콘 이미지는 가로 세로 (20 X 20) 를 넘을수 없습니다.", "E");
  417. //초기화
  418. opt_icon.value = "";
  419. ds_grd_imageLoad.clearData();
  420. img3.image = ds_grd_imageLoad.getColumn(0,"imgdata1");
  421. return false;
  422. }
  423. } else if(sImage == "image2"){
  424. //방법1.
  425. //이미지 BLOB 형식으로 write 한다
  426. //trace("==== : "+ vFile +" / "+ vFile.length);
  427. var rtn = vFile.open(VirtualFile.openRead | VirtualFile.openBinary);
  428. vFile.seek(0,VirtualFile.seekBegin);
  429. var bData = new Buffer(vFile.read(vFile.getFileSize()));
  430. if( ds_grd_imageLoad.getRowCount() <= 0 ) {
  431. ds_grd_imageLoad.addRow();
  432. }
  433. ds_grd_imageLoad.setColumn(0, sImage, bData.data); //Display 칼럼 : image1 / image2
  434. ds_grd_imageLoad.setColumn(0, sImageDb, bData.data); //DB저장 칼럼 : imgdata / imgdata2
  435. ds_grid_grd_tube.setColumn(cRow,"tubeorgimg",bData.data); //그리드 데이터셋에 이미지정보 저장
  436. img1.image = ds_grd_imageLoad.getColumn(0,"imgdata2");
  437. //이미지 경로 받아오기
  438. var addr = vFile.fullpath;
  439. opt_org.value=addr;
  440. if(img1.imageheight>500 || img1.imagewidth>500){
  441. sysf_messageBox("실제 이미지는 가로 세로 (500 X 500) 을 넘을수 없습니다. ", "E");
  442. //초기화
  443. opt_org.value="";
  444. ds_grd_imageLoad.clearData();
  445. img1.image = ds_grd_imageLoad.getColumn(0,"imgdata2");
  446. return false;
  447. }
  448. }
  449. }
  450. //용기아이콘 이미지 저장
  451. function lf_exeTubeImg(){
  452. var iRow = ds_grid_grd_tube.rowposition;
  453. var tubecd = ds_grid_grd_tube.getColumn(iRow,"tubecd");
  454. if(tubecd==""){
  455. sysf_messageBox("용기를 선택하십시오.", "E");
  456. return;
  457. }
  458. if(utlf_transNullToEmpty(ds_grd_imageLoad.getColumn(0,"imgdata1")) == "" ||
  459. utlf_transNullToEmpty(ds_grd_imageLoad.getColumn(0,"imgdata2")) == ""){
  460. sysf_messageBox("등록 할 이미지를 선택하십시오.", "E");
  461. return;
  462. }
  463. // 서브밋호출
  464. var sInDsName = dsf_createDsRow("ds_temp_tubecd"
  465. , [{col: "tubecd", val: tubecd }
  466. ]);
  467. var ds_imginfo = dsf_createDsRow("ds_temp_imginfo"
  468. , [{col: "imgrslt", type:"BLOB",val: ds_grd_imageLoad.getColumn(0,"imgdata1") }
  469. , {col: "imgwidt", val: img3.imagewidth }
  470. , {col: "imght", val: img3.imageheight }
  471. , {col: "orgimg", type:"BLOB",val: ds_grd_imageLoad.getColumn(0,"imgdata2") }
  472. , {col: "orgwidt", val: img1.imagewidth }
  473. , {col: "orght", val: img1.imageheight }]);
  474. var oParam = {};
  475. oParam.id = "TXLLF00402";
  476. oParam.service = "diagtestbaseinfomngtapp.GeneralTestBaseInfoMngt";
  477. oParam.method = "reqExeTubeImg";
  478. oParam.inds = "tubedata="+sInDsName +" imgdata="+ds_imginfo;
  479. oParam.async = false;
  480. oParam.callback = "cbf_TXLLF00402";
  481. tranf_submit(oParam);
  482. //다시 조회
  483. lf_getTubeSrch();
  484. }
  485. //콜백함수
  486. function cbf_TXLLF00402(strSvcID, nErrorCode, strErrorMag){
  487. if(strSvcID == "TXLLF00402" && nErrorCode==0){
  488. sysf_messageBox("저장이","I002","");
  489. }
  490. }
  491. // 종료된 용기 정보 다른색으로 보여주기
  492. function lf_setTubeTodd(){
  493. var tDay = utlf_getCurrentDate();
  494. grdf_setRowStyle(grd_tube,"0",tDay,"tubetodd","small");
  495. }
  496. //진검 사용자별 메뉴권한
  497. function lf_menumaster(){
  498. var edit = frmf_checkAuth("X");
  499. var print = frmf_checkAuth("P");
  500. var eRow = ds_execute.addRow();
  501. var pRow = ds_print.addRow();
  502. if(edit == true){
  503. ds_execute.setColumn(eRow,"able",true);
  504. }
  505. if(print == true){
  506. ds_print.setColumn(pRow,"able",true);
  507. }
  508. }
  509. function group2_cmb_refgbn_onitemchanged(obj:Combo, e:ItemChangeEventInfo)
  510. {
  511. lf_settodd();
  512. lf_getTubeList(); //조회
  513. }
  514. function btn_search_onclick(obj:Button, e:ClickEventInfo)
  515. {
  516. lf_getTubeList();
  517. }
  518. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  519. {
  520. trace("저장");
  521. //lf_ckeckNull();
  522. trace("fNullCheck() = " + fNullCheck());
  523. if(fNullCheck()=="true")
  524. {
  525. lf_saveTubeInfo();
  526. }
  527. //lf_setTubeTodd();
  528. }
  529. // Null 체크
  530. function fNullCheck()
  531. {
  532. trace("???");
  533. var msg = "";
  534. var nullyn = "true";
  535. for(i = 0; i < ds_grid_grd_tube.rowcount; i++)
  536. {
  537. if(ds_grid_grd_tube.getColumn(i, "tubecd") == "")
  538. {
  539. msg = "[용기코드] 는 " ;
  540. sysf_messageBox(msg, "I003", "");
  541. return "false";
  542. }
  543. if(ds_grid_grd_tube.getColumn(i, "tubefromdd") == "")
  544. {
  545. msg = "[용기시용시작일] 은 " ;
  546. sysf_messageBox(msg, "I003", "");
  547. return "false";
  548. }
  549. if(ds_grid_grd_tube.getColumn(i, "tubetodd") == "")
  550. {
  551. msg = "[용기시용종료일] 은 " ;
  552. sysf_messageBox(msg, "I003", "");
  553. return "false";
  554. }
  555. if(ds_grid_grd_tube.getColumn(i, "tubenm") == "")
  556. {
  557. msg = "[용기명] 은 " ;
  558. sysf_messageBox(msg, "I003", "");
  559. return "false";
  560. }
  561. if(ds_grid_grd_tube.getColumn(i, "tubescrnnm") == "")
  562. {
  563. msg = "[용기화면명] 은 " ;
  564. sysf_messageBox(msg, "I003", "");
  565. return "false";
  566. }
  567. if(ds_grid_grd_tube.getColumn(i, "tubedispseq") == "")
  568. {
  569. msg = "[표시순서] 는 " ;
  570. sysf_messageBox(msg, "I003", "");
  571. return "false";
  572. }
  573. return nullyn;
  574. }
  575. trace("nullyn = " + nullyn);
  576. }
  577. function btn_reset_onclick(obj:Button, e:ClickEventInfo)
  578. {
  579. lf_initForm();
  580. }
  581. function saveExcel_onclick(obj:Button, e:ClickEventInfo)
  582. {
  583. lf_savegrdexcel();
  584. }
  585. function btn_ref_onclick(obj:Button, e:ClickEventInfo)
  586. {
  587. lf_getTubeSrch();
  588. }
  589. //행추가
  590. function btn_grdadd_onclick(obj:Button, e:ClickEventInfo)
  591. {
  592. if(group2.cmb_refgbn.value == "2"){ //전체코드 상태에서 행추가 안됨.
  593. sysf_messageBox("사용코드 조회상태일 때 행을 추가할 수 있습니다.", "I");
  594. return;
  595. }
  596. var nRow =0;
  597. var nSeq =0;
  598. var objArg = new Object();
  599. ds_grid_grd_select.clearData();
  600. var s = frmf_modal("SPLLF10600", "SPLLF10600", objArg, "", "", "", "", "", "", "", "", "", "M");
  601. for(var i=0; i < ds_grid_grd_select.rowcount;i++){
  602. if(ds_grid_grd_select.getColumn(i,"chk")==1){
  603. nRow = ds_grid_grd_tube.addRow();
  604. ds_grid_grd_tube.setColumn(nRow,"tubefromdd",utlf_getCurrentDate());
  605. ds_grid_grd_tube.setColumn(nRow,"tubetodd","99991231");
  606. ds_grid_grd_tube.setColumn(nRow,"tubecd",ds_grid_grd_select.getColumn(i,"tubecd"));
  607. ds_grid_grd_tube.setColumn(nRow,"tubenm",ds_grid_grd_select.getColumn(i,"tubenm"));
  608. ds_grid_grd_tube.setColumn(nRow,"tubescrnnm",ds_grid_grd_select.getColumn(i,"tubescrnnm"));
  609. ds_grid_grd_tube.setColumn(nRow,"tubeabbrnm",ds_grid_grd_select.getColumn(i,"tubeabbrnm"));
  610. ds_grid_grd_tube.setColumn(nRow,"tubeprntnm",ds_grid_grd_select.getColumn(i,"tubeprntnm"));
  611. ds_grid_grd_tube.setColumn(nRow,"tubelblnm",ds_grid_grd_select.getColumn(i,"tubelblnm"));
  612. ds_grid_grd_tube.setColumn(nRow,"tubevol",ds_grid_grd_select.getColumn(i,"tubevol"));
  613. ds_grid_grd_tube.setColumn(nRow,"tubeunit",ds_grid_grd_select.getColumn(i,"tubeunit"));
  614. ds_grid_grd_tube.setColumn(nRow,"tubeiconimgnm","-");
  615. ds_grid_grd_tube.setColumn(nRow,"tubeorgimgnm","-");
  616. ds_grid_grd_tube.setColumn(nRow,"tubeiconimg","");
  617. ds_grid_grd_tube.setColumn(nRow,"tubeorgimg","");
  618. var Lseq="";
  619. if(ds_grid_grd_tube.rowcount<2){
  620. Lseq="1";
  621. }else{
  622. Lseq= parseInt(ds_grid_grd_tube.getColumn(ds_grid_grd_tube.rowcount-2,"tubedispseq"))+1;
  623. }
  624. ds_grid_grd_tube.setColumn(nRow,"tubedispseq",Lseq);
  625. }
  626. }
  627. ds_grid_grd_select.clearData();
  628. }
  629. function icon_search1_onclick(obj:Button, e:ClickEventInfo)
  630. {
  631. if( !(fn_imageChange("image1", "imgdata1")) ) return false;
  632. img3.image = ds_grd_imageLoad.getColumn(0,"imgdata1");
  633. }
  634. function icon_search2_onclick(obj:Button, e:ClickEventInfo)
  635. {
  636. if( !(fn_imageChange("image2", "imgdata2")) ) return false;
  637. img1.image = ds_grd_imageLoad.getColumn(0,"imgdata2");
  638. }
  639. function grd_tube_oncellclick(obj:Grid, e:GridClickEventInfo)
  640. {
  641. lf_getTubeOrgImg();
  642. }
  643. //용기 아이콘 이미지 저장
  644. function btn_imgsave_onclick(obj:Button, e:ClickEventInfo)
  645. {
  646. lf_exeTubeImg();
  647. //아이콘 초기화
  648. opt_icon.value = "";
  649. ds_grd_imageLoad.clearData();
  650. img3.image = ds_grd_imageLoad.getColumn(0,"imgdata1");
  651. //실제이미지 초기화
  652. opt_org.value="";
  653. ds_grd_imageLoad.clearData();
  654. img1.image = ds_grd_imageLoad.getColumn(0,"imgdata2");
  655. }
  656. ]]></Script>
  657. </Form>
  658. </FDL>