SMADB00300_병용금기관리.xfdl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMADB00300" position="absolute 0 0 1196 684" titletext="병용금기 관리" oninit="SMADB00300_oninit" onload="SMADB00300_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 116 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. </Layouts>
  13. </Div>
  14. <Static id="caption3" text="성분코드 :" class="search_name" position="absolute 21 37 92 54"/>
  15. <Edit id="inp_comcd" taborder="3" class="input_search" position="absolute 95 34 225 55" onkeydown="inp_comcd_onkeydown"/>
  16. <Static id="caption1" text="성분명칭 :" class="search_name" position="absolute 259 37 330 54"/>
  17. <Edit id="inp_comnm" taborder="4" class="input_search" position="absolute 333 35 698 56" onkeydown="inp_comnm_onkeydown"/>
  18. <Shape id="line13" linetype="vertical" class="line_4" position="absolute 1100 34 1106 56" anchor="top right"/>
  19. <Button id="btn_search" taborder="5" text="조회" class="btn1" position="absolute 1118 34 1176 56" onclick="btn_search_onclick" anchor="top right"/>
  20. <Grid id="grd_datagrid1" taborder="6" binddataset="ds_grd_datagrid1" autoenter="key" useinputpanel="false" autofittype="col" onexpanddown="group3_grd_datagrid1_onexpanddown" position="absolute 0 95 1194 681" anchor="all" cellsizingtype="both" extendsizetype="row">
  21. <Formats>
  22. <Format id="default">
  23. <Columns>
  24. <Column size="25" band="left"/>
  25. <Column size="100"/>
  26. <Column size="62"/>
  27. <Column size="145"/>
  28. <Column size="100"/>
  29. <Column size="60"/>
  30. <Column size="145"/>
  31. <Column size="93"/>
  32. <Column size="93"/>
  33. <Column size="310"/>
  34. </Columns>
  35. <Rows>
  36. <Row size="24" band="head"/>
  37. <Row size="24"/>
  38. </Rows>
  39. <Band id="head">
  40. <Cell/>
  41. <Cell col="1" text="성분코드"/>
  42. <Cell col="2" text="확장코드"/>
  43. <Cell col="3" text="성분명칭"/>
  44. <Cell col="4" text="성분코드"/>
  45. <Cell col="5" text="확장코드"/>
  46. <Cell col="6" text="성분명칭"/>
  47. <Cell col="7" text="시작일자"/>
  48. <Cell col="8" text="종료일자"/>
  49. <Cell col="9" text="설명"/>
  50. </Band>
  51. <Band id="body">
  52. <Cell celltype="head"/>
  53. <Cell col="1" displaytype="text" edittype="text" style="padding:0 0 0 5;" text="bind:comcd1" editautoselect="true" expandshow="show"/>
  54. <Cell col="2" style="padding:0 0 0 5;" text="bind:comexcd1"/>
  55. <Cell col="3" style="padding:0 0 0 5;" text="bind:comnm1"/>
  56. <Cell col="4" displaytype="text" edittype="text" style="padding:0 0 0 5;" text="bind:comcd2" editautoselect="true" expandshow="show"/>
  57. <Cell col="5" style="padding:0 0 0 5;" text="bind:comexcd2"/>
  58. <Cell col="6" style="align:left middle;padding:0 0 0 5;" text="bind:comnm2"/>
  59. <Cell col="7" displaytype="date" edittype="date" text="bind:fromdd"/>
  60. <Cell col="8" displaytype="date" edittype="date" text="bind:todd"/>
  61. <Cell col="9" displaytype="text" edittype="text" style="padding:0 0 0 5;" text="bind:tboocnts" editautoselect="true"/>
  62. </Band>
  63. </Format>
  64. </Formats>
  65. </Grid>
  66. <Button id="btn_grdadd" taborder="7" text="행추가" onclick="btn_grdadd_onclick" class="btn2" position="absolute 1030 71 1083 93" anchor="top right"/>
  67. <Button id="btn_rowcopy" taborder="8" text="행복사" onclick="btn_rowcopy_onclick" class="btn2" position="absolute 1085 71 1138 93" anchor="top right"/>
  68. <Button id="btn_grddel" taborder="9" text="행삭제" onclick="btn_grddel_onclick" class="btn2" position="absolute 1140 71 1193 93" anchor="top right"/>
  69. </Layout>
  70. </Layouts>
  71. <Objects>
  72. <Dataset id="ds_grd_datagrid1" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
  73. <ColumnInfo>
  74. <Column id="comcd1" type="STRING"/>
  75. <Column id="comexcd1" type="STRING"/>
  76. <Column id="comnm1" type="STRING"/>
  77. <Column id="comcd2" type="STRING"/>
  78. <Column id="comexcd2" type="STRING"/>
  79. <Column id="comnm2" type="STRING"/>
  80. <Column id="fromdd" type="STRING"/>
  81. <Column id="todd" type="STRING"/>
  82. <Column id="tboocnts" type="STRING"/>
  83. </ColumnInfo>
  84. <Rows>
  85. <Row/>
  86. </Rows>
  87. </Dataset>
  88. <Dataset id="ds_send_searchdata" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  89. <ColumnInfo>
  90. <Column id="comcd" type="STRING" size="256"/>
  91. <Column id="comnm" type="STRING" size="256"/>
  92. </ColumnInfo>
  93. <Rows>
  94. <Row/>
  95. </Rows>
  96. </Dataset>
  97. <Dataset id="ds_send_req" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  98. <Dataset id="ds_temp_datagrid1" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  99. <Dataset id="ds_hidden_receiveref" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  100. <ColumnInfo>
  101. <Column id="srchtype" type="STRING" size="256"/>
  102. </ColumnInfo>
  103. <Rows>
  104. <Row>
  105. <Col id="srchtype">B</Col>
  106. </Row>
  107. </Rows>
  108. </Dataset>
  109. </Objects>
  110. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  111. * System Name :
  112. * Job Name :
  113. * Creator :
  114. * Make Date : 2015-10-28
  115. * Description :
  116. *---------------------------------------------------------------------------------------
  117. * Modify Date Modifier Modify Description
  118. *---------------------------------------------------------------------------------------
  119. * 2015-10-28 Live Converter TF->XP
  120. *
  121. *---------------------------------------------------------------------------------------
  122. ****************************************************************************************/
  123. include "com_commonxp::comm_main.xjs";
  124. var arErrorCode = new HashArray();
  125. /******************************************************************
  126. * Argument :
  127. * Description : 초기화
  128. ******************************************************************/
  129. function SMADB00300_oninit(obj:Form, e:InitEventInfo)
  130. {
  131. frmf_initForm(obj);
  132. }
  133. function SMADB00300_onload(obj:Form, e:LoadEventInfo)
  134. {
  135. grdf_setRowTypeIcon(grd_datagrid1, 0);
  136. //권한관리
  137. btn_save.enable = frmf_checkAuth("X"); //저장
  138. grdf_initGrid(grd_datagrid1);
  139. }
  140. /******************************************************************
  141. * Argument :
  142. * Description : 조회
  143. ******************************************************************/
  144. function btn_search_onclick(obj:Button, e:ClickEventInfo)
  145. {
  146. var getCode = "";
  147. var getCdnm = "";
  148. if( !utlf_isNull( inp_comcd.text) ) getCode = inp_comcd.text +"%";
  149. if( !utlf_isNull( inp_comnm.text) ) getCdnm = inp_comnm.text +"%";
  150. ds_send_searchdata.setColumn(0, "comcd", getCode);
  151. ds_send_searchdata.setColumn(0, "comnm", getCdnm);
  152. var oParam = {};
  153. oParam.id = "TRADB00301";
  154. oParam.service = "pharmacybaseapp.ComTboo";
  155. oParam.method = "reqGetComTboo";
  156. oParam.inds = "req=ds_send_searchdata";
  157. oParam.outds = "ds_grd_datagrid1=item";
  158. oParam.async = false;
  159. //oParam.callback = "cf_TRADB00301";
  160. tranf_submit(oParam);
  161. ds_temp_datagrid1.copyData(ds_grd_datagrid1);
  162. }
  163. // 성분코드 Enter
  164. function inp_comcd_onkeydown(obj:Edit, e:KeyEventInfo)
  165. {
  166. if( e.keycode == 13 ){
  167. btn_search_onclick();
  168. }
  169. }
  170. //성분명칭 Enter
  171. function inp_comnm_onkeydown(obj:Edit, e:KeyEventInfo)
  172. {
  173. if( e.keycode == 13 ){
  174. btn_search_onclick();
  175. }
  176. }
  177. /******************************************************************
  178. * Argument :
  179. * Description : 행추가
  180. ******************************************************************/
  181. function btn_grdadd_onclick(obj:Button, e:ClickEventInfo)
  182. {
  183. var nRow = ds_grd_datagrid1.addRow();
  184. ds_grd_datagrid1.setColumn(nRow, "todd", "99991231");
  185. }
  186. /******************************************************************
  187. * Argument :
  188. * Description : 행복사
  189. ******************************************************************/
  190. function btn_rowcopy_onclick(obj:Button, e:ClickEventInfo)
  191. {
  192. var addRow = ds_grd_datagrid1.insertRow( ds_grd_datagrid1.rowposition + 1 );
  193. ds_grd_datagrid1.copyRow(addRow, ds_grd_datagrid1, ds_grd_datagrid1.rowposition - 1);
  194. ds_grd_datagrid1.setColumn(grd_datagrid1.currentrow, "todd", "99991231");
  195. }
  196. /******************************************************************
  197. * Argument :
  198. * Description : 행삭제
  199. ******************************************************************/
  200. function btn_grddel_onclick(obj:Button, e:ClickEventInfo)
  201. {
  202. var cRow = ds_grd_datagrid1.rowposition;
  203. if( ds_grd_datagrid1.getRowType(cRow) == 2 ){
  204. ds_grd_datagrid1.deleteRow(cRow);
  205. } else {
  206. grdf_setStatus(grd_datagrid1, "D", grdf_getSelectedRows(grd_datagrid1));
  207. }
  208. }
  209. /******************************************************************
  210. * Argument :
  211. * Description : 코드Button
  212. ******************************************************************/
  213. function group3_grd_datagrid1_onexpanddown(obj:Grid, e:GridMouseEventInfo)
  214. {
  215. var cCol = grd_datagrid1.currentcol;
  216. var cRow = grd_datagrid1.currentrow;
  217. if( cCol == "1" || cCol == "4" ){
  218. frmf_setParameter("srchtype", "B");
  219. frmf_modal("SPADB61300", "SPADB61300", null, null, null, null, null, null, null, null, null, null, "M");
  220. if( cCol == "1" ){
  221. ds_grd_datagrid1.setColumn(cRow, "comcd1", frmf_getParameter("comcd"));
  222. ds_grd_datagrid1.setColumn(cRow, "comexcd1", frmf_getParameter("comexcd"));
  223. ds_grd_datagrid1.setColumn(cRow, "comnm1", frmf_getParameter("comnm"));
  224. } else {
  225. ds_grd_datagrid1.setColumn(cRow, "comcd2", frmf_getParameter("comcd"));
  226. ds_grd_datagrid1.setColumn(cRow, "comexcd2", frmf_getParameter("comexcd"));
  227. ds_grd_datagrid1.setColumn(cRow, "comnm2", frmf_getParameter("comnm"));
  228. }
  229. obj.showEditor(false);
  230. }
  231. }
  232. /******************************************************************
  233. * Argument :
  234. * Description : 저장
  235. ******************************************************************/
  236. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  237. {
  238. if( sysf_messageBox("병용금기", "Q002") != 6 ){
  239. return;
  240. }
  241. var oDsUpdate = grdf_getGridUpdateData(grd_datagrid1);
  242. if( oDsUpdate.rowcount < 1 ){
  243. sysf_messageBox("입력","E013");
  244. return;
  245. }
  246. grdf_setStatusColumn(oDsUpdate, "m"); // 각행의 status에 rowType 값에 따라 'i', 'u', 'd'로 업데이트 시켜준다
  247. ds_send_req.copyData(oDsUpdate, true);
  248. for( var i = 0; i < ds_send_req.rowcount; i++ ){
  249. // 코드 null check
  250. if( utlf_isNull(ds_send_req.getColumn(i, "comcd1")) || utlf_isNull(ds_send_req.getColumn(i, "comcd2")) ){
  251. sysf_messageBox("성분코드는 ","I003");
  252. return;
  253. } else {
  254. // 동일코드 check
  255. if( ds_send_req.getColumn(i, "m") == "i" ){
  256. for( var j = 0; j < ds_temp_datagrid1.rowcount; j++ ){
  257. var tMthdcd = ds_temp_datagrid1.getColumn(j, "comcd2");
  258. var sMthdcd = ds_send_req.getColumn(i, "comcd2");
  259. if( tMthdcd == sMthdcd ){
  260. sysf_messageBox("동일한 코드가 존재합니다.","I");
  261. return;
  262. }
  263. }
  264. }
  265. }
  266. // 확장코드 null check
  267. if( utlf_isNull(ds_send_req.getColumn(i, "comexcd1")) || utlf_isNull(ds_send_req.getColumn(i, "comexcd1")) ){
  268. sysf_messageBox("확장코드는 ","I003");
  269. return;
  270. }
  271. // 시작일자 null check
  272. if( utlf_isNull(ds_send_req.getColumn(i, "fromdd")) ){
  273. sysf_messageBox("시작일자는 ","I003");
  274. return;
  275. }
  276. // 종료일자 null check
  277. if( utlf_isNull(ds_send_req.getColumn(i, "todd")) ){
  278. sysf_messageBox("종료일자는 ","I003");
  279. return;
  280. }
  281. }
  282. dsf_setDefaultVal(ds_send_req, "tboocnts:-");
  283. ds_temp_datagrid1.clearData();
  284. var oParam = {};
  285. oParam.id = "TXADB00301";
  286. oParam.service = "pharmacybaseapp.ComTboo";
  287. oParam.method = "reqExeComTboo";
  288. oParam.inds = "req=ds_send_req";
  289. oParam.outds = "ds_temp_datagrid1=item";
  290. oParam.async = false;
  291. oParam.callback = "cf_TXADB00301";
  292. tranf_submit(oParam);
  293. //조회
  294. var oParam = {};
  295. oParam.id = "TRADB00301";
  296. oParam.service = "pharmacybaseapp.ComTboo";
  297. oParam.method = "reqGetComTboo";
  298. oParam.inds = "req=ds_send_searchdata";
  299. oParam.outds = "ds_grd_datagrid1=item";
  300. oParam.async = false;
  301. //oParam.callback = "cf_TRADB00301";
  302. tranf_submit(oParam);
  303. ds_temp_datagrid1.copyData(ds_grd_datagrid1);
  304. }
  305. function cf_TXADB00301(sSvcId, nErrorCode, sErrorMsg) {
  306. arErrorCode.push(sSvcId, nErrorCode);
  307. }
  308. ]]></Script>
  309. </Form>
  310. </FDL>