145 lines
7.7 KiB
XML
145 lines
7.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<template id="notice_print_template">
|
|
<t t-call="web.html_container">
|
|
<t t-foreach="docs" t-as="doc">
|
|
<t t-call="web.external_layout">
|
|
<style type="text/css">
|
|
/* 表格纵向版式:自适应,最大800px 居中 */
|
|
table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
|
|
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
|
|
.title {
|
|
text-align: center;
|
|
font-weight: bold;
|
|
font-size: 18px;
|
|
padding: 8px 0;
|
|
}
|
|
.header-cell { font-weight: bold; background-color: #d4e6f1;}
|
|
/* 附件清单左对齐 */
|
|
.attachment-list { text-align: left; }
|
|
/* 隐藏意见和审批人之间的竖边框 */
|
|
.no-right-border { border-right: none !important; }
|
|
.no-left-border { border-left: none !important; }
|
|
</style>
|
|
|
|
<!-- 流水号:页面左上角,位于标题之上,浅灰色 -->
|
|
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
|
流水号:<span t-esc="doc.code or ''"/>
|
|
</div>
|
|
|
|
<!-- 通知公告标题 -->
|
|
<div class="title">
|
|
通知公告
|
|
</div>
|
|
|
|
<table>
|
|
<colgroup>
|
|
<col style="width:15%"/>
|
|
<col style="width:35%"/>
|
|
<col style="width:15%"/>
|
|
<col style="width:35%"/>
|
|
</colgroup>
|
|
|
|
<tr>
|
|
<td class="header-cell"><strong>标题</strong></td>
|
|
<td colspan="3"><span t-esc="doc.name or ''"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>类型</strong></td>
|
|
<td><span t-esc="doc.notice_type_id.name or ''"/></td>
|
|
<td class="header-cell"><strong>紧急程度</strong></td>
|
|
<td>
|
|
<span t-if="doc.urgency_level == 'normal'">普件</span>
|
|
<span t-if="doc.urgency_level == 'urgent'">急件</span>
|
|
<span t-if="doc.urgency_level == 'emergency'">特急件</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>发布人</strong></td>
|
|
<td><span t-esc="doc.users_id.name or ''"/></td>
|
|
<td class="header-cell"><strong>发布部门</strong></td>
|
|
<td><span t-esc="doc.department_id.name or ''"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>发布日期</strong></td>
|
|
<td><span t-esc="doc.create_date1 and doc.create_date1.strftime('%Y-%m-%d') or ''"/></td>
|
|
<td class="header-cell"><strong>生效日期</strong></td>
|
|
<td><span t-esc="doc.start_date and doc.start_date.strftime('%Y-%m-%d') or ''"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>正文</strong></td>
|
|
<td colspan="3" class="attachment-list"><span t-field="doc.notice_text1"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>附件</strong></td>
|
|
<td colspan="3" class="attachment-list">
|
|
<t t-foreach="doc.documents_ids" t-as="att">
|
|
<div><span t-esc="att.name or ''"/></div>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- 发布范围 -->
|
|
<tr>
|
|
<td colspan="4" style="background-color: #d4e6f1; text-align: center;"><strong>发布范围</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>部门范围</strong></td>
|
|
<td colspan="3" class="attachment-list">
|
|
<t t-foreach="doc.department_ids" t-as="dept">
|
|
<span t-esc="dept.name"/>
|
|
<t t-if="not dept_last">、</t>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>角色组</strong></td>
|
|
<td colspan="3" class="attachment-list">
|
|
<t t-foreach="doc.users_role_group_ids" t-as="role_group">
|
|
<span t-esc="role_group.name"/>
|
|
<t t-if="not role_group_last">、</t>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>角色范围</strong></td>
|
|
<td colspan="3" class="attachment-list">
|
|
<t t-foreach="doc.users_role_ids" t-as="role">
|
|
<span t-esc="role.name"/>
|
|
<t t-if="not role_last">、</t>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="header-cell"><strong>人员范围</strong></td>
|
|
<td colspan="3" class="attachment-list">
|
|
<t t-foreach="doc.employee_ids" t-as="emp">
|
|
<span t-esc="emp.name"/>
|
|
<t t-if="not emp_last">、</t>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- 审批详情 -->
|
|
<tr>
|
|
<td colspan="4" style="background-color: #d4e6f1; text-align: center;"><strong>审批详情</strong></td>
|
|
</tr>
|
|
<t t-set="logs_ordered" t-value="doc.log_ids.sorted(lambda x: x.date_create or '')"/>
|
|
<t t-foreach="logs_ordered" t-as="log">
|
|
<tr>
|
|
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
|
|
<td class="no-right-border" colspan="2"><span t-esc="log.comment or ''"/></td>
|
|
<td class="no-left-border" colspan="1">
|
|
<t t-if="log.done_by">
|
|
<span t-esc="log.done_by.name"/> <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</table>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
</odoo>
|