{% load seizou_tags workorders_tags %} {# 指示書の一覧の 1 行 (workorders/_rows.html が core/_rows.html の row_template で include する)。context: row (土台の row_for の 1 行。obj は WorkOrder)・columns。 #} {# 欄の描き方は core/_rows.html の 1 行と同じ。「状態」の列 (progress_state_label) だけを進みの状態の印 (未着手・着手済・完了・取消。workorders_tags の workorder_badge) にする (作者の決め。土台の row_for は名前が status の列だけを印にするため)。 #} {# 「受注の明細」の列 (order_line) は欄の字を「受注番号-行番号」だけにし、title に今の全文 (受注番号-行番号 品番 品名) を出す (作者の決め。部品は隣の列にあるので繰り返さない)。CSV は今のまま全文、並び替えは今のまま受注番号の順。 #} {# 「工程の進み」の列 (step_progress。本人の決め 11-07 18:2x〜18:4x): 工程ごとに「工程の名前・細い棒・良品の合計/予定の数」を工程の順に縦に並べる (値は WorkOrder.step_progress)。棒の長さは style の width (class では作らない = R19)、地は base-300 (縞の行の地 base-200 と見分けるため)。予定の数に届いた工程 (full) は棒と数を緑、ほかは主色。長い工程の名前は 1 行で切り、指すと全部 (title)。工程の無い指示書は「—」。 #} {% for cell in row.cells %} {% for col in columns %}{% if forloop.counter0 == forloop.parentloop.counter0 %} {% if col.name == "progress_state_label" %}{% workorder_badge row.obj %} {% elif col.name == "step_progress" %}{% if cell.value %}{% else %}—{% endif %} {% elif col.name == "order_line" %}{{ row.obj.order_line.order.order_no }}-{{ row.obj.order_line.line_no }} {% elif forloop.parentloop.first and row.url and not cell.numeric and not cell.master %}{% if cell.datetime %}{{ cell.value|date:"Y-m-d H:i" }}{% elif cell.date %}{{ cell.value|date:"Y-m-d" }}{% with day=cell.value|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %}{% else %}{{ cell.value|default_if_none:"" }}{% endif %} {% elif cell.numeric %}{% if cell.master %}{% master_link cell.master cell.value %}{% elif cell.negative %}{{ cell.value|yen_if:cell.money }}{% else %}{{ cell.value|yen_if:cell.money }}{% endif %} {% elif cell.date or cell.datetime %}{% if cell.datetime %}{{ cell.value|date:"Y-m-d H:i" }}{% else %}{{ cell.value|date:"Y-m-d" }}{% with day=cell.value|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %}{% endif %} {% elif cell.master %}{% master_link cell.master cell.value %} {% elif cell.boolean %}{% bool_mark cell.value %} {% elif cell.status %}{% status_badge row.obj %} {% else %}{{ cell.value|default_if_none:"" }} {% endif %} {% endif %}{% endfor %} {% endfor %} {# 右端の「要点」の列 (workorders/_rows.html が土台に actions_label を渡して見出しを出す)。目の印を押すと指示書の小窓 (WorkOrderModalView) を開く。 #} {% url 'workorders:workorder_modal' row.pk as modal_url %}{% include "core/_row_summary_link.html" with modal_url=modal_url detail_url=row.url %}