feat(821-2): M01 기계 화면 — 목록 열 줄이기 · 상세 페이지 · 새 기계(비슷한 기계에서 시작) · 저장 때 계수 서버 재계산

- 목록 = 이름 · 규격 · 구분 · 가격 · 손료계수 · 주연료 · 조종원 · 시간당 경비(서버 값) · 별칭 · 비고 (단위 · 출처 열 없음 · 가로 넘침 없음) · 다른 요소 표 그대로
- 상세 = 기계 양식 + 원문번호 · 원문 · 구분 · 상세구분 · 별칭 · 비고 · 쓰는 곳 · 지우기(쓰는 곳 보이고 확인) · 주소 ?machine= 로 바로 열림 · 뒤로 가기 = 목록 · 저장 안 한 고침 나가기 경고
- 고침 = 초안 → 페이지 [저장](자동저장 없음) · 서버 M01_MasterData_Machine.fix = 품셈 입력이 바뀌면 계수 짝으로 다시 셈 · 단위 · 출처 칸 채움(새 칸 = 마스터 단위 · 「자체」)
- API /api/m01/machine/lists · hourly · uses · find · row (시스템 관리자만) · 시험 test_821_2_machine_save.py

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 14:02:04 +09:00
co-authored by Claude Opus 5.5
parent 6e0d86c961
commit 086f6d214a
10 changed files with 1078 additions and 4 deletions
+29
View File
@@ -14,6 +14,7 @@ from pydantic import BaseModel
from M01_MasterData import M01_MasterData_Doc as doc_screen
from M01_MasterData import M01_MasterData_Equation as equation
from M01_MasterData import M01_MasterData_Machine as machine
from M01_MasterData import M01_MasterData_Parts as parts
from M01_MasterData import M01_MasterData_Sheet as line_sheet
from M01_MasterData import M01_MasterData_Store as store
@@ -259,6 +260,34 @@ def get_materials(
return _call(store.materials, sub, detail, spec, region, unit, limit)
@router.get("/machine/lists")
def get_machine_lists() -> dict:
"""기계 양식 고르기 — 연료 · 직종 · 단가 · 원문 · 구분(821-2)."""
return _call(machine.lists)
@router.get("/machine/hourly")
def get_machine_hourly(keys: str) -> dict:
"""기계 키(쉼표) → 시간당 경비(서버 기계경비식 · 전국평균)."""
return _call(machine.hourly, [k for k in keys.split(",") if k])
@router.get("/machine/uses")
def get_machine_uses(key: str) -> dict:
return {"uses": _call(machine.uses, key)}
@router.get("/machine/find")
def get_machine_find(q: str = "") -> dict:
"""비슷한 기계에서 시작 — 이름 · 규격 · 별칭 찾기(값 묶음 같이)."""
return {"rows": _call(machine.find, q)}
@router.get("/machine/row")
def get_machine_row(key: str) -> dict:
return _call(machine.row, key)
@router.post("/calc")
def post_calc(body: CalcBody) -> dict:
with store.cm.mf.mp.choosing(body.고름):