SMRPD30500_전공의수련현황표엑셀upload.xfdl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMRPD30500" position="absolute 0 0 1201 737" titletext="전공의 수련현황표 엑셀upload" oninit="SMRPD30500_oninit" onload="SMRPD30500_onload">
  5. <Layouts>
  6. <Layout>
  7. <Shape position="absolute 0 116 1195 122" linetype="horizontal" id="line7" class="line_10" anchor="left top right"/>
  8. <Grid position="absolute 0 121 1195 675" id="grd_dutlist" binddataset="ds_main_dutlist" autoenter="select" autofittype="col" cellsizingtype="col" anchor="all">
  9. <Formats>
  10. <Format id="default">
  11. <Columns>
  12. <Column size="23"/>
  13. <Column size="57"/>
  14. <Column size="99"/>
  15. <Column size="122"/>
  16. <Column size="44"/>
  17. <Column size="122"/>
  18. <Column size="44"/>
  19. <Column size="327"/>
  20. </Columns>
  21. <Rows>
  22. <Row size="24" band="head"/>
  23. <Row size="24" band="head"/>
  24. <Row size="24"/>
  25. </Rows>
  26. <Band id="head">
  27. <Cell rowspan="2" taborder="undefined"/>
  28. <Cell col="1" rowspan="2" text="사번" taborder="undefined"/>
  29. <Cell col="2" rowspan="2" text="근태코드" taborder="undefined"/>
  30. <Cell col="3" colspan="2" text="근무일시(From)" taborder="undefined"/>
  31. <Cell col="5" colspan="2" text="근무일시(To)" taborder="undefined"/>
  32. <Cell col="7" rowspan="2" text="비고" taborder="undefined"/>
  33. <Cell row="1" col="3" text="년월일"/>
  34. <Cell row="1" col="4" text="시"/>
  35. <Cell row="1" col="5" text="년월일"/>
  36. <Cell row="1" col="6" text="시"/>
  37. </Band>
  38. <Band id="body">
  39. <Cell celltype="head"/>
  40. <Cell col="1" text="bind:emplno" editautoselect="true"/>
  41. <Cell col="2" displaytype="combo" edittype="combo" text="bind:duttype" editautoselect="true" combodataset="ds_init_duttype_codelist" combocodecol="cdid" combodatacol="cdnm" enable="false"/>
  42. <Cell col="3" displaytype="date" edittype="date" text="bind:fromdd" editautoselect="true" calendardisplaynulltype="nulltext" enable="false"/>
  43. <Cell col="4" text="bind:fromtm1" editautoselect="true"/>
  44. <Cell col="5" displaytype="date" edittype="date" text="bind:todd" editautoselect="true" calendardisplaynulltype="nulltext" enable="false"/>
  45. <Cell col="6" text="bind:totm1" editautoselect="true"/>
  46. <Cell col="7" text="bind:cmt" editautoselect="true"/>
  47. </Band>
  48. </Format>
  49. </Formats>
  50. </Grid>
  51. <Static text="상세내역 List" position="absolute 0 100 113 122" id="caption4" class="tit_2"/>
  52. <Static text="※ 엑셀자료 작성시 유의점" position="absolute 0 680 503 700" id="caption3" style="color:#ff0000ff;" anchor="left bottom"/>
  53. <Static text="- 본인의 자료만 등록 가능합니다." position="absolute 16 697 740 717" id="caption5" style="color:#ff0000ff;" anchor="left bottom"/>
  54. <Button position="absolute 996 97 1101 116" id="btn_download" class="btn2" taborder="6" text="양식 Download" anchor="top right" onclick="btn_download_onclick"/>
  55. <Button position="absolute 1102 97 1196 116" id="btn_upload" class="btn7" text="엑셀 Upload" anchor="top right" onclick="btn_upload_onclick"/>
  56. <Static text="- 근태코드는 반드시 코드값으로 작성하십시요." position="absolute 15 713 739 733" id="caption8" style="color:#ff0000ff;" anchor="left bottom"/>
  57. <Button position="absolute 912 97 965 116" id="btn_grddel" class="btn2" visible="false" text="행삭제" anchor="top right" onclick="btn_grddel_onclick"/>
  58. <Grid position="absolute 30 265 900 545" id="grd_sample" visible="false" binddataset="ds_sampledata">
  59. <Formats>
  60. <Format id="default">
  61. <Columns>
  62. <Column size="27"/>
  63. <Column size="57"/>
  64. <Column size="99"/>
  65. <Column size="122"/>
  66. <Column size="44"/>
  67. <Column size="122"/>
  68. <Column size="44"/>
  69. <Column size="327"/>
  70. </Columns>
  71. <Rows>
  72. <Row size="24" band="head"/>
  73. <Row size="24" band="head"/>
  74. <Row size="24"/>
  75. </Rows>
  76. <Band id="head">
  77. <Cell rowspan="2" taborder="undefined"/>
  78. <Cell col="1" rowspan="2" text="사번" taborder="undefined"/>
  79. <Cell col="2" rowspan="2" text="근태코드" taborder="undefined"/>
  80. <Cell col="3" colspan="2" text="근무일시(From)" taborder="undefined"/>
  81. <Cell col="5" colspan="2" text="근무일시(To)" taborder="undefined"/>
  82. <Cell col="7" rowspan="2" text="비고" taborder="undefined"/>
  83. <Cell row="1" col="3" text="년월일"/>
  84. <Cell row="1" col="4" text="시"/>
  85. <Cell row="1" col="5" text="년월일"/>
  86. <Cell row="1" col="6" text="시"/>
  87. </Band>
  88. <Band id="body">
  89. <Cell celltype="head"/>
  90. <Cell col="1" text="bind:emplno"/>
  91. <Cell col="2" text="bind:duttype"/>
  92. <Cell col="3" text="bind:fromdd"/>
  93. <Cell col="4" text="bind:fromtm1"/>
  94. <Cell col="5" text="bind:todd"/>
  95. <Cell col="6" text="bind:totm1"/>
  96. <Cell col="7" text="bind:cmt"/>
  97. </Band>
  98. </Format>
  99. </Formats>
  100. </Grid>
  101. <Static id="caption1" text="전공의 수련현황표 엑셀 Upload" class="tit_1" position="absolute 0 0 307 23"/>
  102. <Shape id="line2" class="line_6" position="absolute 0 42 1195 48" anchor="left top right"/>
  103. <Button id="btn_save" taborder="7" text="저장" class="btn4" position="absolute 1080 21 1136 43" anchor="top right" onclick="btn_save_onclick"/>
  104. <Button id="btn_close" taborder="8" text="닫기" class="btn4" position="absolute 1139 21 1195 43" anchor="top right" onclick="btn_close_onclick"/>
  105. <Div id="grp_sea" taborder="9" position="absolute 0 47 1195 81" class="div_SA" anchor="left top right">
  106. <Layouts>
  107. <Layout>
  108. <Static id="cap_instcd" text="기관코드" class="search_name" position="absolute 61 8 140 25" anchor="default"/>
  109. <Combo id="cmb_instcd" taborder="1" innerdataset="@ds_main_init" codecolumn="cnstcd" datacolumn="cnstnm" class="combo_default" enable="false" position="absolute 140 8 290 27" anchor="default"/>
  110. <Static id="caption7" text="사번" class="search_name" position="absolute 320 8 375 25" anchor="default"/>
  111. <Edit id="ipt_emplnm" taborder="2" enable="false" position="absolute 426 8 520 27" anchor="default"/>
  112. <Edit id="ipt_emplno" taborder="3" enable="false" position="absolute 374 8 425 27" anchor="default" onkeyup="grp_sea_ipt_emplno_onkeyup"/>
  113. <Static id="caption2" text="근무년월" class="search_name" position="absolute 550 8 626 25" anchor="default"/>
  114. <Calendar id="ipt_dutym" taborder="4" position="absolute 630 8 710 27" mask="yyyy-mm" anchor="default" dateformat="yyyy-MM" value="null" editformat="yyyy-MM" onchanged="grp_sea_ipt_dutym_onchanged"/>
  115. <Shape id="line6" linetype="vertical" position="absolute 1052 5 1058 27" anchor="top right"/>
  116. </Layout>
  117. </Layouts>
  118. </Div>
  119. </Layout>
  120. </Layouts>
  121. <Objects>
  122. <Dataset id="ds_send_search" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_send_search_oncolumnchanged">
  123. <ColumnInfo>
  124. <Column id="instcd" type="STRING" size="256"/>
  125. <Column id="emplno" type="STRING" size="256"/>
  126. <Column id="emplnm" type="STRING" size="256"/>
  127. <Column id="dutym" type="STRING" size="256"/>
  128. <Column id="fromdd" type="STRING" size="256"/>
  129. </ColumnInfo>
  130. <Rows>
  131. <Row>
  132. <Col id="instcd"/>
  133. <Col id="emplno"/>
  134. <Col id="emplnm"/>
  135. <Col id="dutym"/>
  136. </Row>
  137. </Rows>
  138. </Dataset>
  139. <Dataset id="ds_main_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  140. <ColumnInfo>
  141. <Column id="cnstnm" type="STRING" size="256"/>
  142. <Column id="cnstcd" type="STRING" size="256"/>
  143. </ColumnInfo>
  144. </Dataset>
  145. <Dataset id="ds_main_dutlist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  146. <Dataset id="ds_sampledata" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  147. <Dataset id="ds_init_duttype_codelist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  148. <ColumnInfo>
  149. <Column id="cdid" type="STRING" size="256" sumtext="코드"/>
  150. <Column id="cdnm" type="STRING" size="256" sumtext="코드명"/>
  151. </ColumnInfo>
  152. </Dataset>
  153. </Objects>
  154. <Bind>
  155. <BindItem id="item0" compid="grp_sea.cmb_instcd" propid="value" datasetid="instcd" columnid="instcd"/>
  156. <BindItem id="item1" compid="grp_sea.ipt_emplno" propid="value" datasetid="ds_send_search" columnid="emplno"/>
  157. <BindItem id="item2" compid="grp_sea.ipt_emplnm" propid="value" datasetid="ds_send_search" columnid="emplnm"/>
  158. <BindItem id="item3" compid="grp_sea.ipt_dutym" propid="value" datasetid="ds_send_search" columnid="dutym"/>
  159. </Bind>
  160. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  161. * System Name :
  162. * Job Name :
  163. * Creator :
  164. * Make Date : 2017-06-19
  165. * Description :
  166. *---------------------------------------------------------------------------------------
  167. * Modify Date Modifier Modify Description
  168. *---------------------------------------------------------------------------------------
  169. * 2017-06-19 Live Converter TF->XP
  170. *
  171. *---------------------------------------------------------------------------------------
  172. ****************************************************************************************/
  173. include "com_commonxp::comm_main.xjs";
  174. include "mis_miscommonxp::MIS.xjs";
  175. function SMRPD30500_oninit(obj:Form, e:InitEventInfo)
  176. {
  177. frmf_initForm(obj);
  178. }
  179. function SMRPD30500_onload(obj:Form, e:LoadEventInfo)
  180. {
  181. grdf_initGrid(grd_dutlist);
  182. grdf_setRowTypeIcon(grd_dutlist, 0);
  183. grdf_initGrid(grd_sample);
  184. grdf_setRowTypeIcon(grd_sample, 0);
  185. misfComboComCdList("Z0007", grp_sea.cmb_instcd, "N"); //기관코드
  186. ds_send_search.setColumn(0, "instcd", sysf_getUserInfo("dutplceinstcd"));
  187. grp_sea.ipt_emplno.value = sysf_getUserInfo("userid");
  188. grp_sea.ipt_emplnm.value = sysf_getUserInfo("usernm");
  189. var oParam = {};
  190. oParam.id = "TRRPD30303";
  191. oParam.service = "dligclaznsmngtapp.DutScheMngt";
  192. oParam.method = "reqGetDuttypeList";
  193. oParam.inds = "req=ds_send_search";
  194. oParam.outds = "ds_init_duttype_codelist=codelist";
  195. oParam.async = false;
  196. //oParam.callback = "cf_TRRPD30303";
  197. tranf_submit(oParam);
  198. }
  199. function grp_sea_ipt_emplno_onkeyup(obj:Edit, e:KeyEventInfo)
  200. {
  201. if(e.keycode == 13)
  202. {
  203. obj.updateToDataset();
  204. }
  205. }
  206. function ds_send_search_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  207. {
  208. if(e.columnid == "emplno")
  209. {
  210. grp_sea.ipt_emplno.enable = true;
  211. grp_sea.ipt_emplno.value = e.newvalue;
  212. grp_sea.ipt_emplno.setFocus();
  213. var recv_list = "emplno,emplnm" ;
  214. rpbfValidationCheck("EMPLNO", recv_list);
  215. grp_sea.ipt_emplno.enable = false;
  216. }
  217. }
  218. function grp_sea_ipt_dutym_onchanged(obj:Calendar, e:ChangeEventInfo)
  219. {
  220. var date = String(obj.value).substr(0,6);
  221. ds_send_search.setColumn(0, "dutym", date);
  222. }
  223. function btn_grddel_onclick(obj:Button, e:ClickEventInfo)
  224. {
  225. var status = ds_main_dutlist.getRowType(ds_main_dutlist.rowposition);
  226. if(status != 4)
  227. {
  228. sysf_messageBox("행삭제는 엑셀 Upload 한 자료 저장하기 전에 수정하는 용도로만 \n사용이 가능합니다. ", "E999", "");
  229. return;
  230. }
  231. ds_main_dutlist.deleteRow(ds_main_dutlist.rowposition);
  232. }
  233. function btn_download_onclick(obj:Button, e:ClickEventInfo)
  234. {
  235. dsf_makeValue(ds_sampledata, "emplno", "string", sysf_getUserInfo("userid"), 0);
  236. dsf_makeValue(ds_sampledata, "duttype", "string", "01", 0);
  237. dsf_makeValue(ds_sampledata, "fromdd", "string", utlf_getCurrentDate(), 0);
  238. dsf_makeValue(ds_sampledata, "todd", "string", "07", 0);
  239. dsf_makeValue(ds_sampledata, "todd", "string", utlf_getCurrentDate(), 0);
  240. dsf_makeValue(ds_sampledata, "todd", "string", "09", 0);
  241. var addrow = ds_sampledata.addRow();
  242. var duttypeCodeTxt = "코드로 입력 ";
  243. for(var i = 0; i < ds_init_duttype_codelist.rowcount; i++)
  244. {
  245. duttypeCodeTxt += ds_init_duttype_codelist.getColumn(i, "cdid") + ":";
  246. duttypeCodeTxt += ds_init_duttype_codelist.getColumn(i, "cdnm") + " ";
  247. }
  248. ds_sampledata.setColumn(addrow, "duttype", duttypeCodeTxt);
  249. grdf_exportExcel(grd_sample, "수련현황표 양식", "see", false);
  250. }
  251. function btn_upload_onclick(obj:Button, e:ClickEventInfo)
  252. {
  253. sysf_messageBox("엑셀 Upload를 하실 때는 반드시 양식에 맞게 입력해주셔야 합니다.", "I999", "");
  254. grdf_ImportExcel("ds_main_dutlist", 2, grd_dutlist)
  255. ds_main_dutlist.updatecontrol = false;
  256. for(var i = 0; i < ds_main_dutlist.rowcount; i++)
  257. {
  258. ds_main_dutlist.setRowType(i, "i");
  259. ds_main_dutlist.setColumn(i, "duttype", ds_main_dutlist.getColumn(i, "duttype").getLeftPad(2,"0"));
  260. ds_main_dutlist.setColumn(i, "fromtm1", ds_main_dutlist.getColumn(i, "fromtm1").getLeftPad(2,"0"));
  261. ds_main_dutlist.setColumn(i, "totm1", ds_main_dutlist.getColumn(i, "fromttotm1m1").getLeftPad(2,"0"));
  262. }
  263. ds_main_dutlist.updatecontrol = true;
  264. sysf_messageBox("Upload 가 완료되었습니다. \n데이터를 확인 후 저장버튼을 누르십시요." , "I999", "");
  265. }
  266. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  267. {
  268. if (sysf_messageBox( "수련현황표 자료를 저장하시겠습니까?", "Q999","") != 6)
  269. {
  270. return;
  271. }
  272. if (datacheck() == false)
  273. {
  274. return;
  275. }
  276. ExecData();
  277. }
  278. function datacheck()
  279. {
  280. if(String(grp_sea.ipt_dutym.value).length != 6)
  281. {
  282. sysf_messageBox("상단의 근무년월이 입력되지 않았습니다. ", "E999", "");
  283. grp_sea.ipt_dutym.setFocus();
  284. return false;
  285. }
  286. for(var i = 0; i < ds_main_dutlist.rowcount; i++)
  287. {
  288. if(ds_main_dutlist.getColumn(i, "emplno") != grp_sea.ipt_emplno.value)
  289. {
  290. sysf_messageBox("사번이 일치하지 않습니다. 사번을 확인하십시요.(본인 자료만 저장 가능) ", "E999", "");
  291. ds_main_dutlist.rowposition = i;
  292. return false;
  293. }
  294. if(utlf_isNull(ds_main_dutlist.getColumn(i, "duttype")))
  295. {
  296. sysf_messageBox("근태코드가 존재하지 않는 코드입니다. 근태코드를 확인하십시요. ", "E999", "");
  297. ds_main_dutlist.rowposition = i;
  298. return false;
  299. }
  300. if(String(ds_main_dutlist.getColumn(i, "fromdd")).length != 10)
  301. {
  302. sysf_messageBox("근무시작일자가 적합하지 않습니다. 근무일자를 확인하십시요. ", "E999", "");
  303. ds_main_dutlist.rowposition = i;
  304. return false;
  305. }
  306. if(String(ds_main_dutlist.getColumn(i, "todd")).length != 10)
  307. {
  308. sysf_messageBox("근무종료일자가 적합하지 않습니다. 근무일자를 확인하십시요. ", "E999", "");
  309. ds_main_dutlist.rowposition = i;
  310. return false;
  311. }
  312. if(String(ds_main_dutlist.getColumn(i, "fromtm1")).length != 2 || ds_main_dutlist.getColumn(i, "fromtm1") < "00" || ds_main_dutlist.getColumn(i, "fromtm1") > "23")
  313. {
  314. sysf_messageBox("근무시작시간의 형식이 적합하지 않습니다. 시간은 두 자리로 입력하세요.(00~23) ", "E999", "");
  315. ds_main_dutlist.rowposition = i;
  316. return false;
  317. }
  318. if(String(ds_main_dutlist.getColumn(i, "totm1")).length != 2 || ds_main_dutlist.getColumn(i, "totm1") < "00" || ds_main_dutlist.getColumn(i, "totm1") > "23")
  319. {
  320. sysf_messageBox("근무종료시간의 형식이 적합하지 않습니다. 시간은 두 자리로 입력하세요.(00~23) ", "E999", "");
  321. ds_main_dutlist.rowposition = i;
  322. return false;
  323. }
  324. if(ds_main_dutlist.getColumn(i, "fromdd") + ds_main_dutlist.getColumn(i, "fromtm1") >= ds_main_dutlist.getColumn(i, "todd")+ds_main_dutlist.getColumn(i, "totm1"))
  325. {
  326. sysf_messageBox("근무 종료일시가 시작일시보다 작거나 같습니다. \n근무일시를 확인하십시요. ", "E999", "");
  327. ds_main_dutlist.rowposition = i;
  328. return false;
  329. }
  330. if(String(ds_main_dutlist.getColumn(i, "fromdd")).substr(0,6) != grp_sea.ipt_dutym.value)
  331. {
  332. sysf_messageBox("근무시작일자가 상단의 근무년월과 일치하지 않습니다. 근무일자를 확인하십시요. ", "E999", "");
  333. ds_main_dutlist.rowposition = i;
  334. return false;
  335. }
  336. if(String(ds_main_dutlist.getColumn(i, "todd")).substr(0,6) != grp_sea.ipt_dutym.value)
  337. {
  338. sysf_messageBox("근무종료일자가 상단의 근무년월과 일치하지 않습니다. 근무일자를 확인하십시요. ", "E999", "");
  339. ds_main_dutlist.rowposition = i;
  340. return false;
  341. }
  342. }
  343. return true;
  344. }
  345. function ExecData()
  346. {
  347. var oParam = {};
  348. oParam.id = "TXRPD30501";
  349. oParam.service = "dligclaznsmngtapp.DutScheMngt";
  350. oParam.method = "reqExeSaveDutyInfoMulti";
  351. oParam.inds = "req=ds_main_dutlist:u";
  352. oParam.outds = "ds_=item";
  353. oParam.async = false;
  354. oParam.callback = "cf_TXRPD30501";
  355. tranf_submit(oParam);
  356. }
  357. function cf_TXRPD30501(sSvcId, nErrorCode, sErrorMsg)
  358. {
  359. if(nErrorCode < 0)
  360. {
  361. return;
  362. }
  363. else
  364. {
  365. sysf_messageBox("저장되었습니다. ", "I999", "" );
  366. }
  367. }
  368. function btn_close_onclick(obj:Button, e:ClickEventInfo)
  369. {
  370. this.close();
  371. }
  372. ]]></Script>
  373. </Form>
  374. </FDL>