init
This commit is contained in:
@@ -0,0 +1,297 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript" >
|
||||
var url ='<c:url value="/onl/statistics/statisticinfo/osidInstiStatisticMan.json" />';
|
||||
var url_view ='<c:url value="/onl/statistics/statisticinfo/osidInstiStatisticMan.view" />';
|
||||
var url_excel ='<c:url value="/onl/statistics/statisticinfo/osidInstiStatisticMan.excel" />';
|
||||
|
||||
var serverType = window.dialogArguments["serverType"];
|
||||
var eaiSevrDstcd = window.dialogArguments["eaiSevrDstcd"];
|
||||
|
||||
function dateFormater(cellvalue, options, rowObject){
|
||||
if (cellvalue==null|| cellvalue==undefined) return "";
|
||||
if (cellvalue.trim().length < 8) return "";
|
||||
var display = "";
|
||||
display=display+cellvalue.substr(0,4)+"-";
|
||||
display=display+cellvalue.substr(4,2)+"-";
|
||||
display=display+cellvalue.substr(6,2)+"";
|
||||
return display;
|
||||
}
|
||||
|
||||
function isValid(){
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//대상 그리드 Reload.
|
||||
function gridReload(){
|
||||
|
||||
$("input[name=apCode]").val("");
|
||||
$("input[name=apCodeName]").val("");
|
||||
|
||||
var postData = getSearchForJqgrid("cmd","DETAIL"); //jqgrid에서는 object 로
|
||||
postData["flag"] = "apcode";
|
||||
$("#grid").setGridParam({ postData: postData ,page : "1" }).trigger("reloadGrid");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("input[name=baseYmd]").inputmask("yyyy-mm-dd",{'autoUnmask':true}).val(getToday());
|
||||
|
||||
$('#grid').jqGrid({
|
||||
datatype:"json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData : { cmd : 'DETAIL' , serverType : serverType , sqlValue : eaiSevrDstcd ,flag : 'apcode'
|
||||
},
|
||||
colNames:[
|
||||
'업무구분코드명',
|
||||
'업무구분코드 한글명',
|
||||
'신규등록일'
|
||||
],
|
||||
colModel:[
|
||||
{ name : 'APCODE' , align:'left' ,width:'40px' , key :true },
|
||||
{ name : 'APCODENAME' , align:'left' },
|
||||
{ name : 'BASEYMD' , align:'center' ,width:'50px' ,formatter: dateFormater }
|
||||
],
|
||||
cmTemplate: {
|
||||
sortable: false,
|
||||
},
|
||||
jsonReader: {
|
||||
repeatitems:false
|
||||
},
|
||||
loadError: function (jqXHR, textStatus, errorThrown) {
|
||||
var location ='<%=request.getContextPath()%>/';
|
||||
comloadError(jqXHR, textStatus, errorThrown ,location);
|
||||
|
||||
},
|
||||
gridComplete:function (d){
|
||||
var colModel = $(this).getGridParam("colModel");
|
||||
for(var i = 0 ; i< colModel.length; i++){
|
||||
$(this).setColProp(colModel[i].name, {sortable : false}); //그리드 헤더 화살표 삭제(정렬X)
|
||||
}
|
||||
$("#selectCnt").text(" [ "+$("#grid").getGridParam("reccount") + " 건] ");
|
||||
|
||||
},
|
||||
multiselect:true,
|
||||
multiboxonly: false,
|
||||
rowNum: 10000,
|
||||
height: '550',
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
ondblClickRow: function(rowId) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("#chkCheck").click(function(e){
|
||||
e = e || event;/* get IE event ( not passed ) */
|
||||
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = false;
|
||||
$("input[id*=chkCHK]").prop("checked",$(this).is(":checked"));
|
||||
});
|
||||
|
||||
|
||||
$("#btn_operate").click(function(){
|
||||
|
||||
if (!isValid()){
|
||||
return;
|
||||
}
|
||||
|
||||
if(confirm("등록하시겠습니까?") == false)
|
||||
return ;
|
||||
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
postData.push({ name: "cmd" , value:"TRANSACTION_APCODE"});
|
||||
postData.push({ name: "sqlValue" , value:eaiSevrDstcd});
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
success:function(json){
|
||||
if(json.result == "success"){
|
||||
alert("<%= localeMessage.getString("common.saveMsg") %>");
|
||||
gridReload();
|
||||
|
||||
}else{
|
||||
alert(json.result);
|
||||
}
|
||||
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#btn_delete").click(function(){
|
||||
var params = new Array();
|
||||
var ids = $("#grid").jqGrid('getDataIDs');
|
||||
var chkcnt = 0;
|
||||
|
||||
for(var i=0;i<ids.length;i++){
|
||||
if($("input:checkbox[id='jqg_grid_"+ids[i]+"']").is(":checked")){
|
||||
var rowObject = $("#grid").getRowData(ids[i]);
|
||||
params.push(rowObject);
|
||||
chkcnt++;
|
||||
}
|
||||
}
|
||||
|
||||
if(chkcnt == 0){
|
||||
alert('삭제할 데이터를 선택해 주세요.');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (confirm("삭제하시겠습니까?")==false){
|
||||
return;
|
||||
}
|
||||
|
||||
var postData = [];
|
||||
postData.push({ name: "cmd" , value:"DELETE_APCODE"});
|
||||
postData.push({ name: "eaiSevrDstcd" , value:eaiSevrDstcd});
|
||||
postData.push({ name: "notIn" , value:"Y"});
|
||||
postData.push({ name: "gridData" , value:JSON.stringify(params)});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : url,
|
||||
dataType : "json",
|
||||
data : postData,
|
||||
success : function(json) {
|
||||
if(json.result == "success"){
|
||||
alert("삭제를 완료하였습니다");
|
||||
gridReload();
|
||||
|
||||
}else{
|
||||
alert("복제중 에러가 발생했습니다.");
|
||||
}
|
||||
|
||||
},
|
||||
error : function(e) {
|
||||
alert("error"+e.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#btn_clone").click(function(){
|
||||
var params = new Array();
|
||||
var ids = $("#grid").jqGrid('getDataIDs');
|
||||
var chkcnt = 0;
|
||||
|
||||
for(var i=0;i<ids.length;i++){
|
||||
if($("input:checkbox[id='jqg_grid_"+ids[i]+"']").is(":checked")){
|
||||
var rowObject = $("#grid").getRowData(ids[i]);
|
||||
params.push(rowObject);
|
||||
chkcnt++;
|
||||
}
|
||||
}
|
||||
|
||||
if(chkcnt == 0){
|
||||
alert('블랙리스트에 올릴 데이터를 체크해 주세요.');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (confirm("블랙리스트에 올리시겠습니까?")==false){
|
||||
return;
|
||||
}
|
||||
|
||||
var postData = [];
|
||||
postData.push({ name: "cmd" , value:"TRANSACTION_MOVE_TO_BLACKLIST_APCODE"});
|
||||
postData.push({ name: "eaiSevrDstcd" , value:eaiSevrDstcd});
|
||||
postData.push({ name: "gridData" , value:JSON.stringify(params)});
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : url,
|
||||
dataType : "json",
|
||||
data : postData,
|
||||
success : function(json) {
|
||||
if(json.result == "success"){
|
||||
alert("복제를 완료하였습니다");
|
||||
gridReload();
|
||||
|
||||
}else{
|
||||
alert("에러가 발생했습니다.");
|
||||
}
|
||||
|
||||
},
|
||||
error : function(e) {
|
||||
alert("error"+e.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#btn_excel").click(function(event) {
|
||||
event.stopPropagation(); // Do not propagate the event.
|
||||
// Create an object that will manage to download the file.
|
||||
var target = "excelDown" ; // iframe의 name
|
||||
//(url,cmd,gridObj,formObject,fileName,merge)
|
||||
gridJsonToExcelSubmit2(url_excel,"LIST_GRID_TO_EXCEL",$("#grid"),$("#ajaxForm"),'업무 리스트');
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#btn_close").click(function(){
|
||||
window.returnValue = "ok";
|
||||
window.close();
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup_box">
|
||||
<div class="search_wrap">
|
||||
<img src="<c:url value="/img/btn_clone1.png"/>" alt="" id="btn_clone" level="W" />
|
||||
<img id="btn_excel" src="<c:url value="/img/btn_excel.png"/>" level="W" status="DETAIL"/>
|
||||
<img src="<c:url value="/img/btn_delete.png"/>" alt="" id="btn_delete" level="W" status="DETAIL,NEW"/>
|
||||
<img src="<c:url value="/img/btn_regist.png"/>" alt="" id="btn_operate" level="W" status="DETAIL,NEW" />
|
||||
<img src="<c:url value="/img/btn_close.png"/>" alt="" id="btn_close" level="R" />
|
||||
</div>
|
||||
<div class="title">업무 리스트</div>
|
||||
|
||||
<form id="ajaxForm" onsubmit="return false;">
|
||||
<span>* 신규등록 (업무코드 입력후 [등록]버튼을 클릭해 주세요.)</span>
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:18%;">업무구분코드</th>
|
||||
<td style="width:20%;"><input type="text" name="apCode" maxlength="4"/> </td>
|
||||
<th style="width:30%;">업무구분코드 한글명</th>
|
||||
<td ><input type="text" name="apCodeName" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>신규등록일</th>
|
||||
<td colspan="3"><input type="text" name="baseYmd" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div style="height:20px;" align="right"> <span style="color:blue;" id="selectCnt"></span> </div>
|
||||
<table id="grid" ></table>
|
||||
<div id="pager"></div>
|
||||
|
||||
</div><!-- end.popup_box -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user