{% extends "core/detail.html" %} {% load seizou_tags seizou_icons workorders_plan workorders_tags %} {# 指示書の詳細: core の詳細 (項目と「工程」「進捗」のタブ)。発行のときだけ、指示書の権限がある人に「取消」。取消は小窓で開く (data-modal-form)。見出しの帯 (#workorder-heading) と中身 (#workorder-live) は、小窓で保存した後の seizou:refresh で取り直す (決め 11-05 11:4x。N158b)。頭の右の緑はその伝票で次にする操作 1 つ (UX-2 a。11-06 22:1x。無ければ出さない): 発行の指示書で指示書の状態が完了で入庫の残りがあり (workorders_plan の finished_due)、部署で在庫を開ける人に「製造の完了を入庫にする」(画面の全体へ移る。初見テスト R5 の候補 C93)。「着手」のボタンと着手の印は無い (状態は実績から出し、題の横の印で見せる。本人の決め WO-1 = b・WO-2 = b。候補 C27)。実績は工程のタブの各行の「実績を入力」から入れる。 #} {% block heading %}
{{ block.super }}
{% endblock %} {# 題の横の印は進みの状態 (未着手・着手済・完了・取消。実績から出す。workorders_tags の workorder_badge)。「発行」は印にしない (C27-1 = a。初見テスト R5 の候補 C27)。 #} {% block heading_badge %}{% workorder_badge object dot=True %}{% endblock %} {% block actions %}{{ block.super }} {% icon "file" "size-4" %}現品票 {% icon "download" "size-4" %}PDF {% endblock %} {% block more %}{% can_write "workorders.WorkOrder" as can_cancel %}{% if object.status == "issued" and can_cancel %}{% url 'workorders:workorder_cancel' object.pk as cancel_url %}{% include "core/_detail_more.html" with more_url=cancel_url more_label="取消" more_modal=True %}{% endif %}{% endblock %} {% block edit_button %}{% if object.status == "issued" %}{% finished_due object as due %}{% if due %}{% can_write "stock.StockMove" as can_stock %}{% url 'stock:finished_create' as finished_url %}{% if can_stock and finished_url %}{% icon "factory" "size-4" %}製造の完了を入庫にする{% endif %}{% endif %}{% endif %}{% endblock %} {# 工程のタブ (block tab_rows の steps) の行ごとに「実績を入力」のボタン (C16)。href と data-modal-form は同じ値 (progress_url に工程の pk と開いた画面の道を付ける) で、実績の新規登録をその工程を選んだ形で小窓に開く。出す条件 = progress の部品がある (progress_url が空でない)・部署と権限で開ける人 (can_progress)・発行の指示書 (取消には出さない。services に断る処理は足さない)。予定に届いた工程にも出す (予定を超えた数も記録できる作り)。行は workorders_plan の step_rows が作る (工程を process と一緒に読み、実績の合計を 1 回で読む)。左に工程の字と、完了の印の付いた工程の「完了」の印 (QR を読んだ先と同じ)、右に「実績の合計/予定の数」とボタン。印の無い最初の工程を太字にする (計画の詳細の小窓と同じ aria-current。生産管理ボードの今の工程と同じ読み方。初見テスト R5 の候補 C27 の 1)。 #} {% block tab_rows %}{% if tab.related == "steps" %}{% url 'progress:progress_create' as progress_url %}{% can_write "progress.Progress" as can_progress %} {% else %}{{ block.super }}{% endif %}{% endblock %} {# 空の進捗のタブ (block tab_empty の progress_records) は、ボタンが出る条件と同じときだけ、土台と同じ箱に入れる場所の 1 文を足す (押せない人には案内しない)。ほかのタブとほかの条件は土台のまま。 #} {% block tab_empty %}{% url 'progress:progress_create' as progress_url %}{% can_write "progress.Progress" as can_progress %}{% if tab.related == "progress_records" and progress_url and can_progress and object.status == "issued" %}
{% icon "inbox" "size-6" %}

まだありません。

{{ tab.label }}が入ると、ここに並びます。

工程のタブの「実績を入力」から入れます。

{% else %}{{ block.super }}{% endif %}{% endblock %} {# 中身の頭 (#workorder-live の中。小窓で保存した後の取り直しでも描き直す) の青の 1 行: 発行の指示書で「取消」が出ない人に、出ない訳と頼む先を出す (初見テスト R5 の V17・U19。候補 C12 の 2。決め C12-1 = a)。出す条件は block more の取消と同じ tag の逆 (block more の can_cancel はこの block から見えないので、もう 1 回引く)。頼む先の字は core/access.py の CONTACT と同じ。CONTACT を直したら、ここも直す。 #} {% block content %}
{% can_write "workorders.WorkOrder" as can_cancel %}{% if object.status == "issued" and not can_cancel %}
{% icon "info" "size-5" %}取消は、指示書の編集の権限があり、部署で指示書を使う人にだけ出ます。要るときはアカウント管理の担当者に頼んでください。
{% endif %}{{ block.super }}{% if "notes" in seizou.parts %}{% include "notes/_note.html" %}{% endif %}
{% endblock %}