Merge pull request !8043 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-01-16 07:32:06 +00:00
committed by Gitee
3 changed files with 39 additions and 121 deletions
@@ -129,18 +129,14 @@ class SoongWorkflowMixin(models.AbstractModel):
record.is_confirm = True
record.is_end = True
domain = [('done_by', '=', self.env.user.id), ('workflow_id', '=', record.workflow_id.id),
('res_id', '=', record.id), ('approval_state', 'in', ['0', '1']), ('name', '!=', '归档')]
('res_id', '=', record.id), ('approval_state', 'not in', ['0', '1']), ('name', '!=', '归档')]
lg2 = record.log_ids2.search(domain)
lg1 = record.log_ids.search(domain)
if lg2 or lg1:
record.is_confirm = False
if not lg1 and not lg2 and record.is_active == True:
if not lg1 and not lg2:
record.is_end = False
if record.log_ids:
if record.log_ids[-1].name == '归档' and record.log_ids[-1].approval_state == '2':
record.is_end = True
@api.depends("node_id", "log_ids")
def _compute_approval_sign_ids(self):
for record in self:
@@ -878,7 +874,7 @@ class SoongWorkflowMixin(models.AbstractModel):
id_el = etree.Element("field")
id_el.set("name", "log_ids")
id_el.set("invisible", "1")
invisible += "or is_end"
invisible += "or not is_end"
if button.name == "退回":
id_el = etree.Element("field")
id_el.set("name", "log_ids")
+15
View File
@@ -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>