123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449 |
- <% if ((ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo) && (ctx.session.sessionUser.accountId === ctx.material.user_id || ctx.tender.isTourist)) { %>
- <!--上报审批-->
- <div class="modal fade" id="sub-sp" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">上报审批</h5>
- </div>
- <div class="modal-body">
- <div class="dropdown text-right">
- <% if (ctx.tender.info.shenpi.material !== shenpiConst.sp_status.gdspl && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
- <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button"
- id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true"
- aria-expanded="false">
- 添加审批流程
- </button>
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton"
- style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm"
- placeholder="姓名/手机 检索" id="gr-search" autocomplete="off"></div>
- <dl class="list-unstyled book-list" id="book-list">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.session.sessionUser.accountId) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- <% } %>
- </div>
- <div class="card mt-3">
- <div class="card-header">
- 审批流程
- </div>
- <div class="modal-height-500" style="overflow: auto">
- <ul class="list-group list-group-flush" id="auditors">
- <% for (let i = 0, iLen = ctx.material.auditorGroups.length; i < iLen; i++) { %>
- <li class="list-group-item d-flex" auditorId="<%- ctx.material.auditorGroups[i][0].aid %>">
- <div class="col-auto"><%- i+1 %></div>
- <div class="col">
- <% for (const auditor of ctx.material.auditorGroups[i]) { %>
- <div class="d-inline-block mx-1" auditorId="<%- auditor.aid %>">
- <i class="fa fa-user text-muted"></i> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small>
- </div>
- <% } %>
- </div>
- <div class="col-auto">
- <% if (ctx.material.auditorGroups[i][0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[ctx.material.auditorGroups[i][0].audit_type].class %> badge-bg-small"><small><%- auditType.info[ctx.material.auditorGroups[i][0].audit_type].long%></small></span>
- <% } %>
- <% if ((ctx.tender.info.shenpi.material === shenpiConst.sp_status.sqspr ||
- (ctx.tender.info.shenpi.material === shenpiConst.sp_status.gdzs && i+1 !== iLen)) && ctx.session.sessionUser.accountId === ctx.material.user_id && !ctx.tender.isTourist) { %>
- <a href="javascript: void(0)" class="text-danger pull-right">移除</a>
- <% } %>
- </div>
- </li>
- <% } %>
- </ul>
- </div>
- </div>
- </div>
- <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <% if (ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
- <button class="btn btn-primary btn-sm" type="submit">确认上报</button>
- <% } %>
- </form>
- </div>
- </div>
- </div>
- <% } %>
- <% if(ctx.material && (ctx.material.status !== auditConst.status.uncheck)) { %>
- <!--审批流程/结果-->
- <div class="modal fade" id="sp-list" data-backdrop="static">
- <div class="modal-dialog modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title"><%- ctx.material.status === auditConst.status.checking ? '审批流程' : '重新上报' %></h5>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="col-4">
- <% if(ctx.material.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
- <a class="sp-list-item" href="#sub-sp" data-toggle="modal" data-target="#sub-sp" id="hideSp">修改审批流程</a>
- <% } else if(ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
- <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
- id="hideSp">修改审批流程</a>
- <% } %>
- <div class="card modal-height-500 mt-3" style="overflow: auto">
- <ul class="list-group list-group-flush auditors-list" id="auditors-list">
- <% ctx.material.auditors2.forEach((item, idx) => { %>
- <% if (idx === 0) { %>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
- </li>
- <% } else if(idx === ctx.material.auditors2.length -1 && idx !== 0) { %>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <div class="d-flex ml-auto">
- <% if (item[0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
- <% } %>
- <span class="badge badge-light badge-pill"><small>终审</small></span>
- </div>
- </li>
- <% } else {%>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <div class="d-flex ml-auto">
- <% if (item[0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
- <% } %>
- <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
- </div>
- </li>
- <% } %>
- <% }) %>
- </ul>
- </div>
- </div>
- <div class="col-8 modal-height-500" style="overflow: auto">
- <% ctx.material.auditHistory.forEach((his, idx) => { %>
- <!-- 展开/收起历史流程 -->
- <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
- <div class="text-right">
- <a href="javascript: void(0);" id="fold-btn" data-target="show" >展开历史审批流程</a>
- </div>
- <% } %>
- <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
- <div class="text-center text-muted"><%- idx+1 %>#</div>
- <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.material.auditHistory.length - 1) { %>last-auditor-list<% } %>">
- <% his.forEach((group, index) => { %>
- <% if (index === 0) { %>
- <li class="timeline-list-item pb-2">
- <div class="timeline-item-date">
- <%- group.beginYear %>
- <span><%- group.beginDate %></span>
- <span><%- group.beginTime %></span>
- </div>
- <div class="timeline-item-tail"></div>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">原报</span>
- <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <div class="card-text p-2 py-3 row">
- <div class="col">
- <span class="h6"><%- ctx.material.user.name %></span>
- <span class="text-muted ml-1"><%- ctx.material.user.role %></span>
- </div>
- <div class="col">
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- <% } %>
- <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.material.auditHistory.length - 1) { %>is_uncheck<% } %>">
- <% if (group.endYear) { %>
- <div class="timeline-item-date">
- <%- group.endYear %>
- <span><%- group.endDate %></span>
- <span><%- group.endTime %></span>
- </div>
- <% } %>
- <% if (index < his.length - 1) { %>
- <div class="timeline-item-tail"></div>
- <% } %>
- <% if (group.status === auditConst.status.checked) { %>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
- <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
- <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
- <% } else if (group.status === auditConst.status.checking) { %>
- <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
- <% } else { %>
- <div class="timeline-item-icon bg-secondary text-light"></div>
- <% } %>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">
- <%- (!group.is_final ? group.audit_order : '终') %>审
- <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
- </span>
- <% if (group.status !== auditConst.status.uncheck) { %>
- <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
- <% } %>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <% for (const [i, auditor] of group.auditors.entries()) { %>
- <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
- <div class="col">
- <span class="h6"><%- auditor.name %></span>
- <span class="text-muted ml-1"><%- auditor.role %></span>
- </div>
- <div class="col">
- <% if (auditor.status === auditConst.status.checked) { %>
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- <% } else if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
- <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
- <% } %>
- </div>
- <% if (auditor.opinion) { %>
- <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
- <% } %>
- </div>
- <% } %>
- </div>
- </div>
- </div>
- </li>
- <% }) %>
- </ul>
- </div>
- <% }) %>
- </div>
- </div>
- </div>
- <form class="modal-footer" method="post" action="<%- preUrl %>/audit/start" onsubmit="return checkAuditorFrom()">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <% if(ctx.material.status === auditConst.status.checkNo && ctx.session.sessionUser.accountId === ctx.material.user_id) { %>
- <button class="btn btn-primary btn-sm sp-list-item" type="submit">确认上报</button>
- <% } %>
- </form>
- </div>
- </div>
- </div>
- <% } %>
- <% if (ctx.material.status === auditConst.status.checking || ctx.material.status === auditConst.status.checkNoPre) { %>
- <% if (ctx.material.curAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0) { %>
- <!--审批通过-->
- <div class="modal fade sp-location-list" id="sp-done" data-backdrop="static">
- <div class="modal-dialog modal-lg" role="document">
- <form class="modal-content" action="<%- preUrl %>/audit/check" method="post" onsubmit="return auditCheck(0);">
- <div class="modal-header">
- <h5 class="modal-title">审批通过</h5>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="col-4">
- <% if(ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
- <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
- id="hideSp">修改审批流程</a>
- <% } %>
- <div class="card modal-height-500 mt-3" style="overflow: auto">
- <ul class="list-group list-group-flush auditors-list">
- <% ctx.material.auditors2.forEach((item, idx) => { %>
- <% if (idx === 0) { %>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
- </li>
- <% } else if(idx === ctx.material.auditors2.length -1 && idx !== 0) { %>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <div class="d-flex ml-auto">
- <% if (item[0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
- <% } %>
- <span class="badge badge-light badge-pill"><small>终审</small></span>
- </div>
- </li>
- <% } else {%>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <div class="d-flex ml-auto">
- <% if (item[0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1 ml-auto"><small><%- auditType.info[item[0].audit_type].short %></small></span>
- <% } %>
- <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
- </div>
- </li>
- <% } %>
- <% }) %>
- </ul>
- </div>
- </div>
- <div class="col-8 modal-height-500" style="overflow: auto">
- <% ctx.material.auditHistory.forEach((his, idx) => { %>
- <!-- 展开/收起历史流程 -->
- <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
- <div class="text-right">
- <a href="javascript: void(0);" id="fold-btn" data-target="show">展开历史审批流程</a>
- </div>
- <% } %>
- <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
- <div class="text-center text-muted"><%- idx+1 %>#</div>
- <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.material.auditHistory.length - 1) { %>last-auditor-list<% } %>">
- <% his.forEach((group, index) => { %>
- <% if (index === 0) { %>
- <li class="timeline-list-item pb-2">
- <div class="timeline-item-date">
- <%- group.beginYear %>
- <span><%- group.beginDate %></span>
- <span><%- group.beginTime %></span>
- </div>
- <div class="timeline-item-tail"></div>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">原报</span>
- <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <div class="card-text p-2 py-3 row">
- <div class="col">
- <span class="h6"><%- ctx.material.user.name %></span>
- <span class="text-muted ml-1"><%- ctx.material.user.role %></span>
- </div>
- <div class="col">
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- <% } %>
- <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.material.auditHistory.length - 1) { %>is_uncheck<% } %>">
- <% if (group.endYear) { %>
- <div class="timeline-item-date">
- <%- group.endYear %>
- <span><%- group.endDate %></span>
- <span><%- group.endTime %></span>
- </div>
- <% } %>
- <% if (index < his.length - 1) { %>
- <div class="timeline-item-tail"></div>
- <% } %>
- <% if (group.status === auditConst.status.checked) { %>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
- <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
- <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
- <% } else if (group.status === auditConst.status.checking) { %>
- <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
- <% } else { %>
- <div class="timeline-item-icon bg-secondary text-light"></div>
- <% } %>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">
- <%- (!group.is_final ? group.audit_order : '终') %>审
- <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
- </span>
- <% if (group.status !== auditConst.status.uncheck) { %>
- <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
- <% } %>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <% for (const [i, auditor] of group.auditors.entries()) { %>
- <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
- <div class="col">
- <span class="h6"><%- auditor.name %></span>
- <span class="text-muted ml-1"><%- auditor.role %></span>
- </div>
- <div class="col">
- <% if (auditor.status === auditConst.status.checked) { %>
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
- <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
- <% } else if (auditor.status === auditConst.status.checking) { %>
- <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
- <% } %>
- </div>
- <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
- <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
- <% } %>
- <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
- <div class="col-12 py-1 bg-light">
- <textarea class="form-control form-control-sm" name="opinion">同意</textarea>
- </div>
- <% } %>
- </div>
- <% } %>
- </div>
- </div>
- </div>
- </li>
- <% }) %>
- </ul>
- </div>
- <% }) %>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
- <input type="hidden" name="checkType" value="<%= auditConst.status.checked %>" />
- <button type="submit" class="btn btn-success btn-sm">确认通过</button>
- </div>
- </form>
- </div>
- </div>
- <!--审批退回-->
- <div class="modal fade sp-location-list" id="sp-back" data-backdrop="static">
- <div class="modal-dialog modal-lg" role="document">
- <form class="modal-content modal-lg" action="<%- preUrl %>/audit/check" method="post"
- onsubmit="return auditCheck(1);">
- <div class="modal-header">
- <h5 class="modal-title">审批退回</h5>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="col-4">
- <% if(ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
- <a class="sp-list-item" href="#sub-sp2" data-toggle="modal" data-target="#sub-sp2"
- id="hideSp">修改审批流程</a>
- <% } %>
- <div class="card modal-height-500 mt-3" style="overflow: auto">
- <ul class="list-group list-group-flush auditors-list">
- <% ctx.material.auditors2.forEach((item, idx) => { %>
- <% if (idx === 0) { %>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-play-circle fa-rotate-90"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <span class="badge badge-light badge-pill ml-auto"><small>原报</small></span>
- </li>
- <% } else if(idx === ctx.material.auditors2.length -1 && idx !== 0) { %>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa fa-stop-circle"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <div class="d-flex ml-auto">
- <% if (item[0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
- <% } %>
- <span class="badge badge-light badge-pill"><small>终审</small></span>
- </div>
- </li>
- <% } else {%>
- <li class="list-group-item d-flex justify-content-between align-items-center">
- <span class="mr-1"><i class="fa fa-chevron-circle-down"></i></span>
- <span class="text-muted">
- <% for (const u of item) { %>
- <small class="d-inline-block text-dark mx-1" title="<%- u.role %>" data-auditorId="<%- u.aid %>"><%- u.name %></small>
- <% } %>
- </span>
- <div class="d-flex ml-auto">
- <% if (item[0].audit_type !== auditType.key.common) { %>
- <span class="badge badge-pill badge-<%- auditType.info[item[0].audit_type].class %> p-1"><small><%- auditType.info[item[0].audit_type].short %></small></span>
- <% } %>
- <span class="badge badge-light badge-pill"><small><%= ctx.helper.transFormToChinese(idx) %>审</small></span>
- </div>
- </li>
- <% } %>
- <% }) %>
- </ul>
- </div>
- </div>
- <div class="col-8 modal-height-500" style="overflow: auto">
- <% ctx.material.auditHistory.forEach((his, idx) => { %>
- <!-- 展开/收起历史流程 -->
- <% if(idx === ctx.material.auditHistory.length - 1 && ctx.material.auditHistory.length !== 1) { %>
- <div class="text-right"><a href="javascript: void(0);" id="fold-btn" data-target="show"
- data-idx="<%- idx + 1 %>">展开历史审批流程</a></div>
- <% } %>
- <div class="<%- idx < ctx.material.auditHistory.length - 1 ? 'fold-card' : '' %>">
- <div class="text-center text-muted"><%- idx+1 %>#</div>
- <ul class="timeline-list list-unstyled mt-2 <% if (idx === ctx.material.auditHistory.length - 1) { %>last-auditor-list<% } %>">
- <% his.forEach((group, index) => { %>
- <% if (index === 0) { %>
- <li class="timeline-list-item pb-2">
- <div class="timeline-item-date">
- <%- group.beginYear %>
- <span><%- group.beginDate %></span>
- <span><%- group.beginTime %></span>
- </div>
- <div class="timeline-item-tail"></div>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-caret-down"></i></div>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">原报</span>
- <span class="pull-right text-success"><%- idx !== 0 ? '重新' : '' %>上报审批</span>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <div class="card-text p-2 py-3 row">
- <div class="col">
- <span class="h6"><%- ctx.material.user.name %></span>
- <span class="text-muted ml-1"><%- ctx.material.user.role %></span>
- </div>
- <div class="col">
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- <% } %>
- <li class="timeline-list-item pb-2 <% if (group.status === auditConst.status.uncheck && idx === ctx.material.auditHistory.length - 1) { %>is_uncheck<% } %>">
- <% if (his.endYear) { %>
- <div class="timeline-item-date">
- <%- group.endYear %>
- <span><%- group.endDate %></span>
- <span><%- group.endTime %></span>
- </div>
- <% } %>
- <% if (index < his.length - 1) { %>
- <div class="timeline-item-tail"></div>
- <% } %>
- <% if (group.status === auditConst.status.checked) { %>
- <div class="timeline-item-icon bg-success text-light"><i class="fa fa-check"></i></div>
- <% } else if (group.status === auditConst.status.checkNo || group.status === auditConst.status.checkNoPre || group.status === auditConst.status.checkCancel) { %>
- <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-level-up"></i></div>
- <% } else if (group.status === auditConst.status.checking) { %>
- <div class="timeline-item-icon bg-warning text-light"><i class="fa fa-ellipsis-h"></i></div>
- <% } else { %>
- <div class="timeline-item-icon bg-secondary text-light"></div>
- <% } %>
- <div class="timeline-item-content">
- <div class="py-1">
- <span class="text-black-50">
- <%- (!group.is_final ? group.audit_order : '终') %>审
- <% if (group.audit_type !== auditType.key.common) { %><span class="text-<%- auditType.info[group.audit_type].class %> "><%- auditType.info[group.audit_type].long %></span><% } %>
- </span>
- <% if (group.status !== auditConst.status.uncheck) { %>
- <span class="pull-right <%- auditConst.statusClass[group.status] %>"><%- auditConst.statusString[group.status] %></span>
- <% } %>
- </div>
- <div class="card">
- <div class="card-body px-3 py-0">
- <% for (const [i, auditor] of group.auditors.entries()) { %>
- <div class="card-text p-2 py-3 row <%- ( i > 0 ? 'border-top' : '') %>">
- <div class="col">
- <span class="h6"><%- auditor.name %></span>
- <span class="text-muted ml-1"><%- auditor.role %></span>
- </div>
- <div class="col">
- <% if (auditor.status === auditConst.status.checked) { %>
- <span class="pull-right text-success"><i class="fa fa-check-circle"></i></span>
- <% } if (auditor.status === auditConst.status.checkNo || auditor.status === auditConst.status.checkNoPre || auditor.status === auditConst.status.checkCancel) { %>
- <span class="pull-right text-warning"><i class="fa fa-share-square fa-rotate-270"></i></span>
- <% } else if (auditor.status === auditConst.status.checking) { %>
- <span class="pull-right text-warning"><i class="fa fa-commenting"></i></span>
- <% } %>
- </div>
- <% if (auditor.status !== auditConst.status.uncheck && auditor.opinion) { %>
- <div class="col-12 py-1 bg-light"><i class="fa fa-commenting-o mr-1"></i><%- auditor.opinion%></div>
- <% } %>
- <% if (auditor.status === auditConst.status.checking && auditor.aid === ctx.session.sessionUser.accountId) { %>
- <div class="col-12 py-1 bg-light">
- <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
- <div class="alert alert-warning mt-1 mb-0 p-2" id="reject-process">
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>">
- <label class="form-check-label" for="inlineRadio1">退回原报 <%- ctx.material.user.name %></label>
- </div>
- <% if (auditor.audit_order > 1) { %>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="checkType" id="inlineRadio2" value="<%- auditConst.status.checkNoPre %>">
- <label class="form-check-label" for="inlineRadio2">退回上一审批人
- <% const pre = ctx.helper._.findLast(his, x => { return x.audit_order === auditor.audit_order - 1 }); %>
- <%- (pre.audit_type === auditType.key.common ? pre.auditors[0].name : `${pre.audit_order}审`)%>
- </label>
- </div>
- <% } %>
- </div>
- </div>
- <% } %>
- </div>
- <% } %>
- </div>
- </div>
- </div>
- </li>
- <% }) %>
- </ul>
- </div>
- <% }) %>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
- <button type="submit" class="btn btn-warning btn-sm">确认退回</button>
- </div>
- </form>
- </div>
- </div>
- <% } %>
- <% } %>
- <!--材料调差-小数位数-->
- <div class="modal fade" id="cc-digits" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <form action="/tender/<%- ctx.tender.id %>/measure/material/<%- ctx.material.order %>/save/decimal" method="post" onsubmit="return checkSetDecimal();" class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">设置</h5>
- </div>
- <div class="modal-body">
- <div class="form-group mb-3">
- <h5>小数位数</h5>
- <div class="row">
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单价</span>
- </div>
- <input type="number" step="1" min="0" max="6" id="decimal_up" name="up" class="form-control" value="<%- material.decimal.up %>" <% if (!((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id)) { %>disabled<% } %>>
- </div>
- </div>
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">金额</span>
- </div>
- <input type="number" step="1" min="0" max="6" id="decimal_tp" name="tp" class="form-control" value="<%- material.decimal.tp %>" <% if (!((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id)) { %>disabled<% } %>>
- </div>
- </div>
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">数量</span>
- </div>
- <input type="number" step="1" min="0" max="6" id="decimal_qty" name="qty" class="form-control" value="<%- material.decimal.qty %>" <% if (!((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id)) { %>disabled<% } %>>
- </div>
- </div>
- </div>
- </div>
- <div class="form-group">
- <h5>计量期数据来源</h5>
- <div>
- <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id && (material.is_new_qty || (!material.is_new_qty && !(ctx.url.indexOf('/file') !== -1 || ctx.url.indexOf('/exponent') !== -1)))) { %>
- <% for (const qs of qtySourceConst) { %>
- <div class="form-check form-check-inline">
- <input type="radio" name="qty_source" id="<%- qs.key %>_source" class="form-check-input" value="<%- qs.value %>" <% if (material.qty_source === qtySourceValueConst[qs.key]) { %>checked<% } %>>
- <label class="form-check-label" for="<%- qs.key %>_source"><%- qs.name %></label>
- </div>
- <% } %>
- <% } else { %>
- <div class="form-check form-check-inline">
- <input type="radio" class="form-check-input" checked disabled>
- <label class="form-check-label"><%- ctx.helper._.find(qtySourceConst, { value: material.qty_source }).name %></label>
- </div>
- <% } %>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <% if ((material.status === auditConst.status.uncheck || material.status === auditConst.status.checkNo) && ctx.session.sessionUser.accountId === material.user_id) { %>
- <button type="submit" class="btn btn-sm btn-primary">确认修改</button>
- <% } %>
- </div>
- </form>
- </div>
- </div>
- <% if (ctx.material.auditors !== undefined && ctx.material.finalAuditorIds.indexOf(ctx.session.sessionUser.accountId) >= 0 && ctx.material.status === auditConst.status.checked && ctx.material.order === ctx.material.highOrder) { %>
- <% if (ctx.material && !ctx.material.authMobile && ctx.session.sessionUser.loginStatus === 0) { %>
- <!--终审重新审批-->
- <div class="modal fade" id="sp-down-back" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">重新审批</h5>
- </div>
- <div class="modal-body">
- <h5>重新审批需要您的手机短信验证</h5>
- <h5>您目前还没设置认证手机,请先设置。</h5>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <a href="/profile/sms" class="btn btn-sm btn-primary">去设置</a>
- </div>
- </div>
- </div>
- </div>
- <% } else { %>
- <div class="modal fade" id="sp-down-back" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">重新审批</h5>
- </div>
- <div class="modal-body">
- <h5>确认由「终审-<%= ctx.session.sessionUser.name %>」重新审批「第<%= ctx.material.order %>期」?
- </h5>
- <% if (ctx.session.sessionUser.loginStatus === 0) { %>
- <div class="form-group">
- <label>重审需要验证码确认,验证码将发送至尾号<%- ctx.material.authMobile.slice(-4) %>的手机</label>
- <div class="input-group input-group-sm mb-3">
- <input class="form-control" type="text" readonly="readonly" name="code"
- placeholder="输入短信中的6位验证码" />
- <div class="input-group-append">
- <button class="btn btn-outline-secondary" type="button" id="get-code">获取验证码</button>
- </div>
- </div>
- </div>
- <% } %>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <!--<a href="<%- preUrl %>/audit/check/again" disabled class="btn btn-warning btn-sm">确定重审</a>-->
- <button <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %> id="re-shenpi-btn"
- class="btn btn-warning btn-sm">确定重审</button>
- </div>
- </div>
- </div>
- </div>
- <% } %>
- <% } %>
- <% if (ctx.material && ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
- <!--上报审批-->
- <div class="modal fade" id="sub-sp2" data-backdrop="static">
- <div class="modal-dialog" style="max-width: 650px" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">修改审批流程</h5>
- </div>
- <div class="modal-body">
- <div class="card mt-1">
- <div class="modal-height-500" style="overflow: auto">
- <style>
- #admin-edit-shenpi thead th {
- border-bottom: 0;
- }
- #admin-edit-shenpi td, #admin-edit-shenpi th {
- padding: 0.75rem;
- }
- #admin-edit-shenpi th {
- background: none;
- color: #212529;
- border-top: 0;
- }
- </style>
- <table class="table table-hover" id="admin-edit-shenpi">
- <thead>
- <tr class="card-header text-center">
- <th width="100px">审批流程</th>
- <th>审批人员</th>
- <th width="80" style="text-align: center">审批状态</th>
- <th width="200" style="text-align: center">操作</th>
- </tr>
- </thead>
- <tbody id="admin-edit-shenpi-list">
- <% for (const [i, group] of ctx.material.auditors2.entries()) { %>
- <% if (i === 0) continue; %>
- <% for (const [j, auditor] of group.entries()) { %>
- <tr>
- <td class="text-left d-flex">
- <% if (j === 0) { %>
- <%- i + '审' %>
- <% if (auditor.audit_type !== auditType.key.common) { %>
- <span class="ml-2 badge badge-pill badge-<%- auditType.info[auditor.audit_type].class %> p-1"><small><%- auditType.info[auditor.audit_type].short %></small></span>
- <% } %>
- <% } %>
- </td>
- <td></span> <%- auditor.name %> <small class="text-muted"><%- auditor.role %></small></td>
- <td style="text-align: center"><span class="<%- auditConst.auditStringClass[auditor.status] %>"><%- auditor.status !== auditConst.status.uncheck ? auditConst.auditString[auditor.status] : '待审批' %></span></td>
- <td style="text-align: center">
- <% if (auditor.status === auditConst.status.checking && j === group.length - 1) { %>
- <span class="dropdown mr-2">
- <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
- <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
- placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
- <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
- data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.material.user_id) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- </span>
- <% } %>
- <% if (auditor.status === auditConst.status.uncheck) { %>
- <% if (j === group.length - 1) { %>
- <span class="dropdown mr-2">
- <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">增加</a>
- <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add_dropdownMenuButton" style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
- placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add"></div>
- <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
- data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.material.user_id) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- </span>
- <% if (auditor.audit_type !== auditType.key.common) { %>
- <span class="dropdown mr-2">
- <a href="javascript: void(0)" class="add-audit" id="<%- auditor.aid %>_add-sibling_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">平级</a>
- <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_add-sibling_dropdownMenu" aria-labelledby="<%- auditor.aid %>_add-sibling_dropdownMenuButton" style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
- placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_add-sibling"></div>
- <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="add-sibling">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
- data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.material.user_id) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- </span>
- <% } %>
- <% } %>
- <span class="dropdown mr-2">
- <a href="javascript: void(0)" class="change-audit" id="<%- auditor.aid %>_change_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更换</a>
- <div class="dropdown-menu dropdown-menu-right" id="<%- auditor.aid %>_change_dropdownMenu" aria-labelledby="<%- auditor.aid %>_change_dropdownMenuButton" style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
- placeholder="姓名/手机 检索" autocomplete="off" data-code="<%- auditor.aid %>_change"></div>
- <dl class="list-unstyled book-list" data-aid="<%- auditor.aid %>" data-operate="change">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>"
- data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.material.user_id) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>">
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- </span>
- <span class="dropdown">
- <a href="javascript: void(0)" class="text-danger" title="移除" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">移除</a>
- <div class="dropdown-menu">
- <span class="dropdown-item" href="javascript:void(0);">确认移除审批人?</span>
- <div class="dropdown-divider"></div>
- <div class="px-2 py-1 text-center">
- <button class="remove-audit btn btn-sm btn-danger" data-id="<%- auditor.aid %>">移除</button>
- <button class="btn btn-sm btn-secondary">取消</button>
- </div>
- </div>
- </span>
- <% } %>
- </td>
- </tr>
- <% } %>
- <% } %>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <form class="modal-footer">
- <div class="mr-auto text-warning">
- <span class="mr-3">增加:后级审核人</span>
- <span class="">平级:会签/或签增加平级审核人</span>
- </div>
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- </form>
- </div>
- </div>
- </div>
- <% } %>
- <script type="text/javascript">
- const csrf = '<%= ctx.csrf %>';
- const authMobile = '<%= ctx.material.authMobile %>';
- const sam_auditConst = JSON.parse('<%- JSON.stringify(auditConst) %>');
- const auditType = JSON.parse('<%- JSON.stringify(auditType) %>');
- </script>
- <% if (ctx.session.sessionUser.accountId === ctx.material.user_id && (ctx.material.status === auditConst.status.uncheck || ctx.material.status === auditConst.status.checkNo)) { %>
- <script>
- const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
- const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
- const shenpi_status = <%- ctx.tender.info.shenpi.material %>;
- const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
- </script>
- <% } else if (ctx.material && ctx.material.status !== auditConst.status.checked && ctx.session.sessionUser.is_admin) { %>
- <script type="text/javascript">
- const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
- const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
- const material_uid = parseInt('<%= ctx.material.user_id %>');
- const auditorList = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.material.auditors2)) %>'));
- </script>
- <% } %>
- <script>
- const cur_uid = parseInt('<%- ctx.session.sessionUser.accountId %>');
- const cur_tenderid = parseInt('<%- ctx.tender.id %>');
- </script>
- <script>
- $('.sp-location-list').on('shown.bs.modal', function () {
- const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
- const bdiv = (scrollBox.offset() && scrollBox.offset().top) || 0;
- scrollBox.scrollTop(0);
- const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
- const hdheight = hdiv ? hdiv.parents('.timeline-item-content').offset().top : null;
- if (hdiv && scrollBox.length && scrollBox[0].scrollHeight > 200 && hdheight - bdiv > 200) {
- scrollBox.scrollTop(hdheight - bdiv);
- }
- });
- function divSearch(div) {
- if (div.length > 0) {
- return true;
- }
- return false;
- }
- // 展开历史审核记录
- $('.modal-body #fold-btn').click(function () {
- const type = $(this).data('target')
- const auditCard = $(this).parent().parent()
- if (type === 'show') {
- $(this).data('target', 'hide')
- auditCard.find('.fold-card').slideDown('swing', () => {
- auditCard.find('#fold-btn').text('收起历史审核记录')
- })
- } else {
- $(this).data('target', 'show')
- auditCard.find('.fold-card').slideUp('swing', () => {
- auditCard.find('#fold-btn').text('展开历史审核记录')
- })
- }
- });
- $('.sp-list-btn').click(function () {
- const type = $(this).data('type')
- if (type === 'hide') {
- $('.sp-list-item').hide()
- $('.modal-title').text('审批流程')
- } else {
- $('.sp-list-item').show()
- $('.modal-title').text('重新上报')
- }
- });
- $('#cc-digits').on('shown.bs.modal', function () {
- $('#decimal_up').val(<%- material.decimal.up %>);
- $('#decimal_tp').val(<%- material.decimal.tp %>);
- $('#decimal_qty').val(<%- material.decimal.qty %>);
- });
- // 小数位设置
- function checkSetDecimal() {
- const up = parseInt($('#decimal_up').val());
- const tp = parseInt($('#decimal_tp').val());
- const qty = parseInt($('#decimal_qty').val());
- let flag = false;
- if(_.isNaN(up) || up > 6 || up < 0) {
- toastr.error('单价小数位数设置不能大于6或小于0');
- flag = true;
- }
- if(_.isNaN(tp) || tp > 6 || tp < 0) {
- toastr.error('金额小数位数设置不能大于6或小于0');
- flag = true;
- }
- if(_.isNaN(qty) || qty > 6 || qty < 0) {
- toastr.error('数量小数位数设置不能大于6或小于0');
- flag = true;
- }
- if (flag) {
- return false;
- }
- }
- // 重新审批按钮
- $("#re-shenpi-btn").click(function () {
- const data = {
- };
- <% if (ctx.session.sessionUser.loginStatus === 0) { %>
- const code = $("#sp-down-back input[name='code']").val();
- if ($(this).hasClass('disabled')) {
- return false;
- }
- if (code.length < 6) {
- // alert('请填写正确的验证码');
- toastr.error('请填写正确的验证码');
- return false;
- }
- data.code = code;
- <% } %>
- $.ajax({
- url: '<%- preUrl %>/audit/check/again',
- type: 'get',
- data: data,
- dataTye: 'json',
- success: function (response) {
- if (response.err === 0) {
- window.location.href = response.url;
- } else {
- toastr.error(response.msg);
- }
- }
- });
- });
- </script>
- <% if (ctx.session.sessionUser.accountId === ctx.material.user_id && (ctx.material.calc_stage !== ctx.material.stage_id || !ctx.material.calc_tp)) { %>
- <div class="modal fade" id="okedit" data-backdrop="static">
- <div class="modal-dialog " role="document" >
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">生成新一期调差清单</h5>
- </div>
- <div class="modal-body">
- <div>
- <h5 id="material-detail">正在获取上期调差清单数据中,请等待...</h5>
- <div class="progress">
- <div id="material-progress" class="progress-bar" role="progressbar" style="width: 100%;" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100">100%</div>
- </div>
- </div>
- <% if (ctx.material.is_stage_self) { %>
- <% for (const ms of materialStageData) { %>
- <div id="list-detail-<%- ms.sid %>" style="display: none" class="mt-3">
- <h5>生成期调差清单:<b>第<%- ms.order %>期</b></h5>
- <div class="progress">
- <div id="list-progress-<%- ms.sid %>" class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
- </div>
- </div>
- <% } %>
- <% } else { %>
- <div id="list-detail" style="display: none" class="mt-3">
- <h5>生成调差清单:</h5>
- <div class="progress">
- <div id="list-progress" class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
- </div>
- </div>
- <% } %>
- <div id="self-detail" style="display: none" class="mt-3">
- <h5>处理独立调差清单和计算总金额:</h5>
- <div class="progress">
- <div id="self-progress" class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
- </div>
- </div>
- </div>
- <div class="modal-footer" style="display: none" id="reload-make">
- <button type="button" class="btn btn-sm btn-primary" onclick="window.location.reload();">刷新页面</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- const stage_ids = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.material.stage_id)) %>'));
- const calc_stages = JSON.parse(unescape('<%- escape(JSON.stringify(ctx.material.calc_stage)) %>'));
- const stage_id = stage_ids.split(',');
- const calc_stage = calc_stages.split(',');
- const calc_tp = parseInt('<%- ctx.material.calc_tp %>');
- // stage_id和calc_stage数组对比,找出不同的值,并发起更新
- const diff_stage_ids = _.difference(stage_id, calc_stage);
- if (diff_stage_ids.length === 0 && calc_tp) return;
- const is_stage_self = parseInt('<%- ctx.material.is_stage_self %>');
- $('#okedit').modal('show');
- let value = 0;
- let interval;
- let stop = false;
- setProgress($('#material-progress'), 30);
- postData('/tender/'+ cur_tenderid +'/measure/material/gcl/load', { stage_id, is_stage_self }, async function (result) {
- // console.log(result);
- const ledger = result.ledger;
- const pos = result.pos;
- const gclList = result.gclList;
- const selfList = result.selfList;
- // 整理material,针对上期是独立单价并多个不同值的单独设置值进行部分值去除
- const materialListForSelf = _.uniqWith(_.orderBy(result.materialListForSelf, ['ms_id'], ['desc']), function(item1, item2) {
- return item1.xmj_id === item2.xmj_id && item1.gcl_id === item2.gcl_id && item1.mx_id === item2.mx_id && item1.mb_id === item2.mb_id;
- });
- const insertSelfList = [];// 需要单独添加的明细清单工料含量列表
- const hadQtySelfList = [];
- $('#material-detail').text('获取上期调差清单数据成功');
- stopProgress($('#material-progress'));
- if (is_stage_self) {
- for (const [i, newSid] of diff_stage_ids.entries()) {
- const sid = parseInt(newSid);
- $('#list-detail-' + sid).show();
- resetProgress($('#list-progress-' + sid));
- if (!interval) {
- $('#list-detail-' + sid).show();
- setProgress($('#list-progress-' + sid), 30);
- }
- const insertGclList = [];
- const insertList = [];
- const removeGclList = [];
- const curLedger = _.find(result.curLedgerData, {sid: newSid});
- const curPos = _.find(result.curPosData, {sid: newSid});
- gclGatherModel.loadLedgerData(_.cloneDeep(ledger), curLedger.ledgerData);
- gclGatherModel.loadPosData(_.cloneDeep(pos), curPos.posData);
- const gclGatherData = gclGatherModel.gatherGclData();
- // console.log(gclGatherData);
- const insertGcl = [];
- for (const g of gclList) {
- const gcl = _.find(gclGatherData, function (item) {
- return item.leafXmjs && item.leafXmjs.length > 0 && _.findIndex(item.leafXmjs, {gcl_id: g.gcl_id}) !== -1;
- });
- if (gcl) {
- const ig = _.find(insertGcl, {gcl});
- if (ig) {
- if (_.findIndex(ig.bills, {mb_id: g.mb_id}) === -1) {
- ig.bills.push(g);
- }
- } else {
- insertGcl.push({
- bills: [g],
- gcl,
- leafXmjs: _.filter(gcl.leafXmjs, function (item) {
- return item.gather_qty !== undefined && item.gather_qty !== null
- }),
- })
- }
- } else {
- removeGclList.push(g);
- }
- }
- for (const one of insertGcl) {
- if (one.leafXmjs && one.leafXmjs.length > 0) {
- for (const xmj of one.leafXmjs) {
- const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' }) !== -1;// 区分单独计量的明细工料含量
- if (is_self) {
- const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' });
- for (const bill of billsList) {
- if (!_.find(hadQtySelfList, bill)) {
- hadQtySelfList.push(bill);
- }
- insertSelfList.push({
- gcl_id: xmj.gcl_id,
- mx_id: xmj.mx_id ? xmj.mx_id : '',
- xmj_id: xmj.id ? xmj.id : null,
- contract_qty: xmj.contract_qty,
- qc_qty: xmj.qc_qty,
- qc_minus_qty: xmj.qc_minus_qty,
- gather_qty: xmj.gather_qty,
- quantity: bill.quantity,
- expr: bill.expr,
- mb_id: bill.mb_id,
- order: bill.order,
- sid,
- });
- }
- } else {
- const newgcl = _.find(gclList, { gcl_id: xmj.gcl_id });
- for (const bill of one.bills) {
- insertList.push({
- gcl_id: xmj.gcl_id,
- mx_id: xmj.mx_id ? xmj.mx_id : '',
- xmj_id: xmj.id ? xmj.id : null,
- contract_qty: xmj.contract_qty,
- qc_qty: xmj.qc_qty,
- qc_minus_qty: xmj.qc_minus_qty,
- gather_qty: xmj.gather_qty,
- quantity: bill.quantity,
- expr: bill.expr,
- mb_id: bill.mb_id,
- order: bill.order,
- sid,
- });
- if (!newgcl) {
- if (_.findIndex(insertGclList, { gcl_id: xmj.gcl_id }) === -1) {
- insertGclList.push({
- gcl_id: xmj.gcl_id,
- quantity: bill.quantity,
- expr: bill.expr,
- old_quantity: bill.quantity,
- old_expr: bill.expr,
- mb_id: bill.mb_id,
- order: bill.order,
- });
- }
- }
- }
- }
- }
- }
- }
- console.log(sid, insertList, insertGclList, removeGclList);
- const msg = await postMLData(sid, insertList, insertGclList, removeGclList, $('#list-progress-' + sid));
- if (!msg) return;
- }
- } else {
- $('#list-detail').show();
- resetProgress($('#list-progress'));
- if (!interval) {
- $('#list-detail').show();
- setProgress($('#list-progress'), 30);
- }
- const insertGclList = [];
- const insertList = [];
- const removeGclList = [];
- const curLedgerData = result.curLedgerData;
- const curPosData = result.curPosData;
- gclGatherModel.loadLedgerData(_.cloneDeep(ledger), curLedgerData);
- gclGatherModel.loadPosData(_.cloneDeep(pos), curPosData);
- const gclGatherData = gclGatherModel.gatherGclData();
- const insertGcl = [];
- for (const g of gclList) {
- const gcl = _.find(gclGatherData, function (item) {
- return item.leafXmjs && item.leafXmjs.length > 0 && _.findIndex(item.leafXmjs, {gcl_id: g.gcl_id}) !== -1;
- });
- if (gcl) {
- const ig = _.find(insertGcl, {gcl});
- if (ig) {
- if (_.findIndex(ig.bills, {mb_id: g.mb_id}) === -1) {
- ig.bills.push(g);
- }
- } else {
- insertGcl.push({
- bills: [g],
- gcl,
- leafXmjs: _.filter(gcl.leafXmjs, function (item) {
- return item.gather_qty !== undefined && item.gather_qty !== null || (item.qc_minus_qty !== undefined && item.qc_minus_qty !== null)
- }),
- })
- }
- } else {
- removeGclList.push(g);
- }
- }
- for (const one of insertGcl) {
- if (one.leafXmjs && one.leafXmjs.length > 0) {
- for (const xmj of one.leafXmjs) {
- const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null }) !== -1;// 区分单独计量的明细工料含量
- if (is_self) {
- const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null });
- for (const bill of billsList) {
- hadQtySelfList.push(bill);
- insertSelfList.push({
- gcl_id: xmj.gcl_id,
- mx_id: xmj.mx_id ? xmj.mx_id : '',
- xmj_id: xmj.id ? xmj.id : null,
- contract_qty: xmj.contract_qty,
- qc_qty: xmj.qc_qty,
- qc_minus_qty: xmj.qc_minus_qty,
- gather_qty: xmj.gather_qty,
- quantity: bill.quantity,
- expr: bill.expr,
- mb_id: bill.mb_id,
- order: bill.order,
- });
- }
- } else {
- const newgcl = _.find(gclList, { gcl_id: xmj.gcl_id });
- for (const bill of one.bills) {
- insertList.push({
- gcl_id: xmj.gcl_id,
- mx_id: xmj.mx_id ? xmj.mx_id : '',
- xmj_id: xmj.id ? xmj.id : null,
- contract_qty: xmj.contract_qty,
- qc_qty: xmj.qc_qty,
- qc_minus_qty: xmj.qc_minus_qty,
- gather_qty: xmj.gather_qty,
- quantity: bill.quantity,
- expr: bill.expr,
- mb_id: bill.mb_id,
- order: bill.order,
- });
- if (!newgcl) {
- insertGclList.push({
- gcl_id: xmj.gcl_id,
- quantity: bill.quantity,
- expr: bill.expr,
- old_quantity: bill.quantity,
- old_expr: bill.expr,
- mb_id: bill.mb_id,
- order: bill.order,
- });
- }
- }
- }
- }
- }
- }
- console.log(diff_stage_ids, insertList, insertGclList, removeGclList);
- const msg = await postMLData(diff_stage_ids.join(','), insertList, insertGclList, removeGclList, $('#list-progress'));
- if (!msg) return;
- }
- $('#self-detail').show();
- setProgress($('#self-progress'), 30);
- // 通过比较materialListForSelf和hadQtySelfList不重合部分,得出本期为null的gather_qty列表,插入到insertSelfList中
- const pushSelfList = _.xorWith(materialListForSelf, hadQtySelfList, _.isEqual);
- if (pushSelfList.length > 0) {
- for (const ps of pushSelfList) {
- insertSelfList.push({
- gcl_id: ps.gcl_id,
- mx_id: ps.mx_id,
- xmj_id: ps.xmj_id,
- contract_qty: null,
- qc_qty: null,
- qc_minus_qty: null,
- gather_qty: null,
- quantity: ps.quantity,
- expr: ps.expr,
- mb_id: ps.mb_id,
- order: ps.order,
- });
- }
- }
- console.log(insertSelfList);
- postData('/tender/' + cur_tenderid + '/measure/material/save/data', { type: 'make_self_list', mid: materialID || mid, material_self_list: insertSelfList }, function (result) {
- stopProgress($('#self-progress'));
- $('#reload-make').show();
- }, function (err) {
- stop = true;
- clearInterval(interval);
- $('#reload-make').show();
- });
- // postData(preUrl + '/measure/material/add', newMaterialData, function (result) {
- // window.location.href = preUrl + '/measure/material/' + result.order;
- // }, function () {
- // stop = true;
- // clearInterval(interval);
- // console.log(_self.parents('div[id="add-qi"]'));
- // $('#add-qi').modal('show');
- // $('#okedit').modal('hide');
- // _self.parents('div[id="add-qi"]').modal('show');
- // _self.attr('disabled', false).text('确认添加');
- // });
- return;
- });
- async function postMLData(stage_id, material_list, insertGclList, removeGclList, _progress) {
- try {
- const result = await postDataAsync('/tender/' + cur_tenderid + '/measure/material/save/data', { type: 'make_material_list', mid: materialID || mid, stage_id, material_list, insertGclList, removeGclList });
- if (!result) {
- stop = true;
- clearInterval(interval);
- $('#reload-make').show();
- } else {
- stopProgress(_progress);
- }
- return result ? result : false;
- } catch (err) {
- console.error('失败:', err);
- stop = true;
- clearInterval(interval);
- $('#reload-make').show();
- return false;
- }
- }
- function setProgress(_this, time = 50) {
- interval = setInterval(function () {
- if (value < 100) {
- value = parseInt(value) + 1;
- _this.css("width", value + "%").text(value + "%");
- } else if (value === 100) {
- value = parseInt(value) + 1;
- value = 30;
- }
- }, time);
- }
- function resetProgress(_this) {
- _this.removeClass('bg-success');
- _this.css("width", "0%").text("0%").attr('aria-valuenow', '0');
- }
- function stopProgress(_this) {
- if (interval) {
- _this.addClass('bg-success');
- _this.css("width", "100%").text("100%");
- value = 0;
- stop = true;
- clearInterval(interval);
- interval = 0;
- }
- }
- })
- </script>
- <% } %>
|