SMLAW00300_물품사용.xrw 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMLAW00300_물품사용.xfm
  4. * 설 명 : 물품불출관리
  5. * 설 계 자 : 설계자가 별도로 존재시 작성
  6. * 작 성 자 : 서승현
  7. * 작 성 일 : 2007.10.13
  8. * 수정이력 : 최종작성일 기준으로 변경사항 이력관리 2009
  9. * 기 타 : 주석문에 반영되어야 할 사항 표기
  10. -->
  11. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  12. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  13. <xhtml:head>
  14. <xhtml:title>물품사용</xhtml:title>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root xmlns="">
  18. <main>
  19. <goodcd>
  20. <goodcdlist>
  21. <choi/>
  22. <goodcd/>
  23. <goodnm/>
  24. <goodengnm/>
  25. </goodcdlist>
  26. </goodcd>
  27. <usegood>
  28. <usegoodlist>
  29. <choi/>
  30. <goodcd/>
  31. <goodnm/>
  32. <lotno/>
  33. <spec/>
  34. <unit/>
  35. <useqty/>
  36. <bfuseqty/>
  37. <unitcost/>
  38. <valiterm/>
  39. <instcd/>
  40. <posdeptcd/>
  41. <dutdeptcd/>
  42. <usedg/>
  43. <usedd/>
  44. <prodcustnm/>
  45. <suppcustnm/>
  46. <allsizespecid/>
  47. <adjtflagcd/>
  48. <adjtflagnm/>
  49. <outdeptcd/>
  50. <outdeptnm/>
  51. <stocqty/>
  52. <setunit/>
  53. <model/>
  54. </usegoodlist>
  55. </usegood>
  56. </main>
  57. <send/>
  58. <init>
  59. <seaval/>
  60. <seamthdcd>0</seamthdcd>
  61. <useflagcd/>
  62. <dutdept>
  63. <appdeptcd>
  64. <cd/>
  65. <nm/>
  66. </appdeptcd>
  67. </dutdept>
  68. <seamthdcd/>
  69. <popupmenu>
  70. <item>
  71. <name>행추가</name>
  72. <func>fExeInsertRow</func>
  73. </item>
  74. <item>
  75. <name>행삭제</name>
  76. <func>fExeDeleteRow</func>
  77. </item>
  78. </popupmenu>
  79. <fromdd/>
  80. <todd/>
  81. <appdeptcd>-</appdeptcd>
  82. <seaflagcd>2</seaflagcd>
  83. <adjtflagcd>0</adjtflagcd>
  84. </init>
  85. <hidden>
  86. </hidden>
  87. </root>
  88. </instance>
  89. <script type="javascript" ev:event="xforms-ready">
  90. <![CDATA[
  91. fExeInitialize();
  92. ]]>
  93. </script>
  94. <submission id="TRLAF00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/deptinfo"/>
  95. <submission id="TRLAA00103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/dutdept/appdeptcd"/>
  96. <submission id="TRLAW00301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/usegood/usegoodlist"/>
  97. <submission id="TRLAW00302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" add="bottom" resultref="/root/main/usegood/usegoodlist"/>
  98. <submission id="TXLAW00301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/message"/>
  99. <submission id="TXLAW00302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/message"/>
  100. </model>
  101. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  102. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  103. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  104. <script type="javascript" src="../../../lis/commonweb/js/LZZ001.js"/>
  105. <script type="javascript" src="../../../lis/commonweb/js/LPZ001.js"/>
  106. <script type="javascript" src="../../../lis/commonweb/js/LAZ001.js"/>
  107. <script type="javascript">
  108. <![CDATA[
  109. /* @group : 초기화
  110. * @ver : 2007.10.13 (CMCDEV-0001)
  111. * @by : 서승현
  112. * @-----------------------------------
  113. * @type : function
  114. * @access : public
  115. * @desc : 초기화 Function
  116. */
  117. function fExeInitialize() {
  118. //현재날짜
  119. var toDay = getCurrentDate();
  120. //--------------------------------
  121. model.removeNodeset("/root/send");
  122. model.removeNodeset("/root/main/goodcd/goodcdlist"); // 물품코드목록 초기화
  123. model.removeNodeset("/root/main/useappgood/useappgoodlist"); // 사용등록 물품목록 초기화
  124. model.removeNodeset("/root/main/usegood/usegoodlist"); // 사용물품 목록 초기화
  125. //-----------------------------------------
  126. //model.setValue("/root/init/seaval", ""); // 검색값 초기화
  127. //model.setValue("/root/init/seamthdcd", "0"); // 검색방법 초기화(0:바코드, 1:물품코드, 2:물품명)
  128. //model.setValue("/root/init/seaflagcd", "2"); // 검색구분 초기화(1:불출, 2:재고)
  129. model.setValue("/root/init/fromdd", toDay);
  130. model.setValue("/root/init/todd", toDay);
  131. //model.setValue("/root/init/appdeptcd", "-");
  132. //model.setValue("/root/init/adjtflagcd", "0"); // 재고보정코드(0:정상, 1:보정)
  133. //--------------------------------------------------------------------
  134. model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
  135. model.makeValue("/root/send/userid", getUserInfo("userid"));
  136. submit("TRLAF00402", false); // 사용자가 속한 과코드 조회
  137. model.makeValue("/root/send/posdeptcd", model.getValue("/root/init/deptinfo/cd"));
  138. submit("TRLAA00103"); // 부서코드 목록
  139. //--------------------------------------
  140. // 헤더 부분의 전체선택 체크박스가 보임.
  141. grd_uselist.fixedcellcheckbox(0, 1) = true;
  142. grd_uselist.colStyle(8, "data", "background-color") = "yellow";
  143. cmb_seadept.select(0);
  144. fExeSeaFlagChange(); //검색구분에 따른 hidden, disabled Control...
  145. ipt_fromdd.disabled = true;
  146. ipt_todd.disabled = true;
  147. }
  148. /* @group : 그리드 행 추가
  149. * @ver : 2007.10.13 (CMCDEV-0001)
  150. * @by : 서승현
  151. * @-----------------------------------
  152. * @type : function
  153. * @access : public
  154. * @desc : 그리드 행 추가 Function
  155. */
  156. function fExeInsertRow() {
  157. if(getNodesetCount("/root/main/usegood/usegoodlist") > 0) {
  158. grd_uselist.insertRow(grd_uselist.row, true);
  159. model.copyNode("/root/main/usegood/usegoodlist["+ grd_uselist.row+"]" , "/root/main/usegood/usegoodlist["+ (grd_uselist.row-1)+"]");
  160. model.setValue("/root/main/usegood/usegoodlist["+ grd_uselist.row+"]/useqty", "0");
  161. model.makeValue("/root/main/usegood/usegoodlist["+ grd_uselist.row+"]/usedg", "0");
  162. grd_uselist.refresh();
  163. }
  164. }
  165. /* @group : 그리드 행 삭제
  166. * @ver : 2007.10.13 (CMCDEV-0001)
  167. * @by : 서승현
  168. * @-----------------------------------
  169. * @type : function
  170. * @access : public
  171. * @desc : 그리드 행 삭제 Function
  172. */
  173. function fExeDeleteRow() {
  174. grd_uselist.deleteRow(grd_uselist.row, true);
  175. }
  176. /* @group : 파일입고
  177. * @ver : 2007.10.13 (CMCDEV-0001)
  178. * @by : 서승현
  179. * @-----------------------------------
  180. * @type : function
  181. * @access : public
  182. * @desc : 피일입고 Function
  183. */
  184. function fFileUse(){
  185. var fileName = window.fileDialog("open", ",", false, "", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls|CSV Files(*.csv)|*.csv");
  186. if (fileName == "" || fileName == null) {
  187. messageBox("사용할 파일을 선택하세요", "E", "");
  188. return;
  189. }
  190. var sStr = fileName.substring(fileName.length - 3);
  191. if(sStr.toLowerCase() == "csv"){
  192. grd_uselist.loadText(fileName);
  193. }
  194. else if(sStr.toLowerCase() == "xls"){
  195. grd_uselist.loadExcel(fileName);
  196. }
  197. else{
  198. messageBox("Excel파일을 선택하세요", "E", "");
  199. return;
  200. }
  201. }
  202. /* @group : 엑셀저장
  203. * @ver : 2007.10.13 (CMCDEV-0001)
  204. * @by : 서승현
  205. * @-----------------------------------
  206. * @type : function
  207. * @access : public
  208. * @desc : 엑셀저장 Function
  209. */
  210. function fExeExcel() {
  211. var fileName = window.fileDialog("save", ",", false, "물품사용목록", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  212. if (fileName != ""){
  213. grd_uselist.saveExcel(fileName);
  214. }
  215. }
  216. /* @group :사용물품 목록
  217. * @ver : 2007.10.13 (CMCDEV-0001)
  218. * @by : 서승현
  219. * @-----------------------------------
  220. * @type : function
  221. * @access : public
  222. * @desc : 사용된 물품 목록 조회 Function
  223. */
  224. function fGetUseGoodList() {
  225. //-----------------------------------------------------------------------------------------
  226. if (model.getValue("/root/init/fromdd") == "" || model.getValue("/root/init/todd") == "") {
  227. messageBox("조회기간이 입력되지 않았습니다.","I007");
  228. return false;
  229. }
  230. //--------------------------------
  231. model.removeNodeset("/root/send");
  232. model.removeNodeset("/root/main/usegood/usegoodlist");
  233. //--------------------------------------------------------------------
  234. model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd")); // 기관코드
  235. model.makeValue("/root/send/posdeptcd", model.getValue("/root/init/deptinfo/cd")); // 로그인 사용자의 부서코드
  236. model.makeValue("/root/send/dutdeptcd", model.getValue("/root/init/appdeptcd")); // 부서코드
  237. model.makeValue("/root/send/subdutdeptcd", model.getValue("/root/init/subappdeptcd")); // 재고부서코드
  238. model.makeValue("/root/send/seaval", model.getValue("/root/init/seaval")); // 검색값
  239. model.makeValue("/root/send/seamthdcd", model.getValue("/root/init/seamthdcd")); // 검색방법
  240. model.makeValue("/root/send/fromdd", model.getValue("/root/init/fromdd")); // 사용일자(From)
  241. model.makeValue("/root/send/todd", model.getValue("/root/init/todd")); // 사용일자(To)
  242. model.makeValue("/root/send/seaflagcd", model.getValue("/root/init/seaflagcd")); // 검색구분(0:입고, 1:사용량, 2:부서물품(재고))
  243. if(model.getValue("/root/hidden/goodflag") != ""){
  244. model.makeValue("/root/send/goodflag", model.getValue("/root/hidden/goodflag"));
  245. }
  246. //-------------------
  247. submit("TRLAW00301");
  248. }
  249. /* @group : 사용등록 물품 목록
  250. * @ver : 2007.10.13 (CMCDEV-0001)
  251. * @by : 서승현
  252. * @-----------------------------------
  253. * @type : function
  254. * @access : public
  255. * @desc : 사용등록 물품 목록 조회 Function
  256. */
  257. function fUseAppGoodSearch(pFlagCd) {
  258. //----------------------------------------------------------------------------------------
  259. if(model.getValue("/root/init/fromdd") == "" || model.getValue("/root/init/todd") == "") {
  260. messageBox("조회기간이 입력되지 않았습니다.","I");
  261. return false;
  262. }
  263. //--------------------------------
  264. model.removeNodeset("/root/send");
  265. //-------------------------------------------------------------------------
  266. // 바코드검색의 경우 그리드에 연속적으로 추가되어야 하기에 삭제하지 않는다.
  267. if (pFlagCd == "") model.removeNodeset("/root/main/usegood/usegoodlist");
  268. //--------------------------------------------------------------------
  269. model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd")); // 기관코드
  270. model.makeValue("/root/send/posdeptcd", model.getValue("/root/init/deptinfo/cd")); // 로그인 사용자의 부서코드
  271. model.makeValue("/root/send/dutdeptcd", model.getValue("/root/init/appdeptcd"));
  272. model.makeValue("/root/send/seaval", model.getValue("/root/init/seaval"));
  273. model.makeValue("/root/send/seamthdcd", model.getValue("/root/init/seamthdcd"));
  274. model.makeValue("/root/send/fromdd", model.getValue("/root/init/fromdd"));
  275. model.makeValue("/root/send/todd", model.getValue("/root/init/todd"));
  276. model.makeValue("/root/send/goodflag", "");
  277. submit("TRLAW00302");
  278. }
  279. /* @group : 물품사용
  280. * @ver : 2007.10.13 (CMCDEV-0001)
  281. * @by : 서승현
  282. * @-----------------------------------
  283. * @type : function
  284. * @access : public
  285. * @desc : 물품코드 목록 선택 체크시 사용물품 목록으로 값 추가 Function
  286. */
  287. function fExeChoiTrue(str) {
  288. var sSrcNode = "/root/main/useappgood/useappgoodlist";
  289. var sDescNode = "/root/main/usegood/usegoodlist";
  290. var sGoodNode = "/root/main/goodcd/goodcdlist";
  291. if (str == "good") { //물품목록
  292. if (model.getValue(sGoodNode+"["+ grd_goodlist.row +"]/choi") == "true") {
  293. var goodcd = model.getValue(sGoodNode+"["+ grd_goodlist.row+"]/goodcd");
  294. if(model.getValue("/root/init/appdeptcd") == "-"){
  295. alert("실사용부서를 선택 하세요");
  296. return;
  297. }
  298. //-------------------
  299. grd_uselist.addRow();
  300. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/choi", "true");
  301. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/goodcd", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/goodcd"));
  302. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/allsizespecid", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/allsizespecid"));
  303. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/goodnm", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/goodnm"));
  304. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/lotno", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/lotno"));
  305. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/spec", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/goodspec"));
  306. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/unit", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/deliveunit"));
  307. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/unitcost", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/goodunitcost"));
  308. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/stocqty", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/stocqty"));
  309. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/useqty", "1");
  310. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/bfuseqty", "0");
  311. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/instcd", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/instcd"));
  312. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/posdeptcd", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/posdeptcd"));
  313. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/dutdeptcd", model.getValue("/root/init/appdeptcd"));
  314. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/valiterm", "99991231");
  315. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/usedd", "-");
  316. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/usedg", "0");
  317. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/prodcustnm", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/prodcustnm"));
  318. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/suppcustnm", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/suppcustnm"));
  319. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/outdeptcd", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/dutdeptcd"));
  320. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/outdeptnm", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/dutdeptnm"));
  321. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/setunit", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/setunit"));
  322. model.makeValue(sDescNode+"["+ grd_uselist.row+"]/model", model.getValue(sGoodNode+"["+grd_goodlist.row+"]/model"));
  323. //-------------------------------------------------------------
  324. grd_uselist.colStyle(grd_uselist.colRef("stocqty"), "data", "background-color") = "yellow";
  325. }
  326. }
  327. //--------------------
  328. grd_uselist.refresh();
  329. }
  330. /* @group : 물품사용
  331. * @ver : 2007.10.13 (CMCDEV-0001)
  332. * @by : 서승현
  333. * @-----------------------------------
  334. * @type : function
  335. * @access : public
  336. * @desc : 물품사용 처리 Function
  337. */
  338. function fExeGoodUse() {
  339. var toDay = getCurrentDate();
  340. var valiterm = "";
  341. var iFindNo = 0;
  342. var sDescNode = "/root/main/usegood/usegoodlist";
  343. //-----------------------------------------------------
  344. iFindNo = grd_uselist.findRow("true", 1, 1, true, true);
  345. if (Number(iFindNo) <= 0) {
  346. messageBox("사용할 물품을 선택하여 주십시오!", "I007");
  347. return false;
  348. }
  349. //------------------------
  350. grd_uselist.clearStatus();
  351. for (var iNo=1; iNo <= getNodesetCount(sDescNode); iNo++) {
  352. //---------------------------------------------------------
  353. if (model.getValue(sDescNode+"["+iNo+"]/choi") == "true") {
  354. //------------------------------------------------------
  355. if (model.getValue(sDescNode+"["+iNo+"]/lotno") == "") {
  356. messageBox(iNo+" 행에 Lot번호가 입력되지 않았습니다.","I007");
  357. return false;
  358. }
  359. //------------------------------------------------------
  360. if (model.getValue(sDescNode+"["+iNo+"]/useqty") == "" || Number(model.getValue(sDescNode+"["+iNo+"]/useqty")) == 0) {
  361. messageBox(iNo+" 행에 사용수량이 입력되지 않았습니다.","I007");
  362. return false;
  363. }
  364. //--------------------------------------------------------
  365. valiterm = model.getValue(sDescNode+"["+iNo+"]/valiterm");
  366. if( Number(valiterm - toDay) < 0 && model.getValue(sDescNode+"["+iNo+"]/valiterm") != "") {
  367. messageBox(iNo+" 행에 유효기간이 지났습니다.","I007");
  368. return false;
  369. }
  370. //------------------
  371. // 재고보정구분 설정
  372. model.makeValue(sDescNode+"["+iNo+"]/adjtflagcd", model.getValue("/root/init/adjtflagcd"));
  373. //------------------------------------------------------
  374. if (model.getValue(sDescNode+"["+iNo+"]/usedg") == "" || model.getValue(sDescNode+"["+iNo+"]/usedg") == "0") {
  375. grd_uselist.addStatus(iNo, "insert");
  376. } else {
  377. grd_uselist.addStatus(iNo, "update");
  378. }
  379. }
  380. }
  381. //--------------------------------
  382. model.removeNodeset("/root/send");
  383. model.makeValue("/root/send/usegoodlist", grd_uselist.getUpdateData());
  384. //-----------
  385. setAlertOn();
  386. if (submit("TXLAW00301")) {
  387. //model.removeNodeset("/root/main/usegood/usegoodlist"); // 사용물품 목록 초기화
  388. model.removeNodeset(sDescNode+"[choi='true']");
  389. fGetGoodCodeSubList();
  390. grd_uselist.clearStatus();
  391. fExeChoiInit();
  392. model.refresh();
  393. }
  394. }
  395. /* @group : 사용취소
  396. * @ver : 2007.10.13 (CMCDEV-0001)
  397. * @by : 서승현
  398. * @-----------------------------------
  399. * @type : function
  400. * @access : public
  401. * @desc :사용취소 Function
  402. */
  403. function fExeCancelUse() {
  404. var iCnt = 0;
  405. var iFindNo = 0;
  406. var sNode = "/root/main/usegood/usegoodlist";
  407. //------------------------------------------------------
  408. iFindNo = grd_uselist.findRow("true", 1, 1, true, true);
  409. if (Number(iFindNo) <= 0) {
  410. messageBox("취소할 물품을 선택하여 주십시오!", "I007");
  411. return false;
  412. }
  413. //------------------------
  414. grd_uselist.clearStatus();
  415. for (var iNo=1; iNo <= getNodesetCount(sNode); iNo++) {
  416. //-----------------------------------------------------
  417. if (model.getValue(sNode+"["+iNo+"]/choi") == "true") {
  418. if (model.getValue(sNode+"["+iNo+"]/usedg") == "0" || model.getValue(sNode+"["+iNo+"]/usedg") == "") {
  419. messageBox("사용 된 내역만 취소 할 수 있습니다.", "I007");
  420. return false;
  421. }
  422. //-----------------------------------
  423. grd_uselist.addStatus(iNo, "delete");
  424. }
  425. }
  426. //--------------------------------
  427. model.removeNodeset("/root/send");
  428. model.makeValue("/root/send/usecancel", grd_uselist.getUpdateData());
  429. //-----------------------------------
  430. if(messageBox("취소", "Q004") == 6) {
  431. //-----------
  432. setAlertOn();
  433. if (submit("TXLAW00302")) {
  434. model.removeNodeset(sNode+"[choi='true']"); // 사용물품 목록 초기화
  435. fGetGoodCodeSubList();
  436. grd_uselist.clearStatus();
  437. fExeChoiInit();
  438. }
  439. }
  440. //-------------
  441. model.refresh();
  442. }
  443. //----------------------------
  444. // 검색부서 선택시 그리드 리셋
  445. function fGridReSet(){
  446. //fGetGoodCodeSubList();
  447. model.removeNodeset("/root/main/useappgood/useappgoodlist"); // 사용등록 물품목록 초기화
  448. model.removeNodeset("/root/main/usegood/usegoodlist"); // 사용등록 목록 초기화
  449. model.refresh();
  450. }
  451. //---------------------
  452. // 물품 사용내역을 검색
  453. function fGetWInGoodList(pFlagCd) {
  454. var sNode = "/root/main/usegood/usegoodlist";
  455. //-------------------------
  456. fUseAppGoodSearch(pFlagCd);
  457. //------------------------------------------------------
  458. for (var iNo=1 ; iNo <= getNodesetCount(sNode); iNo++) {
  459. if ((model.getValue(sNode+"["+ iNo +"]/valiterm")-getCurrentDate()) <= 7 ) {
  460. grd_uselist.rowstyle(i,"data","color")="red";
  461. }
  462. }
  463. }
  464. //------------------------
  465. // 사용등록 물품 선택 해제
  466. function fExeChoiInit() {
  467. //-------------------------
  468. // 물품재고현황 목록 초기화
  469. for (var iNo=1; iNo <= getNodesetCount("/root/main/goodcd/goodcdlist"); iNo++) {
  470. model.setValue("/root/main/goodcd/goodcdlist["+iNo+"]/choi", "false");
  471. }
  472. //---------------------
  473. grd_goodlist.refresh();
  474. }
  475. //-------------------------------------
  476. // 검색구분에 따라 물품목록을 조회한다.
  477. function fExeGoodSea(pAddFlagCd) {
  478. //--------------------------------------------------
  479. if (model.getValue("/root/init/seaflagcd") == "0") {
  480. //-------------------------------------
  481. // 검색값 입력 시 는 그리드에 계속 추가
  482. TRLAW00302.attribute("add") = pAddFlagCd;
  483. //--------------------------
  484. fGetWInGoodList(pAddFlagCd); // 입고량 조회
  485. grd_uselist.colDisabled(grd_uselist.colRef("useqty")) = false;
  486. } else {
  487. fGetUseGoodList(); // 사용량, 부서물품 조회
  488. if (model.getValue("/root/init/seaflagcd") == "1") {
  489. grd_uselist.colDisabled(grd_uselist.colRef("useqty")) = true;
  490. } else {
  491. grd_uselist.colDisabled(grd_uselist.colRef("useqty")) = false;
  492. }
  493. }
  494. //-------------------------------------------------------------
  495. grd_uselist.colStyle(grd_uselist.colRef("stocqty"), "data", "background-color") = "yellow";
  496. }
  497. //----------------------------
  498. // 검색값 입력 후 Enter키 입력
  499. function fExeSeaValOnKeyPress() {
  500. if (event.keyCode == "13") {
  501. model.setValue("/root/init/seaval", ipt_seaval.currentText);
  502. ipt_seaval.refresh();
  503. //--------------------
  504. fExeGoodSea("bottom");
  505. }
  506. }
  507. //----------------------------
  508. // 검색구분이 변경될 경우 처리
  509. function fExeSeaFlagChange() {
  510. if (model.getValue("/root/init/seaflagcd") == "0") { // 0이 없는데 뭘까요?
  511. btn_save.disabled = false;
  512. btn_can.disabled = true;
  513. ipt_fromdd.disabled = false;
  514. ipt_todd.disabled = false;
  515. grd_uselist.colHidden(grd_uselist.colRef("usedd")) = true;
  516. grd_uselist.colHidden(grd_uselist.colRef("dutdeptnm")) = true;
  517. } else if (model.getValue("/root/init/seaflagcd") == "1") { //불출
  518. btn_save.disabled = true;
  519. btn_can.disabled = false;
  520. ipt_fromdd.disabled = false;
  521. ipt_todd.disabled = false;
  522. grd_uselist.colHidden(grd_uselist.colRef("usedd")) = false;
  523. grd_uselist.colHidden(grd_uselist.colRef("dutdeptnm")) = false;
  524. } else { //재고??
  525. btn_save.disabled = false;
  526. btn_can.disabled = true;
  527. ipt_fromdd.disabled = false;
  528. ipt_todd.disabled = false;
  529. grd_uselist.colHidden(grd_uselist.colRef("usedd")) = true;
  530. grd_uselist.colHidden(grd_uselist.colRef("dutdeptnm")) = true;
  531. }
  532. //----------------------------------------------------
  533. model.removeNodeset("/root/main/usegood/usegoodlist");
  534. grd_uselist.rebuildStyle();
  535. grd_uselist.rebuild();
  536. grd_uselist.refresh();
  537. }
  538. //-----------------------
  539. // 사용목록을 선택시 처리
  540. function fExeUseGridSelect(pRowNo) {
  541. var iSNo = Number(pRowNo);
  542. var iENo = Number(pRowNo);
  543. var sNode = "/root/main/usegood/usegoodlist";
  544. //--------------------------------------------------
  545. if (model.getValue("/root/init/seaflagcd") == "1") {
  546. if (Number(pRowNo) > 0) {
  547. //--------------------------------------------------
  548. // 선입선출법에 의해 마지막 Row만 취소 가능토록 처리
  549. if (getNodesetCount(sNode) > Number(pRowNo)) {
  550. /*
  551. if (model.getValue(sNode+"["+(Number(pRowNo)+1)+"]/choi") == "false") {
  552. model.setValue(sNode+"["+pRowNo+"]/choi", "false");
  553. messageBox("최종 사용내역부터 취소가 가능합니다!", "I007");
  554. return false;
  555. }
  556. */
  557. }
  558. }
  559. }
  560. }
  561. //---------------------------------------
  562. // 사용수량 변경시 선택여부 자동체크 기능
  563. function fExeQtyChange(pGridObj) {
  564. //------------------------------
  565. if (Number(pGridObj.col) != pGridObj.colRef("useqty")) {
  566. return false;
  567. }
  568. var sNode = "/root/main/usegood/usegoodlist";
  569. //var iUseQty = Number(model.getValue(sNode+"["+Number(pGridObj.row)+"]/useqty"));
  570. //---------------------------------------------------------------
  571. model.makeValue(sNode+"["+Number(pGridObj.row)+"]/choi", "true");
  572. //pGridObj.refresh();
  573. //---------------------------------------------------
  574. //if (getNodesetCount(sNode) > Number(pGridObj.row)) { //엔터 누르면 onkeypress 이벤트에서 한칸 내려가므로 주석처리함
  575. /*if ( (Number(pGridObj.rows) - 1) > Number(pGridObj.row)) {
  576. pGridObj.row = Number(pGridObj.row) + 1;
  577. //pGridObj.col = 9;
  578. //pGridObj.selected = true;
  579. }*/
  580. }
  581. //---------------------------------------
  582. // 사용수량 변경시 선택여부 자동체크 기능
  583. function fExeNextColMove(pGridObj) {
  584. var sNode = "/root/main/usegood/usegoodlist";
  585. //------------------------------
  586. if (Number(pGridObj.col) != pGridObj.colRef("useqty")) {
  587. return false;
  588. }
  589. if (event.keyCode == 13) {
  590. if (getNodesetCount(sNode) == pGridObj.row) {
  591. // Continue
  592. } else {
  593. pGridObj.row = Number(pGridObj.row) + 1;
  594. pGridObj.col = pGridObj.colRef("useqty");
  595. pGridObj.selected = true;
  596. }
  597. }
  598. }
  599. ]]>
  600. </script>
  601. </xhtml:head>
  602. <xhtml:body guideline="1,1193;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  603. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  604. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:800px; height:14px; ">물품불출관리</caption>
  605. </group>
  606. <group id="grp_biz" scroll="auto" style="left:0px; top:35px; width:1195px; height:744px; ">
  607. <group id="group2" style="left:0px; top:10px; width:1194; height:35; vertical-align:top; ">
  608. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1194; height:35; "/>
  609. <caption id="caption1" class="search_name" style="left:15px; top:9px; width:86px; height:17px; ">검색값 :</caption>
  610. <caption id="caption7" class="search_name" style="left:350px; top:9px; width:86px; height:17px; ">검색구분 :</caption>
  611. <line id="line1" class="line_4" style="x1:1107px; y1:7px; x2:1107px; y2:29; "/>
  612. <input id="ipt_seaval" ref="/root/init/seaval" class="input_search" navindex="2" style="left:188px; top:8px; width:142px; height:19px; ">
  613. <script type="javascript" ev:event="onkeypress">
  614. <![CDATA[
  615. fExeSeaValOnKeyPress();
  616. ]]>
  617. </script>
  618. </input>
  619. <caption id="caption3" class="search_name" style="left:527px; top:10px; width:105px; height:17px; ">조회기간 :</caption>
  620. <caption id="caption4" class="search_no_b" style="left:723px; top:9px; width:12px; height:17px; ">~</caption>
  621. <input id="ipt_todd" ref="/root/init/todd" class="input_s_essential" navindex="5" inputtype="date" required="true" style="left:738px; top:8px; width:100px; height:19px; background-image:../../../com/commonweb/images/input_s_essential.gif; "/>
  622. <input id="ipt_fromdd" ref="/root/init/fromdd" class="input_s_essential" navindex="4" inputtype="date" required="true" style="left:620px; top:8px; width:100px; height:19px; background-image:../../../com/commonweb/images/input_s_essential.gif; "/>
  623. <caption id="caption26" class="search_name" style="left:859px; top:9px; width:99px; height:17px; ">실사용부서 :</caption>
  624. <select1 id="cmb_seadept" ref="/root/init/appdeptcd" navindex="6" appearance="minimal" style="left:963px; top:8px; width:128px; height:19px; ">
  625. <choices>
  626. <itemset nodeset="/root/init/dutdept/appdeptcd">
  627. <label ref="nm"/>
  628. <value ref="cd"/>
  629. </itemset>
  630. </choices>
  631. <script type="javascript" ev:event="xforms-select">
  632. <![CDATA[
  633. fGridReSet();
  634. ]]>
  635. </script>
  636. </select1>
  637. <button id="btn_sea" class="btn1_letter2" navindex="7" style="left:1125; top:7; width:56px; height:22px; ">
  638. <caption>조회</caption>
  639. <script type="javascript" ev:event="DOMActivate">
  640. <![CDATA[
  641. fExeGoodSea("");
  642. ]]>
  643. </script>
  644. </button>
  645. <select1 id="cmb_seamthdcd" ref="/root/init/seamthdcd" class="combo_search" navindex="1" appearance="minimal" style="left:95px; top:8px; width:90px; height:19px; ">
  646. <choices>
  647. <item>
  648. <label>바코드번호</label>
  649. <value>0</value>
  650. </item>
  651. <item>
  652. <label>물품코드</label>
  653. <value>1</value>
  654. </item>
  655. <item>
  656. <label>물품명</label>
  657. <value>2</value>
  658. </item>
  659. </choices>
  660. </select1>
  661. <select1 id="cbo_seaflagcd" ref="/root/init/seaflagcd" navindex="3" appearance="minimal" style="left:440px; top:8px; width:70px; height:19px; ">
  662. <choices>
  663. <item>
  664. <label>불출</label>
  665. <value>1</value>
  666. </item>
  667. <item>
  668. <label>재고</label>
  669. <value>2</value>
  670. </item>
  671. </choices>
  672. <script type="javascript" ev:event="xforms-value-changed">
  673. <![CDATA[
  674. fExeSeaFlagChange();
  675. ]]>
  676. </script>
  677. </select1>
  678. </group>
  679. <line id="line2" class="line_1" style="x1:304px; y1:70px; x2:1193px; y2:70px; "/>
  680. <caption id="caption5" class="tit_2" style="left:310px; top:55px; width:144px; height:14px; ">사용물품목록</caption>
  681. <button id="btn_del" class="btn2_letter3" navindex="10" visibility="hidden" style="left:1072px; top:50px; width:53px; height:19px; ">
  682. <caption>행삭제</caption>
  683. <script type="javascript" ev:event="DOMActivate">
  684. <![CDATA[
  685. fExeDeleteRow();
  686. ]]>
  687. </script>
  688. </button>
  689. <button id="button4" class="btn2_letter3" navindex="9" visibility="hidden" style="left:1016px; top:50px; width:53px; height:19px; ">
  690. <caption>행추가</caption>
  691. <script type="javascript" ev:event="DOMActivate">
  692. <![CDATA[
  693. fExeInsertRow();
  694. ]]>
  695. </script>
  696. </button>
  697. <button id="btn_excsave" class="btn2_letter4" navindex="11" style="left:1128px; top:50px; width:64px; height:19px; ">
  698. <caption>엑셀저장</caption>
  699. <script type="javascript" ev:event="DOMActivate">
  700. <![CDATA[
  701. fExeExcel();
  702. ]]>
  703. </script>
  704. </button>
  705. <button id="button1" class="btn2_letter4" navindex="8" visibility="hidden" style="left:949px; top:50px; width:64px; height:19px; ">
  706. <caption>파일등록</caption>
  707. <script type="javascript" ev:event="DOMActivate">
  708. <![CDATA[
  709. fFileUse();
  710. ]]>
  711. </script>
  712. </button>
  713. <datagrid id="grd_uselist" nodeset="/root/main/usegood/usegoodlist" class="datagrid2" caption="선&#xA;택^불출일시^보정&#xA;여부^물품코드^물품명^Lot번호^규격^기준&#xA;단위^재고&#xA;수량^불출&#xA;수량^단가^instcd^posdeptcd^deptcd^usedg^usedd^bfuseqty^유효기간^포장구성단위^제조사^모델^납품처^ALL SIZE^adjtflagcd^outdeptcd^재고부서^불출부서" colsep="^" colwidth="40, 80, 40, 70, 160, 110, 60, 50, 50, 50, 0, 0, 0, 0, 0, 0, 0, 90, 80, 80, 80, 80, 0, 0, 0, 80, 80" dataheight="23" ellipsis="true" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" rowsep="|" style="left:304px; top:75px; width:889px; height:668px; ">
  714. <col ref="choi" type="checkbox"/>
  715. <col ref="usedd" format="yyyy-mm-dd"/>
  716. <col ref="adjtflagnm"/>
  717. <col ref="goodcd" style="text-align:center; "/>
  718. <col ref="goodnm" style="text-align:left; "/>
  719. <col ref="lotno" type="input" style="text-align:center; "/>
  720. <col ref="spec" style="text-align:center; "/>
  721. <col ref="unit" style="text-align:center; "/>
  722. <col class="text_right" ref="stocqty" format="(-)#,###" mask="exclude" showmask="true"/>
  723. <col autonext="true" ref="useqty" type="input" format="(-)#,###" maxlength="6" style="text-align:right; "/>
  724. <col ref="unitcost" secretendposition="20" secretmark="*" secretstartposition="0" format="#,###" style="text-align:right; "/>
  725. <col ref="instcd"/>
  726. <col ref="posdeptcd"/>
  727. <col ref="dutdeptcd"/>
  728. <col ref="usedg"/>
  729. <col ref="usedd"/>
  730. <col ref="bfuseqty"/>
  731. <col ref="valiterm" type="inputdate" format="yyyy-mm-dd" mask="exclude" showmask="true" style="text-align:center; "/>
  732. <col class="text_center" ref="setunit"/>
  733. <col ref="prodcustnm"/>
  734. <col ref="model"/>
  735. <col ref="suppcustnm"/>
  736. <col ref="allsizespecid"/>
  737. <col ref="adjtflagcd"/>
  738. <col ref="outdeptcd"/>
  739. <col ref="outdeptnm"/>
  740. <col ref="dutdeptnm"/>
  741. <script type="javascript" ev:event="xforms-select">
  742. <![CDATA[
  743. //fExeUseGridSelect(grd_uselist.row);
  744. ]]>
  745. </script>
  746. <script type="javascript" ev:event="xforms-value-changed">
  747. <![CDATA[
  748. fExeQtyChange(grd_uselist);
  749. ]]>
  750. </script>
  751. <script type="javascript" ev:event="onkeypress">
  752. <![CDATA[
  753. fExeNextColMove(grd_uselist);
  754. ]]>
  755. </script>
  756. <script type="javascript" ev:event="onaftersort">
  757. <![CDATA[
  758. grd_uselist.gridToInstance();
  759. ]]>
  760. </script>
  761. </datagrid>
  762. <import id="import1" src="../../../lis/gooddelivemngtweb/xrw/SSLAW00100_물품목록.xrw" style="left:0px; top:55px; width:300px; height:688px; "/>
  763. <caption id="caption2" style="left:842px; top:51px; width:100px; height:20px; ">재고보정</caption>
  764. <bool id="bool_adjtflagcd" checkvalue="1,0" ref="/root/init/adjtflagcd" style="left:819px; top:50px; width:25px; height:20px; font-weight:bold; "/>
  765. </group>
  766. <group id="grp_btn" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  767. <line id="line32" class="line_6" style="x1:0px; y1:25px; x2:1194px; y2:25px; "/>
  768. <button id="btn_save" class="btn4_letter2" navindex="12" style="left:1079; top:3px; width:56px; height:22px; ">
  769. <caption>저장</caption>
  770. <script type="javascript" ev:event="DOMActivate">
  771. <![CDATA[
  772. fExeGoodUse();
  773. ]]>
  774. </script>
  775. </button>
  776. <button id="btn_can" class="btn4_letter2" disabled="true" navindex="13" style="left:1138px; top:3px; width:56px; height:22px; ">
  777. <caption>취소</caption>
  778. <script type="javascript" ev:event="DOMActivate">
  779. <![CDATA[
  780. fExeCancelUse();
  781. ]]>
  782. </script>
  783. </button>
  784. </group>
  785. </xhtml:body>
  786. </xhtml:html>