Compare commits

..

39 Commits
dev ... main

Author SHA1 Message Date
Jonguk. Lim 3d4708862f fix: logback log 경로 설정 변경 2 weeks ago
Jonguk. Lim 03b89664f8 fix: logback log 경로 설정 변경 2 weeks ago
Jonguk. Lim 8f4a618045 fix: 폐기결과보고서 출력시 최소유통단위 값 변경
: 최소유통단위 -> 낱개단위수량으로 변경
       (필드명은 유지 하고, 값만 변경)
2 weeks ago
Jonguk. Lim 82acc8f3bf fix: 그리드 항목 순서 및 정렬 조건 fix 2 weeks ago
Jonguk. Lim 78c367a79a doc: 메뉴얼 추가 2 weeks ago
Jonguk. Lim 13b53e7f43 fix: 보고문서관리 필드 및 정렬 조건 fix 2 weeks ago
Jonguk. Lim 3dc2c20df9 fix: 제품조회 팝업 fix
- 시리얼번호 select box css
    - API 업체코드 적용 변경시 시리얼번호 조회하도록 반영
3 weeks ago
Jonguk. Lim 8a00588664 fix: 폐기결과 팝업
-> 폐기구분 활성/비활성 반영
3 weeks ago
이범준 54824cbb52 폐기신청서 접수 상세화면 저장 오류 수정 3 weeks ago
Jonguk. Lim 176e0732cd fix: 폐기보고통계 - 제품 구분별 현황
-> 마약/향정 구분의 기타
     -> 상세 조회 팝업의 SQL 오류 fix
        -> '기타' => IS NULL로 변경
3 weeks ago
Jonguk. Lim 1bb342c2cc feat: 폐기 결과 처리 팝업의 폐기 장소 처리
-> 신규 입력의 경우 기 등록 폐기 장소로 set
3 weeks ago
Jonguk. Lim 8b078e28c7 feat: 업체 및 제품 검색 데이타 NO 추가 3 weeks ago
Jonguk. Lim f03fa678a6 feat: 폐기결과처리시 폐기장소 set 및 조회시 값 set 4 weeks ago
Jonguk. Lim b2f1087cb4 feat: 폐기결과 처리시 기등록 체크에 폐기구분 추가 4 weeks ago
Jonguk. Lim 9359896fc2 feat: 제품검색 팝업 신규 API 적용/미적용 선택 가능하도록 반영 4 weeks ago
Jonguk. Lim 4f7bf7a7af feat: 업체조회 팝업 페이징 적용
업체조회 팝업 조건 유효성 체크 추가
      제품검색 팝업 페이징 적용
      제품조회 팝업 조건 유효성 체크 추가
4 weeks ago
Jonguk. Lim 2b7b836b1f feat: 업체조회 팝업 페이징 적용
업체조회 팝업 조건 유효성 체크 추가
      제품검색 팝업 페이징 적용
      제품조회 팝업 조건 유효성 체크 추가
4 weeks ago
Jonguk. Lim b1995da72e feat: 일련번호 조회(seqinfo_pub) API 적용
제품조회 반영(업체의 제품 조회 되도록)
1 month ago
Jonguk. Lim 98546af7a3 Merge branch 'main' into main-prdAndseq-api-feat
# Conflicts:
#	src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-edit.jsp
#	src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp
1 month ago
이범준 402ae1d68b dataset.onAppend 수정 1 month ago
Jonguk. Lim c47a7c9b1c feat: 일련번호 조회(seqinfo_pub) API 적용
제품조회 반영(업체의 제품 조회 되도록)
1 month ago
Jonguk. Lim 0259c17ea6 Merge branch 'refs/heads/main' into main-prdAndseq-api-feat 1 month ago
이범준 5c2277767d datasetControl.setData 사용오류 수정 1 month ago
Jonguk. Lim 03bb9be2a3 Merge branch 'main' into main-prdAndseq-api-feat 1 month ago
이범준 6ed0433fd0 pom.xml 수정 2 months ago
Jonguk. Lim a11ceea450 feat: 일련번호 조회(seqinfo_pub) API 적용
제품조회 반영(업체의 제품 조회 되도록)
3 months ago
mjkhan21 826a46e603 userControl 소스 동기화 3 months ago
이범준 4a2de2dc73 help함수 추가 3 months ago
이범준 c9e574b178 js파일명 변경 3 months ago
이범준 1abaa3fd35 no message 3 months ago
이범준 7e1985358e 소스 정리 3 months ago
이범준 9f3d65c5c9 날짜 관련 자바스크립트 소스 리팩토링 3 months ago
이범준 20ec29eaef 공통함수, 문자열 관련 자바스크립트 소스 리팩토링 3 months ago
이범준 a089689c9c datepicker 관련 자바스크립트 소스 리팩토링 3 months ago
이범준 e1644c16ff 파일 처리 관련 자바스크립트 소스 리팩토링 3 months ago
이범준 b88495562c 테이블 관련 자바스크립트 소스 리팩토링 3 months ago
Jonguk. Lim c2e1303b97 fix: Nims 폐기보고 확인 fix 3 months ago
Jonguk. Lim d30cddcd3e fix: 신청서접수시 폐기수량 소숫점 입력 가능하도록 반영 3 months ago
Jonguk. Lim 1cc52b6741 fix: 신청서접수시 폐기수량 소숫점 입력 가능하도록 반영 3 months ago

Binary file not shown.

Binary file not shown.

@ -69,13 +69,13 @@
<dependency>
<groupId>cokr.xit.app</groupId>
<artifactId>app-support</artifactId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>app-support-java</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cokr.xit.app</groupId>
<artifactId>app-support-res</artifactId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>app-support-web</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>

@ -44,6 +44,16 @@ public class ApiUtil {
return rslt.body();
}
public static <T> String callNimsApiFromJSON(String uri, T cls) {
HttpResponse<String> rslt = new WebClient().post(request -> {
request.contentType(WebClient.Request.ContentType.JSON);
request.uri(uri);
toData(request, cls);
System.out.println("request : " + request);
});
return rslt.body();
}
/**
* Object -> data
* @param request WebClient.Request

@ -1,13 +1,10 @@
package cokr.xit.adds.cmm.model;
import java.util.List;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotEmpty;
import org.apache.commons.lang3.*;
import lombok.Builder;
import lombok.Data;
import lombok.Setter;
import lombok.*;
/**
* <pre>
@ -96,7 +93,7 @@ public class NimsApiRequest {
* true DB skip
* </pre>
*/
private String dbSkipYn = "N";
//private String dbSkipYn = "N";
/**
* <pre>
@ -152,6 +149,11 @@ public class NimsApiRequest {
*/
private String pn;
/**
*
*/
private String bc;
/**
* <pre>
* DB skip
@ -160,7 +162,7 @@ public class NimsApiRequest {
*
* </pre>
*/
private String dbSkipYn = "N";
//private String dbSkipYn = "N";
/**
* <pre>
@ -296,7 +298,12 @@ public class NimsApiRequest {
/**
*
*/
private String prdValidDe;
private String vd;
/**
*
*/
private String bc;
/**
*

@ -1,13 +1,11 @@
package cokr.xit.adds.cmmn.hwp.format;
import java.util.List;
import java.util.stream.IntStream;
import java.util.*;
import java.util.stream.*;
import cokr.xit.applib.Print;
import cokr.xit.applib.PrintOption;
import cokr.xit.applib.hwp.format.HWPFormat;
import cokr.xit.foundation.data.DataFormat;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.applib.*;
import cokr.xit.applib.hwp.format.*;
import cokr.xit.foundation.data.*;
public class DisposeResultReport extends HWPFormat {
@ -40,7 +38,8 @@ public class DisposeResultReport extends HWPFormat {
.set("제품정보-구분", one.string("nrcdSeNm"))
.set("제품정보-제품명", one.string("prductNm"))
.set("제품정보-품목코드", one.string("prductCd"))
.set("제품정보-최소유통단위", one.string("minDistbQy")+one.string("stdPackngStleNm"))
// 낱개단위 수량으로 보여짐
.set("제품정보-최소유통단위", one.string("pceQy")+one.string("pceUnit"))
.set("제품정보-제조번호", one.string("mnfNo"))
.set("제품정보-유효기한", DataFormat.yyyy_mm_dd(one.string("prdValidDe")))
.set("폐기량-수량", one.string("dsuseQy")+one.string("pceCoUnitNm"))

@ -1,6 +1,6 @@
package cokr.xit.adds.nims;
import cokr.xit.foundation.component.QueryRequest;
import cokr.xit.foundation.component.*;
/**
*
@ -14,6 +14,7 @@ public class DsuseMgtRsltQuery extends QueryRequest{
private String deptCd; // 부서 코드
private String userId; // 사용자 ID
private String dsuseMthCd; // 폐기 방법 코드
private String dsuseSeCd; // 폐기 구분 코드
private String dsuseDe; // 폐기 일자
public String getDscdmngId() {
@ -42,7 +43,7 @@ public class DsuseMgtRsltQuery extends QueryRequest{
this.userId = userId;
return self();
}
public String getDsuseMthCd() {
return ifEmpty(dsuseMthCd, () -> null);
}
@ -51,7 +52,16 @@ public class DsuseMgtRsltQuery extends QueryRequest{
this.dsuseMthCd = dsuseMthCd;
return self();
}
public String getDsuseSeCd() {
return ifEmpty(dsuseSeCd, () -> null);
}
public <T extends DsuseMgtRsltQuery> T setDsuseSeCd(String dsuseSeCd) {
this.dsuseSeCd = dsuseSeCd;
return self();
}
public String getDsuseDe() {
return ifEmpty(dsuseDe, () -> null);
}

@ -0,0 +1,33 @@
package cokr.xit.adds.nims;
import cokr.xit.foundation.component.QueryRequest;
/**
*
*/
public class DsuseProductAndSeqQuery extends QueryRequest{
private static final long serialVersionUID = 1L;
private String openPage; // 검색 폐기관리 id
private String bsshCd; // 검색 폐기관리 id
public String getOpenPage() {
return ifEmpty(openPage, () -> null);
}
public <T extends DsuseProductAndSeqQuery> T setOpenPage(String openPage) {
this.openPage = openPage;
return self();
}
public String getBsshCd() {
return ifEmpty(bsshCd, () -> null);
}
public <T extends DsuseProductAndSeqQuery> T setBsshCd(String bsshCd) {
this.bsshCd = bsshCd;
return self();
}
}

