form.html 7.09 KB
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${mode=='add'} ? 'A3 报告 - 新增' : (${mode=='edit'} ? 'A3 报告 - 编辑' : 'A3 报告 - 查看')">A3 报告</title>
    <link rel="stylesheet" th:href="@{/a3report/a3report.css}">
</head>
<body class="a3-page" th:attr="data-mode=${mode}">
<div class="a3-header">
    <div class="a3-header-title">
        <span class="a3-header-bar"></span>
        <h1>
            年度方针管理看板 - A3 报告
            <small th:text="${mode=='add'} ? '(新增)' : (${mode=='edit'} ? '(编辑)' : '(查看)')"></small>
        </h1>
    </div>
    <div class="a3-header-actions">
        <a class="btn" th:href="@{/a3Report/page/list}">返回列表</a>
        <button type="button" class="btn btn-primary" id="btn-save" onclick="saveReport()"
                th:if="${mode!='view'}">保存
        </button>
    </div>
</div>

<!-- 1. 顶部信息区 -->
<div class="a3-card">
    <div class="a3-card-title">
        <span class="a3-card-title-bar"></span>
        <span>基本信息</span>
    </div>
    <div class="a3-form-grid">
        <div class="a3-form-item">
            <label>板块<span class="req">*</span></label>
            <select id="f-bk" th:disabled="${mode=='view'}">
                <option value="">请选择</option>
                <option th:each="b : ${blockList}" th:value="${b.id}" th:text="${b.mc}"></option>
            </select>
        </div>
        <div class="a3-form-item">
            <label>负责人</label>
            <input type="text" id="f-fzr" th:disabled="${mode=='view'}" placeholder="请输入负责人">
        </div>
        <div class="a3-form-item">
            <label>年份</label>
            <input type="number" id="f-nf-year" min="2000" max="2100" step="1"
                   th:disabled="${mode=='view'}" placeholder="如 2026">
        </div>
        <div class="a3-form-item">
            <label>工作计划状态</label>
            <select id="f-gzjhzt" th:disabled="${mode=='view'}">
                <option value="">请选择</option>
                <option th:each="e : ${gzjhztList}" th:value="${e.code}" th:text="${e.desc}"></option>
            </select>
        </div>
        <div class="a3-form-item a3-form-item-full">
            <label>目标及现状情况</label>
            <textarea id="f-mdjxqkh" rows="3" th:disabled="${mode=='view'}"
                      placeholder="请输入目标及现状情况"></textarea>
        </div>
        <div class="a3-form-item a3-form-item-full">
            <label>战略考量</label>
            <textarea id="f-zlkl" rows="3" th:disabled="${mode=='view'}"
                      placeholder="请输入战略考量"></textarea>
        </div>
        <div class="a3-form-item a3-form-item-full">
            <label>推进的行为和步骤(总述)</label>
            <textarea id="f-tjdxwh" rows="2" th:disabled="${mode=='view'}"
                      placeholder="请输入推进的行为和步骤总述"></textarea>
        </div>
        <div class="a3-form-item a3-form-item-full">
            <label>显示阶段问题(总述)</label>
            <textarea id="f-xsjdwt" rows="2" th:disabled="${mode=='view'}"
                      placeholder="请输入显示阶段问题总述"></textarea>
        </div>
    </div>
</div>

<!-- 2. 工作计划状态和 BIC -->
<div class="a3-card">
    <div class="a3-card-title">
        <span class="a3-card-title-bar"></span>
        <span>工作计划状态和 BIC</span>
        <button type="button" class="btn btn-mini btn-primary a3-card-title-btn"
                onclick="addPlanStatusRow()" th:if="${mode!='view'}">+ 新增行
        </button>
    </div>
    <table class="a3-table" id="tbl-plan-status">
        <thead>
        <tr>
            <th style="width:50px;">序号</th>
            <th style="width:180px;">指标</th>
            <th style="width:140px;">成效</th>
            <th style="width:110px;">上年度</th>
            <th style="width:110px;">上年度值</th>
            <th style="width:110px;">本年度</th>
            <th style="width:110px;">本年度值</th>
            <th style="width:110px;">后年</th>
            <th style="width:110px;">后年度值</th>
            <th style="width:110px;">BIC 比率</th>
            <th style="width:140px;">公司指标</th>
            <th>备注</th>
            <th style="width:80px;" th:if="${mode!='view'}">操作</th>
        </tr>
        </thead>
        <tbody id="tbody-plan-status"></tbody>
    </table>
</div>

<!-- 3. 推进的行为和步骤 -->
<div class="a3-card">
    <div class="a3-card-title">
        <span class="a3-card-title-bar"></span>
        <span>推进的行为和步骤</span>
        <button type="button" class="btn btn-mini btn-primary a3-card-title-btn"
                onclick="addActionStepRow()" th:if="${mode!='view'}">+ 新增行
        </button>
    </div>
    <table class="a3-table" id="tbl-action-step">
        <thead>
        <tr>
            <th style="width:80px;">序号</th>
            <th>推进的行为和步骤</th>
            <th style="width:180px;">状态</th>
            <th style="width:80px;" th:if="${mode!='view'}">操作</th>
        </tr>
        </thead>
        <tbody id="tbody-action-step"></tbody>
    </table>
</div>

<!-- 4. 显示阶段问题事件 -->
<div class="a3-card">
    <div class="a3-card-title">
        <span class="a3-card-title-bar"></span>
        <span>显示阶段问题事件</span>
        <button type="button" class="btn btn-mini btn-primary a3-card-title-btn"
                onclick="addProblemEventRow()" th:if="${mode!='view'}">+ 新增行
        </button>
    </div>
    <table class="a3-table" id="tbl-problem-event">
        <thead>
        <tr>
            <th style="width:60px;">序号</th>
            <th>问题事件</th>
            <th style="width:180px;">责任人</th>
            <th style="width:180px;">时间</th>
            <th style="width:80px;" th:if="${mode!='view'}">操作</th>
        </tr>
        </thead>
        <tbody id="tbody-problem-event"></tbody>
    </table>
</div>

<div class="a3-footer" th:if="${mode!='view'}">
    <a class="btn" th:href="@{/a3Report/page/list}">取消</a>
    <button type="button" class="btn btn-primary" onclick="saveReport()">保存</button>
</div>

<!-- 数据注入 -->
<script th:inline="javascript">
    /*<![CDATA[*/
    window.__MODE__ = /*[[${mode}]]*/ 'add';
    window.__REPORT_ID__ = /*[[${detail.report != null ? detail.report.id : null}]]*/ null;
    window.__DETAIL__ = JSON.parse(/*[[${detailJson}]]*/ '{}');
    window.__BLOCKS__ = JSON.parse(/*[[${blockListJson}]]*/ '[]');
    window.__INDICATORS_BY_BLOCK__ = JSON.parse(/*[[${indicatorsByBlockJson}]]*/ '{}');
    window.__GZJHZT_LIST__ = [
        /*[# th:each="e : ${gzjhztList}"]*/
        {code: /*[[${e.code}]]*/ '', desc: /*[[${e.desc}]]*/ ''},
        /*[/]*/
    ];
    window.__ZT_LIST__ = [
        /*[# th:each="e : ${ztList}"]*/
        {code: /*[[${e.code}]]*/ '', desc: /*[[${e.desc}]]*/ ''},
        /*[/]*/
    ];
    /*]]>*/
</script>
<script th:src="@{/a3report/form.js}"></script>
</body>
</html>