<% const mobileFlow = ctx.url.indexOf('/wap/') === 0; const showTimeline = !mobileFlow && !inspection.flowDraft; const flowStatusText = { 1: '待处理', 2: '审批中', 3: '已完成', 4: '已关闭', 5: '审批退回', 6: '审批退回', 8: '已跳过', 12: '整改中' }; %> <% if (mobileFlow) { %>
审批流程 · <%= inspection.flowLabel %> <% if (!inspection.readOnly) { %> <% } %>
是否整改 <% [1, 0].forEach(value => { %> <% }); %> 选择“是”时,上报结束后进入整改,整改人按顺序通过后进入批复。
<% } else { %>
审批流程
<% } %>
<% inspection.flowStages.forEach(phase => { %> <% if (phase.stage === 1 || inspection.need_rectification || !inspection.readOnly) { %> <% const people = phase.auditors.map((audit, index) => ({ name: audit.name, icon: phase.stage === 3 && index === phase.auditors.length - 1 ? 'fa-stop-circle' : 'fa-chevron-circle-down', title: phase.stage === 2 ? '第' + audit.audit_order + '位整改人' : audit.audit_order + '审', placeholder: false, })); if (phase.stage === 1) people.unshift({ name: inspection.user.name, icon: 'fa-play-circle fa-rotate-90', title: '上报人', placeholder: false }); if (!phase.auditors.length) people.push({ name: phase.stage === 2 ? '整改人由上报审批人指派' : '尚未设置审批人', icon: 'fa-circle-o', title: '', placeholder: true }); %> <% people.forEach((person, index) => { %> <% if (index === 0) { %><% } %> <% }); %> <% } %> <% }); %>
<%= phase.name %><%= person.name %>
<% inspection.flowStages.forEach(phase => { %> <% if (phase.stage === 1 || inspection.need_rectification || !inspection.readOnly) { %> <% const reportMode = ctx.tender.info.shenpi.inspection; const editable = phase.stage === 2 ? inspection.canAssignRectifiers : !inspection.readOnly && (phase.stage !== 1 || reportMode !== shenpiConst.sp_status.gdspl); const maxOrder = phase.auditors.length ? Math.max(...phase.auditors.map(x => x.order)) : 0; %> <% if (showTimeline) { %>
巡检<%= phase.name %>
<% } else { %>
<% } %> <% if (editable) { %> <% } %> <% if (showTimeline) { %> <% if (phase.stage === 2 && phase.auditors.length) { %>
按顺序整改已通过 <%= inspection.rectificationDone %>/<%= inspection.rectificationTotal %>
<% } %>
    <% phase.nodes.forEach((node, index) => { %> <% const tone = node.status === 3 ? 'success' : [2, 5, 6, 12].includes(node.status) ? 'warning' : node.status === 4 ? 'danger' : 'secondary'; const icon = node.origin ? 'caret-down' : node.status === 3 ? 'check' : [5, 6].includes(node.status) ? 'level-up' : [2, 12].includes(node.status) ? 'ellipsis-h' : node.status === 4 ? 'stop' : ''; %>
  • <% if (node.time) { %>
    <%= moment(node.time).format('YYYY') %><%= moment(node.time).format('MM-DD') %><%= moment(node.time).format('HH:mm:ss') %>
    <% } %> <% if (index < phase.nodes.length - 1) { %>
    <% } %>
    <% if (icon) { %><% } %>
    <%= node.label %> <%= node.origin ? '上报审批' : node.status === 3 ? (phase.stage === 2 ? '整改通过' : '审批通过') : phase.stage === 2 && [5, 6].includes(node.status) ? '整改退回' : flowStatusText[node.status] %>
    <% node.auditors.forEach((audit, personIndex) => { %>
    <%= audit.name %><%= audit.company || '' %><%= audit.company && audit.role ? '-' : '' %><%= audit.role || '' %>
    <% const personTone = node.origin || audit.status === 3 ? 'success' : [2, 5, 6, 12].includes(audit.status) ? 'warning' : audit.status === 4 ? 'danger' : 'secondary'; %> <% if (phase.stage === 2 && editable) { %> <% } else { %> <% if (!node.origin && node.auditors.length > 1) { %><%= flowStatusText[audit.status] %><% } %> <% } %>
    <%= audit.opinion || '' %>
    <% }); %>
  • <% }); %> <% if (!phase.nodes.length) { %>
  • <%= phase.stage === 2 ? '整改人由上报审批人按先后顺序指派,依次处理。' : '尚未设置审批人' %>
  • <% } %>
<% } else { %>
<%= phase.name %>流程 <% if (phase.stage === 2 && phase.auditors.length) { %>第 <%= inspection.stage_round %> 轮 · 已完成 <%= inspection.rectificationDone %>/<%= inspection.rectificationTotal %><% } %>
    <% if (!phase.auditors.length) { %>
  • <%= phase.stage === 2 ? '整改人由上报审批人按先后顺序指派,依次处理。' : '请设置' + phase.name + '审批人' %>
  • <% } %> <% phase.auditors.forEach(audit => { %>
  • <%= audit.name %> <%= audit.role || '' %><%= phase.stage !== 2 && audit.audit_type !== 1 ? ' · ' + auditType.info[audit.audit_type].name : '' %> <% if (editable && !(phase.stage === 1 && reportMode === shenpiConst.sp_status.gdzs && audit.order === maxOrder)) { %> <% } else { %> <%= audit.status === 1 ? '待处理' : audit.status === 3 ? '已完成' : audit.status === 8 ? '已跳过' : auditConst.statusString[audit.status] %> <% } %>
    <%= audit.company || '' %> <% if (mobileFlow && phase.stage === 2 && inspection.rectificationPower && audit.aid === ctx.session.sessionUser.accountId && audit.status === 12) { %>
    <% if (mobileFlow) { %> <% } %>
    <% } else if (mobileFlow && phase.stage === 2 && (audit.rectification_item || audit.rectification_date)) { %>
    <%= audit.rectification_item %>
    整改日期:<%= audit.rectification_date ? moment(audit.rectification_date).format('YYYY-MM-DD') : '' %> <% } %> <% if (!mobileFlow && phase.stage === 2) { %>
    <%= audit.opinion || '' %>
    <% } else if (audit.opinion && !(phase.stage === 2 && inspection.rectificationPower && audit.aid === ctx.session.sessionUser.accountId && audit.status === 12)) { %>

    <%= audit.opinion %>

    <% } %> <% if (mobileFlow && phase.stage !== 2 && inspection.shenpiPower && inspection.flow_stage === phase.stage && audit.aid === ctx.session.sessionUser.accountId && audit.status === 2) { %>
    <% if (phase.stage === 1) { %> <% if (phase.auditors.some(x => x.audit_order < audit.audit_order)) { %><% } %> <% } else { %> <% } %>
    <% } %>
  • <% }); %>
<% } %> <% if (showTimeline) { %>
<% } else { %>
<% } %> <% } %> <% }); %>
本次巡检无整改/批复流程
<% if (inspection.flowHistory.length) { %>
查看处理记录
<% inspection.flowHistory.forEach(audit => { %>
第 <%= audit.times %> 次上报 / 第 <%= audit.stage_round %> 轮 · <%= auditConst.stageString[audit.flow_stage] %> · <%= audit.name %><%= audit.status === 3 ? '已完成' : audit.status === 8 ? '已跳过' : auditConst.statusString[audit.status] %>
<%= moment(audit.begin_time).format('YYYY-MM-DD HH:mm:ss') %><%= audit.end_time ? ' 至 ' + moment(audit.end_time).format('YYYY-MM-DD HH:mm:ss') : '' %> <% if (audit.flow_stage === 2) { %>

<%= audit.rectification_item || '' %> <%= audit.rectification_date ? moment(audit.rectification_date).format('YYYY-MM-DD') : '' %>

<% } %> <% if (audit.opinion) { %>

<%= audit.opinion %>

<% } %>
<% }); %>
<% } %>