12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <!--
- * 제 목 : SMLAW00400_물품T사용.xrw
- * 설 명 : 물품T사용
- * 설 계 자 : 설계자가 별도로 존재시 작성
- * 작 성 자 : 한음미
- * 작 성 일 : 2007.10.13
- * 수정이력 : 최종작성일 기준으로 변경사항 이력관리
- * 기 타 : 주석문에 반영되어야 할 사항 표기
- -->
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>물품T사용</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <goodcd>
- <goodcdlist>
- <choi/>
- <goodcd/>
- <goodnm/>
- <stocqty/>
- <tqty/>
- <unitcost/>
- </goodcdlist>
- </goodcd>
- <datalist>
- <usedd/>
- <goodcd/>
- <useqty/>
- <usedg/>
- <cncldd/>
- <cncltm/>
- <cnclid/>
- <lotno/>
- <dutdeptcd/>
- <unitcost/>
- <posdeptcd/>
- <instcd/>
- </datalist>
- </main>
- <send>
- </send>
- <init>
- <dutdept>
- <appdeptcd/>
- </dutdept>
- <seamthdcd/>
- <popupmenu>
- <item>
- <name>행추가</name>
- <func>fExeInsertRow</func>
- </item>
- <item>
- <name>행삭제</name>
- <func>fExeDeleteRow</func>
- </item>
- </popupmenu>
- <mlist>
- <winvol/>
- <prest/>
- <winqty/>
- <enddd/>
- </mlist>
- <bfvol/>
- <calendar>
- <year/>
- <month/>
- <weeklist>
- <list>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- <sun_memo/>
- <mon_memo/>
- <tue_memo/>
- <wed_memo/>
- <thu_memo/>
- <fri_memo/>
- <sat_memo/>
- </list>
- </weeklist>
- </calendar>
- <appdeptcd/>
- <grdcellcolor>
- <calrow/>
- <calcol/>
- </grdcellcolor>
- <enddd/>
- </init>
- <hidden>
- <wiqty/>
- <prqty/>
- </hidden>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fExeInitialize();
- ]]>
- </script>
- <submission id="TRLAF00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/deptinfo"/>
- <submission id="TRLAA00103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/dutdept/appdeptcd"/>
- <submission id="TRLAW00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/datalist"/>
- <submission id="TRLAW00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/mlist"/>
- <submission id="TXLAW00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/message"/>
- <submission id="TXLAW00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/message"/>
- <submission id="TXLAW00403" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/message"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
- <script type="javascript">
- <![CDATA[
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 초기화 Function
- */
- function fExeInitialize() {
-
- //--------------------------------
- model.removeNodeset("/root/send");
- model.removeNodeset("/root/main/goodcd/goodcdlist"); // 물품코드목록 초기화
- model.removeNodeset("/root/main/winappgood/winappgoodlist"); // 입고신청 물품목록 초기화
- model.removeNodeset("/root/main/wingood/wingoodlist"); // 입고물품 목록 초기화
-
- //--------------------------------------------------------------------
- model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
- model.makeValue("/root/send/userid", getUserInfo("userid"));
- submit("TRLAF00402", false); // 사용자가 속한 과코드 조회
-
- model.makeValue("/root/send/posdeptcd", model.getValue("/root/init/deptinfo/cd"));
- submit("TRLAA00103"); // 부서코드 목록
-
- //-------------
- initCalendar(); // 달력 초기화
- setCurrentDate();
-
- //----------------------------------------------------------
- model.makeValue("/root/init/enddd", getCurrentDate());
- model.makeValue("/root/init/mlist/enddd", "");
- model.makeValue("/root/init/scrno", "40"); // Test별 물품사용
-
- //--------------------
- cmb_seadept.select(0);
-
- model.refresh();
- }
-
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 달력의 값 입력 , 수정, 삭제 Function
- */
- function fSaveGoodCount(pFlagCd) {
-
- var sNode = "/root/main/datalist";
- var objNode = null;
-
-
- //--------------------------------
- if (getNodesetCount(sNode) <= 0) {
- messageBox("저장할 사용량이 없습니다! ", "I007");
- return false;
- }
-
- //---------------------
- grd_data.clearStatus();
-
- //-----------------
- // 빈공백 노드 삭제
- for (var iNo=getNodesetCount(sNode); iNo > 0; iNo--) {
-
- objNode = instance1.selectSingleNode(sNode+"["+iNo+"]/goodcd");
- if (objNode == null) {
- model.removeNodeset(sNode+"["+iNo+"]");
- }
- }
-
- //-----------------------------------------------------
- for (var iNo=1; iNo <= getNodesetCount(sNode); iNo++) {
-
- objNode = instance1.selectSingleNode(sNode+"["+iNo+"]/goodcd");
- if (objNode == null) {
- model.removeNodeset(sNode+"["+iNo+"]");
- }
-
- //------------------
- // 사용량 신규 등록
- if (model.getValue(sNode+"["+iNo+"]/goodcd") != "") {
- if (model.getValue(sNode+"["+iNo+"]/usedg") == "0") {
-
- if (Number(model.getValue(sNode+"["+iNo+"]/useqty")) != 0) {
- grd_data.addStatus(iNo, "insert");
- }
- } else {
- if (Number(model.getValue(sNode+"["+iNo+"]/useqty")) == 0) {
- grd_data.addStatus(iNo, "delete");
- } else if (Number(model.getValue(sNode+"["+iNo+"]/useqty")) != Number(model.getValue(sNode+"["+iNo+"]/bfuseqty"))) {
- grd_data.addStatus(iNo, "update");
- }
- }
- }
- }
- //--------------------------------
- if (pFlagCd != "0") setAlertOn();
-
- //--------------------------------
- model.removeNodeset("/root/send");
- model.makeValue("/root/send/cnt", grd_data.getUpdateData());
- if (submit("TXLAW00401")) {
- fSelectGoodCdList();
- }
- }
-
-
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 오늘 날짜 달력에 표시 Function
- */
- function setCurrentDate() {
-
- var sNode = "/root/init/calendar/weeklist/list";
- var curDate = getCurrentDate().substr(6,2); //오늘날짜
- var curWeek = getCurrentDate().toDate().getDayOfWeek("E").toLowerCase(); //오늘 요일
-
- //-----------------
- switch (curWeek) {
- case "sun" : model.makeValue("/root/init/grdcellcolor/calcol", 0);
- break;
- case "mon" : model.makeValue("/root/init/grdcellcolor/calcol", 1);
- break;
- case "tue" : model.makeValue("/root/init/grdcellcolor/calcol", 2);
- break;
- case "wed" : model.makeValue("/root/init/grdcellcolor/calcol", 3);
- break;
- case "thu" : model.makeValue("/root/init/grdcellcolor/calcol", 4);
- break;
- case "fri" : model.makeValue("/root/init/grdcellcolor/calcol", 5);
- break;
- case "sat" : model.makeValue("/root/init/grdcellcolor/calcol", 6);
- break;
- }
-
- //-------------------------------------------------------
- for (var iNo=0 ; iNo <= getNodesetCount(sNode); iNo++ ) {
- if (model.getValue(sNode+"["+iNo+"]/"+curWeek) == curDate ) {
- model.makeValue("/root/init/grdcellcolor/calrow", iNo);
- }
- }
-
- //-------------------------
- setCellColor(grd_calendar);
- }
-
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 달력의 값 입력 , 수정, 삭제 Function
- */
- function getRsrvPossTm(gridObj) {
-
- var calRow = model.getValue("/root/init/grdcellcolor/calrow");
- var calCol = model.getValue("/root/init/grdcellcolor/calcol");
-
- //----------------
- if ( calCol >= 7 ) {
- calCol -= 7;
- }
-
- var yyyy = model.getValue("/root/init/calendar/year");
- var mm = model.getValue("/root/init/calendar/month");
- var dd = model.getValue("/root/init/calendar/weeklist/list[" + calRow + "]/" + gridObj.colAttribute(calCol, "ref"));
-
- //-----------------------------
- if (getStringLength(dd) == 1) {
- dd = "0" + dd;
- }
-
- //------------------------------------------------
- model.makeValue("/root/send/cal", yyyy + mm + dd);
- }
-
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드에 있는 값 달력에 뿌려주는 Function
- */
- function fSelectGoodCdList() {
-
- var iBfVol = 0;
- var iPrestQty = 0;
- var sGoodNode = "/root/main/goodcd/goodcdlist";
- var setRow = grd_goodlist.row;
-
-
- //------------------------------------------------------------------------
- if (model.getValue(sGoodNode+"["+ grd_goodlist.row +"]/choi") == "true") {
- model.setValue("/root/init/mlist/prest", Number(model.getValue(sGoodNode+"["+grd_goodlist.row+"]/stocqty"))
- * Number(model.getValue(sGoodNode+"["+grd_goodlist.row+"]/tqty")));
-
- //--------------------------------
- model.removeNodeset("/root/send");
- model.makeValue("/root/send/goodcd", model.getValue(sGoodNode+"["+ grd_goodlist.row +"]/goodcd"));
- model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
- model.makeValue("/root/send/posdeptcd", model.getValue("/root/init/deptinfo/cd"));
- model.makeValue("/root/send/dutdeptcd", model.getValue("/root/init/appdeptcd"));
- model.makeValue("/root/send/lotno", model.getValue(sGoodNode+"["+ grd_goodlist.row +"]/lotno"));
- model.makeValue("/root/send/bfvol", model.getValue("/root/init/bfvol"));
- model.makeValue("/root/send/stocym", model.getValue("/root/init/calendar/year")+model.getValue("/root/init/calendar/month"));
-
- //--------------------------------
- // 현재달의 사용량과 입고량을 조회
- submit("TRLAW00402");
-
- //------------------------------------------------------------------------------------------------------
- if (model.getValue("/root/init/mlist/enddd") == "" || model.getValue("/root/init/mlist/enddd") == "-") {
- btn_qtycncl.disabled = true;
- } else {
- btn_qtycncl.disabled = false;
- }
-
- //-----------------------------------------------------------------------------
- iPrestQty = Number(model.getValue(sGoodNode+"["+grd_goodlist.row+"]/stocqty"))
- * Number(model.getValue(sGoodNode+"["+grd_goodlist.row+"]/tqty"));
- iBfVol = Number(model.getValue("/root/init/mlist/winqty")) - iPrestQty;
-
- model.makeValue("/root/init/bfvol", iBfVol);
- model.makeValue("/root/init/mlist/prest", Number(model.getValue(sGoodNode+"["+grd_goodlist.row+"]/stocqty"))
- * Number(model.getValue(sGoodNode+"["+grd_goodlist.row+"]/tqty")));
- }
-
- //--------------------------
- // 체크 된것 외 체크 false로
- for (var iRow=1; iRow <= getNodesetCount(sGoodNode); iRow++) {
- if (model.getValue(sGoodNode+"["+iRow+"]/choi") == "true") {
- if(setRow != iRow) {
- model.setValue(sGoodNode+"["+iRow+"]/choi", "false");
- }
- }
- }
-
- //------------
- // 달력 초기화
- fExeCalValueInit();
-
- //-----------------------------------------
- model.removeNodeset("/root/main/datalist");
- submit("TRLAW00401"); // grd_data 그리드에 입력
- var isMonth = model.getValue("/root/init/calendar/month");
- var isYear = model.getValue("/root/init/calendar/year");
- var isDate = (isYear+isMonth+1).toDate();
- var startDay = isDate.getDay();
-
- //-------------------------------------------
- for (var iNo=1; iNo < grd_data.rows; iNo++) {
- var dd = model.getValue("/root/main/datalist["+iNo+"]/usedd");
- var _year = dd.substr(0, 4);
- var _month = dd.substr(4, 2);
-
- // if ( _year != isYear || _month != isMonth) continue;
-
- var colidx = dd.toDate().getDay();
- var rowidx = Math.ceil( ( startDay + Number(dd.substr(6,2)) ) / 7 );
- grd_calendar.valueMatrix(rowidx, colidx+7) = model.getValue("/root/main/datalist["+iNo+"]/useqty");
- }
- //--------------
- model.refresh();
- }
-
- //--------------
- // 달력값 초기화
- function fExeCalValueInit() {
-
- var sCalNode = "/root/init/calendar/weeklist/list";
-
- //--------------------------------------------------------
- for (var iRo=1; iRo <= getNodesetCount(sCalNode); iRo++) {
- model.makeValue(sCalNode+"["+iRo+"]/sun_memo", "");
- model.makeValue(sCalNode+"["+iRo+"]/mon_memo", "");
- model.makeValue(sCalNode+"["+iRo+"]/tue_memo", "");
- model.makeValue(sCalNode+"["+iRo+"]/wed_memo", "");
- model.makeValue(sCalNode+"["+iRo+"]/thu_memo", "");
- model.makeValue(sCalNode+"["+iRo+"]/fri_memo", "");
- model.makeValue(sCalNode+"["+iRo+"]/sat_memo", "");
- }
-
- //---------------------
- grd_calendar.refresh();
- }
-
- //------------
- // 달력 초기화
- function initCalendar() {
-
- var curDate = getCurrentDate().toDate();
-
- model.makeValue("/root/init/calendar/year", curDate.getDateFormat('YYYY'));
- model.makeValue("/root/init/calendar/month", curDate.getDateFormat('MM'));
- model.refresh();
- //-------------------
- setCalendar(curDate);
- }
-
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 달력 초기화 Function
- */
- function setCalendar(dateObj) {
-
- // 그리드 초기화
- model.removeNodeset("/root/init/calendar/weeklist/list");
- //grd_calendar.rebuild()
-
- dateObj.setDate(1);
- var startDay = dateObj.getDay();
- var days = dateObj.getMonthDay();
-
- var rows = Math.ceil( ( startDay + days ) / 7 );
- for( var i = 0; i < rows; i++ )
- grd_calendar.addRow(false);
-
- grd_calendar.rebuild();
- var rowIndex = grd_calendar.fixedRows;
- var colIndex = startDay;
- for( var i = 1; i <= days; i++ ) {
- grd_calendar.valueMatrix(rowIndex, colIndex) = i;
- colIndex++;
- if( colIndex == 7 ) {
- colIndex = 0;
- rowIndex++;
- }
- }
- }
-
- //----------------------
- // 그리드 달력의 색 변경
- function setCellColor(gridObj) {
-
- var calRow = 0;
- var calCol = 0;
-
- //----------------------------------------------------------------
- calRow = Number(model.getValue("/root/init/grdcellcolor/calrow"));
- calCol = Number(model.getValue("/root/init/grdcellcolor/calcol"));
-
- //---------------------
- gridObj.rebuildStyle();
- gridObj.cellStyle("background-color", calRow, calCol) = "#daa7d9";
-
- //--------------
- if ( calCol < 7 ) {
- calCol += 7;
- } else {
- calCol -= 7;
- }
-
- //----------------------------------------------------------------
- gridObj.cellStyle("background-color", calRow, calCol) = "#daa7d9";
- }
-
- /* @group : 물품T사용
- * @ver : 2007.10.13 (CMCDEV-0001)
- * @by : 한음미
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 물품코드 목록 가져오는 Function
- */
- function fGetSelectDeptCd() {
- fGetGoodCodeSubList(); // import한 화면
- }
-
- /* @group : 물품입고
- * @ver : 2007.02.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 Mouse Down처리 Function
- */
- function fExeMouseDown() {
-
- //-----------------------------------------
- // 마우스 오른쪽 버튼클릭 검사(1:왼쪽, 3:우측)
- // grd_winapplist.mouseRow : 클릭 로우
- // grd_winapplist.fixedrows : 고정 로우 수
- if(event.button == 3){
- if(grd_winapplist.isCell(event.target) && grd_winapplist.mouseRow >= grd_winapplist.fixedrows){
- window.setPopupMenu(true, "/root/init/popupmenu/item", "name", "func", false);
- }else{
- window.setPopupMenu(false);
- }
- }
- }
-
-
- /* @group : 물품입고
- * @ver : 2007.02.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 행 추가 Function
- */
- function fExeInsertRow() {
- grd_winapplist.insertRow(grd_winapplist.row, true);
- }
-
- /* @group : 물품입고
- * @ver : 2007.02.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 행 삭제 Function
- */
- function fExeDeleteRow() {
- grd_winapplist.deleteRow(grd_winapplist.row, true);
- }
-
-
- /* @group : 물품입고
- * @ver : 2007.02.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 포커스 아웃 Function
- */
- function fExeFocusOut() {
- window.setPopupMenu(false);
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.14 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 클릭 Function
- */
- function fExeGridClick() {
-
- if (grd_calendar.isCell(event.target) && grd_calendar.row >= grd_calendar.fixedRows) {
- model.makeValue("/root/init/grdcellcolor/calrow", grd_calendar.row);
- model.makeValue("/root/init/grdcellcolor/calcol", grd_calendar.col);
-
- //-------------------------
- setCellColor(grd_calendar);
- getRsrvPossTm(grd_calendar);
- }
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.14 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드의 Row, Col변경 처리 Function
- */
- function fExeRowColChange(pFlagCd) {
-
- //----------------------------------------------------------------
- model.setValue("/root/init/grdcellcolor/calrow",grd_calendar.row);
- model.setValue("/root/init/grdcellcolor/calcol",grd_calendar.col);
-
- //-------------------------
- setCellColor(grd_calendar);
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.14 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드의 Test별 사용량 변경시 처리 Function
- */
- function fExeTUseChange() {
-
- var iRowNo = 0;
- var sColNm1 = "";
- var sColNm2 = "";
- var iUseQty = 0;
- var iBackUseQty = 0;
- var iPrestQty = 0;
- var objNode = null;
- var sUseDD = "";
- var sCurDY = "";
-
- var aDay = new Array ("", "", "", "", "", "", "", "sun", "mon", "tue", "wed", "thu", "fri", "sat");
- //-------------------------------------------------------------------------------------------------
- sColNm1 = "/root/init/calendar/weeklist/list["+grd_calendar.row+"]" + "/" + aDay[grd_calendar.col];
- sColNm2 = "/root/init/calendar/weeklist/list["+grd_calendar.row+"]" + "/" + aDay[grd_calendar.col] + "_memo";
-
- //----------------------------------
- if (model.getValue(sColNm1) == "") {
- model.setValue(sColNm2, "");
- return false;
-
- } else if (model.getValue("/root/init/bfvol") == "") {
- messageBox("물품을 선택하지 않았습니다! ", "I007");
- model.setValue(sColNm2, "");
- return false;
- }
- //-------------------------------
- sCurDY = model.getValue(sColNm1);
- sCurDY = sCurDY.getLeftPad(2, "0");
-
- //---------
- iRowNo = 0;
- sUseDD = model.getValue("/root/init/calendar/year")+model.getValue("/root/init/calendar/month")+sCurDY;
- //---------------------------------------------------------------------
- for (var iNo=1; iNo <= getNodesetCount("/root/main/datalist"); iNo++) {
- if (model.getValue("/root/main/datalist["+iNo+"]/usedd") == sUseDD) {
- iRowNo = iNo;
- break;
- }
- }
-
- //----------------
- if (iRowNo <= 0) {
- iBackUseQty = 0;
- } else {
- iBackUseQty = Number(model.getValue("/root/main/datalist["+iRowNo+"]/backuseqty"));
- }
-
-
- //------------------------------------------
- iUseQty = Number(model.getValue(sColNm2));
- iPrestQty = Number(model.getValue("/root/init/mlist/prest")) + iBackUseQty - iUseQty;
-
- //----------------------------------------
- // 입력된 일자에 해당하는 사용량 노드 생성
- fExeMakeUseNode(model.getValue("/root/init/calendar/year"), model.getValue("/root/init/calendar/month"),
- sCurDY, model.getValue(sColNm2));
-
- //---------------------------------------------------
- model.makeValue("/root/init/mlist/prest", iPrestQty);
- model.refresh();
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 일자별 입력된 사용량의 노드생성 처리 Function
- */
- function fExeMakeUseNode(pYear, pMonth, pDay, pUseQty) {
-
- var iRowNo = 0;
- var iFindNo = 0;
- var iUseQty = 0;
- var objNode = null;
- var bStatus = false;
- var sNode = "/root/main/datalist";
-
- //-------------------------------------------------------
- iFindNo = grd_goodlist.findRow("true", 1, 1, true, true);
- if (Number(iFindNo) <= 0) {
- messageBox("물품이 선택되지 않았습니다! ", "I007");
- return false;
- }
-
- //------------------------------------------
- if (pUseQty == "" || Number(pUseQty) == 0) {
- iUseQty = 0;
- }
-
- //---------
- iRowNo = 1;
- bStatus = false;
- for (var iNo=1; iNo <= getNodesetCount(sNode); iNo++) {
- if (model.getValue(sNode+"["+iNo+"]/usedd") == (pYear+pMonth+pDay)) {
- iRowNo = iNo;
- bStatus = true;
- break;
- }
- }
-
- //------------
- if (!bStatus) {
- iRowNo = Number(getNodesetCount(sNode)) + 1;
- model.makeValue(sNode+"["+iRowNo+"]/bfuseqty", "0");
- model.makeValue(sNode+"["+iRowNo+"]/usedd", pYear+pMonth+pDay);
- model.makeValue(sNode+"["+iRowNo+"]/usedg", "0");
- }
-
- //--------------------------------------------------------
- model.makeValue(sNode+"["+iRowNo+"]/useqty", pUseQty);
- model.makeValue(sNode+"["+iRowNo+"]/backuseqty", pUseQty);
- model.makeValue(sNode+"["+iRowNo+"]/cncldd", "-");
- model.makeValue(sNode+"["+iRowNo+"]/cncltm", "-");
- model.makeValue(sNode+"["+iRowNo+"]/cnclid", "-");
- model.makeValue(sNode+"["+iRowNo+"]/dutdeptcd", model.getValue("/root/init/appdeptcd"));
- model.makeValue(sNode+"["+iRowNo+"]/posdeptcd", model.getValue("/root/init/deptinfo/cd"));
- model.makeValue(sNode+"["+iRowNo+"]/instcd", getUserInfo("dutplceinstcd"));
- model.makeValue(sNode+"["+iRowNo+"]/unitcost", model.getValue("/root/main/goodcd/goodcdlist["+iFindNo+"]/unitcost"));
- model.makeValue(sNode+"["+iRowNo+"]/lotno", model.getValue("/root/main/goodcd/goodcdlist["+iFindNo+"]/lotno"));
- model.makeValue(sNode+"["+iRowNo+"]/goodcd", model.getValue("/root/main/goodcd/goodcdlist["+iFindNo+"]/goodcd"));
-
- //-----------------
- grd_data.refresh();
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 다음년도 버튼 클릭 처리 Function
- */
- function fExeNextYear() {
-
- var isMonth = model.getValue("/root/init/calendar/month");
- var isYear = model.getValue("/root/init/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(1,'Y');
- model.setValue("/root/init/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/init/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
- //------------------
- setCalendar(isDate);
- fSelectGoodCdList(); // 사용내역 조회
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 다음달 버튼 클릭 처리 Function
- */
- function fExeNextMonth() {
-
- var isMonth = model.getValue("/root/init/calendar/month");
- var isYear = model.getValue("/root/init/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(1,'M');
- model.setValue("/root/init/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/init/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
- //------------------
- setCalendar(isDate);
- fSelectGoodCdList(); // 사용내역 조회
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 이전달 버튼 클릭 처리 Function
- */
- function fExeBfMonth() {
-
- var isMonth = model.getValue("/root/init/calendar/month");
- var isYear = model.getValue("/root/init/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(-1,'M');
- model.setValue("/root/init/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/init/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
- //------------------
- setCalendar(isDate);
- fSelectGoodCdList(); // 사용내역 조회
- }
-
- /* @group : 물품입고
- * @ver : 2008.05.15 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : 이전년도 버튼 클릭 처리 Function
- */
- function fExeBfNext() {
-
- var isMonth = model.getValue("/root/init/calendar/month");
- var isYear = model.getValue("/root/init/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(-1,'Y');
- model.setValue("/root/init/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/init/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
- //------------------
- setCalendar(isDate);
- fSelectGoodCdList(); // 사용내역 조회
- }
-
- //------------------------------
- // Test별 사용량을 사용량에 적용
- function fExeUseQty(pAppFlagCd, pMFlagCd) {
-
- var bState = false;
- var sNode = "/root/init/calendar/weeklist/list";
- var sDescNode = "/root/main/datalist";
- var sGoodNode = "/root/main/goodcd/goodcdlist";
- var setRow = grd_goodlist.row;
-
- //-----------------------------------------------------
- for (var iNo=1; iNo <= getNodesetCount(sNode); iNo++) {
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/sum_memo") != "") {
- bState = true;
- break;
- }
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/mon_memo") != "") {
- bState = true;
- break;
- }
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/tue_memo") != "") {
- bState = true;
- break;
- }
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/wed_memo") != "") {
- bState = true;
- break;
- }
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/thu_memo") != "") {
- bState = true;
- break;
- }
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/fri_memo") != "") {
- bState = true;
- break;
- }
-
- //-----------------------------------------------------
- if (model.getValue(sNode+"["+iNo+"]/sat_memo") != "") {
- bState = true;
- break;
- }
- }
-
- //------------
- if (!bState) {
- messageBox("적용할 수량이 없습니다!", "I007");
- return false;
- }
-
-
- //-------------------
- // Test별 사용량 등록
- if (pAppFlagCd == "0") fSaveGoodCount(pAppFlagCd);
-
- //---------------------------------
- // 현재의 입력된 사용량을 먼저 등록
- model.removeNodeset("/root/send");
- model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
- model.makeValue("/root/send/posdeptcd", model.getValue(sGoodNode+"["+setRow+"]/posdeptcd"));
- model.makeValue("/root/send/dutdeptcd", model.getValue(sGoodNode+"["+setRow+"]/dutdeptcd"));
- model.makeValue("/root/send/goodcd", model.getValue(sGoodNode+"["+setRow+"]/goodcd"));
- model.makeValue("/root/send/lotno", model.getValue(sGoodNode+"["+setRow+"]/lotno"));
- model.makeValue("/root/send/unitcost", model.getValue(sGoodNode+"["+setRow+"]/unitcost"));
- model.makeValue("/root/send/appflagcd", pAppFlagCd); // 0:적용, 1:적용취소, 3:적용수정
- model.makeValue("/root/send/bfenddd", model.getValue("/root/init/mlist/enddd"));
- model.makeValue("/root/send/usedg", model.getValue("/root/init/mlist/usedg"));
- model.makeValue("/root/send/enddd", model.getValue("/root/init/enddd"));
- model.makeValue("/root/send/useflagcd", "0"); // 0:사용량, 1:Test별 사용량
- model.makeValue("/root/send/m", pMFlagCd);
-
- //---------------------------------------------------
- if (model.getValue("/root/init/mlist/enddd") == "" || model.getValue("/root/init/mlist/enddd") == "-") setAlertOn();
- if (submit("TXLAW00402")) {
- }
- }
-
- /* @group : 물품 Test별 사용량
- * @ver : 2008.09.16 (CMCDEV-0001)
- * @by : 유동철(ACK)
- * @-----------------------------------
- * @type : function
- * @access : public
- * @desc : Test별 사용량 일괄 등록 처리 Function
- */
- function fExeTestUseQtyApp() {
-
- var sMsg = "오늘 일자의 이전에 적용된 Test별 수량이 삭제된 후 재 계산됩니다.";
- sMsg += "\n" + "재 계산을 ";
-
- //------------------------------------
- var iYesNo = messageBox(sMsg, "Q004");
- if (iYesNo == 6) {
- model.removeNodeset("/root/send");
- model.makeValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
- model.makeValue("/root/send/posdeptcd", model.getValue("/root/init/deptinfo/cd"));
- model.makeValue("/root/send/dutdeptcd", model.getValue("/root/init/appdeptcd"));
-
- setAlertOn();
- submit("TXLAW00403");
- }
- }
-
- function fExeChoiTrue(pFlagCd) {
- fSelectGoodCdList();
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body guideline="1,1194;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
- <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:800px; height:14px; ">Test별 물품사용관리</caption>
- </group>
- <group id="grp_biz" scroll="auto" style="left:0px; top:25px; width:1195px; height:744px; ">
- <group id="group2" style="left:0px; top:15px; width:1194px; height:35px; vertical-align:top; ">
- <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1194; height:35; "/>
- <line id="line1" class="line_4" style="x1:1107px; y1:7px; x2:1107px; y2:29; "/>
- <caption id="caption26" class="search_name" style="left:859px; top:9px; width:86px; height:17px; ">검색부서 :</caption>
- <select1 id="cmb_seadept" ref="/root/init/appdeptcd" class="combo_search" navindex="3" appearance="minimal" style="left:951px; top:8px; width:140px; height:19px; ">
- <choices>
- <itemset nodeset="/root/init/dutdept/appdeptcd">
- <label ref="nm"/>
- <value ref="cd"/>
- </itemset>
- </choices>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- fGetSelectDeptCd();
- ]]>
- </script>
- </select1>
- </group>
- <line id="line2" class="line_1" style="x1:310px; y1:75px; x2:1194px; y2:75px; "/>
- <caption id="caption5" class="tit_2" style="left:310px; top:60px; width:144px; height:13px; ">물품사용내역</caption>
- <caption id="caption4" class="cell_1" style="left:310px; top:80px; width:90px; height:23px; vertical-align:middle; ">이 월 량</caption>
- <output id="output1" ref="/root/init/bfvol" class="output_fix" format="(-)#,###" style="left:403px; top:81px; width:200px; height:19px; text-align:right; "/>
- <caption id="caption2" class="cell_1" style="left:606px; top:80px; width:90px; height:23px; vertical-align:middle; ">입 고 량</caption>
- <output id="output2" ref="/root/init/mlist/winqty" class="output_fix" format="(-)#,###" style="left:699px; top:81px; width:200px; height:19px; text-align:right; "/>
- <caption id="caption3" class="cell_1" style="left:902px; top:80px; width:90px; height:23px; vertical-align:middle; ">현 재 고</caption>
- <output id="output3" ref="/root/init/mlist/prest" class="output_fix" format="(-)#,###" style="left:995px; top:81px; width:200px; height:19px; text-align:right; "/>
- <line id="line6" class="line_3" style="x1:310px; y1:102px; x2:1194px; y2:102px; "/>
- <import id="import1" src="SSLAW00100_물품목록.xrw" instancetype="merge" ref="/root/main/goodcd/goodcdlist" style="left:5px; top:55px; width:300px; height:688px; ">
- </import>
- <group id="grp_calendar" style="left:310px; top:106px; width:884px; height:40px; ">
- <shape id="rectangle1" class="calendar_header" appearance="rectangle" style="left:0px; top:0px; width:884; height:40px; "/>
- <output id="opt_year" ref="/root/init/calendar/year" class="calendar_output" style="left:390px; top:9px; width:30px; height:19px; "/>
- <output id="opt_month" ref="/root/init/calendar/month" class="calendar_output" style="left:440px; top:9px; width:30px; height:19px; "/>
- <caption id="caption1" class="calendar_output" style="left:420px; top:9px; width:20px; height:19px; ">년</caption>
- <caption id="caption7" class="calendar_output" style="left:470px; top:9px; width:20px; height:19px; ">월</caption>
- <button id="btn_bfyear" class="icon_pre_year" style="left:345px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fExeBfNext();
- ]]>
- </script>
- </button>
- <button id="btn_bfmonth" class="icon_pre_month" style="left:364px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fExeBfMonth();
- ]]>
- </script>
- </button>
- <button id="btn_nextmonth" class="icon_next_month" style="left:501px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fExeNextMonth();
- ]]>
- </script>
- </button>
- <button id="btn_nextyear" class="icon_next_year" style="left:520px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fExeNextYear();
- ]]>
- </script>
- </button>
- </group>
- <multilinegrid id="grd_calendar" nodeset="/root/init/calendar/weeklist/list" class="gridcalendar" caption="일^월^화^수^목^금^토" colsep="^" colwidth="126, 126, 126, 126, 126, 126, 126" dataheight="48" extendlastcol="noscroll" rowsep="|" selectionmode="free" mergecellsfixedrows="bycolrec" style="left:310px; top:140px; width:884px; height:590px; ">
- <row>
- <col class="color_sun" ref="sun" style="border-bottom-width:0px; "/>
- <col ref="mon" style="border-bottom-width:0px; "/>
- <col ref="tue" style="border-bottom-width:0px; "/>
- <col ref="wed" style="border-bottom-width:0px; "/>
- <col ref="thu" style="border-bottom-width:0px; "/>
- <col ref="fri" style="border-bottom-width:0px; "/>
- <col class="color_sat" ref="sat" style="border-bottom-width:0px; "/>
- </row>
- <row>
- <col ref="sun_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- <col ref="mon_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- <col ref="tue_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- <col ref="wed_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- <col ref="thu_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- <col ref="fri_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- <col ref="sat_memo" type="input" format="(-)#,###" mask="exclude" maxlength="6" showmask="true" style="border-top-width:0px; "/>
- </row>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- fExeGridClick();
- ]]>
- </script>
- <script type="javascript" ev:event="onrowchanged">
- <![CDATA[
- fExeRowColChange("R");
- ]]>
- </script>
- <script type="javascript" ev:event="oncolchanged">
- <![CDATA[
- fExeRowColChange("C");
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- fExeTUseChange();
- ]]>
- </script>
- </multilinegrid>
- <datagrid id="grd_data" nodeset="/root/main/datalist" visibility="hidden" caption="일자(dd)^물품코드^사용량^차수^취소일자^취소시간^취소자^lot번호^부서^단가^bfuseqty^instcd^posdeptcd" colsep="^" colwidth="100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100" mergecellsfixedrows="bycolrec" rowsep="|" fixed.background-image="../../../com/commonweb/images/grid_bg.gif" style="left:320px; top:360px; width:860px; height:170px; ">
- <col ref="usedd"/>
- <col ref="goodcd"/>
- <col ref="useqty"/>
- <col ref="usedg"/>
- <col ref="cncldd"/>
- <col ref="cncltm"/>
- <col ref="cnclid"/>
- <col ref="lotno"/>
- <col ref="dutdeptcd"/>
- <col ref="unitcost"/>
- <col ref="bfuseqty"/>
- <col ref="instcd"/>
- <col ref="posdeptcd"/>
- </datagrid>
- <input id="ipt_bfenddd" ref="/root/init/mlist/enddd" format="yyyy-mm-dd" mask="exclude" showmask="true" style="left:976px; top:55px; width:80px; height:19px; "/>
- <caption id="caption8" style="left:910px; top:58px; width:65px; height:15px; ">최근적용일</caption>
- <caption id="caption9" style="left:1061px; top:58px; width:40px; height:15px; ">적용일</caption>
- <input id="ipt_enddd" ref="/root/init/enddd" disabled="true" editable="false" inputtype="date" format="yyyy-mm-dd" mask="exclude" showmask="true" style="left:1103px; top:55px; width:90px; height:19px; "/>
- </group>
- <group id="grp_btn" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
- <line id="line32" class="line_6" style="x1:0px; y1:25; x2:1194px; y2:25; "/>
- <button id="btn_save" class="btn4_letter2" navindex="6" style="left:1135px; top:3; width:56px; height:22px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fSaveGoodCount("S");
- ]]>
- </script>
- </button>
- <button id="btn_qtysave" class="btn4_letter2" navindex="6" style="left:993px; top:3; width:56px; height:22px; ">
- <caption>적용</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- if (model.getValue("/root/init/mlist/enddd") == "" || model.getValue("/root/init/mlist/enddd") == "-") {
- fExeUseQty("0", "i");
- } else {
- fExeUseQty("1", "d");
- fExeUseQty("0", "i");
- }
- ]]>
- </script>
- </button>
- <button id="btn_qtycncl" class="btn4_letter4" navindex="6" style="left:1052px; top:3; width:80px; height:22px; ">
- <caption>적용취소</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fExeUseQty("1", "d");
- ]]>
- </script>
- </button>
- <button id="btn_testuse" class="btn4_letter8" navindex="6" style="left:0; top:3; width:56px; height:22px; ">
- <caption>Test별 수량적용</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- fExeTestUseQtyApp();
- ]]>
- </script>
- </button>
- </group>
- </xhtml:body>
- </xhtml:html>
|