351 lines
12 KiB
Plaintext
351 lines
12 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init.jsp" %>
|
|
<%
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String userId = CommonUtils.checkNull(person.getUserId());
|
|
%>
|
|
|
|
<c:set var="isNew" value="false" />
|
|
<c:if test="${'NEW' eq resultMap.actionType}">
|
|
<c:set var="isNew" value="true" />
|
|
</c:if>
|
|
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
</head>
|
|
<script>
|
|
|
|
$(document).ready(function(){
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
$("#btnDelete").click(function(){
|
|
fn_delrow();
|
|
});
|
|
$("#btnAddrow").click(function(){
|
|
fn_addrow();
|
|
});
|
|
$("#btnAdd").click(function(){
|
|
fn_addSchedule();
|
|
});
|
|
|
|
//fnc_setFileDropZone("instructionMngDropZone", "${resultMap.OBJID}", "INSTRUCTION_MNG_FILE", "지시사항 이행관리 첨부파일", "fileAreaDraw",false,null,null);
|
|
//fileAreaDraw();
|
|
|
|
var defaultOptions = []; //[{"CODE_ID":'',"CODE_NAME":"선택"}];
|
|
//_USER_LIST = defaultOptions.concat(fnc_getJsonAllDataListBySqlId({"sqlId":"common.getCusProjectNoList"}));
|
|
_USER_LIST = fnc_getUserDataList();
|
|
|
|
/*
|
|
fnc_getDeptListAppend("MEASURE_DEPT", "${resultMap.MEASURE_DEPT}");
|
|
fnc_getDeptListAppend("MEASURE_DEPT1", "${resultMap.MEASURE_DEPT1}");
|
|
fnc_getDeptListAppend("MEASURE_DEPT2", "${resultMap.MEASURE_DEPT2}");
|
|
fnc_getDeptListAppend("MEASURE_DEPT3", "${resultMap.MEASURE_DEPT3}");
|
|
fnc_getDeptListAppend("MEASURE_DEPT4", "${resultMap.MEASURE_DEPT4}");
|
|
*/
|
|
fnc_getCodeListAppend("<%=Constants.DIVISION_CODE%>","DIVISION","${resultMap.DIVISION}");
|
|
fnc_getCodeListAppend("<%=Constants.CLASS_CODE%>","CLASS","${resultMap.CLASS}");
|
|
//fnc_getUserList2("USER_IDS","${resultMap.USER_IDS}");
|
|
|
|
var USER_IDS = fnc_checkNull("${resultMap.USER_IDS}");
|
|
//alert(USER_IDS);
|
|
var USER_IDSArr = USER_IDS.split(",");
|
|
if(fnc_isNotEmpty(USER_IDSArr)){
|
|
for(var i=0;i<USER_IDSArr.length;i++){
|
|
// 이스케이프 처리된 값
|
|
var escapedValue = CSS.escape(USER_IDSArr[i]);
|
|
if($("#V_USER_IDS option[value="+escapedValue+"]")) $("#V_USER_IDS option[value="+escapedValue+"]").attr("selected",true);
|
|
}
|
|
$('.select2').select2();
|
|
}
|
|
|
|
var OBJID = '${resultMap.OBJID}';
|
|
//if(fnc_isEmpty(OBJID)){
|
|
if(${isNew}){
|
|
var today = new Date();
|
|
var year = today.getFullYear();
|
|
var month = today.getMonth() + 1;
|
|
var day = today.getDate();
|
|
$("#YEAR_MONTH_WEEK").val(year+'년 ' + month+'월 ' + 'X주차');
|
|
$("#YEAR_MONTH_WEEK").focus();
|
|
}
|
|
|
|
fnc_datepick();
|
|
$('.select2').select2();
|
|
fn_search();
|
|
|
|
/*
|
|
*/
|
|
setTimeout(() => fnc_reCalculateContentHeight('gridDiv',98), 50); //118 paging
|
|
|
|
});
|
|
|
|
</script>
|
|
<script>
|
|
|
|
|
|
var _editable = true;
|
|
var modifiedRows = [];
|
|
var newAddRows = [];
|
|
var _USER_LIST;
|
|
|
|
function editCheck (cell) {
|
|
//var isEditable = (_idx%2 == 0);
|
|
<c:if test="${isNew or resultMap.STATUS eq 'create'}">
|
|
return true;
|
|
</c:if>
|
|
<c:if test="${resultMap.STATUS eq 'complete'}">
|
|
return false
|
|
</c:if>
|
|
}
|
|
function editCheck2 (cell) {
|
|
//var isEditable = (_idx%2 == 0);
|
|
<c:if test="${isNew or resultMap.STATUS eq 'create'}">
|
|
return true;
|
|
</c:if>
|
|
<c:if test="${resultMap.STATUS eq 'release'}"> //complete
|
|
return cell.getData().MEASURE_USER_ID == '${connectUserId}';
|
|
</c:if>
|
|
}
|
|
|
|
function fn_addrow() {
|
|
var isNewObjId = true;
|
|
fnc_tabul_addrow(_tabul_layout_fitDataStretch, _tabulGrid, isNewObjId, 'OBJID');
|
|
}
|
|
function fn_delrow() {
|
|
fnc_tabul_delrow(_tabul_layout_fitDataStretch, _tabulGrid, false);
|
|
}
|
|
|
|
function fn_save(){
|
|
|
|
if(fnc_validate('form1')){
|
|
|
|
var selected = $('#V_USER_IDS').val();
|
|
//alert(selected);
|
|
$('#USER_IDS').val(selected);
|
|
/*
|
|
var selected = $("#V_USER_IDS :selected").map((_, e) => e.value).get();
|
|
//alert(selected);
|
|
|
|
var select_button_value = $('#V_USER_IDS option:selected').toArray().map(item => item.value).join();
|
|
alert(select_button_value);
|
|
|
|
var select_button_text = $('#V_USER_IDS option:selected').toArray().map(item => item.text).join();
|
|
alert(select_button_text);
|
|
return;
|
|
*/
|
|
|
|
var data = _tabulGrid.getData();
|
|
if(data.length < 1){
|
|
Swal.fire('지시사항 미입력').then((result) => {fn_addrow();});;
|
|
return;
|
|
}
|
|
var headerTitles = ['지시사항','조치자','조치예정일','이행관리','조치일','첨부파일'];
|
|
var headerFileds = ['CONTENTS','MEASURE_USER_ID','MEASURE_PLAN_DATE','CONTENTS_IMPLEMENT','MEASURE_DATE','FILE_CNT'];
|
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
//console.log(data[i]);
|
|
for (var j = 0; j < headerFileds.length-3; j++){
|
|
if (fnc_isEmpty(data[i][headerFileds[j]])){
|
|
//if (fnc_isEmpty(data[i]['CONTENTS'])){
|
|
Swal.fire(headerTitles[j]+' 미입력');
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
//if(confirm("저장하시겠습니까?")){
|
|
Swal.fire({
|
|
title: '저장 확인',
|
|
text: '해당 내용을 저장하시겠습니까?',
|
|
icon: 'question',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: '저장',
|
|
cancelButtonText: '취소'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
var param = $("#form1").serializeObject();
|
|
param.dataListJson = JSON.stringify(_tabulGrid.getData());
|
|
|
|
$.ajax({
|
|
url:"/dashboard/saveInstructionMng2.do",
|
|
type:"POST",
|
|
data:param,
|
|
//data:$("#form1").serializeObject(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
alert(data.msg);
|
|
opener.fn_search();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//}
|
|
}
|
|
}
|
|
|
|
function fn_search(){
|
|
/*
|
|
var form1 = document.form1;
|
|
form1.action = "/dashboard/instructionMngListPopUp.do";
|
|
form1.submit();
|
|
*/
|
|
|
|
var columns = [
|
|
{headerHozAlign : 'center', hozAlign : 'left', /* width : '300', */ title : '지시사항 ', field : 'CONTENTS'
|
|
,editor:"input", editorParams:{}, editable: editCheck},
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '조치자 ', field : 'MEASURE_USER_ID'
|
|
,editable: editCheck
|
|
,editor: fnc_customSelectEditor
|
|
,formatter:fnc_customSelectFormatter
|
|
,editorParams: {valueId:"CODE", labelId:"NAME", values:_USER_LIST}
|
|
,formatterParams:{valueId:"CODE", labelId:"NAME", values:_USER_LIST} },
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '조치예정일 ', field : 'MEASURE_PLAN_DATE' , editor:"date", editable: editCheck},
|
|
|
|
{headerHozAlign : 'center', hozAlign : 'left', /* width : '300', */ title : '이행관리' , field : 'CONTENTS_IMPLEMENT'
|
|
,editor:"input", editorParams:{}, editable: editCheck2},
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '조치일 ', field : 'MEASURE_DATE' , editor:"date", editable: editCheck2},
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '첨부파일 ', field : 'FILE_CNT', headerSort:false,
|
|
formatter:fnc_subInfoValueFormatter,
|
|
cellClick:function(e, cell){
|
|
var objid = fnc_checkNull(cell.getData().OBJID);
|
|
var docType = 'INSTRUCTION_MNG2_TASK_FILE';
|
|
var docTypeName = 'INSTRUCTION_MNG2_TASK_FILE';
|
|
<c:if test="${isNew or resultMap.STATUS eq 'create'}">
|
|
fnc_fileRegist(objid, docType, docTypeName,"${resultMap.OBJID}", false, 'FILE_CNT', "fnc_tabulCallbackFnc");
|
|
</c:if>
|
|
<c:if test="${resultMap.STATUS eq 'release'}">
|
|
if(cell.getData().MEASURE_USER_ID == '${connectUserId}'){
|
|
fnc_fileRegist(objid, docType, docTypeName,"${resultMap.OBJID}", false, 'FILE_CNT', "fnc_tabulCallbackFnc");
|
|
}else{
|
|
fnc_fileDetailPopup(objid, docType, docTypeName,"${resultMap.OBJID}", false, 'FILE_CNT', "fnc_tabulCallbackFnc");
|
|
}
|
|
</c:if>
|
|
<c:if test="${resultMap.STATUS eq 'complete'}">
|
|
fnc_fileDetailPopup(objid, docType, docTypeName,"${resultMap.OBJID}", false, 'FILE_CNT', "fnc_tabulCallbackFnc");
|
|
</c:if>
|
|
//fnc_fileDetailPopup(objid, docType, docTypeName);
|
|
}
|
|
},
|
|
];
|
|
|
|
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/dashboard/instructionMng2TaskListPaging.do", columns, true);
|
|
|
|
fn_addrow();
|
|
}
|
|
|
|
|
|
</script>
|
|
<style>
|
|
.input_title {border-left:1px solid #ccc;}
|
|
.input_sub_title {border-left:1px solid #ccc;}
|
|
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
|
|
</style>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="USER_IDS" id="USER_IDS" value="${resultMap.USER_IDS}">
|
|
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}">
|
|
<input type="hidden" name="TARGET_OBJID" id="TARGET_OBJID" value="${param.PROJECT_OBJID}">
|
|
<input type="hidden" name="STATUS" id="STATUS" value="${resultMap.STATUS}">
|
|
<section>
|
|
<div class="plm_menu_name_gdnsi" style="display:flex;">
|
|
<h2>
|
|
<span>지시사항 이행관리</span>
|
|
</h2>
|
|
</div>
|
|
<!--
|
|
<div id="plmSearchZon">
|
|
-->
|
|
<div id="businessPopupFormWrap">
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="7%">
|
|
<col width="*">
|
|
<col width="7%">
|
|
<col width="*">
|
|
<col width="7%">
|
|
<col width="*">
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">구분</label>
|
|
</td>
|
|
<td class="input_sub_title" colspan="">
|
|
<select name="DIVISION" id="DIVISION" class="select2" type="select" required reqTitle="구분"></select>
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">분류</label>
|
|
</td>
|
|
<td class="input_sub_title" colspan="">
|
|
<select name="CLASS" id="CLASS" class="select2" type="select" required reqTitle="분류"></select>
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">주차</label>
|
|
</td>
|
|
<td class="input_sub_title" colspan="">
|
|
<input name="YEAR_MONTH_WEEK" id="YEAR_MONTH_WEEK" required reqTitle="주차" value="${resultMap.YEAR_MONTH_WEEK}" style="width:99%"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">참석자</label>
|
|
</td>
|
|
<td class="input_sub_title" colspan="5">
|
|
<select name="V_USER_IDS" id="V_USER_IDS" class="select2" multiple="multiple" type="select" required reqTitle="참석자" data-value="${resultMap.USER_IDS}" >${code_map.USER_IDS}</select>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap">
|
|
<c:if test="${isNew or resultMap.STATUS eq 'create'}">
|
|
<input type="button" value="한줄추가" class="plm_btns" id = "btnAddrow">
|
|
<input type="button" value="한줄삭제" class="plm_btns" id="btnDelete">
|
|
</c:if>
|
|
<c:if test="${isNew or resultMap.STATUS ne 'complete'}">
|
|
<input type="button" value="저장" class="plm_btns" id="btnSave">
|
|
</c:if>
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
<!--
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="한줄추가" id="btnSave" class="plm_btns create">
|
|
<input type="button" value="줄삭제" id="btnClose" class="plm_btns">
|
|
</div>
|
|
<div class="plm_btn_wrap">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns create">
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
-->
|
|
</div>
|
|
|
|
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
|
<!--
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns create">
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
-->
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |