|
@@ -643,7 +643,151 @@
|
|
|
</div>
|
|
|
<% } %>
|
|
|
<% } %>
|
|
|
+<% if (ctx.advance.finalAuditorId && ctx.advance.finalAuditorId === ctx.session.sessionUser.accountId) { %>
|
|
|
+ <% if (!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">
|
|
|
+ <form id="againForm" class="modal-content" method="post" action="/tender/<%- ctx.tender.id %>/advance/<%- advance.id %>/check/again" onsubmit="return false;">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title">重新审批</h5>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <h5>确认由「终审」重新审批「第<%= advance.order %>期」?</h5>
|
|
|
+ <% if (ctx.session.sessionUser.loginStatus === 0) { %>
|
|
|
+ <div class="form-group">
|
|
|
+ <label>重审需要验证码确认,验证码将发送至尾号<%- 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 get-code" type="button">获取验证码</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <input type="hidden" name="vid" value="<%= advance.id %>">
|
|
|
+ <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
|
|
|
+ <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
|
|
+ <button type="button" id="re-shenpi-btn" class="btn btn-warning btn-sm" <% if (ctx.session.sessionUser.loginStatus === 0) { %>disabled<% } %>>确定重审</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <% } %>
|
|
|
+<script>
|
|
|
+ const csrf = '<%= ctx.csrf %>';
|
|
|
+ const authMobile = '<%= authMobile %>';
|
|
|
+ $(function () {
|
|
|
+ $('#re-shenpi-btn').click(function () {
|
|
|
+ const data = {
|
|
|
+ };
|
|
|
+ <% if (ctx.session.sessionUser.loginStatus === 0) { %>
|
|
|
+ const code = $("#againForm input[name='code']").val();
|
|
|
+ if ($(this).hasClass('disabled')) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (code.length < 6) {
|
|
|
+ // alert('请填写正确的验证码');
|
|
|
+ toastr.error('请填写正确的验证码');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ data.code = code;
|
|
|
+ <% } %>
|
|
|
+ $.ajax({
|
|
|
+ url: '/tender/<%- ctx.tender.id %>/advance/<%- advance.id %>/check/again?_csrf_j=' + csrf,
|
|
|
+ type: 'post',
|
|
|
+ data: data,
|
|
|
+ dataTye: 'json',
|
|
|
+ success: function(response) {
|
|
|
+ if (response.err === 0) {
|
|
|
+ window.location.href = response.url;
|
|
|
+ } else {
|
|
|
+ toastr.error(response.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // 重新审批获取手机验证码
|
|
|
+ // 获取验证码
|
|
|
+ let isPosting = false;
|
|
|
+ $(".get-code").on('click', function() {
|
|
|
+ if (isPosting) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const btn = $(this);
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: '/profile/code?_csrf_j=' + csrf,
|
|
|
+ type: 'post',
|
|
|
+ data: { mobile: authMobile, type: 'shenpi' },
|
|
|
+ dataTye: 'json',
|
|
|
+ error: function() {
|
|
|
+ isPosting = false;
|
|
|
+ },
|
|
|
+ beforeSend: function() {
|
|
|
+ isPosting = true;
|
|
|
+ },
|
|
|
+ success: function(response) {
|
|
|
+ isPosting = false;
|
|
|
+ if (response.err === 0) {
|
|
|
+ codeSuccess(btn);
|
|
|
+ $("input[name='code']").removeAttr('readonly');
|
|
|
+ $("#re-shenpi-btn").removeAttr('disabled');
|
|
|
+ } else {
|
|
|
+ toastr.error(response.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ /**
|
|
|
+ * 获取成功后的操作
|
|
|
+ *
|
|
|
+ * @param {Object} btn - 点击的按钮
|
|
|
+ * @return {void}
|
|
|
+ */
|
|
|
+ function codeSuccess(btn) {
|
|
|
+ let counter = 60;
|
|
|
+ btn.addClass('disabled').text('重新获取 ' + counter + 'S');
|
|
|
+ btn.parent().siblings('input').removeAttr('readonly').attr('placeholder', '输入短信中的6位验证码');
|
|
|
+ const bindBtn = $("#bind-btn");
|
|
|
+ bindBtn.removeClass('btn-secondary disabled').addClass('btn-primary');
|
|
|
|
|
|
+ const countDown = setInterval(function() {
|
|
|
+ const countString = counter - 1 <= 0 ? '' : ' ' + (counter - 1) + 'S';
|
|
|
+ // 倒数结束后
|
|
|
+ if (countString === '') {
|
|
|
+ clearInterval(countDown);
|
|
|
+ btn.removeClass('disabled');
|
|
|
+ }
|
|
|
+ const text = '重新获取' + countString;
|
|
|
+ btn.text(text);
|
|
|
+ counter -= 1;
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<% } %>
|
|
|
<script>
|
|
|
$('.sp-list-btn').click(function () {
|
|
|
const type = $(this).data('type')
|