SMLQF00900_QCLot관리.xfdl 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMLQF00900" position="absolute 0 0 1256 805" titletext="Lot 관리" onload="SMLQF00600_onload" oninit="SMLQF00900_oninit">
  5. <Layouts>
  6. <Layout>
  7. <Static id="caption6" text="Lot 관리" class="tit_1" position="absolute 0 0 119 25"/>
  8. <Div id="grp_sea" anchor="left top right" taborder="3" style="align:center top;" position="absolute 0 25 1256 67" class="div_SA">
  9. <Layouts>
  10. <Layout>
  11. <Combo id="cmb_refflag" taborder="6" class="combo_s_essential" position="absolute 82 10 202 30" style="align:left middle;" anchor="default" innerdataset="@ds_refflag" codecolumn="value" datacolumn="label" index="0" value="1" text="사용자료"/>
  12. <Static id="caption3" text="검사실" class="search_name" position="absolute 226 10 287 30" style="align:left middle;" anchor="default"/>
  13. <Combo id="cbo_execDept" taborder="7" class="combo_s_essential" position="absolute 287 10 387 30" style="align:left middle;" anchor="default" innerdataset="@ds_init_lb0111" codecolumn="cd" datacolumn="nm" onitemchanged="grp_sea_cbo_execDept_onitemchanged" index="-1"/>
  14. <Static id="caption4" text="장비" class="search_name" position="absolute 411 10 459 30" style="align:left middle;" anchor="default"/>
  15. <Combo id="cbo_eqmtList" taborder="8" class="combo_s_essential" position="absolute 459 10 559 30" style="align:left middle;" anchor="default" innerdataset="@ds_init_lb0701" codecolumn="cd" datacolumn="nm"/>
  16. <Static id="caption7" text="Lot 구분" class="search_name" position="absolute 583 10 657 30" style="align:left middle;" anchor="default"/>
  17. <Combo id="cmb_searchflag" taborder="9" class="combo_search" position="absolute 657 10 777 30" style="align:left middle;" anchor="default" innerdataset="@ds_searchflag" codecolumn="value" datacolumn="label" index="0" value="00" text="-전체-"/>
  18. <Button id="btn_ref" taborder="10" text="조회" class="btn1" position="absolute 1188 10 1244 30" style="align:left middle;" anchor="top right" onclick="grp_sea_btn_ref_onclick"/>
  19. <Static id="caption5" text="조회구분" class="search_name" position="absolute 8 10 82 30" style="align:left middle;"/>
  20. </Layout>
  21. </Layouts>
  22. </Div>
  23. <Grid id="grd_detllotlist" taborder="4" useinputpanel="false" position="absolute 690 97 1256 805" autofittype="col" anchor="top right bottom" binddataset="ds_grid_grd_detllotlist" selecttype="cell" cellsizingtype="col">
  24. <Formats>
  25. <Format id="default">
  26. <Columns>
  27. <Column size="30"/>
  28. <Column size="30"/>
  29. <Column size="70"/>
  30. <Column size="130"/>
  31. <Column size="150"/>
  32. <Column size="150"/>
  33. <Column size="0"/>
  34. <Column size="150"/>
  35. </Columns>
  36. <Rows>
  37. <Row size="24" band="head"/>
  38. <Row size="24"/>
  39. </Rows>
  40. <Band id="head">
  41. <Cell/>
  42. <Cell col="1" displaytype="checkbox" edittype="checkbox"/>
  43. <Cell col="2" text="검사코드"/>
  44. <Cell col="3" text="검사명"/>
  45. <Cell col="4" text="Reagent Lot"/>
  46. <Cell col="5" text="Calibrator Lot"/>
  47. <Cell col="6" text="Control Material Lot"/>
  48. <Cell col="7" text="Control Material Lot"/>
  49. </Band>
  50. <Band id="body">
  51. <Cell style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" expr="expr:currow+1"/>
  52. <Cell col="1" displaytype="checkbox" edittype="checkbox" style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" text="bind:chk"/>
  53. <Cell col="2" style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" text="bind:testcd"/>
  54. <Cell col="3" style="align:left middle;background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" text="bind:testnm"/>
  55. <Cell col="4" style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" text="bind:reaglot"/>
  56. <Cell col="5" style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" text="bind:calilot"/>
  57. <Cell col="6" style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));"/>
  58. <Cell col="7" style="background:EXPR(lf_chngBgColor(currow));background2:EXPR(lf_chngBgColor(currow));" text="bind:contlot"/>
  59. </Band>
  60. </Format>
  61. </Formats>
  62. </Grid>
  63. <Grid id="grd_lotlist" taborder="5" useinputpanel="false" position="absolute 0 97 681 805" autofittype="col" anchor="all" binddataset="ds_grid_grd_lotlist" oncelldblclick="grd_lotlist_oncelldblclick" cellsizingtype="col">
  64. <Formats>
  65. <Format id="default">
  66. <Columns>
  67. <Column size="30"/>
  68. <Column size="80"/>
  69. <Column size="100"/>
  70. <Column size="100"/>
  71. <Column size="90"/>
  72. <Column size="90"/>
  73. <Column size="60"/>
  74. <Column size="90"/>
  75. <Column size="80"/>
  76. <Column size="0"/>
  77. <Column size="0"/>
  78. </Columns>
  79. <Rows>
  80. <Row size="24" band="head"/>
  81. <Row size="24"/>
  82. </Rows>
  83. <Band id="head">
  84. <Cell/>
  85. <Cell col="1" text="Lot 코드"/>
  86. <Cell col="2" text="Lot 구분"/>
  87. <Cell col="3" text="Lot 명칭"/>
  88. <Cell col="4" text="사용시작일자"/>
  89. <Cell col="5" text="사용종료일자"/>
  90. <Cell col="6" text="종료키"/>
  91. <Cell col="7" text="Expire Date"/>
  92. <Cell col="8" text="Lot번호"/>
  93. <Cell col="9" text="장비코드"/>
  94. <Cell col="10" text="부서코드"/>
  95. </Band>
  96. <Band id="body">
  97. <Cell displaytype="image" expr="expr:getRowType(currow) == 2 ?'theme://images/ico_i.png' : (getRowType(currow) == 4 ? 'theme://images/ico_u.png' : (getRowType(currow) == 8 ? 'theme://images/ico_d.png' : 'theme://images/ico_e.png'))"/>
  98. <Cell col="1" displaytype="text" edittype="text" text="bind:matrcd" editlimit="10"/>
  99. <Cell col="2" displaytype="combo" edittype="combo" text="bind:matrkindcd" combodataset="ds_matrkindcd" combocodecol="value" combodatacol="label"/>
  100. <Cell col="3" displaytype="text" edittype="text" text="bind:matrnm"/>
  101. <Cell col="4" displaytype="date" edittype="date" text="bind:matrfromdd" calendardisplaynulltype="none"/>
  102. <Cell col="5" displaytype="date" edittype="date" text="bind:matrtodd" calendardisplaynulltype="none"/>
  103. <Cell col="6" displaytype="text" edittype="text" text="bind:todd"/>
  104. <Cell col="7" displaytype="date" edittype="date" text="bind:validd"/>
  105. <Cell col="8" displaytype="text" edittype="text" text="bind:lotno"/>
  106. <Cell col="9"/>
  107. <Cell col="10"/>
  108. </Band>
  109. </Format>
  110. </Formats>
  111. </Grid>
  112. <Static id="caption1" text="QC Lot 목록" class="tit_2" position="absolute 0 77 102 98"/>
  113. <Static id="caption2" text="Lot별 검사항목" class="tit_2" position="absolute 690 77 828 97" anchor="top right"/>
  114. <Button id="btn_end" taborder="6" text="Lot 종료" class="btn2" position="absolute 1067 74 1131 94" anchor="top right" onclick="btn_end_onclick"/>
  115. <Button id="button1" taborder="7" text="Lot 변경" class="btn2" position="absolute 1133 74 1197 94" anchor="top right" onclick="button1_onclick"/>
  116. <Button id="btn_addrow" taborder="8" text="행추가" class="btn2" position="absolute 1200 74 1256 94" anchor="top right" onclick="btn_addrow_onclick"/>
  117. <Button id="btn_save" taborder="9" text="저장" class="btn4" position="absolute 1129 0 1185 20" anchor="top right" onclick="btn_save_onclick"/>
  118. <Button id="btn_init" taborder="10" text="초기화" class="btn4" position="absolute 1188 0 1256 20" anchor="top right" onclick="btn_init_onclick"/>
  119. </Layout>
  120. </Layouts>
  121. <Objects>
  122. <Dataset id="ds_searchflag" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  123. <ColumnInfo>
  124. <Column id="label" type="STRING" size="256"/>
  125. <Column id="value" type="STRING" size="256"/>
  126. </ColumnInfo>
  127. <Rows>
  128. <Row>
  129. <Col id="value">00</Col>
  130. <Col id="label">-전체-</Col>
  131. </Row>
  132. <Row>
  133. <Col id="label">[0]Reagent Lot</Col>
  134. <Col id="value">0</Col>
  135. </Row>
  136. <Row>
  137. <Col id="label">[1]Calibrator Lot</Col>
  138. <Col id="value">1</Col>
  139. </Row>
  140. </Rows>
  141. </Dataset>
  142. <Dataset id="ds_refflag" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  143. <ColumnInfo>
  144. <Column id="label" type="STRING" size="256"/>
  145. <Column id="value" type="STRING" size="256"/>
  146. </ColumnInfo>
  147. <Rows>
  148. <Row>
  149. <Col id="label">사용자료</Col>
  150. <Col id="value">1</Col>
  151. </Row>
  152. <Row>
  153. <Col id="label">전체자료</Col>
  154. <Col id="value">2</Col>
  155. </Row>
  156. </Rows>
  157. </Dataset>
  158. <Dataset id="ds_init_lb0000" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  159. <ColumnInfo>
  160. <Column id="cd" type="STRING" size="256"/>
  161. <Column id="nm" type="STRING" size="256"/>
  162. </ColumnInfo>
  163. </Dataset>
  164. <Dataset id="ds_init_lb0111" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  165. <ColumnInfo>
  166. <Column id="cd" type="STRING" size="256"/>
  167. <Column id="nm" type="STRING" size="256"/>
  168. </ColumnInfo>
  169. </Dataset>
  170. <Dataset id="ds_init_lb0701" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  171. <ColumnInfo>
  172. <Column id="cd" type="STRING" size="256"/>
  173. <Column id="nm" type="STRING" size="256"/>
  174. </ColumnInfo>
  175. </Dataset>
  176. <Dataset id="ds_grid_grd_lotlist" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" onrowposchanged="ds_grid_grd_lotlist_onrowposchanged">
  177. <ColumnInfo>
  178. <Column id="status" type="STRING" size="256"/>
  179. <Column id="matrcd" type="STRING" size="256"/>
  180. <column id="matrnm" type="STRING" size="256"/>
  181. <column id="matrfromdd" type="STRING" size="256"/>
  182. <column id="matrtodd" type="STRING" size="256"/>
  183. <column id="todd" type="STRING" size="256"/>
  184. <column id="matrkindcd" type="STRING" size="256"/>
  185. <column id="validd" type="STRING" size="256"/>
  186. <column id="lotno" type="STRING" size="256"/>
  187. <column id="eqmtcd" type="STRING" size="256"/>
  188. <column id="userdeptcd" type="STRING" size="256"/>
  189. </ColumnInfo>
  190. </Dataset>
  191. <Dataset id="ds_grid_grd_detllotlist" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" onrowposchanged="ds_grid_grd_keyantilist_onrowposchanged">
  192. <ColumnInfo>
  193. <Column id="chk" type="STRING" size="256"/>
  194. <column id="testcd" type="STRING" size="256"/>
  195. <column id="testnm" type="STRING" size="256"/>
  196. <column id="reaglot" type="STRING" size="256"/>
  197. <column id="calilot" type="STRING" size="256"/>
  198. <column id="contlot" type="STRING" size="256"/>
  199. </ColumnInfo>
  200. </Dataset>
  201. <Dataset id="ds_matrkindcd" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  202. <ColumnInfo>
  203. <Column id="label" type="STRING" size="256"/>
  204. <Column id="value" type="STRING" size="256"/>
  205. </ColumnInfo>
  206. <Rows>
  207. <Row>
  208. <Col id="label">[0]Reagent Lot</Col>
  209. <Col id="value">0</Col>
  210. </Row>
  211. <Row>
  212. <Col id="label">[1]Calibrator Lot</Col>
  213. <Col id="value">1</Col>
  214. </Row>
  215. </Rows>
  216. </Dataset>
  217. <Dataset id="ds_testlist" firefirstcount="0" firenextcount="0" useclientlayout="true" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  218. <ColumnInfo>
  219. <Column id="testlist" type="STRING" size="256"/>
  220. </ColumnInfo>
  221. </Dataset>
  222. </Objects>
  223. <Style url="CSS::lis.css"/>
  224. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  225. * System Name :
  226. * Job Name :
  227. * Creator :
  228. * Make Date : 2015-11-13
  229. * Description :
  230. *---------------------------------------------------------------------------------------
  231. * Modify Date Modifier Modify Description
  232. *---------------------------------------------------------------------------------------
  233. * 2015-11-13 Live Converter TF->XP
  234. *
  235. *---------------------------------------------------------------------------------------
  236. ****************************************************************************************/
  237. include "com_commonxp::comm_main.xjs";
  238. var endStr = "";
  239. function SMLQF00900_oninit(obj:Form, e:InitEventInfo)
  240. {
  241. frmf_initForm(obj);
  242. }
  243. function SMLQF00600_onload(obj:Form, e:LoadEventInfo)
  244. {
  245. dsf_createDsRow("ds_temp_search"
  246. , [{col: "codeflag", val: "0000|0111|0701|"}
  247. , {col: "basecdid", val: ""}
  248. , {col: "menuparam", val: ""}]);
  249. var oParam = {};
  250. oParam.id = "TRLZZ00101";
  251. oParam.service = "diagtestapplib.DiagTestBaseInfoMngt";
  252. oParam.method = "reqGetInitCodeInfo";
  253. oParam.inds = "cond=ds_temp_search";
  254. oParam.outds = "ds_init_lb0000=0000 ds_init_lb0111=0111 ds_init_lb0701=0701";
  255. oParam.async = false;
  256. tranf_submit(oParam);
  257. grp_sea.cbo_execDept.index = 0;
  258. grp_sea.cbo_eqmtList.index = 0;
  259. grdf_initGrid(grd_detllotlist);
  260. }
  261. function lf_getLotList() {
  262. if(grp_sea.cbo_eqmtList.value == "00"){
  263. sysf_messageBox("장비를", "C002");
  264. return;
  265. }
  266. var refflag = grp_sea.cmb_refflag.value;
  267. var eqmtcd = grp_sea.cbo_eqmtList.value;
  268. var matrkindcd = grp_sea.cmb_searchflag.value;
  269. var userdeptcd = ds_init_lb0000.getColumn(0, "nm");
  270. dsf_createDsRow("ds_temp_search"
  271. , [{col: "refflag", val: refflag}
  272. , {col: "eqmtcd", val: eqmtcd}
  273. , {col: "matrkindcd", val: matrkindcd}
  274. , {col: "userdeptcd", val: userdeptcd}]);
  275. var oParam = {};
  276. oParam.id = "TRLQF00901";
  277. oParam.service = "grademngtbasemngtapp.QCMaterialMngt";
  278. oParam.method = "reqGetLot";
  279. oParam.inds = "cond=ds_temp_search";
  280. oParam.outds = "ds_grid_grd_lotlist=getLotList";
  281. oParam.async = false;
  282. oParam.callback = "cf_TRLQF00901";
  283. tranf_submit(oParam);
  284. }
  285. function lf_getDetlLotList(){
  286. var crrow = ds_grid_grd_lotlist.rowposition;
  287. var matrcd = ds_grid_grd_lotlist.getColumn(crrow, "matrcd");
  288. var eqmtcd = ds_grid_grd_lotlist.getColumn(crrow, "eqmtcd");
  289. var matrtodd = ds_grid_grd_lotlist.getColumn(crrow, "todd");
  290. var matrfromdd = ds_grid_grd_lotlist.getColumn(crrow, "matrfromdd");
  291. var matrkindcd = ds_grid_grd_lotlist.getColumn(crrow, "matrkindcd");
  292. var lotno = ds_grid_grd_lotlist.getColumn(crrow, "lotno");
  293. var userdeptcd = ds_init_lb0000.getColumn(0, "nm");
  294. var sInDsName = dsf_createDsRow("ds_temp_search"
  295. , [{col: "userdeptcd", val: userdeptcd}
  296. , {col: "lotno", val: lotno}
  297. , {col: "matrcd", val: matrcd}
  298. , {col: "eqmtcd", val: eqmtcd}
  299. , {col: "matrtodd", val: matrtodd}
  300. , {col: "matrfromdd", val: matrfromdd}
  301. , {col: "matrkindcd", val: matrkindcd}
  302. ]);
  303. var oParam = {};
  304. oParam.id = "TRLQF00902";
  305. oParam.service = "grademngtbasemngtapp.QCMaterialMngt";
  306. oParam.method = "reqGetDetlLot";
  307. oParam.inds = "cond=ds_temp_search";
  308. oParam.outds = "ds_grid_grd_detllotlist=getDetlLotList";
  309. oParam.async = false;
  310. tranf_submit(oParam);
  311. }
  312. function lf_setLotList() {
  313. var iMatrcd = grd_lotlist.getBindCellIndex( "body", "matrcd");
  314. var iMatrkindcd = grd_lotlist.getBindCellIndex( "body", "matrkindcd");
  315. var iMatrnm = grd_lotlist.getBindCellIndex( "body", "matrnm");
  316. var iMatrfromdd = grd_lotlist.getBindCellIndex( "body", "matrfromdd");
  317. var iMatrtodd = grd_lotlist.getBindCellIndex( "body", "matrtodd");
  318. var iValidd = grd_lotlist.getBindCellIndex( "body", "validd");
  319. var iLotno = grd_lotlist.getBindCellIndex( "body", "lotno");
  320. var bChkValue= frmf_chkMdtGrid(grd_lotlist,[iMatrcd
  321. , iMatrkindcd
  322. , iMatrnm
  323. , iMatrfromdd
  324. , iMatrtodd
  325. , iValidd
  326. , iLotno]
  327. ,["Lot코드","Lot구분","Lot명칭","사용시작일","사용종료일","Expire Date","Lot번호"]);
  328. if(bChkValue==false) return;
  329. var testcd = "";
  330. var count = ds_grid_grd_detllotlist.getCaseCount("chk==1");
  331. var orgChk = "";
  332. if(count == 0){
  333. alert("Lot별 검사항목에 선택된 항목이 없습니다");
  334. return;
  335. }else{
  336. for(i = 0; i <ds_grid_grd_detllotlist.rowcount; i++){
  337. if(ds_grid_grd_detllotlist.getColumn(i, "chk") == "1") {
  338. orgChk = ds_grid_grd_detllotlist.getOrgColumn(i, "chk");
  339. if((orgChk == "0")
  340. &&(iMatrkindcd == "0")
  341. && (!utlf_isNull(ds_grid_grd_detllotlist.getColumn(i, "reaglot")))) {
  342. alert("이미 다른 Reagent Lot에 등록되어 있는 항목입니다\n등록하시려면 기존 Lot에서 항목 제외 후 다시 등록하세요");
  343. ds_grid_grd_detllotlist.rowposition = i;
  344. return;
  345. }else if((orgChk == "0")
  346. &&(iMatrkindcd == "1")
  347. && (!utlf_isNull(ds_grid_grd_detllotlist.getColumn(i, "calilot")))) {
  348. alert("이미 다른 Calibrator Lot에 등록되어 있는 항목입니다\n등록하시려면 기존 Lot에서 항목 제외 후 다시 등록하세요");
  349. ds_grid_grd_detllotlist.rowposition = i;
  350. return;
  351. }
  352. testcd += ds_grid_grd_detllotlist.getColumn(i, "testcd") + "▦";
  353. }
  354. }
  355. }
  356. ds_testlist.clearData();
  357. var addRw = ds_testlist.addRow();
  358. ds_testlist.setColumn(addRw, "testlist", testcd);
  359. var eqmtcd = grp_sea.cbo_eqmtList.value;
  360. var userdeptcd = ds_init_lb0000.getColumn(0, "nm");
  361. ds_grid_grd_lotlist.setColumn(ds_grid_grd_lotlist.rowposition, "eqmtcd", eqmtcd);
  362. ds_grid_grd_lotlist.setColumn(ds_grid_grd_lotlist.rowposition, "userdeptcd", userdeptcd);
  363. var oParam = {};
  364. oParam.id = "TXLQF00901";
  365. oParam.service = "grademngtbasemngtapp.QCMaterialMngt";
  366. oParam.method = "reqSetLot";
  367. oParam.inds = "cond=ds_grid_grd_lotlist:U testlist=ds_testlist:U";
  368. oParam.async = false;
  369. oParam.callback = "cf_TXLQF00901";
  370. tranf_submit(oParam);
  371. }
  372. function cf_TXLQF00901(sSvcId, nErrorCode, sErrorMsg) {
  373. if(nErrorCode < 0) return;
  374. lf_getLotList();
  375. }
  376. function lf_setEqmtCd(){
  377. var execdept = grp_sea.cbo_execDept.value; //검사실구분 코드(장비코드앞자리)
  378. dsf_createDsRow("ds_temp_search"
  379. , [{col: "codeflag", val: "0701|"}
  380. , {col: "basecdid", val: execdept}
  381. , {col: "eqmtcd", val: "00"}]);
  382. var oParam = {};
  383. oParam.id = "TRLZZ00101";
  384. oParam.service = "diagtestapplib.DiagTestBaseInfoMngt";
  385. oParam.method = "reqGetInitCodeInfo";
  386. oParam.inds = "cond=ds_temp_search";
  387. oParam.outds = "ds_init_lb0701=0701";
  388. oParam.async = false;
  389. tranf_submit(oParam);
  390. }
  391. function lf_addRow(){
  392. if(grp_sea.cbo_eqmtList.value == "00"){
  393. alert("장비를 선택 후 진행하세요");
  394. return;
  395. }
  396. var addRw = ds_grid_grd_lotlist.addRow();
  397. var orgDt = utlf_getCurrentDate();
  398. var fromdate = gf_getDate(orgDt, 1); // 시작일자를 다음날로 변경
  399. var eqmtcd = grp_sea.cbo_eqmtList.value;
  400. ds_grid_grd_lotlist.setColumn(addRw, "matrfromdd", fromdate);
  401. ds_grid_grd_lotlist.setColumn(addRw, "matrtodd", "99991231");
  402. ds_grid_grd_lotlist.setColumn(addRw, "todd", "99991231");
  403. ds_grid_grd_lotlist.setColumn(addRw, "validd", "99991231");
  404. ds_grid_grd_lotlist.setColumn(addRw, "eqmtcd", eqmtcd);
  405. lf_getDetlLotList(); // Lot별 검사항목 조회
  406. }
  407. function gf_getDate(strDate, diff) {
  408. if (strDate) {
  409. var date = gf_str2Date(strDate);
  410. var d = (new Date(date)).addDate(diff);
  411. }
  412. else {
  413. var d = (new Date).addDate(diff);
  414. }
  415. var s = (new Date(d)).getFullYear()
  416. + (((new Date(d)).getMonth() + 1) + "").padLeft(2, '0')
  417. + (((new Date(d)).getDate()) + "").padLeft(2, '0');
  418. return (s);
  419. }
  420. // 문자를 날짜로 변환.
  421. function gf_str2Date(inDate) {
  422. var date = new Date(parseInt(inDate.substr(0,4)),parseInt(inDate.substr(4,2))-1,parseInt(inDate.substr(6,2)));
  423. return date;
  424. }
  425. //Lot변경
  426. function lf_addRow2(){
  427. var row = ds_grid_grd_lotlist.rowposition;
  428. if(row < 0) {
  429. alert("Lot 변경할 ds_grid_grd_lotlist항목을 선택하세요");
  430. return;
  431. }
  432. ds_grid_grd_lotlist.setColumn(row, "matrtodd", utlf_getCurrentDate());
  433. lf_endLot("chng"); //선택된항목 Lot 종료
  434. }
  435. function lf_endLot(str) {
  436. endStr = str;
  437. var row = ds_grid_grd_lotlist.rowposition;
  438. if(row < 0) {
  439. alert("Lot 종료할 항목을 선택하세요");
  440. return;
  441. }
  442. var todd = ds_grid_grd_lotlist.getColumn(row, "matrtodd");
  443. if(toNumber(todd) < toNumber(utlf_getCurrentDate())) {
  444. alert("이미 종료된 Lot입니다.");
  445. return;
  446. }
  447. ds_grid_grd_lotlist.setColumn(ds_grid_grd_lotlist.rowposition, "status", "d"); // delete 상태
  448. var eqmtcd = grp_sea.cbo_eqmtList.value;
  449. var userdeptcd = ds_init_lb0000.getColumn(0, "nm");
  450. ds_grid_grd_lotlist.setColumn(row, "eqmtcd", eqmtcd);
  451. ds_grid_grd_lotlist.setColumn(row, "userdeptcd", userdeptcd);
  452. var oParam = {};
  453. oParam.id = "TXLQF00902";
  454. oParam.service = "grademngtbasemngtapp.QCMaterialMngt";
  455. oParam.method = "reqEndLot";
  456. oParam.inds = "cond=ds_grid_grd_lotlist:U";
  457. oParam.async = true;
  458. oParam.callback = "cf_TXLQF00902";
  459. tranf_submit(oParam);
  460. }
  461. function cf_TXLQF00902(sSvcId, nErrorCode, sErrorMsg) {
  462. if(nErrorCode < 0) return;
  463. lf_getLotList();
  464. }
  465. function lf_chngBgColor(curRw){
  466. var rtnColor = "";
  467. if(ds_grid_grd_detllotlist.getOrgColumn(curRw, "chk")=="1") {
  468. rtnColor = "#ffcc00";
  469. }else{
  470. rtnColor = "transparent";
  471. }
  472. return rtnColor;
  473. }
  474. function cf_TRLQF00901(sSvcId, nErrorCode, sErrorMsg) {
  475. if(nErrorCode < 0) return;
  476. if(endStr == "chng"){
  477. var row = ds_grid_grd_lotlist.rowposition;
  478. var orgDt = utlf_getCurrentDate();
  479. var fromdate = gf_getDate(orgDt, 1); // 시작일자를 다음날로 변경
  480. var eqmtcd = grp_sea.cbo_eqmtList.value;
  481. var addRw = ds_grid_grd_lotlist.addRow();
  482. ds_grid_grd_lotlist.setColumn(addRw, "eqmtcd", eqmtcd);
  483. ds_grid_grd_lotlist.setColumn(addRw, "matrcd", ds_grid_grd_lotlist.getColumn(row, "matrcd"));
  484. ds_grid_grd_lotlist.setColumn(addRw, "matrkindcd", ds_grid_grd_lotlist.getColumn(row, "matrkindcd"));
  485. ds_grid_grd_lotlist.setColumn(addRw, "matrnm", ds_grid_grd_lotlist.getColumn(row, "matrnm"));
  486. ds_grid_grd_lotlist.setColumn(addRw, "matrfromdd", fromdate);
  487. ds_grid_grd_lotlist.setColumn(addRw, "matrtodd", "99991231");
  488. ds_grid_grd_lotlist.setColumn(addRw, "todd", "99991231");
  489. ds_grid_grd_lotlist.setColumn(addRw, "validd", "99991231");
  490. lf_getDetlLotList();
  491. }
  492. }
  493. function grp_sea_btn_ref_onclick(obj:Button, e:ClickEventInfo)
  494. {
  495. ds_grid_grd_lotlist.clearData();
  496. ds_grid_grd_detllotlist.clearData();
  497. lf_getLotList();
  498. }
  499. function grd_lotlist_oncelldblclick(obj:Grid, e:GridClickEventInfo)
  500. {
  501. ds_grid_grd_detllotlist.clearData();
  502. lf_getDetlLotList();
  503. }
  504. function btn_addrow_onclick(obj:Button, e:ClickEventInfo)
  505. {
  506. lf_addRow();
  507. }
  508. function btn_end_onclick(obj:Button, e:ClickEventInfo)
  509. {
  510. lf_endLot("end");
  511. }
  512. function button1_onclick(obj:Button, e:ClickEventInfo)
  513. {
  514. lf_addRow2();
  515. }
  516. function btn_init_onclick(obj:Button, e:ClickEventInfo)
  517. {
  518. this.reload();
  519. }
  520. function btn_save_onclick(obj:Button, e:ClickEventInfo)
  521. {
  522. lf_setLotList();
  523. }
  524. function grp_sea_cbo_execDept_onitemchanged(obj:Combo, e:ItemChangeEventInfo)
  525. {
  526. lf_setEqmtCd();
  527. }
  528. function ds_grid_grd_lotlist_onrowposchanged(obj:Dataset, e:DSRowPosChangeEventInfo)
  529. {
  530. if(e.newrow >= 0) {
  531. }
  532. }
  533. ]]></Script>
  534. </Form>
  535. </FDL>