SPSTP01200_진료수익차트.xfdl 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPSTP01200" position="absolute 0 0 1256 805" titletext="진료수익차트" onload="SPSTP01200_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static text="진료수익차트" position="absolute 0 0 140 25" align="align:center middle;" id="caption60" class="tit_1"/>
  8. <Static text="기간별 수익 현황" position="absolute 0 487 125 503" id="caption1" class="tit_2"/>
  9. <Shape position="absolute 0 506 1195 512" linetype="horizontal" id="line1" class="line_1" style="strokepen:3 solid #33bbbbff;"/>
  10. <ActiveX position="absolute 141 83 1195 483" id="obj_chart" progid="{fab9b41c-87d6-474d-ab7e-f07d78f2422e}"/>
  11. <Grid position="absolute 0 510 1195 765" id="grd_main" binddataset="ds_main_gridlist_gridinfo">
  12. <Formats>
  13. <Format id="default"/>
  14. </Formats>
  15. </Grid>
  16. <Shape id="rectangle1" type="rectangle"/>
  17. <Div id="grp" taborder="4" position="absolute 0 25 1195 66" class="div_SA">
  18. <Layouts>
  19. <Layout width="1195" height="41">
  20. <Shape id="line13" linetype="vertical" position="absolute 1103 7 1109 34" anchor="default"/>
  21. <Static id="caption21" text="조회기간 :" class="search_name" position="absolute 230 12 302 29" anchor="default"/>
  22. <Button id="btn_search" taborder="1" text="조회" class="btn1" position="absolute 1125 10 1181 32" anchor="default" onclick="grp_btn_search_onclick"/>
  23. <Static id="caption6" text="~" visible="false" position="absolute 387 13 397 28" anchor="default"/>
  24. <Calendar id="ipt_fromdd" taborder="2" class="input_search" position="absolute 310 11 380 30" mask="yyyy-mm" anchor="default" dateformat="yyyy-MM" value="null" editformat="yyyy-MM" autoselect="true" autoskip="true"/>
  25. <Calendar id="ipt_todd" taborder="3" class="input_search" visible="false" position="absolute 404 11 474 30" mask="yyyy-mm" anchor="default"/>
  26. <Static id="caption2" text="기간구분 :" class="search_name" position="absolute 5 12 77 29" anchor="default"/>
  27. <Radio id="cmb_srchflag" taborder="4" columncount="2" rowcount="0" codecolumn="codecolumn" datacolumn="datacolumn" position="absolute 85 11 185 30" anchor="default" onitemchanged="grp_cmb_srchflag_onitemchanged">
  28. <Dataset id="innerdataset">
  29. <ColumnInfo>
  30. <Column id="codecolumn"/>
  31. <Column id="datacolumn"/>
  32. </ColumnInfo>
  33. <Rows>
  34. <Row>
  35. <Col id="codecolumn">day</Col>
  36. <Col id="datacolumn">일별</Col>
  37. </Row>
  38. <Row>
  39. <Col id="codecolumn">month</Col>
  40. <Col id="datacolumn">월별</Col>
  41. </Row>
  42. </Rows>
  43. </Dataset>
  44. </Radio>
  45. </Layout>
  46. </Layouts>
  47. </Div>
  48. <Div id="leg" taborder="5" position="absolute 10 165 120 380" style="border:1 solid #808080ff ;">
  49. <Layouts>
  50. <Layout width="110" height="215">
  51. <CheckBox id="checkbox1" taborder="0" position="absolute 27 122 102 137" text="실제 입원" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  52. <CheckBox id="checkbox2" taborder="1" position="absolute 27 97 102 112" text="실제 외래" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  53. <CheckBox id="checkbox3" taborder="2" position="absolute 27 147 102 162" text="실제 합계" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  54. <CheckBox id="checkbox4" taborder="3" position="absolute 27 37 107 52" text="목표 입원" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  55. <CheckBox id="checkbox5" taborder="4" position="absolute 27 12 107 27" text="목표 외래" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  56. <CheckBox id="checkbox6" taborder="5" position="absolute 27 62 107 77" text="목표 합계" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  57. <Shape id="rectangle2" type="rectangle" position="absolute 7 122 22 137" style="fillbrush:solid #ffa500ff true;"/>
  58. <Shape id="rectangle3" type="rectangle" position="absolute 7 97 22 112" style="fillbrush:solid #008000ff true;"/>
  59. <Shape id="rectangle4" type="rectangle" position="absolute 7 147 22 162" style="fillbrush:solid #ff0000ff true;"/>
  60. <Shape id="rectangle5" type="rectangle" position="absolute 7 37 22 52" style="fillbrush:solid #ee82eeff true;"/>
  61. <Shape id="rectangle6" type="rectangle" position="absolute 7 12 22 27" style="fillbrush:solid #5f9ea0ff true;"/>
  62. <Shape id="rectangle7" type="rectangle" position="absolute 7 62 22 77" style="fillbrush:solid #0000ffff true;"/>
  63. <CheckBox id="checkbox7" taborder="6" position="absolute 7 182 97 202" text="누적값 조회" falsevalue="N" truevalue="Y" onclick="CheckBox_onclick"/>
  64. </Layout>
  65. </Layouts>
  66. </Div>
  67. </Layout>
  68. </Layouts>
  69. <Objects>
  70. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  71. <ColumnInfo>
  72. <Column id="fromdd" type="STRING" size="256"/>
  73. <Column id="todd" type="STRING" size="256"/>
  74. <Column id="srchflag" type="STRING" size="256"/>
  75. </ColumnInfo>
  76. <Rows>
  77. <Row>
  78. <Col id="fromdd"/>
  79. <Col id="todd"/>
  80. <Col id="srchflag"/>
  81. </Row>
  82. </Rows>
  83. </Dataset>
  84. <Dataset id="ds_hidden" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  85. <ColumnInfo>
  86. <Column id="accflag" type="STRING" size="256"/>
  87. <Column id="outflag" type="STRING" size="256"/>
  88. <Column id="inflag" type="STRING" size="256"/>
  89. <Column id="totflag" type="STRING" size="256"/>
  90. <Column id="goal_out" type="STRING" size="256"/>
  91. <Column id="goal_in" type="STRING" size="256"/>
  92. <Column id="goal_tot" type="STRING" size="256"/>
  93. </ColumnInfo>
  94. <Rows>
  95. <Row>
  96. <Col id="accflag"/>
  97. <Col id="outflag"/>
  98. <Col id="inflag"/>
  99. <Col id="totflag"/>
  100. <Col id="goal_out"/>
  101. <Col id="goal_in"/>
  102. <Col id="goal_tot"/>
  103. </Row>
  104. </Rows>
  105. </Dataset>
  106. <Dataset id="ds_temp_header" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  107. <Dataset id="ds_temp_gridlist_gridinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  108. <Dataset id="ds_main_gridlist_gridinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  109. <Dataset id="ds_temp_chrtlist_chrtinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  110. <Dataset id="ds_temp_acclist_accinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  111. <Dataset id="ds_temp_goallist_goalinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  112. <Dataset id="ds_temp_goalacclist_goalaccinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  113. </Objects>
  114. <Bind>
  115. <BindItem id="item0" compid="grp.cmb_srchflag" propid="value" datasetid="ds_send" columnid="srchflag"/>
  116. <BindItem id="item1" compid="grp.ipt_fromdd" propid="value" datasetid="ds_send" columnid="fromdd"/>
  117. <BindItem id="item2" compid="grp.ipt_todd" propid="value" datasetid="ds_send" columnid="todd"/>
  118. <BindItem id="item3" compid="leg.checkbox5" propid="value" datasetid="ds_hidden" columnid="goal_out"/>
  119. <BindItem id="item4" compid="leg.checkbox4" propid="value" datasetid="ds_hidden" columnid="goal_in"/>
  120. <BindItem id="item5" compid="leg.checkbox6" propid="value" datasetid="ds_hidden" columnid="goal_tot"/>
  121. <BindItem id="item6" compid="leg.checkbox2" propid="value" datasetid="ds_hidden" columnid="outflag"/>
  122. <BindItem id="item7" compid="leg.checkbox1" propid="value" datasetid="ds_hidden" columnid="inflag"/>
  123. <BindItem id="item8" compid="leg.checkbox3" propid="value" datasetid="ds_hidden" columnid="totflag"/>
  124. <BindItem id="item9" compid="leg.checkbox7" propid="value" datasetid="ds_hidden" columnid="accflag"/>
  125. </Bind>
  126. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  127. * System Name :
  128. * Job Name :
  129. * Creator :
  130. * Make Date : 2016-05-24
  131. * Description :
  132. *---------------------------------------------------------------------------------------
  133. * Modify Date Modifier Modify Description
  134. *---------------------------------------------------------------------------------------
  135. * 2016-05-24 Live Converter TF->XP
  136. *
  137. *---------------------------------------------------------------------------------------
  138. ****************************************************************************************/
  139. //=======================================================================================
  140. // Lib Include
  141. //---------------------------------------------------------------------------------------
  142. include 'com_commonxp::comm_main.xjs';
  143. var colArr = new Array();
  144. var arErrorCode = new HashArray();
  145. //=======================================================================================
  146. // Local methods
  147. //---------------------------------------------------------------------------------------
  148. /**
  149. * [fInit description]
  150. * @return {[type]} [description]
  151. */
  152. function fInit() {
  153. ds_send.setColumn(0, "fromdd", utlf_getCurrentDate());
  154. ds_send.setColumn(0, "todd", utlf_getCurrentDate());
  155. ds_send.setColumn(0, "srchflag", "day");
  156. ds_hidden.setColumn(0, "accflag", "Y");
  157. ds_hidden.setColumn(0, "totflag", "Y");
  158. ds_hidden.setColumn(0, "goal_tot", "Y");
  159. // 목표 외래, 입원, 합계
  160. colArr[0] = "0xa09e5f"; // CadetBlue
  161. colArr[1] = "0xee82ee"; // 보라
  162. colArr[2] = "0xff0000"; // 파랑
  163. // 실제 외래, 입원, 합계
  164. colArr[3] = "0x008000"; // 녹색
  165. colArr[4] = "0x00a5ff"; // 주황
  166. colArr[5] = "0x0000ff"; // 빨강
  167. fMakeChart(0, 0, 0, 0);
  168. }
  169. /**
  170. * [fMakeChart description]
  171. * @param {[type]} hMin [description]
  172. * @param {[type]} hMax [description]
  173. * @param {[type]} vMin [description]
  174. * @param {[type]} vMax [description]
  175. * @return {[type]} [description]
  176. */
  177. function fMakeChart(hMin, hMax, vMin, vMax) {
  178. inff_clearTChart(obj_chart);
  179. obj_chart.Axis.RemoveAllCustom();
  180. obj_chart.Header.Visible = false;
  181. obj_chart.Aspect.View3D = 0; // 3D 설정 :: 0 = 2D | 1 = 3D
  182. obj_chart.Zoom.Enable = false;
  183. obj_chart.Scroll.Enable = 2;
  184. obj_chart.Legend.Visible = false;
  185. obj_chart.Environment.MouseWheelScroll = false;
  186. //margin 값 정하기
  187. obj_chart.Panel.MarginTop = 2;
  188. obj_chart.Panel.MarginLeft = 10;
  189. obj_chart.Panel.MarginRight = 2;
  190. obj_chart.Panel.MarginBottom = 2;
  191. obj_chart.Panel.BevelWidth = 0; // 주취 테두리
  192. obj_chart.Panel.Gradient.Visible = true;
  193. obj_chart.Panel.Gradient.StartColor = 0xffffff;
  194. obj_chart.Panel.Gradient.EndColor = 0xffffff;
  195. // 축 설정
  196. obj_chart.Axis.Bottom.AxisPen.Visible = false;
  197. obj_chart.Axis.Bottom.Automatic = false; //하단축 자동 설정(기본값)
  198. obj_chart.Axis.Bottom.Labels.Visible = true; //하단축 Label 설정
  199. obj_chart.Axis.Bottom.Labels.Multiline = false; //하단축 Label 2줄 설정
  200. obj_chart.Axis.Bottom.Labels.Style = 0;
  201. obj_chart.Axis.Bottom.Labels.Font.Color = 0x000000;
  202. obj_chart.Axis.Bottom.Minimum = hMin;
  203. obj_chart.Axis.Bottom.Maximum = hMax;
  204. obj_chart.Axis.Bottom.Increment = 1; //하단축 증가값 설정
  205. obj_chart.Axis.Bottom.MinorTickCount = 0; //하단축 눈금 갯수 설정
  206. obj_chart.Axis.Bottom.TicksInner.Visible = true; //하단축 눈금 안쪽 표시 설정
  207. // 외래(0), 입원(1), 합계(2)
  208. for (var i = 0; i < 6; i++) {
  209. var axis = obj_chart.Axis.AddCustom(false);
  210. obj_chart.Axis.get_Custom(i).AxisPen.Visible = false;
  211. obj_chart.Axis.get_Custom(i).Title.Font.Size = 8;
  212. obj_chart.Axis.get_Custom(i).Title.Font.Bold = false;
  213. obj_chart.Axis.get_Custom(i).Title.Angle = 0;
  214. obj_chart.Axis.get_Custom(i).Labels.Visible = i < 1 ? true : false;
  215. obj_chart.Axis.get_Custom(i).PositionPercent = 0;
  216. obj_chart.Axis.get_Custom(i).Automatic = false; // 값에 따른 자동 Min-Max 조절
  217. obj_chart.Axis.get_Custom(i).Maximum = vMax;
  218. obj_chart.Axis.get_Custom(i).Minimum = vMin;
  219. obj_chart.Axis.get_Custom(i).Increment = 1; // 세로 눈금
  220. obj_chart.AddSeries(0); // type 0 is a Line series, type 1 is a Bar series, and type 2 is an HorizBar series
  221. obj_chart.Series(i).VerticalAxisCustom = axis;
  222. //라인의 굵기를 정해준다.
  223. obj_chart.Series(i).Color = parseInt(colArr[i], 16);
  224. obj_chart.Series(i).asLine.Pointer.Visible = false;
  225. obj_chart.Series(i).asLine.Pointer.Style = 0;
  226. obj_chart.Series(i).asLine.Pointer.VerticalSize = 3;
  227. obj_chart.Series(i).asLine.Pointer.HorizontalSize = 3;
  228. obj_chart.Series(i).asLine.LinePen.Width = 2;
  229. obj_chart.Series(i).asLine.LinePen.Style = 0;
  230. }
  231. }
  232. /**
  233. * [fSetDynamicGrid description]
  234. * @param {[type]} grd: Grid [description]
  235. * @param {[type]} ref: Dataset [description]
  236. * @param {[type]} sid [description]
  237. * @return {[type]} [description]
  238. */
  239. function fSetDynamicGrid(grd: Grid, ref: Dataset, sid) {
  240. ds_temp_header.clearData();
  241. ds_temp_gridlist_gridinfo.clearData();
  242. ds_temp_chrtlist_chrtinfo.clearData();
  243. ds_temp_acclist_accinfo.clearData();
  244. ds_temp_goallist_goalinfo.clearData();
  245. ds_temp_goalacclist_goalaccinfo.clearData();
  246. var oParam = {};
  247. oParam.id = sid;
  248. oParam.service = "stspamapp.StsPam";
  249. oParam.method = "reqGetPaasMagm_Chart";
  250. oParam.inds = "req=ds_send";
  251. oParam.outds = "ds_temp_header=header ds_temp_gridlist_gridinfo=gridinfo ds_temp_chrtlist_chrtinfo=chrtinfo " +
  252. "ds_temp_acclist_accinfo=accinfo ds_temp_goallist_goalinfo=goalinfo ds_temp_goalacclist_goalaccinfo=goalaccinfo";
  253. oParam.async = false;
  254. oParam.callback = "callback";
  255. tranf_submit(oParam);
  256. if (arErrorCode.pop(sid) < 0) {
  257. return;
  258. }
  259. if (ds_temp_header.rowcount < 1) {
  260. return;
  261. }
  262. ref.copyData(ds_temp_gridlist_gridinfo, false);
  263. var attrArr = String(ds_temp_header.getColumn(0, 'attr')).split("^");
  264. var widthArr = String(ds_temp_header.getColumn(0, "width")).split("^");
  265. var capArr = String(ds_temp_header.getColumn(0, "caption")).split('^');
  266. var xmlStart = '<Formats><Format id="default">';
  267. var xmlEnd = '</Format></Formats>';
  268. var colStart = '<Columns>';
  269. var colEnd = '</Columns>';
  270. var rowStart = '<Rows>';
  271. var rowEnd = '</Rows>';
  272. var bandHeadStart = '<Band id="head">';
  273. var bandHeadEnd = '</Band>';
  274. var bandBodyStart = '<Band id="body">';
  275. var bandBodyEnd = '</Band>';
  276. var colBody = '';
  277. var rowBody = '';
  278. var bandHeadBody = '';
  279. var bandBodyBody = '';
  280. var rowNode = '<Row size="24"';
  281. var END_NODE = '/>';
  282. rowBody = rowNode + ' band="head" ' + END_NODE +
  283. rowNode + END_NODE;
  284. for (var i = 0; i < attrArr.length; i++) {
  285. var colNode = '<Column size="' + widthArr[i] + '" ';
  286. if(i <= 1){
  287. colNode += 'band="left" ';
  288. }
  289. rowNode += (i == 0) ? ' band="head" ' : '';
  290. var bandHeadNode = '';
  291. if((i % 2) == 0){
  292. bandHeadNode += '<Cell ';
  293. if(i != 0){
  294. bandHeadNode += 'col="' + i + '" ';
  295. }
  296. bandHeadNode += 'colspan="2" text="' + capArr[i] + '" '
  297. bandHeadBody += bandHeadNode + END_NODE;
  298. }
  299. var bandBodyNode = '<Cell ';
  300. if(i != 0){
  301. bandBodyNode += 'col="' + i + '" ';
  302. }
  303. else{
  304. bandBodyNode += 'suppress="1" suppressalign="middle,over" '
  305. }
  306. var value = attrArr[i].split(';')[0];
  307. value = value.replace('ref', 'bind');
  308. bandBodyNode += 'text="' + value + '" ';
  309. // bind 되는 column 이 amt 로 끝나면 align 을 right middle 로 설정
  310. var style = 'style="';
  311. if(value.indexOf('amt') >= 0){
  312. style += 'align:right&#32;middle;';
  313. }
  314. style += 'background:BIND(bgColor);background2:BIND(bgColor);';
  315. if(i > 0){
  316. style += 'font:BIND(font);';
  317. }
  318. else{
  319. style += 'font:Dotum,9,bold;';
  320. }
  321. style += '" ';
  322. bandBodyNode += style;
  323. bandBodyBody += bandBodyNode + END_NODE;
  324. colBody += colNode + END_NODE;
  325. }
  326. var format = xmlStart + colStart + colBody + colEnd + rowStart + rowBody + rowEnd + bandHeadStart + bandHeadBody + bandHeadEnd
  327. + bandBodyStart + bandBodyBody + bandBodyEnd + xmlEnd;
  328. grd.formats = format;
  329. }
  330. /**
  331. * [fSetChart description]
  332. * @return {[type]} [description]
  333. */
  334. function fSetChart() {
  335. var cnt = ds_temp_chrtlist_chrtinfo.rowcount;
  336. if (cnt < 1) {
  337. return;
  338. }
  339. var min = 0;
  340. var max = 0;
  341. var outamt = 0;
  342. var inamt = 0;
  343. var totamt = 0;
  344. var result = (ds_hidden.getColumn(0, "accflag") == "Y");
  345. var chrtpath = result ? ds_temp_acclist_accinfo : ds_temp_chrtlist_chrtinfo;
  346. var goalpath = result ? ds_temp_goalacclist_goalaccinfo : ds_temp_goallist_goalinfo;
  347. for (var i = 0; i < cnt; i++) {
  348. outamt = (chrtpath.getColumn(i, "outamt"));
  349. inamt = (chrtpath.getColumn(i, "inamt"));
  350. totamt = (chrtpath.getColumn(i, "totamt"));
  351. if (ds_hidden.getColumn(0, "outflag") == "Y") {
  352. min = Number(outamt) < Number(min) ? outamt : min;
  353. max = Number(outamt) > Number(max) ? outamt : max;
  354. //trace('[outflag]min: ' + min + ', max: ' + max);
  355. }
  356. if (ds_hidden.getColumn(0, "inflag") == "Y") {
  357. min = Number(inamt) < Number(min) ? inamt : min;
  358. max = Number(inamt) > Number(max) ? inamt : max;
  359. }
  360. if (ds_hidden.getColumn(0, "totflag") == "Y") {
  361. min = Number(totamt) < Number(min) ? totamt : min;
  362. max = Number(totamt) > Number(max) ? totamt : max;
  363. }
  364. }
  365. var goalCnt = goalpath.rowcount;
  366. for (var i = 0; i < goalCnt; i++) {
  367. outamt = (goalpath.getColumn(i, "outamt"));
  368. inamt = (goalpath.getColumn(i, "inamt"));
  369. totamt = (goalpath.getColumn(i, "totamt"));
  370. if (ds_hidden.getColumn(0, "goal_out") == "Y") {
  371. min = Number(outamt) < Number(min) ? outamt : min;
  372. max = Number(outamt) > Number(max) ? outamt : max;
  373. }
  374. if (ds_hidden.getColumn(0, "goal_in") == "Y") {
  375. min = Number(inamt) < Number(min) ? inamt : min;
  376. max = Number(inamt) > Number(max) ? inamt : max;
  377. }
  378. if (ds_hidden.getColumn(0, "goal_tot") == "Y") {
  379. min = Number(totamt) < Number(min) ? totamt : min;
  380. max = Number(totamt) > Number(max) ? totamt : max;
  381. }
  382. }
  383. min = Math.round(min * 0.9);
  384. max = Math.round(max * 1.1);
  385. fMakeChart(0, cnt, min, max);
  386. var flag = ds_send.getColumn(0, "srchflag");
  387. var str = (flag == "day") ? "일" : "월";
  388. var outAmtGoal = 0;
  389. var inAmtGoal = 0;
  390. var totAmtGoal = 0;
  391. // 그래프 표시
  392. var lbl = "";
  393. for (var i = 0; i < cnt; i++) {
  394. lbl = parseInt(ds_temp_chrtlist_chrtinfo.getColumn(i, flag)) + str;
  395. outAmtGoal = utlf_transNullToEmpty(goalpath.getColumn(i, "outamt"));
  396. outAmtGoal = (outAmtGoal == '') ? 0 : outAmtGoal;
  397. inAmtGoal = utlf_transNullToEmpty(goalpath.getColumn(i, "inamt"));
  398. inAmtGoal = (inAmtGoal == '') ? 0 : inAmtGoal;
  399. totAmtGoal = utlf_transNullToEmpty(goalpath.getColumn(i, "totamt"));
  400. totAmtGoal = (totAmtGoal == '') ? 0 : totAmtGoal;
  401. //trace('out goal: ' + outAmtGoal + ', in goal: ' + inAmtGoal + ', tot goal: ' + totAmtGoal);
  402. if (ds_hidden.getColumn(0, "goal_out") == "Y") {
  403. obj_chart.Series(0).AddXY(i, outAmtGoal, lbl, obj_chart.Series(0).Color);
  404. }
  405. if (ds_hidden.getColumn(0, "goal_in") == "Y") {
  406. obj_chart.Series(1).AddXY(i, inAmtGoal, lbl, obj_chart.Series(1).Color);
  407. }
  408. if (ds_hidden.getColumn(0, "goal_tot") == "Y") {
  409. obj_chart.Series(2).AddXY(i, totAmtGoal, lbl, obj_chart.Series(2).Color);
  410. }
  411. outamt = utlf_transNullToEmpty(chrtpath.getColumn(i, "outamt"));
  412. outamt = (outamt == '') ? 0 : outamt;
  413. inamt = utlf_transNullToEmpty(chrtpath.getColumn(i, "inamt"));
  414. inamt = (inamt == '') ? 0 : inamt;
  415. totamt = utlf_transNullToEmpty(chrtpath.getColumn(i, "totamt"));
  416. totamt = (totamt == '') ? 0 : totamt;
  417. //trace('out: ' + outamt + ', in: ' + inamt + ', tot: ' + totamt);
  418. if (ds_hidden.getColumn(0, "outflag") == "Y") {
  419. obj_chart.Series(3).AddXY(i, outamt, lbl, obj_chart.Series(3).Color);
  420. }
  421. if (ds_hidden.getColumn(0, "inflag") == "Y") {
  422. obj_chart.Series(4).AddXY(i, inamt, lbl, obj_chart.Series(4).Color);
  423. }
  424. if (ds_hidden.getColumn(0, "totflag") == "Y") {
  425. obj_chart.Series(5).AddXY(i, totamt, lbl, obj_chart.Series(5).Color);
  426. }
  427. }
  428. }
  429. /**
  430. * submit 후 호출 될 공통 콜백
  431. * @param {[type]} sSvcId [description]
  432. * @param {[type]} nErrorCode [description]
  433. * @param {[type]} sErrorMsg [description]
  434. * @return {Function} [description]
  435. */
  436. function callback(sSvcId, nErrorCode, sErrorMsg){
  437. arErrorCode.push(sSvcId, nErrorCode);
  438. }
  439. //=======================================================================================
  440. // Events
  441. //---------------------------------------------------------------------------------------
  442. /**
  443. * onload 이벤트 발생 시 호출
  444. * @param {[type]} obj:Form [description]
  445. * @param {[type]} e:LoadEventInfo [description]
  446. */
  447. function SPSTP01200_onload(obj: Form, e: LoadEventInfo) {
  448. frmf_initForm(obj);
  449. fInit();
  450. }
  451. /**
  452. * 기간구분 라디오 아이템 변경 후 이벤트
  453. * @param {[type]} obj: Radio [description]
  454. * @param {[type]} e: ItemChangeEventInfo [description]
  455. * @return {[type]} [description]
  456. */
  457. function grp_cmb_srchflag_onitemchanged(obj: Radio, e: ItemChangeEventInfo) {
  458. var flag = ds_send.getColumn(0, "srchflag");
  459. if (flag == "day") {
  460. grp.ipt_fromdd.dateformat = "yyyy-MM";
  461. grp.ipt_fromdd.editformat = "yyyy-MM";
  462. }
  463. else if (flag == "month") {
  464. grp.ipt_fromdd.dateformat = "yyyy";
  465. grp.ipt_fromdd.editformat = "yyyy";
  466. }
  467. }
  468. /**
  469. * 조회 버튼 클릭 이벤트
  470. * @param {[type]} obj: Button [description]
  471. * @param {[type]} e: ClickEventInfo [description]
  472. * @return {[type]} [description]
  473. */
  474. function grp_btn_search_onclick(obj: Button, e: ClickEventInfo) {
  475. fSetDynamicGrid(grd_main, ds_main_gridlist_gridinfo, "TRSTP01803");
  476. ds_main_gridlist_gridinfo.addColumn('bgColor', 'string');
  477. ds_main_gridlist_gridinfo.addColumn('font', 'string');
  478. ds_main_gridlist_gridinfo.setColumn(2, 'bgColor', '#e6e6ff');
  479. ds_main_gridlist_gridinfo.setColumn(2, 'font', 'Dotum,9,bold');
  480. ds_main_gridlist_gridinfo.setColumn(5, 'bgColor', '#ffe6e6');
  481. ds_main_gridlist_gridinfo.setColumn(5, 'font', 'Dotum,9,bold');
  482. ds_main_gridlist_gridinfo.setColumn(8, 'bgColor', '#ffcdcd');
  483. ds_main_gridlist_gridinfo.setColumn(8, 'font', 'Dotum,9,bold');
  484. fSetChart();
  485. }
  486. /**
  487. * 차트 범례 체크 박스 클릭 이벤트
  488. * @param {[type]} obj: CheckBox [description]
  489. * @param {[type]} e: ClickEventInfo [description]
  490. */
  491. function CheckBox_onclick(obj: CheckBox, e: ClickEventInfo) {
  492. fSetChart();
  493. }
  494. ]]></Script>
  495. </Form>
  496. </FDL>