SMRSM00401_유해화학물질취급관리대장(본원).xfdl 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMRSM00400" position="absolute 0 0 1199 786" titletext="특별관리물질취급일지 입력" oninit="SMRSM00400_oninit" onload="SMRSM00400_onload">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption6" text="특별관리물질취급일지(본원)" class="tit_1" position="absolute 0 0 206 25"/>
  8. <Shape id="line2" class="line_6" position="absolute 0 48 1194 54" anchor="left top right"/>
  9. <Button id="btn_prt" taborder="1" text="출력" class="btn6" position="absolute 0 27 56 49" onclick="btn_prt_onclick"/>
  10. <Button id="btn_save" taborder="2" text="저장" class="btn4" position="absolute 972 27 1028 49" anchor="top right" onclick="btn_save_onclick"/>
  11. <Button id="btn_cnfm" taborder="3" text="확정처리" class="btn4" position="absolute 1031 27 1111 49" anchor="top right" onclick="btn_cnfm_onclick"/>
  12. <Button id="btn_cancel" taborder="4" text="확정취소" class="btn4" enable="false" position="absolute 1114 27 1194 49" anchor="top right" onclick="btn_cancel_onclick"/>
  13. <Div id="grp_sea" taborder="5" class="div_SA2" position="absolute 0 52 1194 92" anchor="left top right">
  14. <Layouts>
  15. <Layout>
  16. <Shape id="line5" linetype="vertical" class="line_4" position="absolute 1021 9 1027 31" anchor="top right"/>
  17. <Button id="btn_search" taborder="14" text="조회" class="btn1" position="absolute 1040 10 1096 32" anchor="top right" onclick="grp_sea_btn_search_onclick"/>
  18. <Edit id="opt_deptnm" taborder="15" readonly="true" class="output" position="absolute 230 11 410 30"/>
  19. <Static id="caption1" text="부서코드" class="search_name" position="absolute 50 12 126 29"/>
  20. <Edit id="ipt_deptcd" taborder="16" autoselect="true" autoskip="true" class="input_default" position="absolute 131 11 206 30" onkeydown="grp_sea_ipt_deptcd_onkeydown"/>
  21. <Button id="btn_deptcd" taborder="17" class="icon_search" position="absolute 210 12 226 28" onclick="grp_sea_btn_deptcd_onclick"/>
  22. <Static id="caption9" text="입력년월" class="search_name" position="absolute 835 12 911 29"/>
  23. <Calendar id="ipt_ym" taborder="18" autoselect="true" autoskip="true" dateformat="yyyy-MM" editformat="yyyy-MM" class="input_default" position="absolute 915 11 991 30" mask="yyyy-mm" onchanged="grp_sea_ipt_ym_onchanged"/>
  24. <Edit id="opt_matrnm" taborder="19" readonly="true" class="output" position="absolute 578 11 810 30"/>
  25. <Button id="btn_matrcd" taborder="20" class="icon_search" position="absolute 559 12 575 28" onclick="grp_sea_btn_matrcd_onclick"/>
  26. <Edit id="ipt_matrcd" taborder="21" autoselect="true" autoskip="true" class="input_default" position="absolute 510 11 555 30"/>
  27. <Static id="caption7" text="물질코드" class="search_name" position="absolute 432 12 508 29"/>
  28. </Layout>
  29. </Layouts>
  30. </Div>
  31. <Static id="caption21" text="취급일지" class="tit_2" position="absolute 0 101 131 123"/>
  32. <Shape id="line3" class="line_10" position="absolute 0 117 1193 123" anchor="left top right"/>
  33. <Grid id="grd_matrlist" taborder="6" binddataset="ds_main_matrlist" autoenter="select" useinputpanel="false" cellsizingtype="col" position="absolute 0 122 1193 684" anchor="all" onkeyup="grd_matrlist_onkeyup" oncellclick="grd_matrlist_oncellclick">
  34. <Formats>
  35. <Format id="default">
  36. <Columns>
  37. <Column size="25" band="left"/>
  38. <Column size="0"/>
  39. <Column size="0"/>
  40. <Column size="90"/>
  41. <Column size="80"/>
  42. <Column size="140"/>
  43. <Column size="80"/>
  44. <Column size="140"/>
  45. <Column size="250"/>
  46. <Column size="230"/>
  47. <Column size="77"/>
  48. <Column size="77"/>
  49. <Column size="0"/>
  50. <Column size="0"/>
  51. <Column size="0"/>
  52. <Column size="0"/>
  53. <Column size="0"/>
  54. </Columns>
  55. <Rows>
  56. <Row size="24" band="head"/>
  57. <Row size="24"/>
  58. </Rows>
  59. <Band id="head">
  60. <Cell/>
  61. <Cell col="1" text="부서코드"/>
  62. <Cell col="2" text="물질코드"/>
  63. <Cell col="3" text="일자"/>
  64. <Cell col="4" text="*입고량"/>
  65. <Cell col="5" displaytype="normal" edittype="none" text="*사용량(개)"/>
  66. <Cell col="6" text="*반납량"/>
  67. <Cell col="7" text="*재고량"/>
  68. <Cell col="8" text="*작업내용(취급용도)"/>
  69. <Cell col="9" text="*비고(특이사항)"/>
  70. <Cell col="10" text="작성자"/>
  71. <Cell col="11" text="확인자"/>
  72. <Cell col="12" text="작성자id"/>
  73. <Cell col="13" text="전월재고"/>
  74. <Cell col="14" text="전일재고"/>
  75. <Cell col="15" text="예외"/>
  76. <Cell col="16" text="구분"/>
  77. </Band>
  78. <Band id="body">
  79. <Cell celltype="head"/>
  80. <Cell col="1" class="text_center" text="bind:deptcd"/>
  81. <Cell col="2" class="text_center" text="bind:matrcd"/>
  82. <Cell col="3" displaytype="date" class="text_center" text="bind:usedd" editautoselect="true" calendardisplaynulltype="nulltext"/>
  83. <Cell col="4" displaytype="number" edittype="none" style="align:center;" class="text_center" text="bind:winqty" mask="#,##0" editautoselect="false" editdisplay="edit" tooltiptype="mouse" tooltiptext="처음 수령한 수량"/>
  84. <Cell col="5" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:useqty" editautoselect="true" calendardisplaynulltype="none" tooltiptype="mouse" tooltiptext="부서 사용 수량"/>
  85. <Cell col="6" displaytype="number" edittype="none" style="align:center;" text="bind:restocqty" mask="#,##0" editdisplay="edit" tooltiptype="mouse" tooltiptext="병리과 등으로 반납한 수량"/>
  86. <Cell col="7" displaytype="text" edittype="none" style="align:center;" class="text_center" text="bind:stocqty" editautoselect="false" editdisplay="display" tooltiptype="mouse" tooltiptext="부서에 남아있는 수량"/>
  87. <Cell col="8" displaytype="text" edittype="text" style="align:left top;padding:5 2 1 2;" class="text_left" text="bind:workcnts" wordwrap="word" editautoselect="true" tooltiptext="bind:workcnts"/>
  88. <Cell col="9" displaytype="text" edittype="text" style="align:left top;" text="bind:cmt" tooltiptext="bind:cmt"/>
  89. <Cell col="10" class="text_center" text="bind:writnm" editautoselect="true"/>
  90. <Cell col="11" class="text_center" text="bind:cnfmnm" editautoselect="true"/>
  91. <Cell col="12" text="bind:writid"/>
  92. <Cell col="13" text="bind:bfstocqty"/>
  93. <Cell col="14" text="bind:bfddstocqty"/>
  94. <Cell col="15" text="bind:exqty"/>
  95. <Cell col="16" text="bind:gubun"/>
  96. </Band>
  97. </Format>
  98. </Formats>
  99. </Grid>
  100. <Button id="btn_rowdelete" taborder="7" text="행삭제" class="btn2" position="absolute 961 98 1014 117" anchor="top right" onclick="btn_rowdelete_onclick" visible="false"/>
  101. <Button id="btn_excel" taborder="8" text="엑셀출력" class="btn7" position="absolute 1113 98 1193 117" anchor="top right" onclick="btn_excel_onclick"/>
  102. <Static id="caption3" text="※ 1. 화학물질별 월별 확정처리 이후에는 데이터 수정이 불가하며, 출력은 확정처리 이후에 가능합니다." position="absolute 0 686 737 706" anchor="left bottom"/>
  103. <Static id="caption2" text="2. 입고량 : 처음 수령한 수량/ 사용량 : 부서 사용 수량/ 반납량 : 병리과 등으로 반납한 수량/ 재고량 : 부서에 남아있는 수량" position="absolute 16 706 768 726" anchor="left bottom"/>
  104. <Static id="caption5" text="4. 확정처리 이후 자료를 수정하기 위해 확정취소를 원하시는 경우에는 화학물질 담당자에게 연락주시기 바랍니다." position="absolute 16 743 724 763" anchor="left bottom"/>
  105. <Static id="caption8" text="5. 본인이 작성한 자료에 한해 수정 및 삭제가 가능합니다. " position="absolute 16 762 632 782" anchor="left bottom" style="color:#ff0000ff;"/>
  106. <Static id="caption00" text="3. 비고(특이사항) : 취급일지 작성시 취급상 문제점, 특이사항 발생시 처리내역 등을 기록 " position="absolute 16 724 724 744" anchor="left bottom"/>
  107. <Button id="btn_cal" taborder="9" text="계 산" class="btn5" position="absolute 1057 98 1110 117" anchor="top right" visible="false" onclick="btn_cal_onclick"/>
  108. <Static id="st_msg" text="사용량을 빠짐없이 입력하시고 계산버튼을 클릭하여 재고량을 계산 후 저장가능합니다." position="absolute 87 95 628 115" style="background:oldlace;color:hotpink;align:center;font:돋움,9,bold;" visible="false"/>
  109. <Grid id="grd_matrlist_before" taborder="10" binddataset="ds_main_matrlist" autoenter="select" useinputpanel="false" cellsizingtype="col" position="absolute 0 122 1193 684" anchor="all" visible="false">
  110. <Formats>
  111. <Format id="default">
  112. <Columns>
  113. <Column size="25" band="left"/>
  114. <Column size="0"/>
  115. <Column size="0"/>
  116. <Column size="99"/>
  117. <Column size="85"/>
  118. <Column size="85"/>
  119. <Column size="85"/>
  120. <Column size="85"/>
  121. <Column size="270"/>
  122. <Column size="270"/>
  123. <Column size="77"/>
  124. <Column size="77"/>
  125. <Column size="0"/>
  126. </Columns>
  127. <Rows>
  128. <Row size="24" band="head"/>
  129. <Row size="24"/>
  130. </Rows>
  131. <Band id="head">
  132. <Cell/>
  133. <Cell col="1" text="부서코드"/>
  134. <Cell col="2" text="물질코드"/>
  135. <Cell col="3" text="일자"/>
  136. <Cell col="4" text="*입고량"/>
  137. <Cell col="5" displaytype="normal" edittype="none" text="*사용량"/>
  138. <Cell col="6" text="*반납량"/>
  139. <Cell col="7" text="*재고량"/>
  140. <Cell col="8" text="*작업내용(취급용도)"/>
  141. <Cell col="9" text="*비고(특이사항)"/>
  142. <Cell col="10" text="작성자"/>
  143. <Cell col="11" text="확인자"/>
  144. <Cell col="12" text="작성자id"/>
  145. </Band>
  146. <Band id="body">
  147. <Cell celltype="head"/>
  148. <Cell col="1" class="text_center" text="bind:deptcd"/>
  149. <Cell col="2" class="text_center" text="bind:matrcd"/>
  150. <Cell col="3" displaytype="date" class="text_center" text="bind:usedd" editautoselect="true" calendardisplaynulltype="nulltext"/>
  151. <Cell col="4" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:winqty" editautoselect="true" tooltiptype="mouse" tooltiptext="처음 수령한 수량"/>
  152. <Cell col="5" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:useqty" editautoselect="true" tooltiptype="mouse" tooltiptext="부서 사용 수량"/>
  153. <Cell col="6" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:restocqty" tooltiptype="mouse" tooltiptext="병리과 등으로 반납한 수량"/>
  154. <Cell col="7" displaytype="text" edittype="text" style="align:center;" class="text_center" text="bind:stocqty" editautoselect="true" tooltiptype="mouse" tooltiptext="부서에 남아있는 수량"/>
  155. <Cell col="8" displaytype="text" edittype="text" style="align:left top;padding:5 2 1 2;" class="text_left" text="bind:workcnts" wordwrap="word" editautoselect="true"/>
  156. <Cell col="9" displaytype="text" edittype="text" style="align:left top;" text="bind:cmt"/>
  157. <Cell col="10" class="text_center" text="bind:writnm" editautoselect="true"/>
  158. <Cell col="11" class="text_center" text="bind:cnfmnm" editautoselect="true"/>
  159. <Cell col="12" text="bind:writid"/>
  160. </Band>
  161. </Format>
  162. </Formats>
  163. </Grid>
  164. <Static id="st_msg01" text="★ 전산문의 : T.4206" position="absolute 207 0 354 25" style="background:#edffceff;border:1 solid #808080ff ;color:midnightblue;align:center;font:돋움,9,bold;"/>
  165. </Layout>
  166. </Layouts>
  167. <Objects>
  168. <Dataset id="ds_main_condition" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_main_condition_oncolumnchanged">
  169. <ColumnInfo>
  170. <Column id="deptcd" type="STRING" size="256"/>
  171. <Column id="deptnm" type="STRING" size="256"/>
  172. <Column id="matrcd" type="STRING" size="256"/>
  173. <Column id="matrnm" type="STRING" size="256"/>
  174. <Column id="ym" type="STRING" size="256"/>
  175. <Column id="popflag" type="STRING" size="256"/>
  176. <Column id="confirmflag" type="STRING" size="256"/>
  177. <Column id="gubun" type="STRING" size="256"/>
  178. <Column id="chk" type="STRING" size="256"/>
  179. <Column id="ymchk" type="STRING" size="256"/>
  180. <Column id="lastindex" type="STRING" size="256"/>
  181. </ColumnInfo>
  182. <Rows>
  183. <Row>
  184. <Col id="deptcd"/>
  185. <Col id="deptnm"/>
  186. <Col id="matrcd"/>
  187. <Col id="matrnm"/>
  188. <Col id="ym"/>
  189. <Col id="popflag"/>
  190. <Col id="confirmflag"/>
  191. </Row>
  192. </Rows>
  193. </Dataset>
  194. <Dataset id="ds_main_matrlist" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_main_matrlist_oncolumnchanged">
  195. <ColumnInfo>
  196. <Column id="deptcd" type="STRING" size="256" sumtext="부서코드"/>
  197. <Column id="deptnm" type="STRING" size="256" sumtext="부서명"/>
  198. <Column id="matrcd" type="STRING" size="256" sumtext="물질코드"/>
  199. <Column id="matrnm" type="STRING" size="256" sumtext="물질명"/>
  200. <Column id="usedd" type="STRING" size="256" sumtext="사용일자"/>
  201. <Column id="origusedd" type="STRING" size="256" sumtext="원사용일자"/>
  202. <Column id="winqty" type="STRING" size="256" sumtext="입고량"/>
  203. <Column id="useqty" type="STRING" size="256" sumtext="사용량"/>
  204. <Column id="stocqty" type="STRING" size="256" sumtext="재고량"/>
  205. <Column id="workcnts" type="STRING" size="256" sumtext="작업내용(취급용도)"/>
  206. <Column id="writid" type="STRING" size="256" sumtext="작성자id"/>
  207. <!-- column id="cnfmyn" type="cdata" desc="확정여부" ref="matrlist.cnfmyn"/ -->
  208. <Column id="writnm" type="STRING" size="256" sumtext="작성자명"/>
  209. <Column id="cnfmnm" type="STRING" size="256" sumtext="확정자명"/>
  210. <Column id="restocqty" type="STRING" size="256" sumtext="반납량"/>
  211. <Column id="cmt" type="STRING" size="256"/>
  212. <Column id="bfstocqty" type="STRING" size="256" sumtext="전월재고"/>
  213. <Column id="bfddstocqty" type="STRING" size="256" sumtext="전일재고"/>
  214. <Column id="exqty" type="STRING" size="256" sumtext="예외"/>
  215. <Column id="gubun" type="STRING" size="256" sumtext="구분"/>
  216. </ColumnInfo>
  217. </Dataset>
  218. <Dataset id="ds_send" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  219. <ColumnInfo>
  220. <Column id="instcd" type="STRING" size="256"/>
  221. </ColumnInfo>
  222. <Rows>
  223. <Row/>
  224. </Rows>
  225. </Dataset>
  226. <Dataset id="ds_init_prvg" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  227. <ColumnInfo>
  228. <Column id="cnt" type="STRING" size="256"/>
  229. </ColumnInfo>
  230. </Dataset>
  231. <Dataset id="ds_popmatr" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  232. <ColumnInfo>
  233. <Column id="matrcd" type="STRING" size="256"/>
  234. <Column id="matrnm" type="STRING" size="256"/>
  235. <Column id="deptcd" type="STRING" size="256"/>
  236. <Column id="returntype" type="STRING" size="256"/>
  237. <Column id="selectyn" type="STRING" size="256"/>
  238. </ColumnInfo>
  239. <Rows>
  240. <Row>
  241. <Col id="matrcd"/>
  242. <Col id="matrnm"/>
  243. <Col id="deptcd"/>
  244. <Col id="returntype"/>
  245. <Col id="selectyn"/>
  246. </Row>
  247. </Rows>
  248. </Dataset>
  249. <Dataset id="ds_main_prntlist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  250. <ColumnInfo>
  251. <Column id="usedd" type="STRING" size="256" sumtext="사용일자"/>
  252. <Column id="winqty" type="STRING" size="256" sumtext="입고량"/>
  253. <Column id="useqty" type="STRING" size="256" sumtext="사용량"/>
  254. <Column id="stocqty" type="STRING" size="256" sumtext="재고량"/>
  255. <Column id="workcnts" type="STRING" size="256" sumtext="작업내용(취급용도)"/>
  256. <Column id="writid" type="STRING" size="256" sumtext="작성자id"/>
  257. <Column id="writnm" type="STRING" size="256" sumtext="작성자명"/>
  258. <Column id="cnfmnm" type="STRING" size="256" sumtext="확정자명"/>
  259. <Column id="lastday" type="STRING" size="256" sumtext="월말일"/>
  260. <Column id="restocqty" type="STRING" size="256"/>
  261. <Column id="cmt" type="STRING" size="256"/>
  262. </ColumnInfo>
  263. </Dataset>
  264. <Dataset id="ds_matrgood" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  265. <ColumnInfo>
  266. <Column id="goodcd" type="STRING" size="256"/>
  267. </ColumnInfo>
  268. <Rows>
  269. <Row/>
  270. </Rows>
  271. </Dataset>
  272. </Objects>
  273. <Bind>
  274. <BindItem id="item0" compid="grp_sea.ipt_deptcd" propid="value" datasetid="ds_main_condition" columnid="deptcd"/>
  275. <BindItem id="item1" compid="grp_sea.opt_deptnm" propid="value" datasetid="ds_main_condition" columnid="deptnm"/>
  276. <BindItem id="item2" compid="grp_sea.ipt_matrcd" propid="value" datasetid="ds_main_condition" columnid="matrcd"/>
  277. <BindItem id="item3" compid="grp_sea.opt_matrnm" propid="value" datasetid="ds_main_condition" columnid="matrnm"/>
  278. <BindItem id="item4" compid="grp_sea.ipt_ym" propid="value" datasetid="ds_main_condition" columnid="ym"/>
  279. </Bind>
  280. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  281. * System Name :
  282. * Job Name :
  283. * Creator :
  284. * Make Date : 2017-06-19
  285. * Description :
  286. *---------------------------------------------------------------------------------------
  287. * Modify Date Modifier Modify Description
  288. *---------------------------------------------------------------------------------------
  289. * 2017-06-19 Live Converter TF->XP
  290. *
  291. *---------------------------------------------------------------------------------------
  292. ****************************************************************************************/
  293. include "com_commonxp::comm_main.xjs";
  294. include "mis_miscommonxp::MIS.xjs";
  295. function SMRSM00400_oninit(obj:Form, e:InitEventInfo)
  296. {
  297. frmf_initForm(obj);
  298. }
  299. function SMRSM00400_onload(obj:Form, e:LoadEventInfo)
  300. {
  301. //grdf_initGrid(grd_matrlist);
  302. var instcd = sysf_getUserInfo("dutplceinstcd");
  303. if(instcd == "031"){
  304. grdf_setRowTypeIcon(grd_matrlist, 0);
  305. fOpenForm();
  306. }else{
  307. sysf_messageBox("사용권한이 없습니다.", "E999", "");
  308. btn_save.enable = false;
  309. btn_cnfm.enable = false;
  310. grp_sea.btn_search.enable = false;
  311. }
  312. }
  313. function fOpenForm()
  314. {
  315. misfGridInit(grd_matrlist);
  316. var oParam = {};
  317. oParam.id = "TRRSM00403";
  318. oParam.service = "purcbaseapp.PurcBaseMngt";
  319. oParam.method = "reqGetMatrMngtPrvg";
  320. oParam.inds = "req=ds_send";
  321. oParam.outds = "ds_init_prvg=matrlist";
  322. oParam.async = false;
  323. oParam.callback = "cf_TRRSM00403";
  324. tranf_submit(oParam);
  325. try
  326. {
  327. ds_main_condition.copyData(arg_ds_main_condition);
  328. }
  329. catch(e)
  330. {
  331. }
  332. if(ds_main_condition.getColumn(0, "popflag") == "Y")
  333. {
  334. fGetMatrList();
  335. }
  336. else
  337. {
  338. ds_main_condition.setColumn(0, "ym", String(utlf_getCurrentDate()).substr(0,6));
  339. }
  340. }
  341. function cf_TRRSM00403(sSvcId, nErrorCode, sErrorMsg)
  342. {
  343. if(nErrorCode < 0)
  344. {
  345. return;
  346. }
  347. else
  348. {
  349. if( ds_init_prvg.getColumn(0, "cnt") == "1" )
  350. {
  351. btn_cancel.enable = true;
  352. }
  353. }
  354. }
  355. function fGetMatrList()
  356. {
  357. grp_sea.ipt_deptcd.value = grp_sea.ipt_deptcd.value.getTrim();
  358. grp_sea.ipt_matrcd.value = grp_sea.ipt_matrcd.value.getTrim();
  359. if(utlf_isNull(grp_sea.ipt_deptcd.value))
  360. {
  361. sysf_messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
  362. grp_sea.ipt_deptcd.setFocus();
  363. return;
  364. }
  365. if(utlf_isNull(grp_sea.ipt_matrcd.value))
  366. {
  367. sysf_messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
  368. grp_sea.ipt_matrcd.setFocus();
  369. return;
  370. }
  371. if(String(ds_main_condition.getColumn(0, "ym")).length != 6 )
  372. {
  373. sysf_messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
  374. grp_sea.ipt_ym.setFocus();
  375. return;
  376. }
  377. var tmpym = ds_main_condition.getColumn(0,"ym");
  378. if(tmpym > "201911"){
  379. ds_main_condition.setColumn(0,"ymchk","A"); //12월이후
  380. }else{
  381. ds_main_condition.setColumn(0,"ymchk","B"); //12월이전
  382. }
  383. //특별관리 물질코드여부 조회
  384. var oParam = {};
  385. oParam.id = "TRRSM00404";
  386. oParam.service = "purcbaseapp.PurcBaseMngt";
  387. oParam.method = "reqGetSpMatrFlag";
  388. oParam.inds = "req=ds_main_condition";
  389. oParam.outds = "ds_matrgood=matrflag";
  390. oParam.async = false;
  391. //oParam.callback = "cf_TRRSM00404";
  392. tranf_submit(oParam);
  393. ds_main_condition.setColumn(0,"chk",""); //초기화
  394. var flag = ds_matrgood.getColumn(0,"goodcd");
  395. var ymchk = ds_main_condition.getColumn(0,"ymchk");
  396. if(!utlf_isNull(flag)){
  397. ds_main_condition.setColumn(0,"gubun","S"); //특별관리되는 물질
  398. if(ymchk == "A"){
  399. btn_cal.visible = true; //계산버튼
  400. st_msg.visible = true;
  401. grd_matrlist_before.visible = false;
  402. grd_matrlist.visible = true;
  403. }else{
  404. btn_cal.visible = false; //계산버튼
  405. st_msg.visible = false;
  406. grd_matrlist_before.visible = true;
  407. grd_matrlist.visible = false;
  408. }
  409. }else{
  410. ds_main_condition.setColumn(0,"gubun","N"); //일반물질
  411. grd_matrlist_before.visible = true;
  412. grd_matrlist.visible = false;
  413. if(ymchk == "B"){
  414. btn_cal.visible = false; //계산버튼
  415. st_msg.visible = false;
  416. }
  417. }
  418. //조회 로직
  419. var oParam1 = {};
  420. oParam1.id = "TRRSM00401";
  421. oParam1.service = "purcbaseapp.PurcBaseMngt";
  422. oParam1.method = "reqGetMatrUseList";
  423. oParam1.inds = "req=ds_main_condition";
  424. oParam1.outds = "ds_main_matrlist=matrlist";
  425. oParam1.async = false;
  426. oParam1.callback = "cf_TRRSM00401";
  427. tranf_submit(oParam1);
  428. var gubun = ds_main_matrlist.getColumn(0,"gubun");
  429. var bfstocqty = ds_main_matrlist.getColumn(0,"bfstocqty"); //전월재고
  430. var ym = ds_main_condition.getColumn(0,"ym");
  431. if(bfstocqty == "N" && ym >"201911"){ //전월재고 없을경우
  432. //sysf_messageBox("전월 확정처리가 되지 않아 조회할 수 없습니다.", "E999", ""); *************12월 오픈이후 주석 풀어야함.
  433. sysf_messageBox("전월 마지막 재고가 없어 조회할 수 없습니다.", "E999", "");
  434. ds_main_matrlist.clearData();
  435. return;
  436. }else{
  437. if(gubun == "S" && bfstocqty != "N"){
  438. //조회 시 전월마감여부체크 및 제어
  439. //1일에 전월재고 가져오기
  440. var usedd = ds_main_matrlist.getColumn(0,"usedd");
  441. var winqty = ds_main_matrlist.getColumn(0,"winqty"); //입고
  442. //if(utlf_isNull(winqty)) winqty = 0;
  443. var newwinqty = Number(winqty) + Number(bfstocqty);
  444. ds_main_matrlist.setColumn(0,"winqty",newwinqty);
  445. }
  446. }
  447. }
  448. function cf_TRRSM00401(sSvcId, nErrorCode, sErrorMsg)
  449. {
  450. if(nErrorCode < 0)
  451. {
  452. return;
  453. }
  454. else
  455. {
  456. for(var i = 0; i < ds_main_matrlist.rowcount; i++)
  457. {
  458. var writid = ds_main_matrlist.getColumn(i, "writid");
  459. if(!utlf_isNull(writid) && writid != sysf_getUserInfo("userid"))
  460. {
  461. misfSetReadOnlyCol(grd_matrlist, "winqty,useqty,stocqty,workcnts,restocqty,cmt",true, i);
  462. }
  463. }
  464. }
  465. }
  466. // function misfSetReadOnlyCol(pGrid, pRefs, bYn)
  467. // {
  468. // var arrRefs = pRefs.split(",");
  469. //
  470. // if(arrRefs.length == 0)
  471. // {
  472. // return;
  473. // }
  474. //
  475. // for(var j = 0; j < arrRefs.length; j++)
  476. // {
  477. // if(bYn == "true")
  478. // {
  479. // pGrid.setCellProperty("Body", pGrid.getBindCellIndex("Body", arrRefs[j]), "edittype", "none");
  480. // }
  481. // else
  482. // {
  483. // pGrid.setCellProperty("Body", pGrid.getBindCellIndex("Body", arrRefs[j]), "edittype", "normal");
  484. // }
  485. // }
  486. // }
  487. function ds_main_condition_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  488. {
  489. if(e.columnid == "deptcd")
  490. {
  491. var objFocus = this.getFocus();
  492. grp_sea.ipt_deptcd.setFocus();
  493. grp_sea.ipt_deptcd.value = e.newvalue;
  494. misfGridInit(grd_matrlist);
  495. grp_sea.opt_deptnm.value = "";
  496. misfValidationCheck("02", "", "deptcd,deptnm" );
  497. objFocus.setFocus();
  498. }
  499. if(e.columnid == "deptcd")
  500. {
  501. misfGridInit(grd_matrlist);
  502. grp_sea.opt_matrnm.value = "";
  503. }
  504. }
  505. function grp_sea_btn_search_onclick(obj:Button, e:ClickEventInfo)
  506. {
  507. fGetMatrList();
  508. }
  509. function grp_sea_ipt_deptcd_onkeydown(obj:Edit, e:KeyEventInfo)
  510. {
  511. if(e.keycode == 13)
  512. {
  513. obj.updateToDataset();
  514. }
  515. }
  516. function grp_sea_btn_deptcd_onclick(obj:Button, e:ClickEventInfo)
  517. {
  518. var vOrigDeptcd = grp_sea.ipt_deptcd.value;
  519. var recv_list = "deptcd,deptnm";
  520. misfOpenPopUpList("02", ds_main_condition,"", recv_list) ;
  521. if(vOrigDeptcd != grp_sea.ipt_deptcd.value)
  522. {
  523. misfGridInit(grd_matrlist);
  524. }
  525. }
  526. function grp_sea_btn_matrcd_onclick(obj:Button, e:ClickEventInfo)
  527. {
  528. ds_popmatr.setColumn(0, "deptcd", grp_sea.ipt_deptcd.value);
  529. ds_popmatr.setColumn(0, "selectyn", "");
  530. var objArg = new Object();
  531. objArg.arg_ds_popdata = ds_popmatr;
  532. frmf_modal("SPRSM00100", "SPRSM00100", objArg, "", "", "", "", "", "", "", "", "", "M");
  533. if(ds_popmatr.getColumn(0, "selectyn") == "Y")
  534. {
  535. ds_main_condition.setColumn(0, "matrcd", ds_popmatr.getColumn(0, "matrcd"));
  536. ds_main_condition.setColumn(0, "matrnm", ds_popmatr.getColumn(0, "matrnm"));
  537. }
  538. }
  539. function grp_sea_ipt_ym_onchanged(obj:Calendar, e:ChangeEventInfo)
  540. {
  541. var date = String(obj.value).substr(0,6);
  542. ds_main_condition.setColumn(0, "ym", date);
  543. misfGridInit(grd_matrlist);
  544. }
  545. function btn_prt_onclick(obj:Button, e:ClickEventInfo)
  546. {
  547. grp_sea.ipt_deptcd.value = grp_sea.ipt_deptcd.value.getTrim();
  548. grp_sea.ipt_matrcd.value = grp_sea.ipt_matrcd.value.getTrim();
  549. if(utlf_isNull(grp_sea.ipt_deptcd.value))
  550. {
  551. sysf_messageBox("부서코드가 선택되지 않았습니다. \n먼저 부서코드를 선택하십시요.", "E999", "");
  552. grp_sea.ipt_deptcd.setFocus();
  553. return;
  554. }
  555. if(utlf_isNull(grp_sea.ipt_matrcd.value))
  556. {
  557. sysf_messageBox("물질코드가 선택되지 않았습니다. \n먼저 물질코드를 선택하십시요.", "E999", "");
  558. grp_sea.ipt_matrcd.setFocus();
  559. return;
  560. }
  561. if(String(ds_main_condition.getColumn(0, "ym")).length != 6 )
  562. {
  563. sysf_messageBox("입력년월을 정확하게 입력하십시요. ", "E999", "");
  564. grp_sea.ipt_ym.setFocus();
  565. return;
  566. }
  567. ds_main_prntlist.clearData();
  568. var oParam = {};
  569. oParam.id = "TRRSM00402";
  570. oParam.service = "purcbaseapp.PurcBaseMngt";
  571. oParam.method = "reqGetMatrUseCnfmList";
  572. oParam.inds = "req=ds_main_condition";
  573. oParam.outds = "ds_main_prntlist=matrlist";
  574. oParam.async = false;
  575. oParam.callback = "cf_TRRSM00402";
  576. tranf_submit(oParam);
  577. }
  578. function cf_TRRSM00402(sSvcId, nErrorCode, sErrorMsg)
  579. {
  580. if(nErrorCode < 0)
  581. {
  582. return;
  583. }
  584. else
  585. {
  586. var objDOM = rptf_createDOM();
  587. rptf_setNodeListToDOM(objDOM, "/root/main/prntlist", ds_main_prntlist);
  588. rptf_setNodeListToDOM(objDOM, "/root/main/condition", ds_main_condition);
  589. var objParam = new Object();
  590. objParam.xml_data_XML1 = objDOM.documentElement.source;
  591. var option = "";
  592. rptf_exeReportPreview30(["RPRSM00401"],[objParam], option);
  593. }
  594. }
  595. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  596. {
  597. fClickSaveBtn();
  598. }
  599. function fClickSaveBtn()
  600. {
  601. ds_main_condition.setColumn(0,"lastindex","");
  602. // var flag = "";
  603. var gubun = ds_main_condition.getColumn(0, "gubun");
  604. var ymchk = ds_main_condition.getColumn(0, "ymchk");
  605. if(gubun == "S" && ymchk == "A" ){ //특별관리물질, 11월이후
  606. // btn_cal_onclick(); // 계산로직
  607. if (btn_cal_onclick() != false){
  608. //저장
  609. ds_main_matrlist.enableevent = false;
  610. ds_main_matrlist.updatecontrol = false;
  611. grdf_setStatusColumn(ds_main_matrlist, "status");
  612. ds_main_matrlist.updatecontrol = true;
  613. ds_main_matrlist.enableevent = true;
  614. var oParam = {};
  615. oParam.id = "TXRSM00401";
  616. oParam.service = "purcbaseapp.PurcBaseMngt";
  617. oParam.method = "reqExeSaveMatrUse";
  618. oParam.inds = "req=ds_main_condition matrlist=ds_main_matrlist:a";
  619. oParam.async = false;
  620. oParam.callback = "cf_TXRSM00401";
  621. tranf_submit(oParam);
  622. }
  623. }else{
  624. ds_main_matrlist.enableevent = false;
  625. ds_main_matrlist.updatecontrol = false;
  626. grdf_setStatusColumn(ds_main_matrlist, "status");
  627. ds_main_matrlist.updatecontrol = true;
  628. ds_main_matrlist.enableevent = true;
  629. var oParam = {};
  630. oParam.id = "TXRSM00401";
  631. oParam.service = "purcbaseapp.PurcBaseMngt";
  632. oParam.method = "reqExeSaveMatrUse";
  633. oParam.inds = "req=ds_main_condition matrlist=ds_main_matrlist:u";
  634. oParam.async = false;
  635. oParam.callback = "cf_TXRSM00401";
  636. tranf_submit(oParam);
  637. }
  638. }
  639. function cf_TXRSM00401(sSvcId, nErrorCode, sErrorMsg)
  640. {
  641. if(nErrorCode < 0)
  642. {
  643. return;
  644. }
  645. else
  646. {
  647. fGetMatrList();
  648. }
  649. }
  650. function btn_cnfm_onclick(obj:Button, e:ClickEventInfo)
  651. {
  652. if(ds_main_matrlist.rowcount == 0)
  653. {
  654. sysf_messageBox("조회된 자료가 없습니다. \n먼저 조회 후, 확정처리를 진행하시기 바랍니다. ", "I999", "");
  655. return;
  656. }
  657. if (sysf_messageBox("확정처리 후에는 데이터수정이 불가합니다. \n계속하시겠습니까?", "Q999", "") == 6)
  658. {
  659. ds_main_condition.setColumn(0, "confirmflag", "Y");
  660. var oParam = {};
  661. oParam.id = "TXRSM00402";
  662. oParam.service = "purcbaseapp.PurcBaseMngt";
  663. oParam.method = "reqExeConfirmMatrUse";
  664. oParam.inds = "req=ds_main_condition";
  665. oParam.async = false;
  666. oParam.callback = "cf_TXRSM00402";
  667. tranf_submit(oParam);
  668. }
  669. }
  670. function cf_TXRSM00402(sSvcId, nErrorCode, sErrorMsg)
  671. {
  672. if(nErrorCode < 0)
  673. {
  674. return;
  675. }
  676. else
  677. {
  678. grp_sea.btn_search.click();
  679. }
  680. }
  681. function btn_cancel_onclick(obj:Button, e:ClickEventInfo)
  682. {
  683. if(ds_main_matrlist.rowcount == 0)
  684. {
  685. sysf_messageBox("조회된 자료가 없습니다. \n먼저 조회 후, 확정취소를 진행하시기 바랍니다. ", "I999", "");
  686. return;
  687. }
  688. if (sysf_messageBox("조회된 자료의 확정을 취소하시겠습니까?", "Q999", "") == 6)
  689. {
  690. ds_main_condition.setColumn(0, "confirmflag", "N");
  691. var oParam = {};
  692. oParam.id = "TXRSM00402";
  693. oParam.service = "purcbaseapp.PurcBaseMngt";
  694. oParam.method = "reqExeConfirmMatrUse";
  695. oParam.inds = "req=ds_main_condition";
  696. oParam.async = false;
  697. oParam.callback = "cf_TXRSM00402";
  698. tranf_submit(oParam);
  699. }
  700. }
  701. function btn_rowdelete_onclick(obj:Button, e:ClickEventInfo)
  702. {
  703. if(ds_main_matrlist.rowposition < 0)
  704. {
  705. return;
  706. }
  707. if(sysf_getUserInfo("userid") != ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "writid"))
  708. {
  709. sysf_messageBox("본인이 작성한 자료만 행삭제가 가능합니다. ", "E999", "");
  710. return;
  711. }
  712. var status = ds_main_matrlist.getRowType(ds_main_matrlist.rowposition);
  713. if(status == 1)
  714. {
  715. ds_main_matrlist.updatecontrol = false;
  716. ds_main_matrlist.setRowType(ds_main_matrlist.rowposition, "d");
  717. ds_main_matrlist.updatecontrol = true;
  718. }
  719. else if(status == 2)
  720. {
  721. ds_main_matrlist.deleteRow(ds_main_matrlist.rowposition);
  722. }
  723. else if(status == 4)
  724. {
  725. ds_main_matrlist.updatecontrol = false;
  726. ds_main_matrlist.setRowType(ds_main_matrlist.rowposition, "d");
  727. ds_main_matrlist.updatecontrol = true;
  728. }
  729. else if(status == 8)
  730. {
  731. ds_main_matrlist.updatecontrol = false;
  732. ds_main_matrlist.setRowType(ds_main_matrlist.rowposition, "d");
  733. ds_main_matrlist.updatecontrol = true;
  734. }
  735. }
  736. function btn_excel_onclick(obj:Button, e:ClickEventInfo)
  737. {
  738. grdf_exportExcel(grd_matrlist, "excel", "savetype1", "false");
  739. }
  740. function ds_main_matrlist_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  741. {
  742. if( e.columnid == "winqty" && e.columnid == "useqty"){
  743. //trace("here");
  744. var winqty = obj.getColumn(e.row, "winqty");
  745. var useqty = obj.getColumn(e.row, "useqty");
  746. var tmpstoc = parseFloat(winqty) - parseFloat(useqty);
  747. // trace(tmpstoc);
  748. obj.setColumn(e.row,"stocqty",tmpstoc);
  749. }
  750. }
  751. function grd_matrlist_onkeyup(obj:Grid, e:KeyEventInfo)
  752. {
  753. if( e.keycode == 13 ){
  754. var useqty = ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "useqty");
  755. if( utlf_isNull(useqty) ){
  756. if( utlf_isNull(ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "useqty")) ){
  757. // fv_tempFlag = true;
  758. ds_main_matrlist.setColumn(ds_main_matrlist.rowposition, "useqty", "0");
  759. ds_main_matrlist.rowposition = ds_main_matrlist.rowposition+1;
  760. }else{
  761. ds_main_matrlist.rowposition = ds_main_matrlist.rowposition+1;
  762. }
  763. }else{
  764. ds_main_matrlist.rowposition = ds_main_matrlist.rowposition+1;
  765. }
  766. }
  767. }
  768. function grd_matrlist_oncellclick(obj:Grid, e:GridClickEventInfo)
  769. {
  770. var firstuseqty = ds_main_matrlist.getColumn(0,"useqty");
  771. if( utlf_isNull(ds_main_matrlist.getColumn(ds_main_matrlist.rowposition, "useqty")) && e.row != 0 ){
  772. ds_main_matrlist.setColumn(ds_main_matrlist.rowposition, "useqty", "0");
  773. }
  774. }
  775. function btn_cal_onclick(obj, e)
  776. {
  777. for(var j = ds_main_matrlist.rowcount-1; j >=0; j--){
  778. // var nType = ds_main_matrlist.getRowType(j); 마지막 업데이트상태에서 사용량으로 변경
  779. var nuseqty = ds_main_matrlist.getColumn(j,"useqty");
  780. // if(nType == 4){
  781. // ds_main_condition.setColumn(0,"lastindex", j);
  782. // break;
  783. // }
  784. if(!utlf_isNull(nuseqty)){
  785. ds_main_condition.setColumn(0,"lastindex", j);
  786. break;
  787. }
  788. }
  789. var lastindex = ds_main_condition.getColumn(0,"lastindex");
  790. var winqty = ds_main_matrlist.getColumn(0, "winqty"); //입고량
  791. var restocqty = ds_main_matrlist.getColumn(0, "restocqty"); //반납량
  792. var useqty = ds_main_matrlist.getColumn(0, "useqty"); //사용량
  793. var exqty = ds_main_matrlist.getColumn(0, "exqty"); //예외량
  794. var tmpstocqty = parseFloat(winqty) - parseFloat(useqty) - parseFloat(restocqty) - parseFloat(exqty); //재고량 = 입고량-사용량-반납량-예외량
  795. //alert(tmpstocqty);
  796. ds_main_matrlist.setColumn(0,"stocqty",tmpstocqty); //재고량
  797. if(!utlf_isDigit(useqty)){// 숫자체크
  798. sysf_messageBox("첫번째 사용량 입력 시 숫자만 가능합니다.", "E999", "");
  799. grd_matrlist.setFocus();
  800. ds_main_matrlist.rowposition = 0;
  801. return false ;
  802. }
  803. if(!utlf_isNull(lastindex)){
  804. for(var i = 1; i <= lastindex ; i++){
  805. if(utlf_isNull(ds_main_matrlist.getColumn(i, "useqty"))){
  806. sysf_messageBox(ds_main_matrlist.getColumn(i,"usedd") +"일자 사용량이 입력되지 않았습니다. \n\n변경된 값 마지막을 기준으로 중간에 사용량이 없으면 재고량을 계산할 수 없습니다..", "E999", "");
  807. grd_matrlist.setFocus();
  808. ds_main_matrlist.rowposition = i;
  809. return false;
  810. }
  811. ds_main_matrlist.setColumn(i,"bfddstocqty",ds_main_matrlist.getColumn(i-1,"stocqty")); //전일재고
  812. var winqty = ds_main_matrlist.getColumn(i, "winqty"); //입고량
  813. var restocqty = ds_main_matrlist.getColumn(i, "restocqty"); //반납량
  814. var bfddstocqty = ds_main_matrlist.getColumn(i, "bfddstocqty"); //일재고량
  815. var useqty = ds_main_matrlist.getColumn(i, "useqty"); //사용량
  816. var exqty = ds_main_matrlist.getColumn(i, "exqty"); //예외량
  817. var tmpstocqty = parseFloat(bfddstocqty) + parseFloat(winqty) - parseFloat(useqty) - parseFloat(restocqty) - parseFloat(exqty); //재고량 = 전일재고량+입고량-사용량-반납량-예외량
  818. if(!utlf_isDigit(useqty)){// 숫자체크
  819. sysf_messageBox(parseInt(i+1)+"번째 사용량 입력 시 숫자만 가능합니다.", "E999", "");
  820. grd_matrlist.setFocus(i);
  821. ds_main_matrlist.rowposition = i;
  822. return false ;
  823. }
  824. if(tmpstocqty < 0){
  825. sysf_messageBox("재고량이 음수가 될 수 없습니다.", "E999", "");
  826. grd_matrlist.setFocus(i);
  827. ds_main_matrlist.rowposition = i;
  828. return false;
  829. }
  830. ds_main_matrlist.setColumn(i,"stocqty",tmpstocqty); //재고
  831. }
  832. }
  833. }
  834. ]]></Script>
  835. </Form>
  836. </FDL>