feat(tkqc): 관리함 이슈 프로젝트 변경 + cause_person 필드명 버그 수정
- 모바일/데스크톱 관리함에서 이슈 소속 프로젝트 변경 가능 - 프로젝트 변경 시 sequence_no 자동 재계산 (DB 함수 사용) - in_progress 상태에서만 변경 허용 (프론트+백엔드 이중 제한) - cause_person → responsible_person_detail 필드명 불일치 수정 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,6 +66,7 @@ async function loadProjects() {
|
||||
|
||||
if (response.ok) {
|
||||
projects = await response.json();
|
||||
window._cachedProjects = projects;
|
||||
updateProjectFilter();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -1573,7 +1574,10 @@ function openIssueEditModal(issueId, isCompletionMode = false) {
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">프로젝트</label>
|
||||
<input type="text" value="${project ? project.project_name : '-'}" class="w-full px-3 py-2 bg-gray-100 border border-gray-300 rounded-lg text-sm" readonly>
|
||||
<select id="edit-issue-project-${issue.id}" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500"${issue.review_status === 'completed' ? ' disabled' : ''}>
|
||||
<option value="">선택하세요</option>
|
||||
${(window._cachedProjects || []).map(p => `<option value="${p.id}"${p.id == issue.project_id ? ' selected' : ''}>${p.project_name || p.job_no}</option>`).join('')}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">부적합명</label>
|
||||
@@ -1845,6 +1849,27 @@ async function saveIssueFromModal(issueId) {
|
||||
|
||||
const combinedDescription = title + (detail ? '\n' + detail : '');
|
||||
|
||||
// 프로젝트 변경 처리
|
||||
const projectSelect = document.getElementById(`edit-issue-project-${issueId}`);
|
||||
if (projectSelect) {
|
||||
const newProjectId = parseInt(projectSelect.value);
|
||||
const issue = issues.find(i => i.id === issueId);
|
||||
if (newProjectId && issue && newProjectId !== issue.project_id) {
|
||||
try {
|
||||
const projResp = await fetch(`/api/issues/${issueId}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Authorization': `Bearer ${TokenManager.getToken()}`, 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ project_id: newProjectId })
|
||||
});
|
||||
if (!projResp.ok) {
|
||||
const err = await projResp.json();
|
||||
showToast(err.detail || '프로젝트 변경 실패', 'error');
|
||||
return;
|
||||
}
|
||||
} catch (e) { showToast('프로젝트 변경 실패: ' + e.message, 'error'); return; }
|
||||
}
|
||||
}
|
||||
|
||||
const requestBody = {
|
||||
final_description: combinedDescription,
|
||||
final_category: category,
|
||||
|
||||
Reference in New Issue
Block a user