SMADB00500_효능분류관리.xfdl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMADB00500" position="absolute 0 0 1196 695" titletext="효능분류관리" oninit="SMADB00500_oninit" onload="SMADB00500_onload">
  5. <Layouts>
  6. <Layout>
  7. <Button id="btn_save" taborder="1" text="저장" class="btn4" position="absolute 1137 2 1193 24" onclick="btn_save_onclick" anchor="top right"/>
  8. <Static id="caption19" text="효능분류관리" class="tit_1" position="absolute 0 0 106 25"/>
  9. <Div id="group2" taborder="2" style="align:center top;" class="div_SA" position="absolute 0 25 1193 65" anchor="left top right">
  10. <Layouts>
  11. <Layout>
  12. <Static id="caption2" text="코드 :" class="search_name" position="absolute 16 12 61 29" anchor="default"/>
  13. <Edit id="inp_codecd" taborder="1" class="input_search" position="absolute 65 10 195 31" onkeydown="group2_inp_codecd_onkeydown" anchor="default"/>
  14. <Static id="caption1" text="명칭 :" class="search_name" position="absolute 236 12 281 29" anchor="default"/>
  15. <Edit id="inp_codenm" taborder="2" class="input_search" position="absolute 285 10 705 31" onkeydown="group2_inp_codenm_onkeydown" anchor="default"/>
  16. <Shape id="line13" linetype="vertical" class="line_4" position="absolute 1117 9 1123 31" anchor="top right"/>
  17. <Button id="btn_sea" taborder="3" text="조회" class="btn1" position="absolute 1128 9 1184 31" onclick="group2_btn_sea_onclick" anchor="top right"/>
  18. </Layout>
  19. </Layouts>
  20. </Div>
  21. <Button id="button49" taborder="3" text="행삭제" onclick="group3_button49_onclick" class="btn2" position="absolute 1140 75 1193 97" anchor="top right"/>
  22. <Button id="button2" taborder="4" text="행추가" onclick="group3_button2_onclick" class="btn2" position="absolute 1030 75 1083 97" anchor="top right"/>
  23. <Button id="button50" taborder="5" text="행복사" onclick="group3_button50_onclick" class="btn2" position="absolute 1085 75 1138 97" anchor="top right"/>
  24. <Grid id="grd_efficacylist1" taborder="6" binddataset="ds_grd_efficacylist1" useinputpanel="false" autofittype="col" treeusecheckbox="false" treeuseimage="false" treeinitstatus="expand,null" position="absolute 0 99 1194 692" anchor="all" cellsizingtype="both" extendsizetype="row" autoenter="key" oncelldblclick="grd_efficacylist1_oncelldblclick">
  25. <Formats>
  26. <Format id="default">
  27. <Columns>
  28. <Column size="25" band="left"/>
  29. <Column size="194"/>
  30. <Column size="776"/>
  31. <Column size="82"/>
  32. <Column size="96"/>
  33. </Columns>
  34. <Rows>
  35. <Row size="24" band="head"/>
  36. <Row size="24"/>
  37. </Rows>
  38. <Band id="head">
  39. <Cell/>
  40. <Cell col="1" text="코드"/>
  41. <Cell col="2" text="효능분류명"/>
  42. <Cell col="3" text="레벨"/>
  43. <Cell col="4" text="조회순서"/>
  44. </Band>
  45. <Band id="body">
  46. <Cell celltype="head"/>
  47. <Cell col="1" displaytype="tree" edittype="tree" text="bind:efcycd" editautoselect="true" treelevel="bind:efcylevel"/>
  48. <Cell col="2" displaytype="text" edittype="text" text="bind:efcynm" editautoselect="true"/>
  49. <Cell col="3" displaytype="normal" edittype="normal" editfilter="digit" text="bind:efcylevel" editlimit="5" editautoselect="true"/>
  50. <Cell col="4" displaytype="text" edittype="text" style="align:center middle;" text="bind:dispno" editautoselect="true"/>
  51. </Band>
  52. </Format>
  53. </Formats>
  54. </Grid>
  55. </Layout>
  56. </Layouts>
  57. <Objects>
  58. <Dataset id="ds_grd_efficacylist1" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
  59. <ColumnInfo>
  60. <Column id="efcycd" type="STRING"/>
  61. <Column id="efcynm" type="STRING"/>
  62. <Column id="efcylevel" type="STRING"/>
  63. <Column id="dispno" type="STRING"/>
  64. </ColumnInfo>
  65. <Rows>
  66. <Row/>
  67. </Rows>
  68. </Dataset>
  69. <Dataset id="ds_send_searchdata" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  70. <ColumnInfo>
  71. <Column id="srchcomcd" type="STRING" size="256"/>
  72. <Column id="srchcomnm" type="STRING" size="256"/>
  73. </ColumnInfo>
  74. <Rows>
  75. <Row/>
  76. </Rows>
  77. </Dataset>
  78. <Dataset id="ds_send_req" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  79. <Dataset id="ds_temp_efficacylist1" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  80. </Objects>
  81. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  82. * System Name :
  83. * Job Name :
  84. * Creator :
  85. * Make Date : 2015-10-28
  86. * Description :
  87. *---------------------------------------------------------------------------------------
  88. * Modify Date Modifier Modify Description
  89. *---------------------------------------------------------------------------------------
  90. * 2015-10-28 Live Converter TF->XP
  91. *
  92. *---------------------------------------------------------------------------------------
  93. ****************************************************************************************/
  94. include "com_commonxp::comm_main.xjs";
  95. var arErrorCode = new HashArray();
  96. /******************************************************************
  97. * Argument :
  98. * Description : 초기화
  99. ******************************************************************/
  100. function SMADB00500_oninit(obj:Form, e:InitEventInfo)
  101. {
  102. frmf_initForm(obj);
  103. }
  104. function SMADB00500_onload(obj:Form, e:LoadEventInfo)
  105. {
  106. grdf_setRowTypeIcon(grd_efficacylist1, 0);
  107. //권한관리
  108. btn_save.enable = frmf_checkAuth("X"); //저장
  109. grdf_initGrid(grd_efficacylist1);
  110. }
  111. /******************************************************************
  112. * Argument :
  113. * Description : 조회
  114. ******************************************************************/
  115. function group2_btn_sea_onclick(obj:Button, e:ClickEventInfo)
  116. {
  117. var getCode = group2.inp_codecd.text;
  118. var getCdnm = group2.inp_codenm.text;
  119. ds_send_searchdata.setColumn(0, "srchcomcd", getCode);
  120. ds_send_searchdata.setColumn(0, "srchcomnm", getCdnm);
  121. var oParam = {};
  122. oParam.id = "TRADB00501";
  123. oParam.service = "pharmacybaseapp.EfficacyCode";
  124. oParam.method = "reqGetEfficacyList";
  125. oParam.inds = "req=ds_send_searchdata";
  126. oParam.outds = "ds_grd_efficacylist1=item";
  127. oParam.async = false;
  128. //oParam.callback = "cf_TRADB00501";
  129. tranf_submit(oParam);
  130. ds_temp_efficacylist1.copyData(ds_grd_efficacylist1);
  131. }
  132. // 코드 입력 후 Enter
  133. function group2_inp_codecd_onkeydown(obj:Edit, e:KeyEventInfo)
  134. {
  135. if( e.keycode == 13 ){
  136. group2_btn_sea_onclick();
  137. }
  138. }
  139. //명칭 입력 후 Enter
  140. function group2_inp_codenm_onkeydown(obj:Edit, e:KeyEventInfo)
  141. {
  142. if( e.keycode == 13 ){
  143. group2_btn_sea_onclick();
  144. }
  145. }
  146. /******************************************************************
  147. * Argument :
  148. * Description : 행추가
  149. ******************************************************************/
  150. function group3_button2_onclick(obj:Button, e:ClickEventInfo)
  151. {
  152. ds_grd_efficacylist1.insertRow(ds_grd_efficacylist1.rowposition + 1);
  153. }
  154. /******************************************************************
  155. * Argument :
  156. * Description : 행복사
  157. ******************************************************************/
  158. function group3_button50_onclick(obj:Button, e:ClickEventInfo)
  159. {
  160. var addRow = ds_grd_efficacylist1.insertRow( ds_grd_efficacylist1.rowposition + 1 );
  161. ds_grd_efficacylist1.copyRow(addRow, ds_grd_efficacylist1, ds_grd_efficacylist1.rowposition - 1);
  162. }
  163. /******************************************************************
  164. * Argument :
  165. * Description : 행삭제
  166. ******************************************************************/
  167. function group3_button49_onclick(obj:Button, e:ClickEventInfo)
  168. {
  169. var cRow = ds_grd_efficacylist1.rowposition;
  170. if( ds_grd_efficacylist1.getRowType(cRow) == 2 ){
  171. ds_grd_efficacylist1.deleteRow(cRow);
  172. } else {
  173. grdf_setStatus(grd_efficacylist1, "D", grdf_getSelectedRows(grd_efficacylist1));
  174. }
  175. }
  176. /******************************************************************
  177. * Argument :
  178. * Description : 저장
  179. ******************************************************************/
  180. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  181. {
  182. var oDsUpdate = grdf_getGridUpdateData(grd_efficacylist1);
  183. if( oDsUpdate.rowcount < 1 ){
  184. sysf_messageBox("입력","E013");
  185. return;
  186. }
  187. grdf_setStatusColumn(oDsUpdate, "m"); // 각행의 status에 rowType 값에 따라 'i', 'u', 'd'로 업데이트 시켜준다
  188. ds_send_req.copyData(oDsUpdate, true);
  189. for( var i = 0; i < ds_send_req.rowcount; i++ ){
  190. // 코드 null check
  191. if( utlf_isNull(ds_send_req.getColumn(i, "efcycd")) ){
  192. sysf_messageBox("코드는 ","I003");
  193. return;
  194. } else {
  195. // 동일코드 check
  196. if( ds_send_req.getColumn(i, "m") == "i" ){
  197. for( var j = 0; j < ds_temp_efficacylist1.rowcount; j++ ){
  198. var tMthdcd = ds_temp_efficacylist1.getColumn(j, "efcycd");
  199. var sMthdcd = ds_send_req.getColumn(i, "efcycd");
  200. if( tMthdcd == sMthdcd ){
  201. sysf_messageBox("동일한 코드가 존재합니다.","I");
  202. return;
  203. }
  204. }
  205. }
  206. }
  207. // 효능분류명 null check
  208. if( utlf_isNull(ds_send_req.getColumn(i, "efcynm")) ){
  209. sysf_messageBox("효능분류명은 ","I003");
  210. return;
  211. }
  212. // 레벨 null check
  213. if( utlf_isNull(ds_send_req.getColumn(i, "efcylevel")) ){
  214. sysf_messageBox("레벨은 ","I003");
  215. return;
  216. }
  217. }
  218. //efcylevel string을 int로 변경
  219. dsf_setTypeFormat(ds_send_req, "efcylevel:INT");
  220. ds_temp_efficacylist1.clearData();
  221. var oParam = {};
  222. oParam.id = "TXADB00501";
  223. oParam.service = "pharmacybaseapp.EfficacyCode";
  224. oParam.method = "reqExeEfficacyCode";
  225. oParam.inds = "efcy1=ds_send_req";
  226. oParam.outds = "ds_temp_efficacylist1=item";
  227. oParam.async = false;
  228. oParam.callback = "cf_TXADB00501";
  229. tranf_submit(oParam);
  230. //조회
  231. var oParam = {};
  232. oParam.id = "TRADB00501";
  233. oParam.service = "pharmacybaseapp.EfficacyCode";
  234. oParam.method = "reqGetEfficacyList";
  235. oParam.inds = "req=ds_send_searchdata";
  236. oParam.outds = "ds_grd_efficacylist1=item";
  237. oParam.async = false;
  238. //oParam.callback = "cf_TRADB00501";
  239. tranf_submit(oParam);
  240. ds_temp_efficacylist1.copyData(ds_grd_efficacylist1);
  241. }
  242. function cf_TXADB00501(sSvcId, nErrorCode, sErrorMsg) {
  243. arErrorCode.push(sSvcId, nErrorCode);
  244. }
  245. function grd_efficacylist1_oncelldblclick(obj:Grid, e:GridClickEventInfo)
  246. {
  247. //*var colNom = grd_efficacylist1.currentcol;
  248. //if( e.col != "1" ){
  249. // return;
  250. //}
  251. //var cRow = ds_grd_efficacylist1.rowposition;
  252. //sysf_messageBox(cRow);
  253. //var comCd = ds_grd_efficacylist1.getColumn(cRow, "efcycd");
  254. //var comNm = ds_grd_efficacylist1.getColumn(cRow, "efcynm");
  255. // var comExcd = ds_grd_efficacylist1.getColumn(cRow, "comexcd");
  256. //var drugCdcnt = ds_grd_efficacylist1.getColumn(cRow, "dispno");
  257. //sysf_messageBox(comCd);
  258. //if( utlf_isNull(comCd) ) return;
  259. //ds_send_searchdata.setColumn(0, "srchcomcd", comCd); //성분코드
  260. // ds_send_searchdata.setColumn(0, "srchcomexcd", comExcd); //확장코드
  261. //ds_send_searchdata.setColumn(0, "srchcomnm", comNm); //성분명칭
  262. //var oParam = {};
  263. // oParam.id = "TRADB00501";
  264. // oParam.service = "pharmacybaseapp.EfficacyCode";
  265. // oParam.method = "reqGetEfficacyList";
  266. // oParam.inds = "req=ds_send_searchdata";
  267. // oParam.outds = "ds_grd_efficacylist1=item";
  268. // oParam.async = false;
  269. // //oParam.callback = "cf_TRADB00202";
  270. //
  271. //tranf_submit(oParam);
  272. //switch1.visible = true;
  273. }
  274. ]]></Script>
  275. </Form>
  276. </FDL>