SMABC00700_조혈모세포일괄폐기.xfdl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMABC00700" position="absolute 0 0 1200 778" titletext="조혈모세포 일괄폐기" oninit="SMABC00700_oninit" onload="SMABC00700_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption6" text="조혈모세포일괄폐기" class="tit_1" position="absolute 0 0 200 23"/>
  8. <Button id="btn_save" taborder="1" text="폐기처리" class="btn4" position="absolute 1029 21 1109 43" anchor="top right" onclick="btn_save_onclick"/>
  9. <Button id="btn_can" taborder="2" text="폐기취소" class="btn4" position="absolute 1113 21 1193 43" anchor="top right" onclick="btn_can_onclick"/>
  10. <Static id="caption1" text="조혈모세포 일괄폐기 대상" class="tit_2" position="absolute 0 86 200 107"/>
  11. <Shape id="line1" class="line_10" position="absolute 0 102 1194 108" anchor="left top right"/>
  12. <Div id="grp_sea" anchor="left top right" taborder="3" class="div_SA" position="absolute 0 44 1194 79">
  13. <Layouts>
  14. <Layout>
  15. <Shape id="line13" linetype="vertical" class="line_4" position="absolute 1104 7 1110 29" anchor="top right"/>
  16. <Button id="btn_sea" taborder="4" text="조회" class="btn1" position="absolute 1123 7 1179 29" anchor="top right" onclick="grp_sea_btn_sea_onclick"/>
  17. <Radio id="radio2" taborder="5" columncount="2" rowcount="1" codecolumn="codecolumn" datacolumn="datacolumn" class="radio_search" position="absolute 335 8 511 28" onitemchanged="grp_sea_radio2_onitemchanged">
  18. <Dataset id="innerdataset">
  19. <ColumnInfo>
  20. <Column id="codecolumn"/>
  21. <Column id="datacolumn"/>
  22. </ColumnInfo>
  23. <Rows>
  24. <Row>
  25. <Col id="codecolumn">1</Col>
  26. <Col id="datacolumn">폐기대상만</Col>
  27. </Row>
  28. <Row>
  29. <Col id="codecolumn">2</Col>
  30. <Col id="datacolumn">폐기된것만</Col>
  31. </Row>
  32. </Rows>
  33. </Dataset>
  34. </Radio>
  35. <Static id="caption5" text="~" class="search_no_b" position="absolute 207 10 219 27"/>
  36. <Calendar id="ipt_sdate" taborder="6" class="input_s_essential" position="absolute 104 9 204 28" dateformat="yyyy-MM-dd" autoselect="true"/>
  37. <Calendar id="ipt_edate" taborder="7" class="input_s_essential" enable="false" position="absolute 222 9 322 28" dateformat="yyyy-MM-dd" value="null" autoselect="true"/>
  38. <Static id="cpt_days" text="보관일자 :" class="search_name" position="absolute 15 10 101 27"/>
  39. </Layout>
  40. </Layouts>
  41. </Div>
  42. <Grid id="grd_abnlist" taborder="4" binddataset="ds_main_celltretdetl_celltretdetail" useinputpanel="false" cellsizingtype="col" autofittype="col" position="absolute 0 107 1194 772" anchor="all">
  43. <Formats>
  44. <Format id="default">
  45. <Columns>
  46. <Column size="26"/>
  47. <Column size="102"/>
  48. <Column size="142"/>
  49. <Column size="113"/>
  50. <Column size="92"/>
  51. <Column size="108"/>
  52. <Column size="116"/>
  53. <Column size="80"/>
  54. <Column size="358"/>
  55. <Column size="40"/>
  56. <Column size="0"/>
  57. <Column size="0"/>
  58. </Columns>
  59. <Rows>
  60. <Row size="24" band="head"/>
  61. <Row size="24"/>
  62. </Rows>
  63. <Band id="head">
  64. <Cell/>
  65. <Cell col="1" text="보관일자"/>
  66. <Cell col="2" text="Stem Cell Source"/>
  67. <Cell col="3" text="등록번호"/>
  68. <Cell col="4" text="환자명"/>
  69. <Cell col="5" text="폐기일자"/>
  70. <Cell col="6" text="폐기사유"/>
  71. <Cell col="7" text="폐기자"/>
  72. <Cell col="8" text="비고"/>
  73. <Cell col="9" text="확인"/>
  74. <Cell col="10" text="caption1"/>
  75. <Cell col="11" text="caption2"/>
  76. </Band>
  77. <Band id="body">
  78. <Cell celltype="head" expr="currow+1"/>
  79. <Cell col="1" displaytype="date" edittype="none" text="bind:keepdd" mask="yyyy-MM-dd" calendardisplaynulltype="nulltext"/>
  80. <Cell col="2" displaytype="combo" edittype="combo" text="bind:scs" combodataset="ds_init_cmbinfo_stemcellsource_A0159" combocodecol="cdid" combodatacol="cdnm" enable="false"/>
  81. <Cell col="3" displaytype="none" edittype="none" text="bind:pid"/>
  82. <Cell col="4" text="bind:hngnm"/>
  83. <Cell col="5" displaytype="date" edittype="date" text="bind:abndd" mask="yyyy-MM-dd" calendardisplaynulltype="nulltext"/>
  84. <Cell col="6" displaytype="combo" edittype="combo" text="bind:abnresn" combodataset="ds_init_cmbinfo_abnresn_A0155" combocodecol="cdid" combodatacol="cdnm"/>
  85. <Cell col="7" text="bind:abnnm"/>
  86. <Cell col="8" displaytype="text" edittype="text" text="bind:abnrem"/>
  87. <Cell col="9" displaytype="checkbox" edittype="checkbox" text="bind:chk" expr="expr:chk == 'Y' ? 1 : 0"/>
  88. <Cell col="10" text="bind:abnid"/>
  89. <Cell col="11" text="bind:cellbcno"/>
  90. </Band>
  91. </Format>
  92. </Formats>
  93. </Grid>
  94. </Layout>
  95. </Layouts>
  96. <Objects>
  97. <Dataset id="ds_send_baseinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  98. <ColumnInfo>
  99. <Column id="sdate" type="STRING" size="256"/>
  100. <Column id="tdate" type="STRING" size="256"/>
  101. <Column id="gb" type="STRING" size="256"/>
  102. </ColumnInfo>
  103. <Rows>
  104. <Row>
  105. <Col id="sdate"/>
  106. <Col id="tdate"/>
  107. <Col id="gb"/>
  108. </Row>
  109. </Rows>
  110. </Dataset>
  111. <Dataset id="ds_main_celltretdetl_celltretdetail" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_main_celltretdetl_celltretdetail_oncolumnchanged">
  112. <ColumnInfo>
  113. <Column id="keepdd" type="STRING" size="256" sumtext="보관일자"/>
  114. <Column id="scs" type="STRING" size="256" sumtext="Stem Cell Source"/>
  115. <Column id="pid" type="STRING" size="256" sumtext="등록번호"/>
  116. <Column id="hngnm" type="STRING" size="256" sumtext="환자명"/>
  117. <Column id="abndd" type="STRING" size="256" sumtext="폐기일자"/>
  118. <Column id="abnresn" type="STRING" size="256" sumtext="폐기사유"/>
  119. <Column id="abnnm" type="STRING" size="256" sumtext="폐기자"/>
  120. <Column id="abnrem" type="STRING" size="256" sumtext="비고"/>
  121. <Column id="chk" type="STRING" size="256" sumtext="선택"/>
  122. <Column id="abnid" type="STRING" size="256" sumtext="폐기자"/>
  123. <Column id="cellbcno" type="STRING" size="256" sumtext="바코드번호"/>
  124. </ColumnInfo>
  125. </Dataset>
  126. <Dataset id="ds_init_cmbinfo_stemcellsource_A0159" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  127. <ColumnInfo>
  128. <Column id="cdnm" type="STRING" size="256"/>
  129. <Column id="cdid" type="STRING" size="256"/>
  130. </ColumnInfo>
  131. </Dataset>
  132. <Dataset id="ds_init_cmbinfo_abnresn_A0155" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  133. <ColumnInfo>
  134. <Column id="cdid" type="STRING" size="256"/>
  135. <Column id="cdnm" type="STRING" size="256"/>
  136. </ColumnInfo>
  137. </Dataset>
  138. </Objects>
  139. <Bind>
  140. <BindItem id="item0" compid="grp_sea.ipt_sdate" propid="value" datasetid="ds_send_baseinfo" columnid="sdate"/>
  141. <BindItem id="item1" compid="grp_sea.ipt_edate" propid="value" datasetid="ds_send_baseinfo" columnid="tdate"/>
  142. <BindItem id="item2" compid="grp_sea.radio2" propid="value" datasetid="ds_send_baseinfo" columnid="gb"/>
  143. </Bind>
  144. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  145. * System Name :
  146. * Job Name :
  147. * Creator :
  148. * Make Date : 2015-11-13
  149. * Description :
  150. *---------------------------------------------------------------------------------------
  151. * Modify Date Modifier Modify Description
  152. *---------------------------------------------------------------------------------------
  153. * 2015-11-13 Live Converter TF->XP
  154. *
  155. *---------------------------------------------------------------------------------------
  156. ****************************************************************************************/
  157. include "com_commonxp::comm_main.xjs";
  158. function SMABC00700_oninit(obj:Form, e:InitEventInfo)
  159. {
  160. frmf_initForm(obj);
  161. }
  162. function SMABC00700_onload(obj:Form, e:LoadEventInfo)
  163. {
  164. grdf_initGrid(grd_abnlist);
  165. var arrParam = [{dsNm: "ds_init_cmbinfo_abnresn_A0155", cdGrpId: "A0155"}
  166. , {dsNm: "ds_init_cmbinfo_stemcellsource_A0159", cdGrpId: "A0159"}]
  167. appf_getCodeList(arrParam);
  168. ds_send_baseinfo.setColumn(0, "sdate", utlf_getCurrentDate());
  169. ds_send_baseinfo.setColumn(0, "tdate", grp_sea.ipt_sdate.value);
  170. grp_sea.ipt_sdate.value = String(grp_sea.ipt_sdate.value).toDate().getAddDate(-365 * 4,"D").getDateFormat("YYYYMMDD") ;
  171. btn_save.enable = false;
  172. btn_can.enable = true;
  173. ds_send_baseinfo.setColumn(0, "gb", "1");
  174. }
  175. function grp_sea_radio2_onitemchanged(obj:Radio, e:ItemChangeEventInfo)
  176. {
  177. if (obj.value == "1")
  178. {
  179. btn_save.enable = true;
  180. btn_can.enable = false;
  181. grp_sea.ipt_edate.enable = false;
  182. grp_sea.ipt_sdate.value = String(grp_sea.ipt_edate.value).toDate().getAddDate(-365 * 4,"D").getDateFormat("YYYYMMDD") ;
  183. grp_sea.cpt_days.text = "보관일자";
  184. }
  185. else
  186. {
  187. btn_save.enable = false;
  188. btn_can.enable = true;
  189. grp_sea.ipt_edate.enable = true;
  190. grp_sea.ipt_sdate.value = String(grp_sea.ipt_edate.value).toDate().getAddDate(-7,"D").getDateFormat("YYYYMMDD") ;
  191. grp_sea.cpt_days.text = "폐기일자";
  192. }
  193. fReadFunc();
  194. }
  195. function trim(data)
  196. { // 문자에 대한 TRIM 작업
  197. return data.replace(/(^\s*)|(\s*$)/g, "");
  198. }
  199. function isDate(str)
  200. {
  201. if(utlf_isNull(str))
  202. {
  203. return true;
  204. }
  205. if (utlf_isNull(trim(str)))
  206. {
  207. return true; // 빈건 체크안함
  208. }
  209. if (isNaN(parseInt(str)))
  210. {
  211. return false; // 숫자가 아니면 fals
  212. }
  213. if (str.length != 8)
  214. {
  215. return false;
  216. }
  217. var yy = new Number(str.substr(0, 4));
  218. var mm = new Number(str.substr(4, 2));
  219. var dd = new Number(str.substr(6, 2));
  220. var date = new Date(yy, mm, dd);
  221. if (yy != date.getFullYear() || mm != date.getMonth() || dd != date.getDate())
  222. {
  223. return false; // 존재하지 않는 날짜
  224. }
  225. return true; // 존재하는 날짜
  226. }
  227. function fDataCheck()
  228. {
  229. if (isDate(ds_send_baseinfo.getColumn(0, "sdate")) == false)
  230. {
  231. sysf_messageBox("보관 시작일의 날짜 형식이 잘못 입력되었습니다.", "E999", "");
  232. return false;
  233. }
  234. if (utlf_isNull(ds_send_baseinfo.getColumn(0, "sdate")))
  235. {
  236. sysf_messageBox("보관 시작일은 필수 입력 또는 선택 항목입니다.", "E999", "");
  237. return false;
  238. }
  239. if (isDate(ds_send_baseinfo.getColumn(0, "tdate")) == false)
  240. {
  241. sysf_messageBox("보관 종료일의 날짜 형식이 잘못 입력되었습니다.", "E999", "");
  242. return false;
  243. }
  244. if (utlf_isNull(ds_send_baseinfo.getColumn(0, "tdate")))
  245. {
  246. sysf_messageBox("보관 종료일은 필수 입력 또는 선택 항목입니다.", "E999", "");
  247. return false;
  248. }
  249. if (ds_send_baseinfo.getColumn(0, "sdate") > ds_send_baseinfo.getColumn(0, "tdate"))
  250. {
  251. sysf_messageBox("보관 기간일이 잘못 입력되었습니다.", "E999", "");
  252. return false;
  253. }
  254. return true;
  255. }
  256. function fReadFunc()
  257. {
  258. if (fDataCheck() == false)
  259. {
  260. return;
  261. }
  262. ds_main_celltretdetl_celltretdetail.clearData();
  263. var oParam = {};
  264. oParam.id = "TRABC00701";
  265. oParam.service = "hsctstemcellapp.StemCellTreat";
  266. oParam.method = "reqGetStemCellBatAbn";
  267. oParam.inds = "req=ds_send_baseinfo";
  268. oParam.outds = "ds_main_celltretdetl_celltretdetail=celltretdetail";
  269. oParam.async = false;
  270. //oParam.callback = "cf_TRABC00701";
  271. tranf_submit(oParam);
  272. if(utlf_isNull(ds_main_celltretdetl_celltretdetail.getColumn(0, "pid")))
  273. {
  274. ds_main_celltretdetl_celltretdetail.clearData();
  275. }
  276. if(ds_send_baseinfo.getColumn(0, "gb") == "1")
  277. {
  278. grd_abnlist.setCellProperty("Body", grd_abnlist.getBindCellIndex("Body", "abnresn"), "eddittype", "combo");
  279. }
  280. else
  281. {
  282. grd_abnlist.setCellProperty("Body", grd_abnlist.getBindCellIndex("Body", "abnresn"), "eddittype", "none");
  283. }
  284. }
  285. function grp_sea_btn_sea_onclick(obj:Button, e:ClickEventInfo)
  286. {
  287. fReadFunc();
  288. }
  289. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  290. {
  291. if (fSaveChk() == false)
  292. {
  293. return;
  294. }
  295. fSaveData();
  296. }
  297. function fSaveChk()
  298. {
  299. var k = 0;
  300. for (var i = 0; i < ds_main_celltretdetl_celltretdetail.rowcount; i++)
  301. {
  302. if(ds_main_celltretdetl_celltretdetail.getColumn(i, "chk") == "Y")
  303. {
  304. k = parseInt(k) + 1;
  305. if(utlf_isNull(ds_main_celltretdetl_celltretdetail.getColumn(i, "abndd")))
  306. {
  307. sysf_messageBox("폐기일자는 필수 입력항목입니다.", "E999", "");
  308. return false;
  309. }
  310. if (isDate(ds_main_celltretdetl_celltretdetail.getColumn(i, "abndd")) == false)
  311. {
  312. sysf_messageBox("폐기일자의 날짜 형식이 잘못 입력되었습니다.", "E999", "");
  313. return false;
  314. }
  315. if (utlf_isNull(ds_main_celltretdetl_celltretdetail.getColumn(i, "abnresn")))
  316. {
  317. sysf_messageBox("폐기사유는 필수 선택항목입니다.", "E999", "");
  318. return false;
  319. }
  320. }
  321. }
  322. if (k == 0)
  323. {
  324. sysf_messageBox("폐기처리할 자료를 선택하지 않았습니다.", "E999", "");
  325. return false;
  326. }
  327. return true;
  328. }
  329. function fSaveData()
  330. {
  331. var oParam = {};
  332. oParam.id = "TXABC00701";
  333. oParam.service = "hsctstemcellapp.StemCellTreat";
  334. oParam.method = "reqExeStemCellBatAbn";
  335. oParam.inds = "celltretdetail=ds_main_celltretdetl_celltretdetail";
  336. oParam.outds = "ds_=item";
  337. oParam.async = false;
  338. oParam.callback = "cf_TXABC00701";
  339. tranf_submit(oParam);
  340. }
  341. function cf_TXABC00701(sSvcId, nErrorCode, sErrorMsg)
  342. {
  343. if(nErrorCode < 0)
  344. {
  345. return;
  346. }
  347. else
  348. {
  349. fReadFunc();
  350. }
  351. }
  352. function ds_main_celltretdetl_celltretdetail_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  353. {
  354. if(e.columnid == "chk")
  355. {
  356. obj.setColumn(e.row, "chk", (e.newvalue == "Y" || e.newvalue == 1) ? "Y" : "N");
  357. if(ds_send_baseinfo.getColumn(0, "gb") == "1")
  358. {
  359. if(e.newvalue == 1)
  360. {
  361. obj.setColumn(e.row, "abndd", utlf_getCurrentDate());
  362. obj.setColumn(e.row, "abnnm", sysf_getUserName());
  363. obj.setColumn(e.row, "abnid", sysf_getUserId());
  364. obj.setColumn(e.row, "abnresn", "6");
  365. }
  366. else
  367. {
  368. obj.setColumn(e.row, "abndd", "");
  369. obj.setColumn(e.row, "abnnm", "");
  370. obj.setColumn(e.row, "abnid", "");
  371. obj.setColumn(e.row, "abnresn", "");
  372. }
  373. }
  374. }
  375. }
  376. function btn_can_onclick(obj:Button, e:ClickEventInfo)
  377. {
  378. var k = 0;
  379. for(var i = 0; i < ds_main_celltretdetl_celltretdetail.rowcount; i++)
  380. {
  381. if(ds_main_celltretdetl_celltretdetail.getColumn(i, "chk") == "Y")
  382. {
  383. k = parseInt(k) + 1;
  384. }
  385. }
  386. if (k == 0)
  387. {
  388. sysf_messageBox("폐기취소할 자료를 선택하지 않았습니다.", "E999", "");
  389. return false;
  390. }
  391. fSaveData2();
  392. }
  393. function fSaveData2()
  394. {
  395. var oParam = {};
  396. oParam.id = "TXABC00702";
  397. oParam.service = "hsctstemcellapp.StemCellTreat";
  398. oParam.method = "reqExeStemCellAbnCncl";
  399. oParam.inds = "celltretdetail=ds_main_celltretdetl_celltretdetail";
  400. oParam.outds = "ds_=item";
  401. oParam.async = false;
  402. oParam.callback = "cf_TXABC00702";
  403. tranf_submit(oParam);
  404. }
  405. function cf_TXABC00702(sSvcId, nErrorCode, sErrorMsg)
  406. {
  407. if(nErrorCode < 0)
  408. {
  409. return;
  410. }
  411. else
  412. {
  413. fReadFunc();
  414. }
  415. }
  416. ]]></Script>
  417. </Form>
  418. </FDL>