From 3f4b9c816ae2d7cdd989850b436bc369bb6aa30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=9C=EA=B3=A8=EC=95=BD=EC=82=AC?= Date: Tue, 17 Feb 2026 02:23:37 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A1=9C=ED=8A=B8=20=EB=B0=B0=EB=B6=84?= =?UTF-8?q?=20=EB=AA=A8=EB=8B=AC=20=ED=95=84=EC=9A=94=EB=9F=89=200=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: - 원산지 선택에서 "수동 배분" 선택 시 필요량이 0으로 표시 - loadOriginOptions 함수 호출 시점의 requiredQty를 그대로 사용 해결: - 모달 열기 시점에 현재 행의 실제 필요량 재계산 - gramsPerCheop × cheopTotal로 실시간 계산 - 디버깅 로그 추가로 값 확인 가능 이제 첩수나 용량이 변경된 후에도 정확한 필요량이 모달에 표시됩니다. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- static/app.js | 18 ++++++++++-- test_lot_modal.html | 72 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 test_lot_modal.html diff --git a/static/app.js b/static/app.js index 4bf5ba4..c60944e 100644 --- a/static/app.js +++ b/static/app.js @@ -1871,8 +1871,13 @@ $(document).ready(function() { const row = $(this).closest('tr'); if (selectedValue === 'manual') { - // 수동 배분 모달 열기 - openLotAllocationModal(herbId, requiredQty, row, response.data); + // 현재 행의 실제 필요량 재계산 + const gramsPerCheop = parseFloat(row.find('.grams-per-cheop').val()) || 0; + const cheopTotal = parseFloat($('#cheopTotal').val()) || 0; + const actualRequiredQty = gramsPerCheop * cheopTotal; + + // 수동 배분 모달 열기 (재계산된 필요량 사용) + openLotAllocationModal(herbId, actualRequiredQty, row, response.data); } else { // 기존 자동/원산지 선택 - lot_assignments 제거 row.removeAttr('data-lot-assignments'); @@ -2552,6 +2557,15 @@ $(document).ready(function() { // 로트 배분 모달 열기 window.openLotAllocationModal = function(herbId, requiredQty, row, data) { + // 디버깅: 전달받은 필요량 확인 + console.log('로트 배분 모달 열기:', { + herbId: herbId, + requiredQty: requiredQty, + herbName: data.herb_name, + gramsPerCheop: row.find('.grams-per-cheop').val(), + cheopTotal: $('#cheopTotal').val() + }); + currentLotAllocation = { herbId: herbId, requiredQty: requiredQty, diff --git a/test_lot_modal.html b/test_lot_modal.html new file mode 100644 index 0000000..f60eae0 --- /dev/null +++ b/test_lot_modal.html @@ -0,0 +1,72 @@ + + + + + 로트 배분 모달 테스트 + + + + + +
+

로트 배분 필요량 테스트

+ +
+
+
시나리오 테스트
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file