@ -1,78 +1,43 @@
package cokr.xit.adds.nims.web;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import javax.annotation.Resource;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.core.type.TypeReference;
import cokr.xit.adds.cmm.model.ApiBaseResponse;
import cokr.xit.adds.cmm.model.ApiUtil;
import cokr.xit.adds.cmm.model.DsuseMappingInfo;
import cokr.xit.adds.cmm.model.DsuseReceiptDtl;
import cokr.xit.adds.cmm.model.DsuseRsltInfo;
import cokr.xit.adds.cmm.model.NimsApiRequest;
import cokr.xit.adds.cmmn.hwp.format.DisposeProcessDetails;
import cokr.xit.adds.cmmn.hwp.format.DisposeResultReport;
import cokr.xit.adds.nims.ApiKeyQuery;
import cokr.xit.adds.nims.DsuseMgtDetailQuery;
import cokr.xit.adds.nims.DsuseMgtDocQuery;
import cokr.xit.adds.nims.DsuseMgtReceiptQuery;
import cokr.xit.adds.nims.DsuseMgtRsltQuery;
import cokr.xit.adds.nims.DsuseMgtStatisticsQuery;
import cokr.xit.adds.nims.service.AddsNimsService;
import cokr.xit.adds.nims.service.ApiKeyService;
import cokr.xit.adds.nims.service.DsuseMgtDocService;
import cokr.xit.adds.nims.service.DsuseMgtReceiptService;
import cokr.xit.applib.Print;
import cokr.xit.applib.PrintOption;
import cokr.xit.applib.xls.StyleMaker;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.docs.xls.CellDef;
import java.io.*;
import java.net.*;
import java.net.http.*;
import java.nio.charset.*;
import java.text.*;
import java.util.*;
import java.util.stream.*;
import javax.annotation.*;
import org.apache.poi.hssf.util.*;
import org.apache.poi.ss.usermodel.*;
import org.json.simple.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.*;
import org.springframework.web.servlet.*;
import com.fasterxml.jackson.core.type.*;
import cokr.xit.adds.cmm.model.*;
import cokr.xit.adds.cmmn.hwp.format.*;
import cokr.xit.adds.nims.*;
import cokr.xit.adds.nims.service.*;
import cokr.xit.applib.*;
import cokr.xit.applib.xls.*;
import cokr.xit.base.code.*;
import cokr.xit.base.docs.xls.Format;
import cokr.xit.base.docs.xls.Style;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.FileInfo.Relation;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.FileService;
import cokr.xit.base.user.DepartmentQuery;
import cokr.xit.base.user.service.SigunguDepartmentService;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.data.JSON;
import cokr.xit.foundation.web.WebClient;
import cokr.xit.base.docs.xls.*;
import cokr.xit.base.file.*;
import cokr.xit.base.file.FileInfo.*;
import cokr.xit.base.file.service.*;
import cokr.xit.base.user.*;
import cokr.xit.base.user.service.*;
import cokr.xit.base.web.*;
import cokr.xit.foundation.data.*;
import cokr.xit.foundation.web.*;
@Controller
@RequestMapping(
@ -124,7 +89,7 @@ public class AddsNimsController extends ApplicationController {
@Resource(name="dsuseMgtDocService")
private DsuseMgtDocService dsuseMgtDocService;
@Resource(name="apiKeyService")
private ApiKeyService apiKeyService;
@ -152,7 +117,7 @@ public class AddsNimsController extends ApplicationController {
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/dsuseMgtReceipt-list.do", name="신청서 접수 목록 조회")
public ModelAndView getDsuseMgtReceiptList(DsuseMgtReceiptQuery query) {
query.setOrderBy("DSUSE_DE DESC, DSUSE_MTH_CD, DSCDMNG_ID");
query.setOrderBy("DSUSE_DE DESC, DSUSE_SE_CD, DSUSE_MTH_CD, DSCDMNG_ID");
setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getDsuseMgtReceiptList(query),"","");
@ -242,7 +207,8 @@ public class AddsNimsController extends ApplicationController {
.setDscdmngId(dsuseRsltInfo.getDscdmngId())
.setDeptCd(dsuseRsltInfo.getDeptCd())
.setDsuseDe(dsuseRsltInfo.getDsuseDe().replaceAll("-", ""))
.setDsuseMthCd(dsuseRsltInfo.getDsuseMthCd()
.setDsuseMthCd(dsuseRsltInfo.getDsuseMthCd())
.setDsuseSeCd(dsuseRsltInfo.getDsuseSeCd()
)
)
)
@ -305,7 +271,7 @@ public class AddsNimsController extends ApplicationController {
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "dsuseMgtDoc-list.do", name="보고문서관리 목록 조회")
public ModelAndView getDsuseMgtDocList(DsuseMgtDocQuery query) {
query.setOrderBy("dsuse_de DESC, dsuse_mth_cd, dscdmng_id");
query.setOrderBy("dsuse_de DESC, dsuse_se_cd, dsuse_mth_cd, dscdmng_id");
setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtDocService.getDsuseMgtDocList(query),"","");
@ -463,7 +429,7 @@ public class AddsNimsController extends ApplicationController {
//-------------------------------------------------------------------------------------------------
// ApiKey 관리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// menu 처리
//-------------------------------------------------------------------------------------------------
@ -592,14 +558,15 @@ public class AddsNimsController extends ApplicationController {
}
@RequestMapping(value = "/product-popup.do", name="마약류 제품 조회 팝업")
public ModelAndView productPopup(String openPage) {
public ModelAndView productPopup(DsuseProductAndSeqQuery query) {
ModelAndView mav = new ModelAndView("adds/nims/product-popup");
return mav
.addObject("pageName", "productMain") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("pageName", "productPopup") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("infoPrefix", "product") // prefix
.addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
.addObject("openPage", openPage);
.addObject("openPage", query.getOpenPage())
.addObject("bsshCd", query.getBsshCd());
}
//-------------------------------------------------------------------------------------------------
// 마약류폐기보고 팝업
@ -614,6 +581,12 @@ public class AddsNimsController extends ApplicationController {
return json.parse(rslt, new TypeReference<>() {});
}
@RequestMapping(value = "/getNimsBsshInfoSt2.do", name="업체(마약류취급자) 검색", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsBsshInfoSt2(@ModelAttribute NimsApiRequest.BsshInfoReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + bsshInfoEndpoint, dto);
return json.parse(rslt, new TypeReference<>() {});
}
@RequestMapping(value = "/getNimsProductInfoKd.do", name="제품 검색", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> getNimsProductInfoKd(@ModelAttribute NimsApiRequest.ProductInfoReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + productInfoEndpoint, dto);
@ -704,7 +677,7 @@ public class AddsNimsController extends ApplicationController {
@RequestMapping(value = "/modifyMappingDsuseMgt.do", name="폐기보고 확인 정보 저장", produces = "application/json;charset=UTF-8")
public @ResponseBody ApiBaseResponse<List<JSONObject>> modifyMappingDsuseMgt(@ModelAttribute NimsApiRequest.DsuseMgtMappingReq dto) {
String rslt = ApiUtil.callNimsApi(apiHost + modifyMappingDsuseMgtEndpoint, dto);
String rslt = ApiUtil.callNimsApiFromJSON(apiHost + modifyMappingDsuseMgtEndpoint, dto);
return json.parse(rslt, new TypeReference<>() {});
}
//-------------------------------------------------------------------------------------------------

@ -21,7 +21,7 @@
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- .gz,.zip 등을 넣으면 자동 일자별 로그파일 압축 -->
<fileNamePattern>${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd}_%i.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/backup/${LOG_FILE}.%d{yyyy-MM-dd}_%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
@ -36,6 +36,7 @@
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>error</level>
<onMatch>ACCEPT</onMatch>
<!-- 다른 수준의 레벨은 기록하지 않는다.(상위 레벨도 기록 안함), 상위 수준의 레벨에 대한 기록을 원하면 ACCEPT 로 하면 기록된다. -->
<onMismatch>DENY</onMismatch>
</filter>
@ -46,13 +47,13 @@
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- .gz,.zip 등을 넣으면 자동 일자별 로그파일 압축 -->
<fileNamePattern>${LOG_PATH}/${LOG_FILE}-error.%d{yyyy-MM-dd}_%i.log</fileNamePattern>
<fileNamePattern>${LOG_PATH}/backup/${LOG_FILE}-error.%d{yyyy-MM-dd}_%i.log.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- 파일당 최고 용량 kb, mb, gb -->
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 일자별 로그파일 최대 보관주기(~일), 해당 설정일 이상된 파일은 자동으로 제거-->
<maxHistory>60</maxHistory>
<maxHistory>30</maxHistory>
</rollingPolicy>
</appender>
@ -67,6 +68,8 @@
<logger name="com.zaxxer" level="OFF" additivity="false"/>
<logger name="jdbc.sqltiming" level="DEBUG" />
<logger name="org.quartz" level="Error" additivity="false"/>
<!-- jndi log level 변경 : spring.liveBeansView.mbeanDomain 에러 -->
<logger name="org.springframework.jndi" level="WARN"/>
<!-- 특정패키지 로깅레벨 설정 -->
<!-- <logger name="cokr.xit" level="DEBUG" additivity="false">-->

@ -10,6 +10,8 @@
, tdm.DSUSE_MTH_CD
, tcc.CODE_VAL AS DSUSE_MTH_NM
, tdm.DSUSE_DE
, tdm.DSUSE_LOC
, tdm.DSUSE_SE_CD
, IF(#{dscdmngId} = tdm.DSCDMNG_ID, 'Y', 'N') AS SELF_YN
, (SELECT GROUP_CONCAT(dscdmng_id SEPARATOR ',')
FROM tb_dsuse_mgt
@ -30,6 +32,7 @@
AND tdm.use_yn = 'Y'
AND tdm.dept_cd = #{deptCd}
AND tdm.dsuse_mth_cd = #{dsuseMthCd}
AND tdm.dsuse_se_cd = #{dsuseSeCd}
AND tdm.dsuse_de = #{dsuseDe}
</select>
</mapper>

@ -141,7 +141,12 @@
AND tdm.prgrs_stts_cd = #{schSttsCd} <!-- 진행 상태 -->
</if>
<if test="nrcdSeNm != null">
AND tpi.nrcd_se_nm = #{nrcdSeNm} <!-- 진행 상태 -->
<if test="nrcdSeNm eq '기타'">
AND tpi.nrcd_se_nm IS NULL
</if>
<if test="nrcdSeNm != '기타'">
AND tpi.nrcd_se_nm = #{nrcdSeNm}
</if><!-- 진행 상태 -->
</if>
<if test="prtmSeNm != null">
AND tpi.prtm_se_nm = #{prtmSeNm} <!-- 진행 상태 -->

@ -180,7 +180,7 @@ $(document).ready(function() {
// 저장
$P.fnSave = async() => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let apiKeyData = $P.apiKeyFormFields.get();
@ -193,7 +193,7 @@ $(document).ready(function() {
dialog.alert({
content: "현재 API KEY 정보를 저장 하시겠습니까?"
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { $P.control.save(apiKeyData); }
});
}

@ -269,7 +269,7 @@
}
// DataTables(그리드)
let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
let cellDefs = AppSupport.getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.control.query.cellDefs = cellDefs;
@ -300,7 +300,7 @@
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
Componentization.fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
}

@ -8,21 +8,17 @@
<!-- hidden -->
<%-- <label for="bssh--${pageName}">마약류 취급업체 정보</label>--%>
<div class="row my-1 mx-4 g-1" style="align-items: baseline">
<div class="col-md-3">
<label for="schBsshNm--${pageName}" class="w-px-90 bg-lighter pe-2 col-form-label text-sm-end">취급업체명</label>
<input type="text" class="form-control w-50" id="schBsshNm--${pageName}" name="schBsshNm" data-map="schBsshNm" >
<div class="col-md-6">
<label for="schBsshNm--${pageName}" class="w-px-140 bg-lighter pe-2 col-form-label text-sm-end">취급업체명/식별번호</label>
<input type="text" class="form-control w-px-100" id="schBsshNm--${pageName}" name="schBsshNm" data-map="schBsshNm" >
<input type="text" class="form-control w-px-120" id="schBsshCd--${pageName}" name="schBsshCd" data-map="schBsshCd" >
</div>
<div class="col-md-3">
<label for="schRprsntvNm--${pageName}" class="w-px-80 bg-lighter pe-2 col-form-label text-sm-end">대표자명</label>
<input type="text" class="form-control w-50" id="schRprsntvNm--${pageName}" name="schRprsntvNm" data-map="schRprsntvNm" >
</div>
<div class="col-md-3">
<label for="schBsshCd--${pageName}" class="w-px-90 bg-lighter pe-2 col-form-label text-sm-end">취급자번호</label>
<input type="text" class="form-control w-50" id="schBsshCd--${pageName}" name="schBsshCd" data-map="schBsshCd" >
</div>
<div class="col-md-3">
<button type="button" class="btn btn-search w-px-120" id="btnSearch--${pageName}" title="검색">검색</button>&nbsp;
<button type="button" class="btn btn-primary w-px-120" id="btnSearch2--${pageName}" title="검색">NIMS 검색</button>
<button type="button" class="btn btn-primary w-px-120" id="btnSearch--${pageName}" title="검색">NIMS 검색</button>
</div>
</div>
</div>
@ -36,36 +32,32 @@
</span>
</span>
</div>
<!-- / 업무 버튼 표시 -->
<!-- / 업무 버튼 표시 -->
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-500" id="table-responsive--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead>
<thead class="sticky-thead">
<tr>
<!-- <th style="width: 15.828px;text-align:center;" tabindex="0">No</th> -->
<th class="cmn" style="width: 70px;">No.</th>
<th class="sorting" style="width: 140.156px;">취급자번호</th>
<th class="sorting" style="width: 250.141px;">취급업체명</th>
<th class="sorting" style="width: 160.141px;">업종명</th>
<th class="sorting" style="width: 120.469px;">대표자</th>
<th class="sorting" style="width: 250.469px;">허가번호</th>
<%-- <th class="sorting" style="width: 120.469px;">담당자명</th>--%>
<%-- <th class="sorting" style="width: 120.469px;">구분</th>--%>
</tr>
</thead>
<tbody id="tbody--${pageName}">
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{bsshCd}">
<!-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{bsshCd}</td> -->
<td class="row-num text-end" onclick="{onclick}" ondblclick="{ondblclick}"></td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{bsshCd}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{bsshNm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{indutyNm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{rprsntvNm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prmisnNo}</td>
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{chrgNm}</td>--%>
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{hdntNm}</td>--%>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}">
@ -119,7 +111,7 @@
, appendData: true
, infoSize: "xl"
});
// $P.control 설정
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
@ -130,16 +122,17 @@
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$P.control.onDatasetChange = (obj, option) => {
$P.renderList(obj.totalCount, option);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
list: $P.control.dataset
, prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length
, totalSize: obj.totalCount
, fetchSize: obj.${infoPrefix}Fetch
, func: "pageObject['${pageName}'].control.load({index})"
// , func: "pageObject['${pageName}'].control.load({index})"
});
};
@ -152,9 +145,9 @@
$("#tbody--${pageName}").setCurrentRow(key);
}
// 저장 callback
// 저장
/**************************************************************************
@ -162,33 +155,22 @@
**************************************************************************/
// DataTables에 click, dbclick 이벤트
$P.renderList = (totalSize) => {
$P.renderList = (totalSize, option) => {
let ${infoPrefix}List = $P.control.dataset;
let empty = ${infoPrefix}List.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("${infoPrefix}Row--${pageName}").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let foundTds = $(foundContent).find("td");
foundTds.each(function() {
foundTr.appendChild(this.cloneNode(true));
});
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("bsshCd") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
let trs = empty ?
[document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML]
: ${infoPrefix}List.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}").innerHTML,
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("bsshCd") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()"));
let noMore = (${infoPrefix}List.length >= totalSize);
let initScroll = ($P.control.query.pageNum < 2);
$("#tbody--${pageName}").html(trs.join());
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
/**************************************************************************
* 사용자 함수(function)
@ -197,14 +179,27 @@
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
$P.fnSearchList = (dbSkipYn) => {
$P.fnSearchList = () => {
if($P.formFields.get().schBsshCd.length + $P.formFields.get().schBsshNm.length === 0){
dialog.alert({
content: "취급업체명 또는 취급자식별번호중<br>하나는 필수입니다."
});
return false;
}
if($P.formFields.get().schBsshNm.length !== 0 && $P.formFields.get().schBsshNm.length < 2){
dialog.alert({
content: "취급업체명은 2자 이상으로 조회해 주세요."
});
return false;
}
$P.control.query = {
//... $P.formFields.get(),
pg: 1,
bc: $P.formFields.get().schBsshCd,
bn: $P.formFields.get().schBsshNm,
rprsntvNm: $P.formFields.get().schRprsntvNm,
dbSkipYn: dbSkipYn? dbSkipYn : "N",
userId: "${currentUser.account}"
};
$P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수
@ -212,7 +207,13 @@
$P.control.load(1);
}
$P.scrollDataList = () => {
$P.control.query.pg = $P.control.query.pageNum + 1;
$P.control.load($P.control.query.pageNum + 1);
}
// 저장
$P.fnSave = () => {
let openPage = new AddsFormFields("#${openPage}");
@ -228,13 +229,17 @@
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList());
$("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y"));
$("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList);
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}')
, (tr)=>{ return $(tr).find("td.row-num")[0]; }
, (marker, value)=>{ if(marker != null){ marker.innerHTML = value; } }
);
}
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
Componentization.fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// 초기 화면 설정
$P.initForm = () => {}

@ -95,21 +95,21 @@
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 60px;">No.</th>
<th class="cmn" style="width: 50px;">
<input type="checkbox" class="form-check-input" id="gridAllCheckbox--${pageName}"
<input type="checkbox" class="form-check-input" id="gridAllCheckbox--${pageName}"
onchange="pageObject['${pageName}'].control.select(this.checked);" />
</th>
<th class="cmn" style="width: 160.141px;">관할관청</th>
<th class="cmn" style="width: 120.141px;">폐기관리번호</th>
<th class="cmn" style="width: 110.469px;">폐기일자</th>
<th class="cmn" style="width: 140px;">폐기구분</th>
<th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th>
<th class="cmn" style="width: 250.469px;">업체명</th>
<th class="cmn" style="width: 90px;">폐기건수</th>
<th class="cmn" style="width: 145px;">폐기결과보고서</th>
<th class="cmn" style="width: 145px;">처리내역및사진</th>
<th class="cmn" style="width: 160.469px;">처리상태</th>
<th class="cmn" style="width: 180.469px;">폐기사유</th>
<th class="cmn" style="width: 140px;">폐기구분</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th>
<th class="cmn" style="width: 110.141px;">취급일자</th>
</tr>
</thead>
@ -119,13 +119,15 @@
<tr data-key="{dscdmng_id}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="{dscdmng_id}"
<input type="checkbox" class="form-check-input" name="gridCheckbox" value="{dscdmng_id}"
onchange="pageObject['${pageName}'].control.select('{dscdmng_id}', this.checked);">
</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dept_nm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dscdmng_id}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_de}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_se_nm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_mth_nm}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_loc}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{bssh_nm}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{rnd_dtl_rpt_cnt}</td>
<td class="cmn text-center" onclick="{onclick}">
@ -136,8 +138,6 @@
</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prgrs_stts_nm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_prv_nm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_se_nm}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{dsuse_loc}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{hdr_de}</td>
</tr>
</template>
@ -198,7 +198,7 @@
$P.control.defaultFetchSize = FETCH_XS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.beforeCurrent = null;
/**************************************************************************
* DatasetControl 이벤트
@ -206,7 +206,7 @@
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#${infoPrefix}Paging--${pageName}").setPaging({
list: $P.control.dataset
, prefix: "${infoPrefix}Paging--${pageName}"
@ -216,7 +216,7 @@
, func: "pageObject['${pageName}'].control.load({index})"
});
};
// 현재 선택 자료 변경 이벤트
@ -225,32 +225,32 @@
if (!item) {
return;
}
let key = item.data.dscdmng_id;
$("#tbody--${pageName}").setCurrentRow(key);
};
// 체크 자료 변경 이벤트
$P.control.onSelectionChange = (selected) => {
let list = $P.control.dataset;
let keys = selected.map(e => list.getKey(e));
//버튼
$("#btnCreateDsuseRsltDoc--${pageName}").prop("disabled", keys.length < 1);
$("#btnCreateDsuseRsltListPhoto--${pageName}").prop("disabled", keys.length < 1);
if(${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
$("#btnCreateDsuseRsltDoc--${pageName}").prop("disabled", true);
$("#btnCreateDsuseRsltListPhoto--${pageName}").prop("disabled", true);
}
//그리드 체크박스
$("#tbody--${pageName}").find("td input[type='checkbox']").each(function() {
let checkbox = $(this);
checkbox.prop("checked", keys.includes(checkbox.val()));
});
//그리드 제목 체크박스
if (keys.length < 1) {
$("#theadTr--${pageName}").find("input[type='checkbox']").prop("checked", false); // 체크 해제
@ -289,7 +289,7 @@
$("#tbody--${pageName}").html(trs.join());
}
$P.control.getBsshInfo = (gdccId) => {
@ -314,7 +314,7 @@
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 사용자검색 callback
$P.callbackFindUser = (userId, userNm) => {
@ -333,17 +333,17 @@
} else {
return;
}
dialog.alert({
content: "선택한 폐기관리 정보로 "+ docName+" 파일을 생성 하시겠습니까?"
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
$P.fnCreateDoc(ADDS12);
}
});
};
//한글문서파일 생성 요청
$P.fnCreateDoc = (ADDS12) => {
let dscdmngIds = $P.control.dataset.getKeys("selected");
@ -368,7 +368,7 @@
content: "파일 생성 중 오류가 발생하였습니다."
+"<br/>"
+responseJson.description,
init: () => { setDialogZindex(); }
init: () => { AppSupport.setDialogZindex(); }
});
});
return false;
@ -403,7 +403,7 @@
//alert(e)
});
};
// 업체 검색 버튼 이벤트
$P.fnSearchBssh = () => {
$P.control.getBsshInfo();
@ -448,7 +448,7 @@
}
// DataTables(그리드)
let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
let cellDefs = AppSupport.getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.control.query.cellDefs = cellDefs;
@ -493,14 +493,14 @@
}
});
});
// 업체 검색 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh();
});
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
Componentization.fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
}
@ -517,8 +517,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSttsCd--${pageName}').val('06');

@ -328,7 +328,7 @@
// 끝에서 2개의 th 요소 선택
let lastColNames = $(`#theadTr0--${pageName} th`).not("[colspan]").slice(-2);
$P.control.query.cellDefs = getCellDefs(
$P.control.query.cellDefs = AppSupport.getCellDefs(
$([...firstColNames, ...middleColNames, ...lastColNames]),
$($("#${infoPrefix}Row--${pageName}")[0].content).find("td")
.not(".dummy-td").not(":eq(0)").not("[colspan]")
@ -386,8 +386,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSggCd--${pageName}').val("${currentUser.deptCode}");

@ -348,7 +348,7 @@
// 끝에서 2개의 th 요소 선택
let lastColNames = $(`#theadTr0--${pageName} th`).not("[colspan]").slice(-2);
$P.control.query.cellDefs = getCellDefs(
$P.control.query.cellDefs = AppSupport.getCellDefs(
$([...firstColNames, ...middleColNames, ...lastColNames]),
$($("#${infoPrefix}Row--${pageName}")[0].content).find("td")
.not(".dummy-td").not(":eq(0)").not("[colspan]")
@ -406,8 +406,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSggCd--${pageName}').val("${currentUser.deptCode}");

@ -326,7 +326,7 @@
// 끝에서 2개의 th 요소 선택
let lastColNames = $(`#theadTr0--${pageName} th`).not("[colspan]").slice(-2);
$P.control.query.cellDefs = getCellDefs(
$P.control.query.cellDefs = AppSupport.getCellDefs(
$([...firstColNames, ...middleColNames, ...lastColNames]),
$($("#${infoPrefix}Row--${pageName}")[0].content).find("td")
.not(".dummy-td").not(":eq(0)").not("[colspan]")
@ -386,8 +386,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSggCd--${pageName}').val("${currentUser.deptCode}");

@ -402,7 +402,7 @@
ajax.post({
url: wctx.url("/adds/nims/modifyMappingDsuseMgt.do")
, data: JSON.stringify({
, data: {
dscdmngId: $P.formFields.get().dscdmngId,
prgrsSttsCd: "21",
usrRptIdNo: $P.mappingControl.dataset.getCurrent().usrRptIdNo,
@ -410,8 +410,7 @@
rptTyCd: $P.mappingControl.dataset.getCurrent().rptTyCd,
stts: $P.mappingControl.dataset.getCurrent().status,
userId: "${currentUser.account}"
})
, contentType : "application/json; charset=utf-8"
}
, success: resp => {
if(!resp.success){
dialog.alert({
@ -510,7 +509,7 @@
if(!checkData){
dialog.alert({
content: "선택한 NIMS 폐기보고 데이타가 없습니다."
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {}
});
return false;
@ -519,7 +518,7 @@
dialog.alert({
content: "확인 선택한 NIMS 폐기보고 정보를 저장 하시겠습니까?"
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
$P.control.save(); // formFields
}

@ -90,13 +90,13 @@
<th class="cmn" style="width: 170.141px;">관할관청</th>
<th class="cmn" style="width: 120.141px;">폐기관리번호</th>
<th class="cmn" style="width: 110.469px;">폐기일자</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 300.469px;">업체명</th>
<th class="cmn" style="width: 90px;">보고건수</th>
<th class="cmn" style="width: 270.469px;">NIMS보고ID</th>
<th class="cmn" style="width: 160.469px;">처리상태</th>
<th class="cmn" style="width: 180.469px;">폐기사유</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th>
<th class="cmn" style="width: 110.141px;">취급일자</th>
</tr>
@ -109,6 +109,7 @@
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DEPT_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
@ -117,7 +118,6 @@
</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
</tr>
@ -223,7 +223,7 @@
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.query = { pageNum : 1, fetchSize : $P.control.defaultFetchSize };
$P.control.beforeCurrent = null;
$P.detailControl = new DatasetControl({
urls : {
@ -236,8 +236,8 @@
, formats : {
PRD_VALID_DE: dateFormat
}
});
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
@ -254,9 +254,9 @@
, func: "pageObject['${pageName}'].control.load({index})"
});
};
$P.detailControl.onDatasetChange = (obj) => {
$P.renderDetailList(obj.${infoPrefix}Total);
};
@ -291,7 +291,7 @@
}
}
};
// 현재 선택 자료 변경 이벤트
$P.detailControl.onCurrentChange = (item) => {
if (!item) return;
@ -348,7 +348,7 @@
};
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtMapping-info.do")
url : wctx.url("/adds/nims/dsuseMgtMapping-info.do")
, data : params
, success : resp => {
dialog.open({
@ -356,7 +356,7 @@
, title : dialogTitle
, content : resp
, size : "xxl"
, onClose : () => {
, onClose : () => {
$P.control.reload({all : true});
}
});
@ -366,16 +366,16 @@
$P.control.onSave = (resp) => {
// let dialogTitle = $("#" + $P.control.prefix + "Dialog").find("h5.modal-title").html();
let showMessage = "저장에 실패 하였습니다.";
let showMessage = "저장에 실패 하였습니다.";
if (resp.saved) {
showMessage = "저장에 성공 하였습니다.";
}
dialog.alert({
content : showMessage,
init : function(){
setDialogZindex();
focusClose();
AppSupport.setDialogZindex();
AppSupport.focusClose();
}
});
@ -391,7 +391,7 @@
userId: "${currentUser.account}",
prgrsSttsCd: "99"
};
ajax.get({
url : wctx.url("/adds/nims/updatePrgsSttusOfDsuseMgt.do")
, data: params
@ -430,12 +430,12 @@
if(option != null && option.reloaded){
initScroll = false;
}
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
$P.renderDetailList = () => {
let ${infoPrefix}List = $P.detailControl.dataset;
let empty = ${infoPrefix}List.empty;
@ -454,11 +454,11 @@
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.control.load($P.control.query.pageNum + 1);
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "frmSearch--${pageName}"};
@ -476,8 +476,8 @@
});
}
});
}
}
/**************************************************************************
* 사용자 함수(function)
@ -494,20 +494,20 @@
$P.fnCreateDsuseMgtMapping = (title) => {
$P.control.getInfo();
}
// 처리상태 완료로 변경
$P.fnPrgsStts = () => {
dialog.alert({
content : "현재 " + $P.control.dataset.getCurrent().DSCDMNG_ID + " 정보를 완료 처리 하시겠습니까?",
init : function() {
focusOK();
AppSupport.focusOK();
},
onOK : () => {
$P.control.prgsSttus();
}
});
});
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
@ -553,7 +553,7 @@
}
// DataTables(그리드)
let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
let cellDefs = AppSupport.getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.control.query.cellDefs = cellDefs;
@ -595,20 +595,20 @@
}
});
});
// 안내문 등록 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
Componentization.fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
// DataTables 스크롤 이벤트 생성
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
Componentization.fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// 하단 테이블 행 번호 표시
fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
, (tr)=>{ return $(tr).find("td.row-num")[0]; }
, (marker, value)=>{ if(marker != null){ marker.innerHTML = value; } }
);
@ -627,8 +627,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSttsCd--${pageName}').val('06');

@ -351,7 +351,7 @@
let lastColNames = $(`#theadTr0--${pageName} th`).not("[colspan]").slice(-2);
// DataTables(그리드)
$P.control.query.cellDefs = getCellDefs(
$P.control.query.cellDefs = AppSupport.getCellDefs(
$([...firstColNames, ...middleColNames, ...lastColNames]),
$($("#${infoPrefix}Row--${pageName}")[0].content).find("td")
.not(".dummy-td").not(":eq(0)").not("[colspan]")
@ -410,8 +410,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSggCd--${pageName}').val("${currentUser.deptCode}");

@ -27,6 +27,15 @@
<!-- hidden -->
<input type="hidden" name="dscdmngId" data-map="dscdmngId" />
<input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" />
<input type="hidden" name="indutyNm" data-map="indutyNm"/>
<input type="hidden" name="hdntCd" data-map="hdntCd"/>
<input type="hidden" name="hdntNm" data-map="hdntNm"/>
<input type="hidden" name="chrgNm" data-map="chrgNm"/>
<input type="hidden" name="hptlNo" data-map="hptlNo"/>
<input type="hidden" name="joinYn" data-map="joinYn"/>
<input type="hidden" name="bsshSttusNm" data-map="bsshSttusNm"/>
<label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
@ -34,7 +43,7 @@
<input type="text" class="form-control w-70" id="bsshNm--${pageName}" name="bsshNm" data-map="bsshNm" readonly>
</div>
<div class="col-md-8">
<label for="bsshCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">식별번호</label>
<label for="bsshCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">업체식별번호</label>
<input type="text" class="form-control w-px-150" id="bsshNm--${pageName}" name="bsshCd" data-map="bsshCd" readonly>
<button type="button" class="btn btn-search w-px-100" id="btnBsshSearch--${pageName}" title="업체 검색">업체 검색</button>
</div>
@ -67,12 +76,19 @@
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form>
<form id="product--${pageName}" name="product">
<input type="hidden" name="prdlstMstCd" data-map="prdlstMstCd"/>
<input type="hidden" name="nrcdSeNm" data-map="nrcdSeNm"/>
<input type="hidden" name="prtmSeNm" data-map="prtmSeNm"/>
<input type="hidden" name="bsshCd" data-map="bsshCd"/>
<input type="hidden" name="rgsDt" data-map="rgsDt"/>
<input type="hidden" name="updDt" data-map="updDt"/>
<label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>폐기 제품 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-6">
<label for="prductNm--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품명</label>
<input type="text" class="form-control w-75" id="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly>
</div>
</div>
<div class="col-md-6">
<label for="prductCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label>
<input type="text" class="form-control w-px-140" id="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly>
@ -187,12 +203,17 @@
const fnPrdChange = (e) => {
let key = e.target.closest('tr').dataset.key;
const key = e.target.closest('tr').dataset.key;
const name = e.target.name;
let value = e.target.value;
let name = e.target.name;
//alert(JSON.stringify($P.productList.getData(key)));
if(name === 'dsuseQy') {
let parts = value.replace(/[^0-9.]/g, '').split('.').filter(d=> d !== '');
if(parts.length > 1) value = parts.shift() + '.' + parts.join('');
else value = parts[0]
e.target.value = value;
}
$P.productList.setValue(key, name, value);
//alert(JSON.stringify($P.productList.getData(key)));
}
const fnBarcodeSearch = (barcode) => {
@ -225,6 +246,12 @@
mnfNo: prdInfo.mnfSeqInfos[0].mnfNo,
mnfSeq: prdInfo.mnfSeqInfos[0].mnfSeq,
prdlstMstCd: prdInfo.prdlstMstCd,
nrcdSeNm: prdInfo.nrcdSeNm,
prtmSeNm: prdInfo.prtmSeNm,
bsshCd: prdInfo.bsshCd,
rgsDt: prdInfo.rgsDt,
updDt: prdInfo.updDt
}
);
$("#prductCd--${pageName}").prop("readonly", true);
@ -299,7 +326,7 @@
if($("input[name='prgrsSttsCd']").val() == '99') {
$("#btnSave--${pageName}").prop("disabled", true);
}
let checkData = item.data.dsusePrvCd;
if (checkData =="01" || checkData =="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false);
@ -308,7 +335,7 @@
$("#dsuseAcdtDe--${pageName}").val("");
}
}
$P.productControl.onCurrentChange = item => {
if (!item) return;
@ -324,7 +351,7 @@
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
@ -346,31 +373,42 @@
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
, onClose : () => { $P.control.setData([]); }
});
}
});
}
$P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회";
let params = {openPage : "product--${pageName}"};
let rowData = $P.bsshFormFields.get();
if(rowData.bsshCd == null || rowData.bsshCd === "") {
dialog.alert({
content: "업체를 먼저 선택해주세요."
});
return false;
}
let params = {
openPage : "product--${pageName}"
, bsshCd: rowData.bsshCd
};
ajax.get({
url : wctx.url("/adds/nims/product-popup.do")
, data : params
, success : resp => {
dialog.open({
id : "productMainDialog"
id : "productPopupDialog"
, title : dialogTitle
, content : resp
, size : $P.productControl.infoSize
, onClose : () => { $P.productControl.setData(); }
, onClose : () => { $P.productControl.setData([]); }
});
}
});
}
// 저장
$P.control.save = (jsonBssh, datasetListPrd, fileArr) => {
let saveBsshData = {
@ -399,13 +437,20 @@
}
});
}
$P.productList.onAppend = item => {
$P.productList.onAppend = (item) => {
if($P.productList._items != null && $P.productList._items.length > 0){
$P.productList._items.forEach((it)=>{
if(it.state == "added"){
it.state = "";
}
});
}
if (!item) return;
if (item.length < 1) return;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
@ -418,37 +463,37 @@
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');");
for(let i=0; i<item.length; i++){
let di = $P.productList.getData(item[i].keyCnt, "item");
let tr = di.inString(foundTr.outerHTML, replacer);
$("#tbody--productList").append(tr);
fnMakeGridImageViewer(
$("#tbody--productList").find("td.prdDsuseImg").last()[0],
AddsComponentization.fnMakeGridImageViewer(
$("#tbody--productList").find("td.prdDsuseImg").last()[0],
"dsusePrdImgFiles",
di.data.fileInfo
);
}
}
$P.productList.onRemove = item => {
let key = item[0].data.keyCnt;
$("#tbody--productList").find("tr[data-key='"+key+"']").remove();
}
$P.productList.onCurrentChange = item => {
if (!item) return;
let key = item.data.keyCnt;
$("#tbody--productList").setCurrentRow(key);
}
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
@ -456,12 +501,12 @@
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
}
$P.fnSearchProduct = (title) => {
$P.productControl.getProductInfo();
}
@ -472,12 +517,12 @@
// 저장
$P.fnSave = async() => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let bsshData = $P.bsshFormFields.get();
if(bsshData.bsshCd == ""){
if(bsshData.bsshCd === ""){
dialog.alert({
content: "마약류 취급업체 정보를 입력해주세요."
});
@ -489,7 +534,7 @@
}
let dsProd = $P.productList.getDataset();
if(dsProd.length == 0){
if(dsProd.length === 0){
dialog.alert({
content: "폐기 제품 정보를 입력해주세요."
});
@ -529,7 +574,7 @@
}
if(!isContinue) return false;
let fileCount = 0;
let fileCount = 0;
$("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() {
if(this.dataset.url != null){
fileCount++;
@ -538,7 +583,7 @@
}
});
if(dsProd.length != fileCount){
if(dsProd.length !== fileCount){
dialog.alert({
content: "입력되지 않은 폐기 제품 이미지가 있습니다."
});
@ -547,7 +592,7 @@
dialog.alert({
content: "현재 폐기 신청서 접수 정보를 저장 하시겠습니까?"
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
let promiseArr = [];
@ -561,17 +606,17 @@
fileInfo.MIME_TYPE = this.dataset.mimeType;
fileInfo.FILE_NM = this.dataset.fileNm;
fileInfo.FILE_ID = this.dataset.fileId;
promiseArr.push(fnCreateFileFromFileInfo(fileInfo));
promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(fileInfo));
}
});
Promise.all(promiseArr).then((values) => {
$P.control.save(bsshData, dsProd, values);
}).catch((error) => {});
}
});
}
//추가
$P.fnAdd = () => {
if(!$P.productFormFields.get().prductCd){
@ -600,7 +645,7 @@
const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe.replaceAll('-','')+prdFrm.mnfNo+prdFrm.mnfSeq;
let isDup = $P.productList
.getDataset()
.filter(item => prdInfo == ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq)
.filter(item => prdInfo === ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq)
.length > 0;
if(isDup){
const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq;
@ -614,31 +659,31 @@
data.prdValidDe = data.prdValidDe.replaceAll('-','');
$P.productList.append([data]);
}
$P.fnDel = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
const row = $P.productList.getCurrent();
dialog.alert({
content: "아래 제품을 삭제하시겠습니까?<br>제품명: "+row.prductNm + "<br>유효기간: " +row.prdValidDe+"<br>제조번호: "+row.mnfNo+"<br>일련번호: " + row.mnfSeq
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
$P.productList.remove($P.productList.getCurrent().keyCnt);
}
});
}
$P.fnChangeDsusePrvCd = () => {
// validate 확인
let checkData = $("#dsusePrvCd--${pageName} option:selected").val();
if (checkData =="01" || checkData =="02") {
if (checkData ==="01" || checkData ==="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false);
}else{
$("#dsuseAcdtDe--${pageName}").prop('disabled', true);
$("#dsuseAcdtDe--${pageName}").val("");
}
}
/**************************************************************************
@ -650,18 +695,18 @@
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
$("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title"));
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
$("#dsusePrvCd--${pageName}").on("change", () => $P.fnChangeDsusePrvCd()); // 추가
//-------------------------------------------------------------------------
@ -680,16 +725,19 @@
}
});
// 숫자만 입력받도록 input 요소에 이벤트 리스너 추가
$("input[name='dsuseQy']").on('change', function() {
this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
});
//-------------------------------------------------------------------------
}
// 초기 화면 설정
$P.initForm = () => {
if($("input[name='prgrsSttsCd']").val() == '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
if($("input[name='prgrsSttsCd']").val() === '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
$("#btnSave--${pageName}").prop("disabled", true);
}
initDatepicker("bssh--${pageName}");
AppSupport.initDatepicker("bssh--${pageName}");
$("#dsuseAcdtDe--${pageName}").datepicker("setDate", new Date());
}
@ -705,14 +753,14 @@
// 3. Dataset 설정
$P.control.setData([${dsuseReceptInfo}]);
let productInfo = ${dsuseReceptDtlInfo};
let fileInfo = ${fileInfo};
for(let p of productInfo){
p.keyCnt = (""+prdRowKey++);
for(let f of fileInfo){
if(p.dscdmngSn == f.SUB_TYPE){
if(p.dscdmngSn === f.SUB_TYPE){
p.fileInfo = f;
}
}
@ -720,8 +768,8 @@
$P.productList.append(productInfo);
$("#tbody--productList tr td input[type=text]").on('change', (e) => {
fnPrdChange(e);
})
fnPrdChange(e);
})
});
</script>

@ -14,6 +14,15 @@
<!-- hidden -->
<input type="hidden" name="dscdmngId" data-map="dscdmngId" />
<input type="hidden" name="prgrsSttsCd" data-map="prgrsSttsCd" />
<input type="hidden" name="indutyNm" data-map="indutyNm"/>
<input type="hidden" name="hdntCd" data-map="hdntCd"/>
<input type="hidden" name="hdntNm" data-map="hdntNm"/>
<input type="hidden" name="chrgNm" data-map="chrgNm"/>
<input type="hidden" name="hptlNo" data-map="hptlNo"/>
<input type="hidden" name="joinYn" data-map="joinYn"/>
<input type="hidden" name="bsshSttusNm" data-map="bsshSttusNm"/>
<label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급 업체 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
@ -21,7 +30,7 @@
<input type="text" class="form-control w-70" id="bsshNm--${pageName}" name="bsshNm" data-map="bsshNm" readonly>
</div>
<div class="col-md-8">
<label for="bsshCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">식별번호</label>
<label for="bsshCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">업체식별번호</label>
<input type="text" class="form-control w-px-150" id="bsshNm--${pageName}" name="bsshCd" data-map="bsshCd" readonly>
<button type="button" class="btn btn-search w-px-100" id="btnBsshSearch--${pageName}" title="업체 검색">업체 검색</button>
</div>
@ -54,12 +63,19 @@
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form>
<form id="product--${pageName}" name="product">
<input type="hidden" name="prdlstMstCd" data-map="prdlstMstCd"/>
<input type="hidden" name="nrcdSeNm" data-map="nrcdSeNm"/>
<input type="hidden" name="prtmSeNm" data-map="prtmSeNm"/>
<input type="hidden" name="bsshCd" data-map="bsshCd"/>
<input type="hidden" name="rgsDt" data-map="rgsDt"/>
<input type="hidden" name="updDt" data-map="updDt"/>
<label for="product--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>폐기 제품 정보</strong></label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-6">
<label for="prductNm--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품명</label>
<input type="text" class="form-control w-75" id="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly>
</div>
</div>
<div class="col-md-6">
<label for="prductCd--${pageName}" class="w-px-100 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label>
<input type="text" class="form-control w-px-140" id="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly>
@ -169,6 +185,7 @@
* script 진입
**************************************************************************/
$(document).ready(function() {
const fnBarcodeSearch = (barcode) => {
ajax.get({
url : wctx.url("/adds/nims/getNimsPrdMnfSeqInfoOfBarcode.do")
@ -199,6 +216,12 @@
mnfNo: prdInfo.mnfSeqInfos[0].mnfNo,
mnfSeq: prdInfo.mnfSeqInfos[0].mnfSeq,
prdlstMstCd: prdInfo.prdlstMstCd,
nrcdSeNm: prdInfo.nrcdSeNm,
prtmSeNm: prdInfo.prtmSeNm,
bsshCd: prdInfo.bsshCd,
rgsDt: prdInfo.rgsDt,
updDt: prdInfo.updDt
}
);
$("#prductCd--${pageName}").prop("readonly", true);
@ -276,7 +299,7 @@
if($("input[name='prgrsSttsCd']").val() == '99') {
$("#btnSave--${pageName}").prop("disabled", true);
}
let checkData = item.data.dsusePrvCd;
if (checkData =="01" || checkData =="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false);
@ -285,7 +308,7 @@
$("#dsuseAcdtDe--${pageName}").val("");
}
}
$P.productControl.onCurrentChange = item => {
if (!item) return;
@ -301,7 +324,7 @@
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
@ -323,31 +346,42 @@
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
, onClose : () => { $P.control.setData([]); }
});
}
});
}
$P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회";
let params = {openPage : "product--${pageName}"};
let rowData = $P.bsshFormFields.get();
if(rowData.bsshCd == null || rowData.bsshCd === "") {
dialog.alert({
content: "업체를 먼저 선택해주세요."
});
return false;
}
let params = {
openPage : "product--${pageName}"
, bsshCd : rowData.bsshCd
};
ajax.get({
url : wctx.url("/adds/nims/product-popup.do")
, data : params
, success : resp => {
dialog.open({
id : "productMainDialog"
id : "productPopupDialog"
, title : dialogTitle
, content : resp
, size : $P.productControl.infoSize
, onClose : () => { $P.productControl.setData(); }
, onClose : () => { $P.productControl.setData([]); }
});
}
});
}
// 저장
$P.control.save = (jsonBssh, datasetListPrd, fileArr) => {
let saveBsshData = {
@ -376,13 +410,20 @@
}
});
}
$P.productList.onAppend = item => {
$P.productList.onAppend = (item) => {
if($P.productList._items != null && $P.productList._items.length > 0){
$P.productList._items.forEach((it)=>{
if(it.state == "added"){
it.state = "";
}
});
}
if (!item) return;
if (item.length < 1) return;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
@ -395,37 +436,37 @@
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');");
for(let i=0; i<item.length; i++){
let di = $P.productList.getData(item[i].keyCnt, "item");
let tr = di.inString(foundTr.outerHTML, replacer);
$("#tbody--productList").append(tr);
fnMakeGridImageViewer(
$("#tbody--productList").find("td.prdDsuseImg").last()[0],
AddsComponentization.fnMakeGridImageViewer(
$("#tbody--productList").find("td.prdDsuseImg").last()[0],
"dsusePrdImgFiles",
di.data.fileInfo
);
}
}
$P.productList.onRemove = item => {
let key = item[0].data.keyCnt;
$("#tbody--productList").find("tr[data-key='"+key+"']").remove();
}
$P.productList.onCurrentChange = item => {
if (!item) return;
let key = item.data.keyCnt;
$("#tbody--productList").setCurrentRow(key);
}
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
@ -433,12 +474,12 @@
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
}
$P.fnSearchProduct = (title) => {
$P.productControl.getProductInfo();
}
@ -449,12 +490,12 @@
// 저장
$P.fnSave = async() => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let bsshData = $P.bsshFormFields.get();
if(bsshData.bsshCd == ""){
if(bsshData.bsshCd === ""){
dialog.alert({
content: "마약류 취급업체 정보를 입력해주세요."
});
@ -466,14 +507,14 @@
}
let dsProd = $P.productList.getDataset();
if(dsProd.length == 0){
if(dsProd.length === 0){
dialog.alert({
content: "폐기 제품 정보를 입력해주세요."
});
return false;
}
let fileCount = 0;
let fileCount = 0;
$("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function() {
if(this.dataset.url != null){
fileCount++;
@ -482,7 +523,7 @@
}
});
if(dsProd.length != fileCount){
if(dsProd.length !== fileCount){
dialog.alert({
content: "입력되지 않은 폐기 제품 이미지가 있습니다."
});
@ -491,7 +532,7 @@
dialog.alert({
content: "현재 폐기 신청서 접수 정보를 저장 하시겠습니까?"
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
let promiseArr = [];
@ -505,17 +546,17 @@
fileInfo.MIME_TYPE = this.dataset.mimeType;
fileInfo.FILE_NM = this.dataset.fileNm;
fileInfo.FILE_ID = this.dataset.fileId;
promiseArr.push(fnCreateFileFromFileInfo(fileInfo));
promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(fileInfo));
}
});
Promise.all(promiseArr).then((values) => {
$P.control.save(bsshData, dsProd, values);
}).catch((error) => {});
}
});
}
//추가
$P.fnAdd = () => {
if(!$P.productFormFields.get().prductCd){
@ -544,7 +585,7 @@
const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe.replaceAll('-','')+prdFrm.mnfNo+prdFrm.mnfSeq;
let isDup = $P.productList
.getDataset()
.filter(item => prdInfo == ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq)
.filter(item => prdInfo === ""+item.prductCd+item.prdValidDe.replaceAll('-','')+item.mnfNo+item.mnfSeq)
.length > 0;
if(isDup){
const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq;
@ -558,31 +599,31 @@
data.prdValidDe = data.prdValidDe.replaceAll('-','');
$P.productList.append([data]);
}
$P.fnDel = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
const row = $P.productList.getCurrent();
dialog.alert({
content: "아래 제품을 삭제하시겠습니까?<br>제품명: "+row.prductNm + "<br>유효기간: " +row.prdValidDe+"<br>제조번호: "+row.mnfNo+"<br>일련번호: " + row.mnfSeq
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
$P.productList.remove($P.productList.getCurrent().keyCnt);
}
});
}
$P.fnChangeDsusePrvCd = () => {
// validate 확인
let checkData = $("#dsusePrvCd--${pageName} option:selected").val();
if (checkData =="01" || checkData =="02") {
if (checkData ==="01" || checkData ==="02") {
$("#dsuseAcdtDe--${pageName}").prop('disabled', false);
}else{
$("#dsuseAcdtDe--${pageName}").prop('disabled', true);
$("#dsuseAcdtDe--${pageName}").val("");
}
}
/**************************************************************************
@ -594,18 +635,18 @@
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
$("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title"));
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
$("#dsusePrvCd--${pageName}").on("change", () => $P.fnChangeDsusePrvCd()); // 추가
//-------------------------------------------------------------------------
@ -623,15 +664,20 @@
fnBarcodeSearch(barcode);
}
});
// 숫자만 입력받도록 input 요소에 이벤트 리스너 추가
$("input[name='dsuseQy']").on('input', function() {
this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
});
//-------------------------------------------------------------------------
}
// 초기 화면 설정
$P.initForm = () => {
if($("input[name='prgrsSttsCd']").val() == '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
if($("input[name='prgrsSttsCd']").val() === '99' || ${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
$("#btnSave--${pageName}").prop("disabled", true);
}
initDatepicker("bssh--${pageName}");
AppSupport.initDatepicker("bssh--${pageName}");
$("#dsuseAcdtDe--${pageName}").datepicker("setDate", new Date());
}
@ -647,20 +693,20 @@
// 3. Dataset 설정
$P.control.setData([${dsuseReceptInfo}]);
let productInfo = ${dsuseReceptDtlInfo};
let fileInfo = ${fileInfo};
for(let p of productInfo){
p.keyCnt = (""+prdRowKey++);
for(let f of fileInfo){
if(p.dscdmngSn == f.SUB_TYPE){
if(p.dscdmngSn === f.SUB_TYPE){
p.fileInfo = f;
}
}
}
$P.productList.append(productInfo);
});
</script>

@ -92,13 +92,13 @@
<th class="cmn" style="width: 170.141px;">관할관청</th>
<th class="cmn" style="width: 120.141px;">폐기관리번호</th>
<th class="cmn" style="width: 110.469px;">폐기일자</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 300.469px;">업체명</th>
<th class="cmn" style="width: 90px;">폐기건수</th>
<th class="cmn" style="width: 160.469px;">처리상태</th>
<th class="cmn" style="width: 180.469px;">폐기사유</th>
<th class="cmn" style="width: 110.141px;">사고발생일</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th>
<th class="cmn" style="width: 110.141px;">취급일자</th>
</tr>
@ -111,13 +111,13 @@
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DEPT_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_ACDT_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
</tr>
@ -228,7 +228,7 @@
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.query = { pageNum : 1, fetchSize : $P.control.defaultFetchSize };
$P.control.beforeCurrent = null;
$P.detailControl = new DatasetControl({
urls : {
@ -239,7 +239,7 @@
, keymapper : info => info ? info.DSCDMNG_SN : ""
, dataGetter : obj => obj.dsuseMgtDetailList
, formats : {
PRD_VALID_DE: dateFormat
PRD_VALID_DE: dateFormat
}
});
@ -259,7 +259,7 @@
, func: "pageObject['${pageName}'].control.load({index})"
});
};
$P.detailControl.onDatasetChange = (obj) => {
@ -269,7 +269,7 @@
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) {
$P.detailControl.setData([]);
$P.detailControl.setData([]);
return;
}
let key = item.data.DSCDMNG_ID;
@ -303,34 +303,13 @@
bsshCd: row.BSSH_CD,
rprsntvNm: row.RPRSNTV_NM,
prmisnNo: row.PRMISN_NO,
bizrno: row.BIZR_NO,
bizrno: row.BIZRNO,
dsusePrvCd: row.DSUSE_PRV_CD,
dsuseAcdtDe: row.DSUSE_ACDT_DE,
prgrsSttsCd: row.PRGRS_STTS_CD
};
// let productDS = $P.detailControl.dataset.getDataset();
// if(productDS.length > 0){
// let newArr = [];
// for(let product of productDS){
// let newObj = {};
// newObj.dscdmngSn = product.DSCDMNG_SN;
// newObj.prductNm = product.PRDUCT_NM;
// newObj.prductCd = product.PRDUCT_CD;
// newObj.prdValidDe = product.PRD_VALID_DE;
// newObj.mnfNo = product.MNF_NO;
// newObj.mnfSeq = product.MNF_SEQ;
// newObj.minDistbQy = product.MIN_DISTB_QY;
// newObj.minDistbUnit = product.MIN_DISTB_UNIT;
// newObj.pceQy = product.PCE_QY;
// newObj.pceUnit = product.PCE_UNIT;
// newObj.dsuseQy = product.DSUSE_QY;
// newArr.push(newObj);
// }
// params.productList = JSON.stringify(newArr);
//
// }
}
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data : params
@ -347,7 +326,7 @@
}
});
}
// 신청서 정보 dialog
$P.control.removeDsuseMgt = (dscdmngId) => {
let params = {
@ -355,7 +334,7 @@
userId: "${currentUser.account}",
useYn: "N"
};
ajax.get({
url : wctx.url("/adds/nims/removeDsuseMgt.do")
, data: params
@ -365,8 +344,8 @@
dialog.alert({
content:"삭제되었습니다.",
init : () => {
setDialogZindex();
focusClose();
AppSupport.setDialogZindex();
AppSupport.focusClose();
},
onClose : () => {
$P.control.reload({all : true});
@ -408,7 +387,7 @@
if(option != null && option.reloaded){
initScroll = false;
}
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
@ -457,7 +436,7 @@
$P.fnCreateDsuseMGT = () => {
$P.control.getInfo();
}
// 폐기신청서 접수 등록 버튼 이벤트
$P.fnRemoveDsuseMGT = () => {
const row = $P.control.dataset.getCurrent();
@ -469,13 +448,13 @@
}
dialog.alert({
content: "자료를 삭제할 경우 복구가 불가능합니다.<br>아래 자료를 삭제하시겠습니까?<br>폐기관리번호: "+row.DSCDMNG_ID + "<br>업체명: " +row.BSSH_NM+"<br>폐기건수: "+row.RND_DTL_RPT_CNT+"<br>폐기사유: " + row.DSUSE_PRV_NM
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
$P.control.removeDsuseMgt(row.DSCDMNG_ID);
}
});
}
// 업체 검색 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
@ -525,7 +504,7 @@
}
// DataTables(그리드)
let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
let cellDefs = AppSupport.getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.control.query.cellDefs = cellDefs;
@ -553,7 +532,7 @@
$("#btnCreateDsuseMGT--${pageName}").on("click", function() {
$P.fnCreateDsuseMGT($(this).attr("title"));
});
// 폐기신청서 삭제
$("#btnRemoveDsuseMGT--${pageName}").on("click", function() {
$P.fnRemoveDsuseMGT($(this).attr("title"));
@ -578,13 +557,13 @@
});
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
Componentization.fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
// DataTables 스크롤 이벤트 생성
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
Componentization.fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// 하단 테이블 행 번호 표시
fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
, (tr)=>{ return $(tr).find("td.row-num")[0]; }
, (marker, value)=>{ if(marker != null){ marker.innerHTML = value; } }
);
@ -603,8 +582,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date());
$('#schSggCd--${pageName}').val("${currentUser.deptCode}");

@ -94,7 +94,7 @@
</div>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form> <!-- /입력 영역 -->
<input type="file" accept="image/*" id="inputUploadSet--${pageName}" hidden multiple />
@ -125,7 +125,6 @@
</li>
</template>
<script src="<c:url value="/webjars/applib/js/cmmnDateUtil.js?${ver}"/>"></script>
<script>
/**************************************************************************
* Global Variable
@ -158,10 +157,14 @@
document.getElementById("rsltImgList").innerHTML = "";
$('#btnImgAdd--${pageName}').prop('disabled', false);
$('#btnImgDel--${pageName}').prop('disabled', false);
$('#dsuseLoc--${pageName}')
.val('')
.prop('disabled', false);
let param = {
dscdmngId: $("#dscdmngId--${pageName}").val(),
dsuseDe: $("#dsuseDe--${pageName}").val().replace(/-/g, ""),
dsuseSeCd: $("#dsuseSeCd--${pageName}").val(),
dsuseMthCd: $("#dsuseMthCd--${pageName}").val(),
deptCd: "${currentUser.deptCode}"
};
@ -195,10 +198,11 @@
if(dscnmngIds.length > 1){
$('#dsuseDe--${pageName}').prop('disabled', true);
$('#dsuseMthCd--${pageName}').prop('disabled', true);
$('#dsuseSeCd--${pageName}').prop('disabled', true);
$('#dsuseLoc--${pageName}').prop('disabled', false);
$('#spnDsuseDe').show();
$('#spnDsuseMthCd').show();
document.getElementById("rsltImgList").innerHTML = '총 ' + dscnmngIds.length + '건 에서 폐기사진 공유<br>폐기사진 공유 폐기관리번호 : [' + dscnmngIds.filter(item => item != $("#dscdmngId--${pageName}").val()).join(', ') + ']';
}
return;
@ -207,18 +211,23 @@
isImgSaved = false;
$('#btnImgAdd--${pageName}').prop('disabled', true);
$('#btnImgDel--${pageName}').prop('disabled', true);
let tagsTextArr = [];
$('#dsuseLoc--${pageName}').prop('disabled', true);
if($('#dsuseLoc--${pageName}').val().length === 0){
$('#dsuseLoc--${pageName}').val(list[0].DSUSE_LOC);
}
let tagsTextArr = [];
for(let idx = 0; idx < list.length; idx++){
let item = list[idx];
tagsTextArr.push('폐기관리번호 : [ ' + item.DSCDMNG_ID + ' ]의 폐기사진 공유(총 ' + dscnmngIds.length + '건)<br>폐기일자 : [ ' + item.DSUSE_DE + ' ], 폐기방법 : [ ' + item.DSUSE_MTH_NM + ' ]');
tagsTextArr.push('폐기관리번호 : [ ' + item.DSCDMNG_ID + ' ]의 폐기사진 공유(총 ' + dscnmngIds.length + '건)<br>폐기일자 : [ ' + item.DSUSE_DE + ' ], 폐기방법 : [ ' + item.DSUSE_MTH_NM + ' ], 폐기장소 : [ ' + item.DSUSE_LOC + ' ]');
}
document.getElementById("rsltImgList").innerHTML = tagsTextArr.join("");
if(isOnloadExistRsltImg && list.length > 0) isRsltImgRemove = true;
}
// pageObject
let $P = pageObject["${pageName}"];
$P.fileInfos = ${fileInfos};
$P.fileArr = [];
@ -253,7 +262,7 @@
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
// 현재 선택 자료 변경 이벤트
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = item => {
if (!item) return;
@ -280,7 +289,7 @@
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { setDialogZindex(); }
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
@ -302,12 +311,12 @@
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
, onClose : () => { $P.control.setData([]); }
});
}
});
}
// 저장
$P.control.save = (info, fileArr) => {
let saveData = {
@ -333,7 +342,7 @@
dialog.alert({
content: "변경된 내용이 없습니다.",
init: () => {
focusOK();
AppSupport.focusOK();
}
});
return;
@ -342,7 +351,7 @@
//const msg = "현재 " + $P.control.prefixName + " 정보를 저장 하시겠습니까?" + isRsltImgRemove ? "<br>현재 등록된 이미지 삭제" : "";
dialog.alert({
content: (isRsltImgRemove ? "현재 등록된 이미지는 삭제 됩니다<br>[기등록 이미지 사용]<br>" : "") + $P.control.prefixName + " 정보를 저장 하시겠습니까?"
, init: () => setDialogZindex()
, init: () => AppSupport.setDialogZindex()
, onOK: () => {
upload({
url: wctx.url("/adds/nims/saveDsuseMgtRslt.do")
@ -377,11 +386,11 @@
$P.fileArr.push(files[i]);
}
}
$P.fnDisplay();
};
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
@ -416,10 +425,10 @@
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 이미지 표시
$P.fnDisplay = () => {
if($P.fileArr.length > 0){
let tagsText = $P.fnMakeImgTags($P.fileArr);
document.querySelector("#dragAndDrop--${pageName}").innerHTML = tagsText;
@ -428,9 +437,9 @@
document.querySelector("#dragAndDrop--${pageName}").innerHTML = "";
$("#btnImgDel--${pageName}").attr("hidden","hidden");
}
}
// HTML 태그(img,checkbox) 문자열 생성
$P.fnMakeImgTags = (fileArr) => {
let tagsTextArr = [];
@ -439,7 +448,7 @@
let item = fileArr[index];
let template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML;
template = template.replace(/{name}/gi, "dsuseDsuseImgFilesSelector");
template = template.replace(/{value}/gi, item.id);
template = template.replace(/{src}/gi, item.url);
@ -448,7 +457,7 @@
return tagsTextArr.join("");
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
@ -460,7 +469,7 @@
// 저장
$P.fnSave = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let rsltData = $P.formFields.get();
if(rsltData.hdrDe == ""){
@ -510,7 +519,7 @@
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
//이미지 삭제 버튼
$("#btnImgDel--${pageName}").on("click", function() {
let checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked");
@ -519,16 +528,16 @@
checkeds.each(function(){
keys.push(this.value);
});
$P.fileArr = $P.fileArr.filter((element) => keys.indexOf(element.id) === -1);
$P.fnDisplay();
}
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}").on("change", () => {
$("#dsuseDe--${pageName}, #dsuseMthCd--${pageName}, #dsuseSeCd--${pageName}").on("change", () => {
isImgSaved = true;
isRsltImgRemove = false;
if(initDataset) searchRsltImgList();
@ -546,7 +555,7 @@
let tmp = $P.fileArr[evt.oldIndex];
$P.fileArr[evt.oldIndex] = $P.fileArr[evt.newIndex];
$P.fileArr[evt.newIndex] = tmp;
$P.fnDisplay();
}
}
@ -559,7 +568,7 @@
searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
initDatepicker("frmEdit--${pageName}"); // 달력 초기화
AppSupport.initDatepicker("frmEdit--${pageName}"); // 달력 초기화
if(${currentUser.hasAuthorities("ROLE_MANAGER")} || ${currentUser.hasAuthorities("ROLE_ADMIN")}) {
$("#btnSave--${pageName}").prop("disabled", true);
@ -594,24 +603,24 @@
$("#hdrDe--${pageName}").datepicker("setDate", new Date()); // 취급 일자
$("#dsuseDe--${pageName}").datepicker("setDate", new Date()); // 폐기 일자
}
if($P.fileInfos.length > 0){
let promiseArr = [];
$P.fileInfos.forEach(f => {
// URL에 c: d: 제거
if(/^[a-zA-Z][\:]/.test(f.URL)){
f.URL = f.URL.substring(2);
}
try{
promiseArr.push(fnCreateFileFromFileInfo(f));
promiseArr.push(AddsSupport.fnCreateFileFromFileInfo(f));
}catch(e){
console.log(e);
}
});
Promise.all(promiseArr).then((values) => {
$P.fileArr = $P.fileArr.concat(values);
$P.fnDisplay();
@ -622,6 +631,6 @@
});
</script>

@ -87,13 +87,13 @@
<th class="cmn" style="width: 170.141px;">관할관청</th>
<th class="cmn" style="width: 120.141px;">폐기관리번호</th>
<th class="cmn" style="width: 110.469px;">폐기일자</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 150px;">폐기방법</th>
<th class="cmn" style="width: 250.469px;">업체명</th>
<th class="cmn" style="width: 90px;">폐기건수</th>
<th class="cmn" style="width: 160.469px;">처리상태</th>
<th class="cmn" style="width: 180.469px;">폐기사유</th>
<th class="cmn" style="width: 120.141px;">사고발생일</th>
<th class="cmn" style="width: 150px;">폐기구분</th>
<th class="cmn" style="width: 200.469px;">폐기장소</th>
<th class="cmn" style="width: 110.141px;">취급일자</th>
</tr>
@ -106,13 +106,13 @@
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DEPT_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_ACDT_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
</tr>
@ -221,7 +221,7 @@
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.query = { pageNum : 1, fetchSize : $P.control.defaultFetchSize };
$P.control.beforeCurrent = null;
$P.detailControl = new DatasetControl({
urls : {
@ -252,7 +252,7 @@
, func: "pageObject['${pageName}'].control.load({index})"
});
};
$P.detailControl.onDatasetChange = (obj) => {
@ -262,7 +262,7 @@
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) {
$P.detailControl.setData([]);
$P.detailControl.setData([]);
return;
}
@ -292,9 +292,10 @@
$P.control.getInfo = (isDtl) => {
let dialogTitle = "폐기 결과[통보] 등록";
const row = $P.control.dataset.getCurrent();
if(isDtl && row.PRGRS_STTS_CD != "01") dialogTitle = "폐기 결과[통보] 상세";
if (typeof row == "undefined" || row == null || row == "") return;
let params = {
dscdmngId: row.DSCDMNG_ID,
bsshNm: row.BSSH_NM,
@ -329,7 +330,7 @@
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => {
, onClose : () => {
$P.control.reload({all : true});
}
});
@ -369,10 +370,10 @@
if(option != null && option.reloaded){
initScroll = false;
}
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
@ -421,7 +422,7 @@
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 사용자검색 callback
$P.callbackFindUser = (userId, userNm) => {
@ -438,7 +439,7 @@
});
return;
}
$P.control.getInfo();
}
@ -491,7 +492,7 @@
}
// DataTables(그리드)
let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
let cellDefs = AppSupport.getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.control.query.cellDefs = cellDefs;
@ -539,13 +540,13 @@
});
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
Componentization.fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
// DataTables 스크롤 이벤트 생성
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
Componentization.fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// 하단 테이블 행 번호 표시
fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
, (tr)=>{ return $(tr).find("td.row-num")[0]; }
, (marker, value)=>{ if(marker != null){ marker.innerHTML = value; } }
);
@ -564,8 +565,8 @@
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
AppSupport.initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateSupport.getAddDay(-7)); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSttsCd--${pageName}').val('01');

@ -10,25 +10,25 @@
<div class="container-search">
<!-- hidden -->
<div class="row my-0 mx-1 g-0" style="align-items: baseline">
<div class="col-md-8">
<div class="col-md-9">
<label for="ProductNm--${pageName}" class="w-px-90 bg-lighter pe-2 col-form-label text-sm-end">제품명/코드</label>
<input type="text" class="form-control w-px-100" id="productNm--${pageName}" name="schProductNm" >
<input type="text" class="form-control w-px-120" id="productCd--${pageName}" name="schProductCd" >
<input type="text" class="form-control w-px-100" id="productNm--${pageName}" name="schProductNm">
<input type="text" class="form-control w-px-150" id="productCd--${pageName}" name="schProductCd" maxlength="13" oninput="this.value = this.value.slice(0, 13)">
</div>
<div class="col-md-4">
<button type="button" class="btn btn-search w-px-50" id="btnSearch--${pageName}" title="검색">검색</button>&nbsp;
<button type="button" class="btn btn-primary w-px-80" id="btnSearch2--${pageName}" title="검색">NIMS 검색</button>
<div class="col-md-3">
<button type="button" class="btn btn-search w-px-50" id="btnSearch--${pageName}" title="검색">NIMS 검색</button>&nbsp;
</div>
</div>
</div>
</form>
<!-- / 업무 버튼 표시 -->
<!-- / 업무 버튼 표시 -->
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-500" id="table-responsiv-0--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-600" id="table-responsive-0--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead>
<thead class="sticky-thead">
<tr>
<th class="cmn" style="width: 70px;">No.</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 350.141px;">제품명</th>
<th class="sorting" style="width: 120.469px;">유통단위</th>
@ -38,10 +38,11 @@
<th class="sorting" style="width: 130.469px;">취급자번호</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{keyCnt}">
<td class="row-num text-end" onclick="{onclick}" ondblclick="{ondblclick}"></td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{prductNm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prdMinDistbQy} {stdPackngStleNm}</td>
@ -64,55 +65,59 @@
<label id="${infoPrefix}Paging--${pageName}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="${infoPrefix}Paging--${pageName}" class="pagination pagination-primary" style="display: none;">
</ul>
<!-- FIXME:: NIMS API 개발 완료후 적용 -->
<%--
<span class="container-window-btn-right">
<input type="checkbox" id="chkBsshCd--${pageName}" name="chkBsshCd" title="업체코드적용" style="align-items: baseline"/>&nbsp;<strong>신규API 업체코드 적용</strong>
</span>
--%>
</div>
</div>
<div class="card col-6">
<form id="frmSearch--${pageName}Detail" name="frmSearchDetail">
<input type="hidden" id="bsshCd" name="bsshCd">
<div class="container-search">
<!-- hidden -->
<div class="row my-0 mx-1 g-0" style="align-items: baseline">
<div class="col-md-5">
<select id="schOpt--${pageName}" name="schOpt" class="form-selectxit">
<select id="schOpt--${pageName}" name="schOpt" class="form-select" style="width: 106px !important;">
<option value="1">제조번호</option>
<option value="2">일련번호</option>
</select>
<input type="text" class="form-control w-60" id="schText--${pageName}" name="schText" >
<input type="text" class="form-control w-px-100" id="schText--${pageName}" name="schText" >
</div>
<div class="col-md-5">
<label for="schPrdValidDe--${pageName}" class="w-px-90 bg-lighter pe-2 col-form-label text-sm-end">유효기간</label>
<input type="text" class="form-control w-50" id="schPrdValidDe--${pageName}" name="schPrdValidDe" data-fmt-type="day" data-map="schPrdValidDe" autocomplete="off" title="유효기간" />
</div>
<div class="col-md-2">
<button type="button" class="btn btn-primary w-px-90" id="btnSearch3--${pageName}" title="검색">NIMS 검색</button>
<button type="button" class="btn btn-primary w-px-60" id="btnSearchDtl--${pageName}" title="검색">NIMS 검색</button>
</div>
</div>
<div>
<span style="padding-left: 50px; font-weight: bold; color: #696cff">유효기간(제조번호 또는 시리얼번호 조회 결과 내에서 조회)</span>
</div>
</div>
</form>
</form>
<!-- 업무 버튼 표시 -->
<div>
</div>
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_1_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-500" id="table-responsive-1--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-600" id="table-responsive-1--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_1_info">
<thead>
<thead class="sticky-thead">
<tr>
<%-- <th class="sorting" style="width: 146.156px;">제품코드</th>--%>
<%-- <th class="sorting" style="width: 330.141px;">제품명</th>--%>
<th class="sorting" style="width: 120.469px;">유효기간</th>
<th class="sorting" style="width: 160.469px;">제조번호</th>
<th class="sorting" style="width: 160.469px;">제조일련번호</th>
<th class="cmn" style="width: 70px;">No.</th>
<th class="sorting" style="width: 146px;">제품코드</th>
<th class="sorting" style="width: 110px;">유효기간</th>
<th class="sorting" style="width: 155px;">제조번호</th>
<th class="sorting" style="width: 155px;">제조일련번호</th>
</tr>
</thead>
<tbody id="tbody--${pageName}Detail">
<tbody id="tbody--${pageName}Detail">
</tbody>
<template id="${infoPrefix}Row--${pageName}Detail">
<tr data-key="{keyCnt}">
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>--%>
<%-- <td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{prductNm}</td>--%>
<td class="row-num text-end" onclick="{onclick}" ondblclick="{ondblclick}"></td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prdValidDe}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{mnfNo}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{mnfSeq}</td>
@ -132,6 +137,7 @@
<ul id="${infoPrefix}DetailPaging--${pageName}" class="pagination pagination-primary" style="display: none;">
</ul>
<span class="container-window-btn-right">
<input type="checkbox" id="chkDtlBsshCd--${pageName}" name="chkDtlBsshCd" title="업체코드적용" style="align-items: baseline"/>&nbsp;<strong>신규 API 업체코드 적용</strong>
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="선택">선택</button>
</span>
@ -189,13 +195,13 @@
, appendData: true
, infoSize: "xl"
});
// $P.control 설정
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.detailControl = new DatasetControl({
$P.seqInfoControl = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/getNimsProductSeqInfo.do"), // 시리얼번호 검색
}
@ -225,9 +231,9 @@
prdValidDe: dateFormat
}
});
// $P.control 설정
$P.detailControl.defaultFetchSize = FETCH_MD; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.seqInfoControl.defaultFetchSize = FETCH_MD; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
@ -235,39 +241,39 @@
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj, option) => {
$P.renderList(obj.${infoPrefix}Total, option);
$P.renderList(obj.totalCount, option);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
list: $P.control.dataset
, prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length
, totalSize: obj.totalCount
, fetchSize: obj.${infoPrefix}Fetch
, func: "pageObject['${pageName}'].control.load({index})"
//, func: "pageObject['${pageName}'].control.load({index})"
});
};
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = item => {
if (!item) {
$P.detailControl.setData([]);
$("#btnSearch3--${pageName}").prop("disabled", true);
$P.seqInfoControl.setData([]);
$("#btnSearchDtl--${pageName}").prop("disabled", true);
return;
}
let key = item.data.keyCnt;
$("#tbody--${pageName}").setCurrentRow(key);
$("#btnSearch3--${pageName}").prop("disabled", false);
$("#btnSearchDtl--${pageName}").prop("disabled", false);
$P.fnDetailSearchList();
}
// 현재 선택 자료 변경 이벤트
$P.detailControl.onCurrentChange = (item) => {
$P.seqInfoControl.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.keyCnt;
@ -275,20 +281,17 @@
$("#tbody--${pageName}Detail").setCurrentRow(key);
};
$P.detailControl.onDatasetChange = (obj, option) => {
$P.seqInfoControl.onDatasetChange = (obj, option) => {
$P.renderDetailList(obj.totalCount, option);
$("#${infoPrefix}DetailPaging--${pageName}").setPagingInfo({
list: $P.detailControl.dataset
list: $P.seqInfoControl.dataset
, prefix: "${infoPrefix}DetailPaging--${pageName}"
, totalSize: obj.totalCount
});
};
// 저장 callback
// 저장
/**************************************************************************
* DataTables 이벤트
@ -299,30 +302,20 @@
let ${infoPrefix}List = $P.control.dataset;
let empty = ${infoPrefix}List.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("${infoPrefix}Row--${pageName}").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let foundTds = $(foundContent).find("td");
foundTds.each(function() {
foundTr.appendChild(this.cloneNode(true));
});
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("keyCnt") + "');");
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
$("#tbody--${pageName}").html(trs.join());
let trs = empty ?
[document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] :
${infoPrefix}List.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}").innerHTML,
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("keyCnt") + "');"));
let noMore = (${infoPrefix}List.length >= totalSize);
let initScroll = ($P.control.query.pageNum < 2);
$("#table-responsive-0--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
$P.renderDetailList = (totalSize, option) => {
let ${infoPrefix}DetailList = $P.detailControl.dataset;
let ${infoPrefix}DetailList = $P.seqInfoControl.dataset;
let empty = ${infoPrefix}DetailList.empty;
let trs = empty ?
@ -330,16 +323,13 @@
${infoPrefix}DetailList.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].detailControl.setCurrent('" + dataItem.getValue("keyCnt") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()")
);
.replace(/{onclick}/gi, "pageObject['${pageName}'].seqInfoControl.setCurrent('" + dataItem.getValue("keyCnt") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()"));
let noMore = (${infoPrefix}DetailList.length >= totalSize);
let initScroll = ($P.detailControl.query.pageNum < 2);
$("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
let initScroll = ($P.seqInfoControl.query.pageNum < 2);
$("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
/**************************************************************************
* 사용자 함수(function)
@ -349,12 +339,33 @@
* 버튼 clickEvent
**************************************************************************/
//그리드(좌)조회(새로 조회)
$P.fnSearchList = (dbSkipYn) => {
$P.fnSearchList = () => {
if($P.formFields.get().schProductNm.length + $P.formFields.get().schProductCd.length === 0){
dialog.alert({
content: "상품명 또는 상품번호중 하나는 필수입니다."
});
return false;
}
// if($P.formFields.get().schProductNm.length !== 0 && $P.formFields.get().schProductNm.length < 2){
// dialog.alert({
// content: "상품명은 2자 이상으로 조회해 주세요."
// });
// return false;
// }
// FIXME:: NIMS API 개발 완료후 적용
let bsshCd = '${bsshCd}';
<%--if(!$('#chkBsshCd--${pageName}').is(":checked")){--%>
<%-- bsshCd = '';--%>
<%--}--%>
$P.control.query = {
... $P.formFields.get(),
pg: 1,
p: $P.formFields.get().schProductCd,
pn: $P.formFields.get().schProductNm,
dbSkipYn: dbSkipYn? dbSkipYn : "N",
bc: bsshCd, //업체코드
userId: "${currentUser.account}"
};
$P.control.query.fetchSize = FETCH_XXL; // 한번에 조회되는 자료 건수
@ -362,36 +373,52 @@
$P.control.load(1);
}
$P.scrollList = () => {
$P.control.query.pg = $P.control.query.pageNum + 1;
$P.control.load($P.control.query.pageNum + 1);
}
//그리드(우)조회(새로 조회)
$P.fnDetailSearchList = () => {
$P.detailControl.query = {
fg: $('#schOpt--productMain').val(), // 1-제조번호, 2-시리얼번호
if(!$P.control.dataset.getCurrent()?.prductCd){
return false;
}
let bsshCd = '${bsshCd}';
if(!$('#chkDtlBsshCd--${pageName}').is(":checked")){
bsshCd = '';
}
$P.seqInfoControl.query = {
fg: $('#schOpt--productPopup').val(), // 1-제조번호, 2-시리얼번호
pg: 1,
p: $P.control.dataset.getCurrent().prductCd , //제품코드
prdValidDe: $("input[name='schPrdValidDe']").val().replaceAll("-", ""),
t: $('#schText--productMain').val(), //제조번호 또는 시리얼번호
p: $P.control.dataset.getCurrent().prductCd , //제품코드
t: $('#schText--productPopup').val(), //제조번호 또는 시리얼번호
vd: $("input[name='schPrdValidDe']").val().replaceAll("-", ""),
bc: bsshCd, //업체코드
userId: "${currentUser.account}"
};
$P.detailControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수
$P.detailControl.query.delYn = "N"; // 삭제 여부
$P.seqInfoControl.query.fetchSize = FETCH_MD; // 한번에 조회되는 자료 건수
$P.seqInfoControl.query.delYn = "N"; // 삭제 여부
$P.detailControl.load(1);
$P.seqInfoControl.load(1);
}
//그리드(우)조회(스크롤)
$P.scrollDetailDataList = () => {
$P.detailControl.query.pg = $P.detailControl.query.pageNum + 1;
$P.detailControl.load($P.detailControl.query.pageNum + 1);
$P.seqInfoControl.query.pg = $P.seqInfoControl.query.pageNum + 1;
$P.seqInfoControl.load($P.seqInfoControl.query.pageNum + 1);
}
// 저장
$P.fnSave = () => {
let openPage = new AddsFormFields("#${openPage}");
productData = {...$P.control.getCurrent(), ...$P.detailControl.getCurrent()}
productData = {...$P.control.getCurrent(), ...$P.seqInfoControl.getCurrent()}
openPage.set (null,productData); // formFields
dialog.close("productMainDialog");
dialog.close("productPopupDialog");
}
/**************************************************************************
@ -399,7 +426,7 @@
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$("#frmSearch--${pageName}").find(".form-date").each(function() {
$(this).on("input", function() {
let value = this.value.replaceAll("-", "");
@ -411,24 +438,35 @@
}
});
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList());
$("#btnSearch2--${pageName}").on("click", () => $P.fnSearchList("Y"));
$("#btnSearch3--${pageName}").on("click", () => $P.fnDetailSearchList());
$("#btnSearchDtl--${pageName}").on("click", () => $P.fnDetailSearchList());
$("#chkDtlBsshCd--${pageName}").on("change", () => $P.fnDetailSearchList());
$("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList);
$("#frmSearch--${pageName}Detail input").onEnterPress($P.fnDetailSearchList);
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}')
, (tr)=>{ return $(tr).find("td.row-num")[0]; }
, (marker, value)=>{ if(marker != null){ marker.innerHTML = value; } }
);
Componentization.fnMakeRowNumberingTable(document.getElementById('tbody--${pageName}Detail')
, (tr)=>{ return $(tr).find("td.row-num")[0]; }
, (marker, value)=>{ if(marker != null){ marker.innerHTML = value; } }
);
}
fnMakeScrollableTable($("#table-responsive-1--${pageName}")[0], $P.scrollDetailDataList);
Componentization.fnMakeScrollableTable($("#table-responsive-0--${pageName}")[0], $P.scrollList);
Componentization.fnMakeScrollableTable($("#table-responsive-1--${pageName}")[0], $P.scrollDetailDataList);
// 초기 화면 설정
$P.initForm = () => {
$("#btnSearch3--${pageName}").prop("disabled", true);
$("#btnSearchDtl--${pageName}").prop("disabled", true);
}
/**************************************************************************

@ -183,9 +183,18 @@ sggDepts.depts.onDatasetChange = obj => {
sggDepts.sggs.setData({sggList: ${sggs}});
sggDepts.depts.setData({deptList: ${depts}});
<c:if test="${!empty userInfo}">infoPrefixCtrl.setData([${userInfo}]);</c:if>
var infoPrefixFields = new FormFields("#infoPrefix-form");
<c:if test="${!empty userInfo}">
var info = ${userInfo};
if (infoPrefixCtrl.dataset.empty)
infoPrefixCtrl.dataset.setData({userList: [info]});
else
infoPrefixCtrl.dataset.replace({data: info});
</c:if>
infoPrefixCtrl.setInfo = obj => {
infoPrefixFields.set(infoPrefixCtrl, obj);
obj = obj || infoPrefixCtrl.dataset.getCurrent("item");
let create = isEmpty(obj.data.USER_ACNT);
$("input[name='account']").prop("readonly", !create);
@ -234,7 +243,7 @@ function saveinfoPrefix() {
dialog.alert({
content:"현재 prefixName 정보를 저장하시겠습니까?",
onOK:() => {
infoPrefixCtrl.save(infoPrefixCtrl.toObject());
infoPrefixCtrl.save(infoPrefixFields.get());
}
});
}
@ -264,5 +273,7 @@ function setDepts(instCode) {
sggDepts.getDepts({instCode: instCode});
}
$(infoPrefixCtrl.selector("[name='birthday']")).datePicker();
//# sourceURL=user-info.jsp
</script>

@ -7,7 +7,7 @@
<div class="d-flex flex-row justify-content-between p-3">
<div>
<div class="input-group">
<select name="by" onchange="userCtrl.find('term').focus();" class="form-select">
<select name="by" onchange="userCtrl.find('name', 'term').focus();" class="form-select">
<option value="userName">이름</option>
<option value="userAccount">계정</option>
</select>
@ -24,11 +24,11 @@
<table class="datatables-ajax table table-bordered dataTable no-footer">
<thead name="userThead">
<tr><th tabindex="0" style="width: 158.828px; text-align:center;"><input onchange="userCtrl.select(this.checked);" type="checkbox" class="form-check-input"></th>
<th data-field="USER_ACNT" class="sorting" style="width: 223.719px;">계정</th>
<th data-field="USER_NM" class="sorting" style="width: 146.156px;">이름</th>
<th class="sorting" style="width: 195.688px;">이메일</th>
<th class="sorting" style="width: 160.141px;">전화번호(무선)</th>
<th class="sorting" style="width: 230.469px;">등록일자</th>
<th style="width: 223.719px;">계정</th>
<th style="width: 146.156px;">이름</th>
<th style="width: 195.688px;">이메일</th>
<th style="width: 160.141px;">전화번호(무선)</th>
<th style="width: 230.469px;">등록일자</th>
</tr>
</thead>
<tbody name="userList">
@ -62,8 +62,8 @@ var userCtrl = newUserControl();
userCtrl.search = () => {
userCtrl.query = {
by: userCtrl.find("by").value,
term: userCtrl.find("term").value
by: userCtrl.find("name", "by").value,
term: userCtrl.find("name", "term").value
};
userCtrl.load(1);
}
@ -82,15 +82,15 @@ userCtrl.renderList = () => {
empty = userList.empty;
let trs = empty ?
[userCtrl.find("userNotFound").innerHTML] :
[userCtrl.find("name", "userNotFound").innerHTML] :
userList.inStrings(
userCtrl.find("userRow").innerHTML,
userCtrl.find("name", "userRow").innerHTML,
(str, dataItem) => str
.replace(/{onclick}=""/gi, 'onclick="userCtrl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
.replace(/{ondblclick}=""/gi, 'ondblclick="userCtrl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"')
.replace(/{onclick}=""/gi, 'onclick="userCtrl.setCurrent(\'{USER_ID}\');"')
.replace(/{ondblclick}=""/gi, 'ondblclick="userCtrl.getInfo({userID: \'{USER_ID}\'});"')
);
userCtrl.find("userList").innerHTML = trs.join("");
userCtrl.querySelector("[name='userThead'] th input[type='checkbox']").checked = false;
userCtrl.find("name", "userList").innerHTML = trs.join("");
userCtrl.find("[name='userThead'] th input[type='checkbox']").checked = false;
}
userCtrl.onDatasetChange = obj => {
@ -116,12 +116,12 @@ userCtrl.onCurrentChange = item => {
userCtrl.onSelectionChange = selected => {
let userList = userCtrl.dataset;
let keys = selected.map(e => userList.getKey(e));
userCtrl.querySelectorAll("[name='userList'] input[type='checkbox']")
userCtrl.findAll("[name='userList'] input[type='checkbox']")
.forEach(node => {
node.checked = keys.includes(node.value);
});
userCtrl.querySelectorAll(".enable-onfound")
userCtrl.findAll(".enable-onfound")
.forEach(node => {
node.disabled = keys.length < 1;
});
@ -131,7 +131,6 @@ $(userCtrl.selector("[name='term']")).onEnterPress(userCtrl.search);
$(function(){
${onload}
tableSorter(userCtrl, "th[data-field]");
userCtrl.setData({
userList:${userList},

@ -21,6 +21,7 @@
<!-- base -->
<script src="<c:url value="/webjars/js/base/base.js"/>"></script>
<script src="<c:url value="/webjars/js/base/dataset.js"/>"></script>
<script src="<c:url value="/webjars/js/base/dataset-support.js"/>"></script>
<script src="<c:url value="/webjars/js/base/upload-support.js?${ver}"/>"></script>
<script src="<c:url value="/webjars/js/base/code.js"/>"></script>
<script src="<c:url value="/webjars/js/base/code-support.js"/>"></script>
@ -31,22 +32,20 @@
<script src="<c:url value="/webjars/js/base/sgg-dept.js?${ver}"/>"></script>
<script src="<c:url value="/webjars/js/base/authority.js"/>"></script>
<!-- 전체화면 비활성화 -->
<script src="<c:url value="/webjars/3rd-party/sneat/libs/block-ui/block-ui.js"/>"></script>
<!-- 드래그앤드롭 정렬 -->
<script src="<c:url value="/webjars/3rd-party/sneat/libs/sortablejs/sortable.js"/>"></script>
<script src="<c:url value="/resources/js/base/addsFormFields.js?${ver}"/>"></script>
<!-- 공통 유틸 -->
<script src="<c:url value="/webjars/applib/js/cmmnUtil.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/adds/cmmn/adds-cmmnUtil.js?${ver}"/>"></script>
<!-- 날짜 관련 유틸 -->
<script src="<c:url value="/webjars/applib/js/cmmnDateUtil.js?${ver}"/>"></script>
<!-- 초기화 유틸 -->
<script src="<c:url value="/webjars/applib/js/initAfterPageLoad.js?${ver}"/>"></script>
<!-- 커스텀UI -->
<!-- 공통 유틸(applib) -->
<script src="<c:url value="/webjars/applib/js/app-base.js?${ver}"/>"></script>
<script src="<c:url value="/webjars/applib/js/string-support.js?${ver}"/>"></script>
<script src="<c:url value="/webjars/applib/js/date-support.js?${ver}"/>"></script>
<script src="<c:url value="/webjars/applib/js/app-support.js?${ver}"/>"></script>
<script src="<c:url value="/webjars/applib/js/componentization.js?${ver}"/>"></script>
<!-- (adds) -->
<script src="<c:url value="/resources/js/adds/cmmn/adds-base.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/adds/cmmn/adds-support.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/adds/cmmn/adds-componentization.js?${ver}"/>"></script>

@ -53,6 +53,12 @@
${functions}
var currentUserCtrl = newUserControl();
currentUserCtrl.prefix = "currentUser";
currentUserCtrl.onSave = resp => {
if (resp.saved) {
dialog.alert("저장됐습니다.");
dialog.close(currentUserCtrl.prefixed("dialog"));
}
};
function currentUserInfo() {
currentUserCtrl.dataset.clear();

@ -247,7 +247,7 @@ function fnReturn(){
dialog.close("searchAddrDialog");
}
fnMakeResizableTable($("#table-responsive")[0]);
Componentization.fnMakeResizableTable($("#table-responsive")[0]);
$("#list").hide();
</script>

@ -1,3 +1,7 @@
if(window.help !== undefined){
help.prototype.list.push("AddsFormFields 클래스 : FormFields클래스를 상속받은 ADDS프로젝트 내에서 사용하는 FormFields클래스");
}
/**************************************************************************
* AddsFormFields
**************************************************************************/

@ -1,33 +0,0 @@
/**************************************************************************
* 서버의 파일 정보로 javascript File 객체 생성
**************************************************************************/
async function fnCreateFileFromFileInfo(fileInfo){
if(/^[a-zA-Z][\:]/.test(fileInfo.URL)){
fileInfo.URL = fileInfo.URL.substring(2);
}
let response = null;
try {
response = await fetch(fileInfo.URL);
} catch(error){
let data = new Blob();
let metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
return new Promise(resolve => { resolve(file); });
}
let data = await response.blob();
let metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
return new Promise(resolve => { resolve(file); });
}

@ -1,62 +1,69 @@
/**************************************************************************
* 그리드 내부 이미지 첨부
**************************************************************************/
function fnMakeGridImageViewer(tdEl, fileInputElName, fileInfo) {
let fileInputEl = document.createElement("input");
fileInputEl.name = fileInputElName;
fileInputEl.type = "file";
fileInputEl.setAttribute("hidden", "hidden");
fileInputEl.setAttribute("accept", "image/*")
tdEl.appendChild(fileInputEl);
if (fileInfo != null) {
fileInputEl.dataset.url = fileInfo.URL;
fileInputEl.dataset.fileNm = fileInfo.FILE_NM;
fileInputEl.dataset.mimeType = fileInfo.MIME_TYPE;
fileInputEl.dataset.fileId = fileInfo.FILE_ID;
}
let uploadButtonEl = document.createElement("button");
uploadButtonEl.type = "button";
uploadButtonEl.classList.add("btn", "btn-primary", "w-px-50", "mx-1");
uploadButtonEl.textContent = "등록";
tdEl.appendChild(uploadButtonEl);
let viewButtonEl = document.createElement("button");
viewButtonEl.type = "button";
viewButtonEl.classList.add("btn", "btn-primary", "w-px-50", "mx-1");
viewButtonEl.setAttribute("hidden", "hidden");
viewButtonEl.textContent = "보기";
tdEl.appendChild(viewButtonEl);
$(fileInputEl).on("change", function () {
if (this.files != null && this.files.length > 0) {
$(uploadButtonEl).text("변경");
$(viewButtonEl).removeAttr("hidden");
} else if (this.dataset.url != null) {
$(uploadButtonEl).text("변경");
$(viewButtonEl).removeAttr("hidden");
} else {
$(uploadButtonEl).text("등록");
$(viewButtonEl).attr("hidden", "hidden");
}
});
$(uploadButtonEl).on("click", function () {
$(fileInputEl).click();
});
$(viewButtonEl).on("click", function () {
let viewUrl = "";
if (fileInputEl.files.length != 0) {
viewUrl = (window.URL || window.webkitURL).createObjectURL(fileInputEl.files[0]);
} else {
viewUrl = fileInputEl.dataset.url;
}
window.open(viewUrl, "이미지", "width=500, height=500");
});
$(fileInputEl).trigger("change");
if(window.help !== undefined){
help.prototype.list.push("AddsComponentization 클래스 : 특정 HTML요소에 기능을 추가할 수 있다.");
}
class AddsComponentization {
/**************************************************************************
* 그리드 내부 이미지 첨부
**************************************************************************/
static fnMakeGridImageViewer(tdEl, fileInputElName, fileInfo) {
let fileInputEl = document.createElement("input");
fileInputEl.name = fileInputElName;
fileInputEl.type = "file";
fileInputEl.setAttribute("hidden", "hidden");
fileInputEl.setAttribute("accept", "image/*")
tdEl.appendChild(fileInputEl);
if (fileInfo != null) {
fileInputEl.dataset.url = fileInfo.URL;
fileInputEl.dataset.fileNm = fileInfo.FILE_NM;
fileInputEl.dataset.mimeType = fileInfo.MIME_TYPE;
fileInputEl.dataset.fileId = fileInfo.FILE_ID;
}
let uploadButtonEl = document.createElement("button");
uploadButtonEl.type = "button";
uploadButtonEl.classList.add("btn", "btn-primary", "w-px-50", "mx-1");
uploadButtonEl.textContent = "등록";
tdEl.appendChild(uploadButtonEl);
let viewButtonEl = document.createElement("button");
viewButtonEl.type = "button";
viewButtonEl.classList.add("btn", "btn-primary", "w-px-50", "mx-1");
viewButtonEl.setAttribute("hidden", "hidden");
viewButtonEl.textContent = "보기";
tdEl.appendChild(viewButtonEl);
$(fileInputEl).on("change", function () {
if (this.files != null && this.files.length > 0) {
$(uploadButtonEl).text("변경");
$(viewButtonEl).removeAttr("hidden");
} else if (this.dataset.url != null) {
$(uploadButtonEl).text("변경");
$(viewButtonEl).removeAttr("hidden");
} else {
$(uploadButtonEl).text("등록");
$(viewButtonEl).attr("hidden", "hidden");
}
});
$(uploadButtonEl).on("click", function () {
$(fileInputEl).click();
});
$(viewButtonEl).on("click", function () {
let viewUrl = "";
if (fileInputEl.files.length != 0) {
viewUrl = (window.URL || window.webkitURL).createObjectURL(fileInputEl.files[0]);
} else {
viewUrl = fileInputEl.dataset.url;
}
window.open(viewUrl, "이미지", "width=500, height=500");
});
$(fileInputEl).trigger("change");
}
}

@ -0,0 +1,40 @@
if(window.help !== undefined){
help.prototype.list.push("AddsSupport 클래스 : ADDS프로젝트 내에서 공통적으로 사용할 수 있는 기능 지원");
}
class AddsSupport {
/**************************************************************************
* 서버의 파일 정보로 javascript File 객체 생성
**************************************************************************/
static async fnCreateFileFromFileInfo(fileInfo){
if(/^[a-zA-Z][\:]/.test(fileInfo.URL)){
fileInfo.URL = fileInfo.URL.substring(2);
}
let response = null;
try {
response = await fetch(fileInfo.URL);
} catch(error){
let data = new Blob();
let metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
return new Promise(resolve => { resolve(file); });
}
let data = await response.blob();
let metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
return new Promise(resolve => { resolve(file); });
}
}
Loading…
Cancel
Save