SMADT50400_임상약품입출고관리.xfdl 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMADT50200" position="absolute 0 0 1001 777" titletext="임상시험약품재고관리" oninit="SMADT50200_oninit" onload="SMADT50200_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption6" text="임상시험약품재고관리" class="tit_1" position="absolute 0 0 163 25"/>
  8. <Div id="group2" anchor="left top right" taborder="1" class="div_SA" position="absolute 0 24 1000 64">
  9. <Layouts>
  10. <Layout>
  11. <Shape id="line13" linetype="vertical" position="absolute 853 8 859 33" anchor="top right"/>
  12. <Static id="caption24" text="업무일자 :" class="search_name" position="absolute 10 13 81 30" anchor="default" onclick="group2_caption24_onclick"/>
  13. <Button id="btn_sea" taborder="8" text="조회" onclick="group3_group2_btn_sea_onclick" class="btn1" position="absolute 873 9 929 31" anchor="top right"/>
  14. <Calendar id="ipt_fromdd" taborder="9" autoselect="true" dateformat="yyyy-MM-dd" class="input_essential" position="absolute 88 11 188 30" anchor="default" onchanged="group2_ipt_fromdd_onchanged"/>
  15. <Button id="btn_sea00" taborder="10" text="엑셀" class="btn4" position="absolute 932 9 988 31" anchor="top right" onclick="group2_btn_sea00_onclick"/>
  16. </Layout>
  17. </Layouts>
  18. </Div>
  19. <Shape id="line00" class="line_1" position="absolute 2 92 841 102" style="strokepen:3 solid #33bbbbff;"/>
  20. <Static id="caption3" text="임상시험약품재고관리" class="search_name" position="absolute 7 77 172 94"/>
  21. <Button id="btn_save" taborder="3" text="저장" position="absolute 947 74 988 94" class="btn5" onclick="btn_save_onclick"/>
  22. <Grid id="Grid00" taborder="4" useinputpanel="false" position="absolute 750 99 984 760" binddataset="ds_stoclist" visible="false">
  23. <Formats>
  24. <Format id="default">
  25. <Columns>
  26. <Column size="81"/>
  27. <Column size="74"/>
  28. <Column size="75"/>
  29. <Column size="65"/>
  30. <Column size="0"/>
  31. <Column size="0"/>
  32. <Column size="0"/>
  33. </Columns>
  34. <Rows>
  35. <Row size="45" band="head"/>
  36. <Row size="24"/>
  37. </Rows>
  38. <Band id="head">
  39. <Cell text="약품코드"/>
  40. <Cell col="1" text="불가용재고량"/>
  41. <Cell col="2" text="가용재고량"/>
  42. <Cell col="3" text="총재고량"/>
  43. <Cell col="4" text="입고량"/>
  44. <Cell col="5" text="출고량"/>
  45. <Cell col="6" text="반납량"/>
  46. </Band>
  47. <Band id="body">
  48. <Cell text="bind:drugcd"/>
  49. <Cell col="1" text="bind:nousestocqty"/>
  50. <Cell col="2" text="bind:usestocqty"/>
  51. <Cell col="3" style="align:right;padding:0 5 0 0;" text="bind:totstocqty"/>
  52. <Cell col="4" style="align:right;padding:0 5 0 0;" text="bind:inqty"/>
  53. <Cell col="5" style="align:right;padding:0 5 0 0;" text="bind:outqty"/>
  54. <Cell col="6" style="align:right;padding:0 5 0 0;" text="bind:rtnqty"/>
  55. </Band>
  56. </Format>
  57. </Formats>
  58. </Grid>
  59. <Shape id="line01" class="line_1" position="absolute 750 92 984 102" style="strokepen:3 solid #33bbbbff;"/>
  60. <Button id="Button00" taborder="5" text="삭제" position="absolute 900 74 945 94" onclick="Button00_onclick"/>
  61. <Grid id="grd_iolist" taborder="2" binddataset="ds_iolist" useinputpanel="false" position="absolute 2 99 988 760" oncelldblclick="grd_iolist_oncelldblclick">
  62. <Formats>
  63. <Format id="default">
  64. <Columns>
  65. <Column size="22"/>
  66. <Column size="0"/>
  67. <Column size="117"/>
  68. <Column size="73"/>
  69. <Column size="343"/>
  70. <Column size="51"/>
  71. <Column size="51"/>
  72. <Column size="49"/>
  73. <Column size="49"/>
  74. <Column size="57"/>
  75. <Column size="53"/>
  76. <Column size="51"/>
  77. <Column size="51"/>
  78. </Columns>
  79. <Rows>
  80. <Row size="45" band="head"/>
  81. <Row size="24"/>
  82. </Rows>
  83. <Band id="head">
  84. <Cell/>
  85. <Cell col="1" text="업무일자"/>
  86. <Cell col="2" text="과제명"/>
  87. <Cell col="3" text="약품코드"/>
  88. <Cell col="4" text="약품명"/>
  89. <Cell col="5" text="적정&#13;&#10;재고량"/>
  90. <Cell col="6" text="입고량"/>
  91. <Cell col="7" text="불출량"/>
  92. <Cell col="8" text="가용-&gt;&#13;&#10;불가용"/>
  93. <Cell col="9" text="불가용&#13;&#10;반납량"/>
  94. <Cell col="10" text="가용&#13;&#10;반납량"/>
  95. <Cell col="11" text="불가용&#13;&#10;재고량"/>
  96. <Cell col="12" text="가용&#13;&#10;재고량"/>
  97. </Band>
  98. <Band id="body">
  99. <Cell/>
  100. <Cell col="1" displaytype="date" edittype="date" text="bind:workdd"/>
  101. <Cell col="2" style="align:left;padding:0 0 0 5;" text="bind:subjid"/>
  102. <Cell col="3" style="align:left;padding:5 5 5 5;" text="bind:drugcd"/>
  103. <Cell col="4" style="align:left;padding:0 0 0 5;" text="bind:drugnm"/>
  104. <Cell col="5" style="align:right;padding:0 5 0 0;" text="bind:safestocqty"/>
  105. <Cell col="6" displaytype="number" edittype="text" editfilter="number" style="padding:0 5 0 0;" text="bind:inqty"/>
  106. <Cell col="7" displaytype="number" edittype="text" editfilter="number" style="padding:0 5 0 0;" text="bind:outqty"/>
  107. <Cell col="8" displaytype="number" edittype="text" editfilter="number" style="padding:0 5 0 0;" text="bind:nouseqty"/>
  108. <Cell col="9" displaytype="number" edittype="text" editfilter="number" style="padding:0 5 0 0;" text="bind:nortnqty"/>
  109. <Cell col="10" displaytype="number" edittype="text" editfilter="number" style="padding:0 5 0 0;" text="bind:rtnqty"/>
  110. <Cell col="11" style="align:right;padding:0 5 0 0;" text="bind:nousestocqty"/>
  111. <Cell col="12" style="align:right;padding:0 5 0 0;background:EXPR(bgcolor==&quot;1&quot;?&quot;yellow&quot;:&quot;&quot;);background2:EXPR(bgcolor==&quot;1&quot;?&quot;yellow&quot;:&quot;&quot;);" text="bind:usestocqty"/>
  112. </Band>
  113. </Format>
  114. </Formats>
  115. </Grid>
  116. <Button id="Button01" taborder="6" text="일자별 입출고내역 조회" position="absolute 748 74 898 94" onclick="Button01_onclick"/>
  117. <Button id="Button02" taborder="7" text="적정재고량 관리" position="absolute 638 74 746 94" onclick="Button02_onclick"/>
  118. </Layout>
  119. </Layouts>
  120. <Objects>
  121. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  122. <ColumnInfo>
  123. <Column id="workdd" type="STRING" size="256"/>
  124. </ColumnInfo>
  125. <Rows>
  126. <Row/>
  127. </Rows>
  128. </Dataset>
  129. <Dataset id="ds_iolist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  130. <ColumnInfo>
  131. <Column id="workdd" type="STRING" size="256"/>
  132. <Column id="drugcd" type="STRING" size="256"/>
  133. <Column id="drugnm" type="STRING" size="256"/>
  134. <Column id="inqty" type="STRING" size="256"/>
  135. <Column id="outqty" type="STRING" size="256"/>
  136. <Column id="rtnqty" type="STRING" size="256"/>
  137. <Column id="flag" type="STRING" size="256"/>
  138. <Column id="cmt" type="STRING" size="256"/>
  139. <Column id="nouseqty" type="STRING" size="256"/>
  140. <Column id="nortnqty" type="STRING" size="256"/>
  141. <Column id="subjid" type="STRING" size="256"/>
  142. <Column id="safestocqty" type="STRING" size="256"/>
  143. <Column id="bgcolor" type="STRING" size="256"/>
  144. </ColumnInfo>
  145. </Dataset>
  146. <Dataset id="ds_send_savedata" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  147. <Dataset id="ds_stoclist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  148. <ColumnInfo>
  149. <Column id="drugcd" type="STRING" size="256"/>
  150. <Column id="inqty" type="STRING" size="256"/>
  151. <Column id="outqty" type="STRING" size="256"/>
  152. <Column id="rtnqty" type="STRING" size="256"/>
  153. <Column id="totstocqty" type="STRING" size="256"/>
  154. </ColumnInfo>
  155. <Rows>
  156. <Row/>
  157. </Rows>
  158. </Dataset>
  159. </Objects>
  160. <Bind>
  161. <BindItem id="item0" compid="group2.ipt_fromdd" propid="value" datasetid="ds_send" columnid="workdd"/>
  162. </Bind>
  163. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  164. * System Name :
  165. * Job Name :
  166. * Creator :
  167. * Make Date : 2015-11-13
  168. * Description :
  169. *---------------------------------------------------------------------------------------
  170. * Modify Date Modifier Modify Description
  171. *---------------------------------------------------------------------------------------
  172. * 2015-11-13 Live Converter TF->XP
  173. *
  174. *---------------------------------------------------------------------------------------
  175. ****************************************************************************************/
  176. include "com_commonxp::comm_main.xjs";
  177. var arErrorCode = new HashArray();
  178. /******************************************************************
  179. * Argument :
  180. * Description : 초기화
  181. ******************************************************************/
  182. function SMADT50200_oninit(obj:Form, e:InitEventInfo)
  183. {
  184. frmf_initForm(obj);
  185. }
  186. function SMADT50200_onload(obj:Form, e:LoadEventInfo)
  187. {
  188. var deptcd = sysf_getUserInfo("dutplcecd");
  189. var userid = sysf_getUserInfo("userid");
  190. if(deptcd != "7460000000" && userid != "AST") {
  191. sysf_messageBox("사용 권한이 없습니다. ", "E");
  192. this.close();
  193. }
  194. ds_send.setColumn(0, "workdd", utlf_getCurrentDate());
  195. grdf_setRowTypeIcon(grd_iolist, 0); //상태값 표시
  196. ds_iolist.updatecontrol = true;
  197. fSearch();
  198. }
  199. function group3_group2_btn_sea_onclick(obj:Button, e:ClickEventInfo)
  200. {
  201. fSearch();
  202. }
  203. function fSearch() {
  204. var oParam = {};
  205. oParam.id = "TRADT50401";
  206. oParam.service = "pharmacystocapp.DrugStocSum";
  207. oParam.method = "reqGetImsangDrugInOutInfo";
  208. oParam.inds = "req=ds_send";
  209. oParam.outds = "ds_iolist=info ds_stoclist=stoclist";
  210. oParam.async = false;
  211. //oParam.callback = "TRADT50300";
  212. tranf_submit(oParam);
  213. fChkSafeStocQty();
  214. }
  215. function fChkSafeStocQty() {
  216. var safestocqty;
  217. var usestocqty;
  218. var drugcd;
  219. var str ="약품코드: ";
  220. var cnt = 0;
  221. ds_iolist.updatecontrol = false;
  222. for(var i = 0; i < ds_iolist.rowcount; i++) {
  223. safestocqty = ds_iolist.getColumn(i, "safestocqty");
  224. usestocqty = ds_iolist.getColumn(i, "usestocqty");
  225. drugcd = ds_iolist.getColumn(i, "drugcd");
  226. if(safestocqty > usestocqty) {
  227. if(cnt >0) {
  228. str += ", ";
  229. }
  230. str += drugcd;
  231. cnt++;
  232. ds_iolist.setColumn(i, "bgcolor", "1");
  233. }
  234. //grd_iolist.setCellProperty("Body", grd_iolist.getBindCellIndex("body","usestocqty"), "font", "#ff0000"); //colfont14
  235. //grd_iolist.setCellProperty("Body", grd_iolist.getBindCellIndex("body","usestocqty"), "background", "#00ffff"); //colfont14
  236. }
  237. ds_iolist.updatecontrol = true;
  238. if(cnt > 0) {
  239. str += "\n항목이 가용재고량이 적정재고량보다 적습니다.";
  240. alert(str);
  241. }
  242. }
  243. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  244. {
  245. ds_send_savedata.clearData();
  246. var updtdata1 = grdf_getGridUpdateData(grd_iolist, "all");
  247. grdf_setStatusColumn(updtdata1, "m");
  248. ds_send_savedata.copyData(updtdata1,true);
  249. var oParam = {};
  250. oParam.id = "TXADT50401";
  251. oParam.service = "pharmacystocapp.DrugStocSum";
  252. oParam.method = "reqExeImsangDrugInOutInfo";
  253. oParam.inds = "req=ds_send_savedata";
  254. oParam.outds = "ds_iolist=info";
  255. oParam.async = false;
  256. //oParam.callback = "TRADT50300";
  257. tranf_submit(oParam);
  258. fSearch();
  259. }
  260. function group2_caption24_onclick(obj:Static, e:ClickEventInfo)
  261. {
  262. }
  263. function Button00_onclick(obj:Button, e:ClickEventInfo)
  264. {
  265. //Dataset 행삭제
  266. ds_iolist.updatecontrol = false;
  267. ds_iolist.setRowType(grd_iolist.currentrow, Dataset.ROWTYPE_DELETE);
  268. ds_iolist.updatecontrol = true;
  269. }
  270. function grd_iolist_oncelldblclick(obj:Grid, e:GridClickEventInfo)
  271. {
  272. var drugcd = "";
  273. if(grd_iolist.currentcol == "2" || grd_iolist.currentcol == "3") {
  274. drugcd = ds_iolist.getColumn(grd_iolist.currentrow, "drugcd");
  275. var objArg = new Object();
  276. objArg.arg_drugcd = drugcd;
  277. frmf_modal("SMADT50500", "SMADT50500", objArg, null, null, null, null, null, null, null, null, null, "M");
  278. }
  279. }
  280. function group2_ipt_fromdd_ontextchanged(obj:Calendar, e:TextChangedEventInfo)
  281. {
  282. }
  283. function group2_ipt_fromdd_onchanged(obj:Calendar, e:ChangeEventInfo)
  284. {
  285. obj.updateToDataset();
  286. fSearch();
  287. }
  288. function Button01_onclick(obj:Button, e:ClickEventInfo)
  289. {
  290. var objArg = new Object();
  291. objArg.arg_drugcd = "";
  292. frmf_modal("SMADT50500", "SMADT50500", objArg, null, null, null, null, null, null, null, null, null, "M");
  293. fSearch();
  294. }
  295. function Button02_onclick(obj:Button, e:ClickEventInfo)
  296. {
  297. var objArg = new Object();
  298. objArg.arg_drugcd = "";
  299. frmf_modal("SMADT50600", "SMADT50600", objArg, null, null, null, null, null, null, null, null, null, "M");
  300. fSearch();
  301. }
  302. function group2_btn_sea00_onclick(obj:Button, e:ClickEventInfo)
  303. {
  304. //조회된 자료가 없으면 먼저 조회하라고 message
  305. if(ds_iolist.rowcount < 1) {
  306. sysf_messageBox("조회된 결과가 존재하지 않습니다. \n\n먼저 조회 후 Download 하십시요. ", "E999", "");
  307. return;
  308. }
  309. grdf_exportExcel(grd_iolist, "excel", "savetype", false, "", "user", false);
  310. }
  311. ]]></Script>
  312. </Form>
  313. </FDL>