접수 저장 및 메시지 처리

This commit is contained in:
pjs
2026-01-28 00:59:29 +09:00
parent 50d2f05404
commit b9f1419e5e
12 changed files with 319 additions and 17 deletions

View File

@@ -251,7 +251,7 @@
let html = "";
if( res.msgCode == 0 ){
const userList = res.list;
console.log(userList);
if (!userList || userList.length === 0) {
alert("조회된 정보가 없습니다.");
return;
@@ -260,7 +260,7 @@
userList.forEach((user, index) => {
html += `
<tr>
<td><input type="radio" name="selectedUser" class="user-radio" value="${user.userNumber}" ${index === 0 ? 'checked' : ''}></td>
<td><input type="radio" name="selectedUser" class="user-radio" value="${user.muUserId}" ${index === 0 ? 'checked' : ''}></td>
<td class="user-name-cell">${user.userName}</td>
<td>${user.birthday || '-'}</td>
<td>${user.gender === 'M' ? '남' : (user.gender === 'F' ? '여' : '-')}</td>
@@ -282,16 +282,44 @@
});
}
function submitBtn() {
const selectedUser = $("input[name='selectedUser']:checked");
if (selectedUser.length === 0) {
alert("접수할 고객을 선택해 주세요.");
return;
}
const userName = selectedUser.val();
alert(userName + "님 접수가 완료되었습니다.");
$("#customerDialog").dialog("close");
}
function submitBtn() {
const selectedUser = $("input[name='selectedUser']:checked");
// 1. 선택 여부 확인
if (selectedUser.length === 0) {
alert("접수할 고객을 선택해 주세요.");
return;
}
// 2. 선택된 사용자의 식별값 (userNumber) 가져오기
const muUserId = selectedUser.val();
const userName = selectedUser.closest('tr').find('.user-name-cell').text();
// 3. 서버로 접수 정보 전송 (AJAX)
$.ajax({
url: '/kiosk/putSubmit.do', // 실제 서버의 접수 처리 URL로 변경하세요
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
muUserId: muUserId,
userName: userName
}),
success: function(res) {
if (res.msgCode == 0) {
alert(res.msgDesc);
$("#customerDialog").dialog("close");
// 접수 완료 후 메인 페이지로 이동하거나 초기화
location.href = "/kiosk";
} else {
alert(res.msgDesc);
}
},
error: function() {
alert("서버 통신 중 오류가 발생했습니다.");
}
});
}
function moveKiosk() {
window.location.href = "/kiosk";