打印
This commit is contained in:
@@ -40,3 +40,18 @@ class YuthonNotice(http.Controller):
|
||||
'code':200,
|
||||
'message':'success'
|
||||
})
|
||||
|
||||
@http.route('/yuthon/notice/list', methods=['POST'], type='http', auth='none', csrf=False)
|
||||
def yuthon_notice_list(self, **kwargs):
|
||||
notice_ids = request.env['yuthon.notice'].sudo().search([('employee_id.id', "=", kwargs.get('employee_id'))])
|
||||
data_list = []
|
||||
for notice in notice_ids:
|
||||
result = {
|
||||
'id': notice.id,
|
||||
'create_data1': notice.create_data1,
|
||||
'users_id': notice.users_id.name,
|
||||
'name': notice.name,
|
||||
}
|
||||
data_list.append(result)
|
||||
return json.dumps({'data': data_list, 'code': 200, 'message': 'success'})
|
||||
|
||||
|
||||
@@ -7,139 +7,46 @@
|
||||
<t t-call="web.external_layout">
|
||||
<style type="text/css">
|
||||
td { border:1px solid #000; padding:6px; }
|
||||
table { border-collapse: collapse; width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
.title {
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-size:18px;
|
||||
padding: 12px 0;
|
||||
}
|
||||
.section-title {
|
||||
font-weight:bold;
|
||||
font-size:16px;
|
||||
margin:0;
|
||||
background-color: #e8f4f8;
|
||||
padding: 8px;
|
||||
border-left: 4px solid #2c5f8d;
|
||||
}
|
||||
.hdr { /* 匹配加班单的标题列样式 */
|
||||
background: #f0f0f0;
|
||||
font-weight: bold;
|
||||
width: 12em;
|
||||
text-align: center;
|
||||
}
|
||||
.section { /* 匹配加班单的审批详情标题样式 */
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
background: #d4e6f1;
|
||||
}
|
||||
table { border-collapse: collapse; width: 1000px; margin: 0 auto; table-layout: fixed; }
|
||||
.title { text-align:center; font-weight:bold; font-size:18px; padding: 12px 0; }
|
||||
.section-title { font-weight:bold; font-size:16px; margin:0; background-color: #e8f4f8; padding: 8px; border-left: 4px solid #2c5f8d; }
|
||||
.hdr { background: #f0f0f0; font-weight: bold; width: 6em; text-align: center; }
|
||||
.section { text-align: center; font-weight: bold; background: #d4e6f1; }
|
||||
.cell-content { text-align: left; word-wrap: break-word; word-break: break-all; }
|
||||
.approval-name { text-align: center; }
|
||||
/* 与加班单完全一致的审批列宽 */
|
||||
.approval-col1 { width: 20%; } /* 节点名称列 */
|
||||
.approval-col2 { width: 50%; } /* 意见列 */
|
||||
.approval-col3 { width: 30%; } /* 审批人列 */
|
||||
/* 隐藏边框(与加班单一致) */
|
||||
.approval-col1 { width: 20%; }
|
||||
.approval-col2 { width: 50%; }
|
||||
.approval-col3 { width: 30%; }
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
/* 内容居中(与加班单一致) */
|
||||
.approval-center { text-align: center !important; }
|
||||
/* 减少内边距(与加班单一致) */
|
||||
.approval-pull-left { padding-left: 0 !important; }
|
||||
/* 部门栏样式 */
|
||||
.dept-container {
|
||||
width: 800px;
|
||||
margin: 0 auto 10px auto;
|
||||
font-weight:bold;
|
||||
text-align:left;
|
||||
border: none !important;
|
||||
}
|
||||
/* 附件清单左对齐 */
|
||||
.dept-container { width: 1000px; margin: 0 auto 10px auto; font-weight:bold; text-align:left; border: none !important; }
|
||||
.attachment-list { text-align: left !important; }
|
||||
</style>
|
||||
|
||||
<!-- 标题 -->
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">
|
||||
业务审批单
|
||||
</div>
|
||||
|
||||
<!-- 部门栏 -->
|
||||
<div class="dept-container">
|
||||
<strong>部门:</strong><span t-esc="doc.department_id.name"/>
|
||||
</div>
|
||||
|
||||
<!-- 核心修改:将表格改为3列结构(与加班单一致) -->
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">业务审批单</div>
|
||||
<div class="dept-container"><strong>部门:</strong><span t-esc="doc.department_id.name"/></div>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:12em"/> <!-- 标题列(与加班单一致) -->
|
||||
<col style="width:50%"/> <!-- 内容列(与加班单一致) -->
|
||||
<col style="width:30%"/> <!-- 内容列(与加班单一致) -->
|
||||
<col style="width:6em"/>
|
||||
<col style="width:50%"/>
|
||||
<col style="width:30%"/>
|
||||
</colgroup>
|
||||
<!-- 事项标题(合并2列,与加班单一致) -->
|
||||
<tr>
|
||||
<td class="hdr"><strong>事项标题</strong></td>
|
||||
<td colspan="2" class="cell-content">
|
||||
<span t-esc="doc.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 业务类型(合并2列) -->
|
||||
<tr>
|
||||
<td class="hdr"><strong>业务类型</strong></td>
|
||||
<td colspan="2" class="cell-content">
|
||||
<t t-foreach="doc.information_categories_ids" t-as="category">
|
||||
<span t-esc="category.name"/><t t-if="not category_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 事项说明(合并2列) -->
|
||||
<tr>
|
||||
<td class="hdr"><strong>事项说明</strong></td>
|
||||
<td colspan="2" class="cell-content">
|
||||
<span t-esc="doc.reason"/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 用章类型(合并2列) -->
|
||||
<tr>
|
||||
<td class="hdr"><strong>用章类型</strong></td>
|
||||
<td colspan="2" class="cell-content">
|
||||
<t t-foreach="doc.type_stamp_ids" t-as="stamp">
|
||||
<span t-esc="stamp.name"/><t t-if="not stamp_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 用章范围(合并2列) -->
|
||||
<tr>
|
||||
<td class="hdr"><strong>用章范围</strong></td>
|
||||
<td colspan="2" class="cell-content">
|
||||
<t t-foreach="doc.scope_chapter_ids" t-as="scope">
|
||||
<span t-esc="scope.name"/><t t-if="not scope_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 附件清单(合并2列 + 左对齐) -->
|
||||
<tr>
|
||||
<td class="hdr"><strong>附件清单</strong></td>
|
||||
<td colspan="2" class="cell-content attachment-list">
|
||||
<t t-foreach="doc.document_ids" t-as="att">
|
||||
<div><t t-esc="att.name"/></div>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 审批详情(与加班单完全一致) -->
|
||||
<tr><td class="hdr"><strong>事项标题</strong></td><td colspan="2" class="cell-content"><span t-esc="doc.name"/></td></tr>
|
||||
<tr><td class="hdr"><strong>业务类型</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.information_categories_ids" t-as="category"><span t-esc="category.name"/><t t-if="not category_last">、</t></t></td></tr>
|
||||
<tr><td class="hdr"><strong>事项说明</strong></td><td colspan="2" class="cell-content"><span t-esc="doc.reason"/></td></tr>
|
||||
<tr><td class="hdr"><strong>用章类型</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.type_stamp_ids" t-as="stamp"><span t-esc="stamp.name"/><t t-if="not stamp_last">、</t></t></td></tr>
|
||||
<tr><td class="hdr"><strong>用章范围</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.scope_chapter_ids" t-as="scope"><span t-esc="scope.name"/><t t-if="not scope_last">、</t></t></td></tr>
|
||||
<tr><td class="hdr"><strong>附件清单</strong></td><td colspan="2" class="cell-content attachment-list"><t t-foreach="doc.document_ids" t-as="att"><div><t t-esc="att.name"/></div></t></td></tr>
|
||||
<tr><td class="section" colspan="3"><strong>审批详情</strong></td></tr>
|
||||
<t t-foreach="doc.log_ids.sorted('sequence')" t-as="log">
|
||||
<tr>
|
||||
<td class="cell-content approval-name approval-col1"><span t-esc="log.name"/></td>
|
||||
<td class="cell-content approval-col2 no-right-border approval-center"><span t-esc="log.comment"/></td>
|
||||
<td class="cell-content approval-col3 no-left-border approval-center approval-pull-left">
|
||||
<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>
|
||||
<td class="cell-content approval-col3 no-left-border approval-center approval-pull-left"><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>
|
||||
|
||||
Reference in New Issue
Block a user