Merge branch 'dev' into fetch_friday
This commit is contained in:
@@ -25,6 +25,10 @@ public class CreateDailyExpenseValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
@@ -46,6 +50,14 @@ public class CreateDailyExpenseValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현금 또는 현물평가액을 입력해 주세요.");
|
||||
} else if(vo.getPrice() != null && vo.getPrice() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"price", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
} else if(vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ public class CreateDailyFarmingValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
@@ -49,6 +53,10 @@ public class CreateDailyFarmingValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현물평가액을 입력해 주세요.");
|
||||
} else if(vo.getEstimatedValue() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ public class CreateDailyForestryValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
@@ -43,6 +47,10 @@ public class CreateDailyForestryValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현물평가액을 입력해 주세요.");
|
||||
} else if(vo.getEstimatedValue() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ public class CreateDailyIncomeValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수량을 입력해 주세요.");
|
||||
} else if(vo.getQuantity() != null && vo.getQuantity() <= 0){
|
||||
errors.rejectValue(
|
||||
"quantity", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
|
||||
if (vo.getQuantity() != null && StringUtils.isBlank(vo.getUnitCode())) {
|
||||
@@ -46,6 +50,14 @@ public class CreateDailyIncomeValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"현금 또는 현물평가액을 입력해 주세요.");
|
||||
} else if(vo.getPrice() != null && vo.getPrice() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"price", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
} else if(vo.getEstimatedValue() != null && vo.getEstimatedValue() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"estimatedValue", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,14 @@ public class CreateDailyPowerValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"leasedHours", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"자가 사용시간 또는 임차 사용시간을 입력해 주세요.");
|
||||
} else if(vo.getOwnedHours() != null && vo.getOwnedHours() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"ownedHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"자가 사용시간은 0보다 커야 합니다.");
|
||||
} else if(vo.getLeasedHours() != null && vo.getLeasedHours() <= 0 ){
|
||||
errors.rejectValue(
|
||||
"leasedHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"임차 사용시간은 0보다 커야 합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ public class CreateDailyWorkValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"workLandArea", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"작업 면적을 입력해 주세요.");
|
||||
} else if(vo.getWorkLandArea() != null && vo.getWorkLandArea() <= 0){
|
||||
errors.rejectValue(
|
||||
"workLandArea", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
|
||||
if (vo.getWorkLandArea() != null && StringUtils.isBlank(vo.getAreaUnitCode())) {
|
||||
@@ -43,6 +47,10 @@ public class CreateDailyWorkValidator implements Validator {
|
||||
errors.rejectValue(
|
||||
"harvestQuantity", CommonConstants.VALID_CODE_NOTBLANK,
|
||||
"수확량을 입력해 주세요.");
|
||||
} else if(vo.getHarvestQuantity() != null && vo.getHarvestQuantity() <= 0){
|
||||
errors.rejectValue(
|
||||
"harvestQuantity", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
|
||||
if (vo.getHarvestQuantity() != null && StringUtils.isBlank(vo.getHarvestUnitCode())) {
|
||||
@@ -73,5 +81,45 @@ public class CreateDailyWorkValidator implements Validator {
|
||||
errors.rejectValue("volunteerMHours", "valid.common.required");
|
||||
errors.rejectValue("volunteerFHours", "valid.common.required");
|
||||
}
|
||||
if(vo.getOwnerTime() != null && vo.getOwnerTime() <= 0){
|
||||
errors.rejectValue("ownerTime", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getSpouseTime() != null && vo.getSpouseTime() <= 0){
|
||||
errors.rejectValue("spouseTime", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getFamilyMHours() != null && vo.getFamilyMHours() <= 0){
|
||||
errors.rejectValue("familyMHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getFamilyFHours() != null && vo.getFamilyFHours() <= 0){
|
||||
errors.rejectValue("familyFHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getHiredMHours() != null && vo.getHiredMHours() <= 0){
|
||||
errors.rejectValue("hiredMHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getHiredFHours() != null && vo.getHiredFHours() <= 0){
|
||||
errors.rejectValue("hiredFHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getSharedMHours() != null && vo.getSharedMHours() <= 0){
|
||||
errors.rejectValue("sharedMHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getSharedFHours() != null && vo.getSharedFHours() <= 0){
|
||||
errors.rejectValue("sharedFHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getVolunteerMHours() != null && vo.getVolunteerMHours() <= 0){
|
||||
errors.rejectValue("volunteerMHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
if(vo.getVolunteerFHours() != null && vo.getVolunteerFHours() <= 0){
|
||||
errors.rejectValue("volunteerFHours", CommonConstants.VALID_CODE_NOTZERO,
|
||||
"입력값은 0보다 커야 합니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,11 +54,10 @@ class CreateBankInputController {
|
||||
|
||||
|
||||
if(currentMonthlyInfo!=null) {
|
||||
//TODO 트렌젝션 고려
|
||||
// 트렌젝션 고려
|
||||
removeBanksPortIn.operate(new RemoveBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(), reqVO.getTransferType()));
|
||||
|
||||
// if (!reqVO.getStatus() && reqVO.getBankList() != null && !reqVO.getBankList().isEmpty()) { // 등록없음 처리가 아님.
|
||||
if (reqVO.getBankList() != null && !reqVO.getBankList().isEmpty()) { // 등록없음 처리가 아님.
|
||||
if (reqVO.getBankList() != null && !reqVO.getBankList().isEmpty()) {
|
||||
for (CreateBankInputProductReqVO item : reqVO.getBankList()) {
|
||||
|
||||
UICodeView code = uiCodeViewPortIn.connect(item.getTransferCategoryCode()).orElse(null);
|
||||
@@ -67,7 +66,9 @@ class CreateBankInputController {
|
||||
String expenseCode = null;
|
||||
if(reqVO.getTransferType().equals("code.bank.input")){
|
||||
incomdeCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("INPUT") ? code.getCodeValue() : null;
|
||||
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("OUTPUT") ?code.getCodeValue() : null;
|
||||
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("OUTPUT") ?code.getCodeValue() : null;
|
||||
} else {
|
||||
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") ? code.getCodeValue() : null;
|
||||
}
|
||||
createBankPortIn.operate(new CreateBankCmd(
|
||||
AuthUtil.getUserSeq(),
|
||||
|
||||
@@ -47,10 +47,10 @@ class CreateMonthlyController {
|
||||
|
||||
|
||||
if(currentMonthlyInfo!=null) {
|
||||
//TODO 트렌젝션 고려
|
||||
// 트렌젝션 고려
|
||||
removeMonthForestProductsPortIn.operate(new RemoveMonthForestProductsCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq()));
|
||||
|
||||
if (!reqVO.getStatus() && reqVO.getProductList() != null && !reqVO.getProductList().isEmpty()) { // 등록없음 처리가 아님.
|
||||
if (!reqVO.getStatus() && reqVO.getProductList() != null && !reqVO.getProductList().isEmpty()) {
|
||||
for (CreateMonthlyProductReqVO item : reqVO.getProductList()) {
|
||||
createForestProductPortIn.operate(new CreateForestProductCmd(
|
||||
AuthUtil.getUserSeq(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.info.notice.getNotice.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.FileUploadType;
|
||||
import app.module.core.usecase.file.model.UploadFile;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -9,7 +10,7 @@ import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* DTO for {@link app.module.core.config.adapters.persistence.entity.UploadFile}
|
||||
* DTO for {@link UploadFile}
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -2,6 +2,7 @@ valid.common.required=\uD544\uC218\uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4.
|
||||
valid.common.required.size={0} \uAC1C \uD56D\uBAA9\uC774 \uB2F4\uACA8\uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.
|
||||
valid.common.required.size.min={0} \uAC1C \uC774\uC0C1 \uD56D\uBAA9\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
|
||||
valid.common.required.remove.item=\uC0AD\uC81C\uD560 \uC544\uC774\uD15C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||
valid.common.notZero=\uC785\uB825\uAC12\uC740 0\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4.
|
||||
valid.common.id.wrong=\uC601\uBB38 \uB300\uC18C\uBB38\uC790(a-zA-Z), \uC22B\uC790(0-9), \uD558\uC774\uD508(-), \uC5B8\uB354\uBC14(_)\uC744 \uC774\uC6A9\uD574 6\uC790 \uC774\uC0C1 12\uC790 \uC774\uD558\uC778 \uC544\uC774\uB514\uB97C \uAE30\uC785\uD574\uC8FC\uC138\uC694.
|
||||
valid.common.email.wrong=\uC774\uBA54\uC77C \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
|
||||
valid.common.nickname.wrong=\uB2C9\uB124\uC784(2-10\uAE00\uC790)\uC740 \uD55C\uAE00,\uC601\uC5B4 \uB300\uC18C\uBB38\uC790, -, _ \uB9CC \uC785\uB825\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 210 KiB |
@@ -164,11 +164,6 @@ var ajaxUtil = {
|
||||
},
|
||||
422:function(rstData, status) {
|
||||
console.log('422', rstData)
|
||||
/**
|
||||
* TODO
|
||||
* 폼이 너무 여러가지 형식이 있는데 서버에러를 가지고 처리하는게 맞는지 검토 필요
|
||||
* 코드 정리는 나중에 하려고 그냥 만듬.... 정리 필요.
|
||||
*/
|
||||
|
||||
let isResetDone = false;
|
||||
|
||||
@@ -322,13 +317,13 @@ var ajaxUtil = {
|
||||
_hideWaiting:function(){
|
||||
if (ajaxUtil.loadingStatus) {
|
||||
ajaxUtil.loadingStatus = false;
|
||||
// TODO : 로딩바 숨김
|
||||
// 로딩바 숨김
|
||||
document.querySelector('#loadingBar').style.display = 'none';
|
||||
}
|
||||
},
|
||||
_showWaiting:function(){
|
||||
ajaxUtil.loadingStatus = true;
|
||||
// TODO : 로딩바 활성화
|
||||
// 로딩바 활성화
|
||||
document.querySelector('#loadingBar').style.display = 'block';
|
||||
},
|
||||
};
|
||||
@@ -36,14 +36,6 @@
|
||||
<span class="btn-txt">이전 정보 불러오기</span>
|
||||
</button>
|
||||
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
<!-- <div class="component-input align-center" id="forestProductStatusDiv">-->
|
||||
<!-- <label class="checkbox-inner">-->
|
||||
<!-- <input type="checkbox" id="forestProductStatus" name="forestProductStatus"-->
|
||||
<!-- th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">-->
|
||||
<!-- <span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>-->
|
||||
<!-- </label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</section>
|
||||
|
||||
@@ -199,9 +191,6 @@
|
||||
//이전 데이터 취득 버튼
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
//데이터 없음 버튼
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// const forestProductStatus = document.getElementById("forestProductStatus");
|
||||
|
||||
//등록 완료 버튼
|
||||
const next = document.getElementById('complateBtn');
|
||||
@@ -251,17 +240,6 @@
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
}
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// }
|
||||
// else if (ENV.data.currentStatus == "NOTHING") {
|
||||
//
|
||||
//
|
||||
// addItemBtn.disabled = true;
|
||||
// icon.classList.toggle("ico-add", false);
|
||||
// icon.classList.toggle("ico-add-disabled", true);
|
||||
// callPastInfoBtn.disabled = true;
|
||||
// forestProductStatus.checked = true;
|
||||
// next.disabled = true;
|
||||
|
||||
} else if (ENV.data.currentStatus == "REGISTERED") {
|
||||
if (ENV.data.bankList.length > 0) {
|
||||
@@ -369,12 +347,6 @@
|
||||
},
|
||||
updateLayout() {
|
||||
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// const btn = document.getElementById("addItemBtn");
|
||||
// const isChecked = ENV.elementRefs.noDataCheckbox.checked;
|
||||
// const icon = btn.querySelector("i");
|
||||
// const status = document.getElementById('forestProductStatusDiv');
|
||||
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
const next = document.getElementById('complateBtn');
|
||||
@@ -390,10 +362,6 @@
|
||||
count.textContent = total;
|
||||
totalItems.textContent = total;
|
||||
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// btn.disabled = isData;
|
||||
// icon.classList.toggle("ico-add", !isData);
|
||||
// icon.classList.toggle("ico-add-disabled", isData);
|
||||
if (isData) {
|
||||
next.disabled = !isData;
|
||||
} else {
|
||||
@@ -420,6 +388,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (form.count.value && form.count.value <= 0) errors.push({field: 'count', message: '입력값은 0보다 커야 합니다. '});
|
||||
|
||||
if(form.count.value){
|
||||
if(!form.unitCode.value){
|
||||
errors.push({
|
||||
@@ -435,6 +405,8 @@
|
||||
}
|
||||
}
|
||||
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
|
||||
else if (form.price.value && form.price.value <= 0) errors.push({field: 'price', message: '입력값은 0보다 커야 합니다. '});
|
||||
|
||||
console.log(errors) //////////////////////////
|
||||
kri.form.error(errors);
|
||||
if (errors.length > 0) {
|
||||
|
||||
@@ -36,15 +36,6 @@
|
||||
<span class="btn-txt">이전 정보 불러오기</span>
|
||||
</button>
|
||||
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
<!-- <div class="component-input align-center" id="forestProductStatusDiv">-->
|
||||
<!-- <label class="checkbox-inner">-->
|
||||
<!-- <input type="checkbox" id="forestProductStatus" name="forestProductStatus"-->
|
||||
<!-- th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">-->
|
||||
<!-- <span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>-->
|
||||
<!-- </label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</section>
|
||||
|
||||
</div>
|
||||
@@ -198,10 +189,6 @@
|
||||
//이전 데이터 취득 버튼
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
//데이터 없음 버튼
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// const forestProductStatus = document.getElementById("forestProductStatus");
|
||||
|
||||
//등록 완료 버튼
|
||||
const next = document.getElementById('complateBtn');
|
||||
|
||||
@@ -250,16 +237,6 @@
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
}
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// } else if (ENV.data.currentStatus == "NOTHING") {
|
||||
//
|
||||
//
|
||||
// addItemBtn.disabled = true;
|
||||
// icon.classList.toggle("ico-add", false);
|
||||
// icon.classList.toggle("ico-add-disabled", true);
|
||||
// callPastInfoBtn.disabled = true;
|
||||
// forestProductStatus.checked = true;
|
||||
// next.disabled = true;
|
||||
|
||||
} else if (ENV.data.currentStatus == "REGISTERED") {
|
||||
if (ENV.data.bankList.length > 0) {
|
||||
@@ -359,12 +336,6 @@
|
||||
},
|
||||
updateLayout() {
|
||||
|
||||
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// const isChecked = ENV.elementRefs.noDataCheckbox.checked;
|
||||
// const btn = document.getElementById("addItemBtn");
|
||||
// const icon = btn.querySelector("i");
|
||||
// const status = document.getElementById('forestProductStatusDiv');
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
const next = document.getElementById('complateBtn');
|
||||
@@ -381,10 +352,6 @@
|
||||
count.textContent = total;
|
||||
totalItems.textContent = total;
|
||||
|
||||
<!-- TODO(ks) : "이번달 등록내용 없음" 삭제 확정 시 주석 지우기 -->
|
||||
// btn.disabled = isData;
|
||||
// icon.classList.toggle("ico-add", !isData);
|
||||
// icon.classList.toggle("ico-add-disabled", isData);
|
||||
if (isData) {
|
||||
next.disabled = !isData;
|
||||
} else {
|
||||
@@ -411,6 +378,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (form.count.value && form.count.value <= 0) errors.push({field: 'count', message: '입력값은 0보다 커야 합니다. '});
|
||||
|
||||
if(form.count.value){
|
||||
if(!form.unitCode.value){
|
||||
errors.push({
|
||||
@@ -429,6 +398,8 @@
|
||||
|
||||
|
||||
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
|
||||
else if (form.price.value && form.price.value <= 0) errors.push({field: 'price', message: '입력값은 0보다 커야 합니다. '});
|
||||
|
||||
console.log(errors) //////////////////////////
|
||||
kri.form.error(errors);
|
||||
if (errors.length > 0) {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="inner">
|
||||
<dl class="info-card">
|
||||
<dt class="name" th:text="${userInfo?.ownerName}"></dt>
|
||||
<dd class="location" th:text="${userInfo?.address}"></dd><!-- TODO 임가 주소 위치 임시로 . 처리함. -->
|
||||
<dd class="location" th:text="${userInfo?.address}"></dd>
|
||||
<dd class="date" th:if="${not #strings.isEmpty(dailyLatest)}">
|
||||
최근등록 : <span th:text="${dailyLatest}"></span></dd>
|
||||
<dd class="date" th:if="${#strings.isEmpty(dailyLatest)}">등록된 일계부가 없습니다.</dd>
|
||||
|
||||
@@ -15,18 +15,6 @@
|
||||
<p class="form-desc">필수입력</p>
|
||||
|
||||
<section class="form-group">
|
||||
<!-- 읍면동 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="town" class="label-txt">
|
||||
읍면동
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="town" placeholder="읍면동을 입력해 주세요" name="town"
|
||||
maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 지번 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
@@ -52,7 +40,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 읍면동 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
<label for="town" class="label-txt">
|
||||
읍면동
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="town" placeholder="읍면동을 입력해 주세요" name="town"
|
||||
maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 가능 면적 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
|
||||
@@ -20,13 +20,6 @@
|
||||
<span class="tag" th:text="${item.forestProductStatus.desc}"></span>
|
||||
</a>
|
||||
</li>
|
||||
<!--/* TODO : 등록없음 추가 */-->
|
||||
<!--/* <li class="complete-nodata">
|
||||
<a href="">
|
||||
<p class="list-tit">2025년 5월</p>
|
||||
<span class="tag">등록없음</span>
|
||||
</a>
|
||||
</li> */-->
|
||||
</ul>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -382,10 +382,14 @@
|
||||
});
|
||||
|
||||
const errors = [];
|
||||
if (form.availableArea.value && form.availableArea.value <= 0) errors.push({field: 'availableArea', message: '입력값은 0보다 커야 합니다. '});
|
||||
if (!form.cropName.value) errors.push({field: 'cropName', message: '재배 작물명을 입력해주세요.'});
|
||||
|
||||
if (form.landArea.value && form.landArea.value <= 0) errors.push({field: 'landArea', message: '입력값은 0보다 커야 합니다. '});
|
||||
|
||||
if(form.mainYield.value){
|
||||
if (form.mainYield.value <= 0) errors.push({field: 'mainYield', message: '입력값은 0보다 커야 합니다. '});
|
||||
|
||||
if(!form.mainYieldUnitCode.value){
|
||||
errors.push({
|
||||
field: 'mainYieldUnitCode',
|
||||
@@ -401,6 +405,7 @@
|
||||
}
|
||||
|
||||
if(form.mainSaleAmount.value){
|
||||
if (form.mainSaleAmount.value <= 0) errors.push({field: 'mainSaleAmount', message: '입력값은 0보다 커야 합니다. '});
|
||||
if(!form.mainSaleUnitCode.value){
|
||||
errors.push({
|
||||
field: 'mainSaleUnitCode',
|
||||
@@ -417,6 +422,7 @@
|
||||
|
||||
|
||||
if(form.subYield.value){
|
||||
if (form.subYield.value <= 0) errors.push({field: 'subYield', message: '입력값은 0보다 커야 합니다. '});
|
||||
if(!form.subYieldUnitCode.value){
|
||||
errors.push({
|
||||
field: 'subYieldUnitCode',
|
||||
@@ -433,6 +439,7 @@
|
||||
|
||||
|
||||
if(form.subSaleAmount.value){
|
||||
if (form.subSaleAmount.value <= 0) errors.push({field: 'subSaleAmount', message: '입력값은 0보다 커야 합니다. '});
|
||||
if(!form.subSaleUnitCode.value){
|
||||
errors.push({
|
||||
field: 'subSaleUnitCode',
|
||||
@@ -530,7 +537,6 @@
|
||||
document.getElementById('listBody').innerHTML = '';
|
||||
formControl.updateLayout();
|
||||
|
||||
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
|
||||
document.getElementById('totalItems').textContent = ENV.data.productList.length;
|
||||
},
|
||||
});
|
||||
@@ -566,11 +572,6 @@
|
||||
function (rstData, status) {
|
||||
if (rstData.code === 'SUCCESS') {
|
||||
ajaxUtil._alert('등록이 완료되었습니다.', null, function () {
|
||||
/**
|
||||
* TODO
|
||||
* 내정보에서만 들어온다는 가정하에서 back을 하게함 SB에는 내정보로 이동하게 되어 있음.
|
||||
*/
|
||||
// history.back()
|
||||
location.href = '/info/monthly';
|
||||
});
|
||||
} else if (rstData.code === 'ERROR') {
|
||||
|
||||
@@ -108,8 +108,7 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* TODO 검색할때 각 페이지에 함수 구현 필요.
|
||||
* TODO 일단 뒤로가기에 대한 부분 정의가 없기에 페이지 이동으로 처리해둠...
|
||||
* 검색할때 각 페이지에 함수 구현 필요.
|
||||
*/
|
||||
goSearch() {
|
||||
const f = document.reqForm;
|
||||
|
||||
@@ -57,10 +57,7 @@ root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl',
|
||||
|
||||
},
|
||||
goList() {
|
||||
/**
|
||||
* TODO 외부 유입에 따라 history.back과 location.href 가 적절하게 사용되어야함...
|
||||
* 전체적인 수정 필요.(이전 페이지
|
||||
*/
|
||||
|
||||
const previousUrl = document.referrer;
|
||||
|
||||
/* if (previousUrl.includes('/info/notice')) {
|
||||
|
||||
@@ -254,7 +254,21 @@
|
||||
const date = new Date(detail.viewDate)
|
||||
const monthKey = this._getMonthKey(date)
|
||||
|
||||
// this._setupMonth(date)
|
||||
// 주 모드일 때 월이 변경되면 weekStart 업데이트
|
||||
if (this.state.mode === 'week') {
|
||||
this._setFirstDateDay(date)
|
||||
|
||||
// datepicker 옵션 업데이트
|
||||
this.instances.datepicker.setOptions({
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
|
||||
// refresh를 통해 요일 헤더 업데이트
|
||||
if (this.instances.datepicker.refresh) {
|
||||
this.instances.datepicker.refresh()
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.state.isLoading) {
|
||||
await this.loadMonthData(date)
|
||||
@@ -263,6 +277,32 @@
|
||||
this.callbacks.changeMonth(monthKey, date)
|
||||
}
|
||||
|
||||
async _finalizeDateLoading(date) {
|
||||
this._setupMonth(date)
|
||||
|
||||
const today = new Date()
|
||||
const targetDate = this._getTargetDate(date, today)
|
||||
this.instances.datepicker.setDate(targetDate)
|
||||
|
||||
// 주 모드일 때 요일 헤더 업데이트
|
||||
if (this.state.mode === 'week') {
|
||||
this._setFirstDateDay(date)
|
||||
this.instances.datepicker.setOptions({
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
}
|
||||
|
||||
this._scheduleClick()
|
||||
|
||||
if (date >= this.data.minDate) {
|
||||
this.instances.datepicker.refresh()
|
||||
}
|
||||
|
||||
this._loadingEnd()
|
||||
this.elements.datepicker.classList.remove(DatepickerComponent.CONSTANTS.CLASSES.LOADING)
|
||||
}
|
||||
|
||||
_handleWeekChange({
|
||||
detail
|
||||
}) {
|
||||
@@ -325,15 +365,30 @@
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
// 옵션 변경 후 즉시 refresh 호출
|
||||
if (this.instances.datepicker.refresh) {
|
||||
this.instances.datepicker.refresh()
|
||||
}
|
||||
}
|
||||
|
||||
_initializeWeekMode() {
|
||||
const selectedDate = this.instances.datepicker.getDate()
|
||||
const selectedDay = selectedDate.getDate()
|
||||
|
||||
// // 선택된 날짜가 포함된 주차 계산
|
||||
// 선택된 날짜가 포함된 주차 계산
|
||||
this.state.weekPaging = Math.floor((selectedDay - 1) / DatepickerComponent.CONSTANTS.DAYS_PER_WEEK)
|
||||
|
||||
// weekStart 설정 및 옵션 업데이트
|
||||
this._setFirstDateDay(selectedDate)
|
||||
this.instances.datepicker.setOptions({
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
|
||||
// refresh를 통해 요일 헤더 업데이트
|
||||
if (this.instances.datepicker.refresh) {
|
||||
this.instances.datepicker.refresh()
|
||||
}
|
||||
this._weekPagination()
|
||||
this._updateWeekNavigationButtons()
|
||||
}
|
||||
@@ -367,15 +422,31 @@
|
||||
if (this.state.mode !== 'week') return
|
||||
|
||||
const currentDate = this.instances.datepicker.getDate()
|
||||
const currentMonth = currentDate.getMonth()
|
||||
const currentYear = currentDate.getFullYear()
|
||||
|
||||
// // 이전주 버튼 상태 확인
|
||||
// 이전주 버튼 상태 확인
|
||||
const prevWeekDate = this._getPrevWeekDate(currentDate)
|
||||
const isPrevDisabled = prevWeekDate <= this.data.minDate
|
||||
this._toggleButtonDisabled(this.elements.prevWeek, isPrevDisabled)
|
||||
|
||||
// // 다음주 버튼 상태 확인
|
||||
const nextWeekDate = this._getNextWeekDate(currentDate)
|
||||
const isNextDisabled = nextWeekDate >= this.data.maxDate
|
||||
// 다음주 버튼 상태 확인 개선
|
||||
const nextWeekStart = this._getNextWeekDate(currentDate)
|
||||
|
||||
// maxDate와 비교할 때 더 정확한 계산
|
||||
// 다음주가 시작되는 날짜가 maxDate를 초과하는지 확인
|
||||
let isNextDisabled = false
|
||||
|
||||
// 다음주가 다음 달로 넘어가는 경우 체크
|
||||
if (nextWeekStart.getMonth() !== currentMonth) {
|
||||
// 다음 달의 첫째 날이 maxDate를 초과하는지 확인
|
||||
const nextMonthFirstDay = new Date(currentYear, currentMonth + 1, 1)
|
||||
isNextDisabled = nextMonthFirstDay > this.data.maxDate
|
||||
} else {
|
||||
// 같은 달 내에서 다음주 시작일이 maxDate를 초과하는지 확인
|
||||
isNextDisabled = nextWeekStart > this.data.maxDate
|
||||
}
|
||||
|
||||
this._toggleButtonDisabled(this.elements.nextWeek, isNextDisabled)
|
||||
}
|
||||
|
||||
@@ -385,8 +456,12 @@
|
||||
}
|
||||
|
||||
_getNextWeekDate(currentDate) {
|
||||
const endWeekDate = (this.state.weekPaging + 2) * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK
|
||||
return new Date(currentDate.getFullYear(), currentDate.getMonth(), endWeekDate)
|
||||
// 현재 주의 시작일 계산
|
||||
const currentWeekStart = (this.state.weekPaging * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK) + 1
|
||||
// 다음주의 시작일 계산
|
||||
const nextWeekStart = currentWeekStart + DatepickerComponent.CONSTANTS.DAYS_PER_WEEK
|
||||
|
||||
return new Date(currentDate.getFullYear(), currentDate.getMonth(), nextWeekStart)
|
||||
}
|
||||
|
||||
_weekPagingPrev() {
|
||||
@@ -412,11 +487,7 @@
|
||||
|
||||
this.state.maxWeekPaging = Math.ceil(lastDayOfMonth / DatepickerComponent.CONSTANTS.DAYS_PER_WEEK)
|
||||
|
||||
const endWeekDate = (this.state.weekPaging + 2) * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK
|
||||
const date = new Date(currentDate.getFullYear(), currentDate.getMonth(), endWeekDate)
|
||||
|
||||
this._disablePrevNextButtons('next', date)
|
||||
|
||||
// 현재 주가 마지막 주인지 확인
|
||||
if (this.state.weekPaging >= this.state.maxWeekPaging - 1) {
|
||||
this._moveToNextMonth()
|
||||
return
|
||||
@@ -425,6 +496,8 @@
|
||||
this.state.weekPaging += 1
|
||||
this._clickFirstVisibleCell()
|
||||
this._dispatchWeekChangeEvent('next', currentDate)
|
||||
this._weekPagination('next')
|
||||
this._updateWeekNavigationButtons() // 버튼 상태 업데이트 추가
|
||||
}
|
||||
|
||||
_clickFirstVisibleCell() {
|
||||
@@ -487,13 +560,31 @@
|
||||
|
||||
_moveToPreviousMonth() {
|
||||
const currentDate = this.instances.datepicker.getDate()
|
||||
const prevMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1)
|
||||
const lastDayOfPrevMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).getDate()
|
||||
const lastWeekOfPrevMonth = Math.ceil(lastDayOfPrevMonth / DatepickerComponent.CONSTANTS.DAYS_PER_WEEK) - 1
|
||||
const firstDayOfLastWeek = (lastWeekOfPrevMonth * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK) + 1
|
||||
const targetDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, firstDayOfLastWeek)
|
||||
|
||||
// 먼저 날짜 설정
|
||||
this.instances.datepicker.setDate(targetDate)
|
||||
|
||||
// 새로운 달의 첫째 날 기준으로 weekStart 업데이트
|
||||
this._setFirstDateDay(prevMonth)
|
||||
|
||||
// datepicker 옵션 업데이트
|
||||
this.instances.datepicker.setOptions({
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
|
||||
this.state.weekPaging = lastWeekOfPrevMonth
|
||||
|
||||
// refresh를 통해 요일 헤더 업데이트
|
||||
if (this.instances.datepicker.refresh) {
|
||||
this.instances.datepicker.refresh()
|
||||
}
|
||||
|
||||
this._weekPagination('prev')
|
||||
this._clickFirstVisibleCell()
|
||||
this._updateWeekNavigationButtons()
|
||||
@@ -503,18 +594,41 @@
|
||||
const currentDate = this.instances.datepicker.getDate()
|
||||
const nextMonthFirstDay = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1)
|
||||
|
||||
// 먼저 날짜 설정
|
||||
this.instances.datepicker.setDate(nextMonthFirstDay)
|
||||
|
||||
// 새로운 달의 첫째 날 기준으로 weekStart 업데이트
|
||||
this._setFirstDateDay(nextMonthFirstDay)
|
||||
|
||||
// datepicker 옵션 업데이트
|
||||
this.instances.datepicker.setOptions({
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
|
||||
this.state.weekPaging = 0
|
||||
|
||||
// // 주 모드에서 월 이동 시 적절한 날짜가 선택되도록 loadMonthData 호출
|
||||
// // changeMonth 이벤트가 자동으로 발생하여 loadMonthData가 호출됨
|
||||
// refresh를 통해 요일 헤더 업데이트
|
||||
if (this.instances.datepicker.refresh) {
|
||||
this.instances.datepicker.refresh()
|
||||
}
|
||||
|
||||
this._weekPagination('next')
|
||||
this._clickFirstVisibleCell()
|
||||
this._updateWeekNavigationButtons()
|
||||
}
|
||||
|
||||
_setFirstDateDay(date) {
|
||||
const firstDate = new Date(date.getFullYear(), date.getMonth(), 1)
|
||||
this.state.weekStart = firstDate.getDay()
|
||||
|
||||
// 주 모드일 때 datepicker 옵션도 즉시 업데이트
|
||||
if (this.state.mode === 'week' && this.instances.datepicker) {
|
||||
this.instances.datepicker.setOptions({
|
||||
...this.instances.datepickerComp.core.props,
|
||||
weekStart: this.state.weekStart
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
_weekPagination(direction) {
|
||||
@@ -768,198 +882,198 @@
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:src="@{/static/library/jsRender/jsrender.min.js}"></script>
|
||||
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: '',
|
||||
list: '/record/calendar/{searchMonth}/{groupNo}',
|
||||
create: '/record/daily/{searchMonth}/{groupNo}',
|
||||
alert: '/api/record/daily/alert/{searchMonth}',
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
<script th:src="@{/static/library/jsRender/jsrender.min.js}"></script>
|
||||
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: '',
|
||||
list: '/record/calendar/{searchMonth}/{groupNo}',
|
||||
create: '/record/daily/{searchMonth}/{groupNo}',
|
||||
alert: '/api/record/daily/alert/{searchMonth}',
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
setDetail(rowdata, currentDate, viewDate) {
|
||||
const searchMonth = viewDate.getFullYear().toString() + (viewDate.getMonth() + 1).toString().padStart(2, '0');
|
||||
let childList = rowdata.children;
|
||||
let monthlyList = rowdata.monthly;
|
||||
if (rowdata == null) {
|
||||
kri.logger.error('달력 선택 데이터 없음.')
|
||||
}
|
||||
let formControl = {
|
||||
setDetail(rowdata, currentDate, viewDate) {
|
||||
const searchMonth = viewDate.getFullYear().toString() + (viewDate.getMonth() + 1).toString().padStart(2, '0');
|
||||
let childList = rowdata.children;
|
||||
let monthlyList = rowdata.monthly;
|
||||
if (rowdata == null) {
|
||||
kri.logger.error('달력 선택 데이터 없음.')
|
||||
}
|
||||
|
||||
let tmpl = $.templates('#dailyNoneTmpl');
|
||||
let html = '';
|
||||
if (childList === undefined || childList.length === 0) {
|
||||
html = tmpl.render({
|
||||
month: searchMonth,
|
||||
no: rowdata.no,
|
||||
date: currentDate,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
});
|
||||
} else {
|
||||
tmpl = $.templates('#dailyListTmpl');
|
||||
html = tmpl.render({
|
||||
month: searchMonth,
|
||||
no: rowdata.no,
|
||||
date: currentDate,
|
||||
list: childList,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
carryOver: rowdata.carryOver != null ? Number(rowdata.carryOver).toLocaleString() : null,
|
||||
});
|
||||
}
|
||||
let tmpl = $.templates('#dailyNoneTmpl');
|
||||
let html = '';
|
||||
if (childList === undefined || childList.length === 0) {
|
||||
html = tmpl.render({
|
||||
month: searchMonth,
|
||||
no: rowdata.no,
|
||||
date: currentDate,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
});
|
||||
} else {
|
||||
tmpl = $.templates('#dailyListTmpl');
|
||||
html = tmpl.render({
|
||||
month: searchMonth,
|
||||
no: rowdata.no,
|
||||
date: currentDate,
|
||||
list: childList,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
carryOver: rowdata.carryOver != null ? Number(rowdata.carryOver).toLocaleString() : null,
|
||||
});
|
||||
}
|
||||
|
||||
$('#selectedDay').html(html);
|
||||
$('#selectedDay').html(html);
|
||||
|
||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||
const today = new Date();
|
||||
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||
// 마지막 alert 날짜 확인
|
||||
const lastAlertDate = sessionStorage.getItem('lastAlertDate');
|
||||
const todayDateString = today.toDateString();
|
||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||
const today = new Date();
|
||||
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||
// 마지막 alert 날짜 확인
|
||||
const lastAlertDate = sessionStorage.getItem('lastAlertDate');
|
||||
const todayDateString = today.toDateString();
|
||||
|
||||
if (lastAlertDate !== todayDateString &&
|
||||
today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||
today.getDate() === lastDayOfMonth.getDate()) {
|
||||
ajaxUtil._ajaxSyncMethod(
|
||||
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
||||
{},
|
||||
function (response) {
|
||||
let dailyNo = []
|
||||
let msgTxt = '';
|
||||
let month = viewDate.getMonth() + 1;
|
||||
let idxPlus = 0;
|
||||
msgTxt += "등록하지 않은 일계부 항목이 있습니다.\n 정확한 조사를 위해 꾸준히 입력해 주세요.\n";
|
||||
if(response.dailyRecordAlertDtoList.length > 0){
|
||||
response.dailyRecordAlertDtoList.forEach((dto) =>{
|
||||
let dateTxt;
|
||||
if(dto.startDay === dto.endDay){
|
||||
dateTxt = month+"월 "+dto.startDay+"일";
|
||||
}else{
|
||||
dateTxt = month+"월 "+dto.startDay+"~"+dto.endDay+"일";
|
||||
}
|
||||
dailyNo.push(dateTxt);
|
||||
});
|
||||
msgTxt += "<p class=\"dialog-info-tit\">1. 일계부 미등록 </p>\n <p class=\"dialog-info\">"+dailyNo.join(',')+"</p>\n";
|
||||
idxPlus ++;
|
||||
}
|
||||
if(response.monthRecordAlertDtoList.length > 0) {
|
||||
response.monthRecordAlertDtoList.forEach((dto,idx) => {
|
||||
msgTxt += "<p class=\"dialog-info-tit\">"+ (idx+idxPlus+1) +". "+dto+"</p>\n";
|
||||
});
|
||||
}
|
||||
if (lastAlertDate !== todayDateString &&
|
||||
today.getFullYear() === lastDayOfMonth.getFullYear() &&
|
||||
today.getMonth() === lastDayOfMonth.getMonth() &&
|
||||
today.getDate() === lastDayOfMonth.getDate()) {
|
||||
ajaxUtil._ajaxSyncMethod(
|
||||
ENV.httpUrl.alert.replace('{searchMonth}', searchMonth.replace('-', '')),
|
||||
{},
|
||||
function (response) {
|
||||
let dailyNo = []
|
||||
let msgTxt = '';
|
||||
let month = viewDate.getMonth() + 1;
|
||||
let idxPlus = 0;
|
||||
msgTxt += "등록하지 않은 일계부 항목이 있습니다.\n 정확한 조사를 위해 꾸준히 입력해 주세요.\n";
|
||||
if(response.dailyRecordAlertDtoList.length > 0){
|
||||
response.dailyRecordAlertDtoList.forEach((dto) =>{
|
||||
let dateTxt;
|
||||
if(dto.startDay === dto.endDay){
|
||||
dateTxt = month+"월 "+dto.startDay+"일";
|
||||
}else{
|
||||
dateTxt = month+"월 "+dto.startDay+"~"+dto.endDay+"일";
|
||||
}
|
||||
dailyNo.push(dateTxt);
|
||||
});
|
||||
msgTxt += "<p class=\"dialog-info-tit\">1. 일계부 미등록 </p>\n <p class=\"dialog-info\">"+dailyNo.join(',')+"</p>\n";
|
||||
idxPlus ++;
|
||||
}
|
||||
if(response.monthRecordAlertDtoList.length > 0) {
|
||||
response.monthRecordAlertDtoList.forEach((dto,idx) => {
|
||||
msgTxt += "<p class=\"dialog-info-tit\">"+ (idx+idxPlus+1) +". "+dto+"</p>\n";
|
||||
});
|
||||
}
|
||||
|
||||
if(response.dailyRecordAlertDtoList.length > 0 || dto.monthRecordAlertDtoList.length > 0) {
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: msgTxt,
|
||||
type:'alert',
|
||||
callback: function () {
|
||||
sessionStorage.setItem('lastAlertDate',lastDayOfMonth.toDateString());
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
function (rstData, status) {
|
||||
if(response.dailyRecordAlertDtoList.length > 0 || dto.monthRecordAlertDtoList.length > 0) {
|
||||
etUI.dialog.alert({
|
||||
title: '',
|
||||
message: msgTxt,
|
||||
type:'alert',
|
||||
callback: function () {
|
||||
sessionStorage.setItem('lastAlertDate',lastDayOfMonth.toDateString());
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
function (rstData, status) {
|
||||
|
||||
},
|
||||
'get'
|
||||
,'json'
|
||||
);
|
||||
}
|
||||
},
|
||||
recordCreate(searchMonth, groupNo) {
|
||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo);
|
||||
},
|
||||
};
|
||||
},
|
||||
'get'
|
||||
,'json'
|
||||
);
|
||||
}
|
||||
},
|
||||
recordCreate(searchMonth, groupNo) {
|
||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo);
|
||||
},
|
||||
};
|
||||
|
||||
</script>
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
</script>
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
{{if registrable}}
|
||||
<div class="component-btns btn-add">
|
||||
<button type="button" onclick="formControl.recordCreate('{{:month}}', {{:no}});">
|
||||
<p class="txt">일계부 등록하기</p>
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
<script id="dailyListTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{if no == 1}}
|
||||
<li>
|
||||
<p class="label">월초이월금</p>
|
||||
{{if carryOver == null}}
|
||||
<p class="value">정산중입니다.</p>
|
||||
{{else}}
|
||||
<p class="value"><em><b>{{:carryOver}}</b> 원</em></p>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{if registrable}}
|
||||
<div class="component-btns btn-add">
|
||||
<button type="button" onclick="formControl.recordCreate('{{:month}}', {{:no}});">
|
||||
<p class="txt">일계부 등록하기</p>
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{for list ~edit=modifiable}}
|
||||
{{if status == null}}
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
<script id="dailyListTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{if no == 1}}
|
||||
<li>
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value">미작성</p>
|
||||
</li>
|
||||
{{else}}
|
||||
<li class="{{if ~edit}}edit{{else}}view{{/if}}">
|
||||
{{if status == 'TARGET' && total != 0}}
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
</a>
|
||||
{{else status == 'TARGET' && total == 0}}
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value">미완료</p>
|
||||
</a>
|
||||
{{else status == 'TODAY_NONE'}}
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value">없음</p>
|
||||
</a>
|
||||
<p class="label">월초이월금</p>
|
||||
{{if carryOver == null}}
|
||||
<p class="value">정산중입니다.</p>
|
||||
{{else}}
|
||||
<p class="value"><em><b>{{:carryOver}}</b> 원</em></p>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/for}}
|
||||
</ul>
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
<script id="titleTmpl" type="text/x-jsrender">
|
||||
{{if date.start == date.end}}
|
||||
<p class="date">{{:date.start}}</p>
|
||||
{{else}}
|
||||
<p class="date">{{:date.start}} ~ {{:date.end}}</p>
|
||||
{{/if}}
|
||||
</script>
|
||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||
<div class="regist-btn-area">
|
||||
{{for monthlyList}}
|
||||
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
<p>{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<span>등록완료</span>
|
||||
{{for list ~edit=modifiable}}
|
||||
{{if status == null}}
|
||||
<li>
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value">미작성</p>
|
||||
</li>
|
||||
{{else}}
|
||||
<span>미등록</span>
|
||||
<li class="{{if ~edit}}edit{{else}}view{{/if}}">
|
||||
{{if status == 'TARGET' && total != 0}}
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
</a>
|
||||
{{else status == 'TARGET' && total == 0}}
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value">미완료</p>
|
||||
</a>
|
||||
{{else status == 'TODAY_NONE'}}
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
<p class="value">없음</p>
|
||||
</a>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
</a>
|
||||
{{/for}}
|
||||
</div>
|
||||
</script>
|
||||
{{/for}}
|
||||
</ul>
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
<script id="titleTmpl" type="text/x-jsrender">
|
||||
{{if date.start == date.end}}
|
||||
<p class="date">{{:date.start}}</p>
|
||||
{{else}}
|
||||
<p class="date">{{:date.start}} ~ {{:date.end}}</p>
|
||||
{{/if}}
|
||||
</script>
|
||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||
<div class="regist-btn-area">
|
||||
{{for monthlyList}}
|
||||
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
<p>{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<span>등록완료</span>
|
||||
{{else}}
|
||||
<span>미등록</span>
|
||||
{{/if}}
|
||||
</a>
|
||||
{{/for}}
|
||||
</div>
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
@@ -168,7 +168,6 @@
|
||||
<div class="input-label">
|
||||
<label for="ownerTime" class="label-txt">
|
||||
경영주
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-hour">
|
||||
@@ -181,7 +180,6 @@
|
||||
<div class="input-label">
|
||||
<label for="spouseTime" class="label-txt">
|
||||
배우자
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field type-hour">
|
||||
|
||||
@@ -261,7 +261,15 @@
|
||||
},
|
||||
function () {
|
||||
// 노동투입시간 invalid reset
|
||||
$('.segment-label .guide-info li').eq(2).addClass('invalid');
|
||||
if($('.type-sub').find('.input-info').length > 0 && $('.type-sub').find('.input-info').first().text() === "필수입력 항목입니다."){
|
||||
$('.segment-label .guide-info li').eq(2).text("최소 1개의 노동투입시간을 입력해 주세요.");
|
||||
$('.segment-label .guide-info li').eq(2).addClass('invalid');
|
||||
}else if($('.type-sub').find('.input-info').length > 0 ){
|
||||
$('.segment-label .guide-info li').eq(2).text("입력값은 0보다 커야 합니다.");
|
||||
$('.segment-label .guide-info li').eq(2).addClass('invalid');
|
||||
}else{
|
||||
$('.segment-label .guide-info li').eq(2).removeClass('invalid');
|
||||
}
|
||||
$('.type-sub').find('.input-info').remove();
|
||||
$('.input-flex-group').find('.input-info').remove();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user